Class emulator::EmulatorOutputManager
ClassList > emulator > EmulatorOutputManager
Manages all diagnostic output for an emulator component. More...
#include <emulator_output_manager.hpp>
Public Functions
| Type | Name |
|---|---|
| EmulatorOutputManager () = default |
|
| void | finalize () Finalize and close all files. |
| std::string | find_restart_file (const std::string & rpointer_dir, FileType file_type) const Find restart file from rpointer. |
| void | init_timestep (int current_step, double dt) Called at the start of each timestep. |
| void | initialize (const DiagnosticConfig & config, MPI_Comm comm, const std::vector< int > & col_gids, int nlat, int nlon, const std::string & case_name, const std::string & run_dir, Logger & logger) Initialize the output manager. |
| bool | is_initialized () const Check if output manager is initialized. |
| bool | is_restart_step (int step) const Check if restart should be written at this step. |
| size_t | num_history_streams () const Get number of history streams. |
| bool | read_history_restart (const std::string & filename) Read history restart from file. |
| bool | read_restart (const std::string & filename) Read model restart file. |
| void | run (int current_step, const FieldDataProvider & fields) Process output at current timestep. |
| void | setup (const FieldDataProvider & fields) Set up output streams with field information. |
| bool | write_history_restart (int step) Write history restart for all non-instant streams. |
| bool | write_restart (const FieldDataProvider & fields, int step) Write model restart file. |
| ~EmulatorOutputManager () = default |
Detailed Description
Public Functions Documentation
function EmulatorOutputManager
emulator::EmulatorOutputManager::EmulatorOutputManager () = default
function finalize
Finalize and close all files.
void emulator::EmulatorOutputManager::finalize ()
function find_restart_file
Find restart file from rpointer.
std::string emulator::EmulatorOutputManager::find_restart_file (
const std::string & rpointer_dir,
FileType file_type
) const
Parameters:
rpointer_dirDirectory containing rpointer.atmfile_typeRESTART or HISTORY_RESTART
Returns:
Filename if found, empty string otherwise
function init_timestep
Called at the start of each timestep.
void emulator::EmulatorOutputManager::init_timestep (
int current_step,
double dt
)
Parameters:
current_stepCurrent model stepdtTimestep in seconds
function initialize
Initialize the output manager.
void emulator::EmulatorOutputManager::initialize (
const DiagnosticConfig & config,
MPI_Comm comm,
const std::vector< int > & col_gids,
int nlat,
int nlon,
const std::string & case_name,
const std::string & run_dir,
Logger & logger
)
Parameters:
configDiagnostic configurationcommMPI communicatorcol_gidsGlobal IDs of local columnsnlatNumber of latitudesnlonNumber of longitudescase_nameCase name for filenamesrun_dirRun directory for output filesloggerLogger reference
function is_initialized
Check if output manager is initialized.
inline bool emulator::EmulatorOutputManager::is_initialized () const
function is_restart_step
Check if restart should be written at this step.
bool emulator::EmulatorOutputManager::is_restart_step (
int step
) const
function num_history_streams
Get number of history streams.
inline size_t emulator::EmulatorOutputManager::num_history_streams () const
function read_history_restart
Read history restart from file.
bool emulator::EmulatorOutputManager::read_history_restart (
const std::string & filename
)
Parameters:
filenameHistory restart file path
Returns:
true if successful
function read_restart
Read model restart file.
bool emulator::EmulatorOutputManager::read_restart (
const std::string & filename
)
Parameters:
filenameRestart file pathfieldsField data receiver (mutable)
Returns:
true if successful
function run
Process output at current timestep.
void emulator::EmulatorOutputManager::run (
int current_step,
const FieldDataProvider & fields
)
Updates averaging buffers and writes output if needed.
Parameters:
current_stepCurrent model stepfieldsField data provider
function setup
Set up output streams with field information.
void emulator::EmulatorOutputManager::setup (
const FieldDataProvider & fields
)
Parameters:
fieldsField data provider
function write_history_restart
Write history restart for all non-instant streams.
bool emulator::EmulatorOutputManager::write_history_restart (
int step
)
Parameters:
stepCurrent step (for filename)
Returns:
true if successful
function write_restart
Write model restart file.
bool emulator::EmulatorOutputManager::write_restart (
const FieldDataProvider & fields,
int step
)
Writes all prognostic fields to a restart file and updates rpointer.atm.
Parameters:
fieldsField data providerstepCurrent step (for filename)
Returns:
true if successful
function ~EmulatorOutputManager
emulator::EmulatorOutputManager::~EmulatorOutputManager () = default
The documentation for this class was generated from the following file components/emulator_comps/common/src/emulator_output_manager.hpp