Skip to content

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_dir Directory containing rpointer.atm
  • file_type RESTART 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_step Current model step
  • dt Timestep 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:

  • config Diagnostic configuration
  • comm MPI communicator
  • col_gids Global IDs of local columns
  • nlat Number of latitudes
  • nlon Number of longitudes
  • case_name Case name for filenames
  • run_dir Run directory for output files
  • logger Logger 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:

  • filename History restart file path

Returns:

true if successful


function read_restart

Read model restart file.

bool emulator::EmulatorOutputManager::read_restart (
    const std::string & filename
) 

Parameters:

  • filename Restart file path
  • fields Field 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_step Current model step
  • fields Field data provider

function setup

Set up output streams with field information.

void emulator::EmulatorOutputManager::setup (
    const FieldDataProvider & fields
) 

Parameters:

  • fields Field data provider

function write_history_restart

Write history restart for all non-instant streams.

bool emulator::EmulatorOutputManager::write_history_restart (
    int step
) 

Parameters:

  • step Current 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:

  • fields Field data provider
  • step Current 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