Class emulator::EmulatorOutputStream
ClassList > emulator > EmulatorOutputStream
Manages a single diagnostic output stream. More...
#include <emulator_output_stream.hpp>
Public Functions
| Type | Name |
|---|---|
| EmulatorOutputStream () = default |
|
| const OutputStreamConfig & | config () const Get the stream configuration. |
| void | finalize () Finalize and close any open files. |
| void | init_timestep (int current_step, double dt) Called at the start of each timestep. |
| void | initialize (const OutputStreamConfig & config, MPI_Comm comm, const std::vector< int > & col_gids, int nlat, int nlon, Logger & logger) Initialize the output stream. |
| bool | is_write_step () const Check if this step is a write step. |
| bool | needs_history_restart () const Check if stream needs history restart (non-instant averaging). |
| bool | read_history_restart (const std::string & filename) Read averaging state from history restart file. |
| void | run (int current_step, const FieldDataProvider & fields, const std::string & case_name) Process fields at current timestep. |
| bool | write_history_restart (const std::string & filename) Write averaging state to history restart file. |
| ~EmulatorOutputStream () = default |
Detailed Description
Handles:
- NetCDF file creation and management
- Accumulation buffer for averaging (AVERAGE, MIN, MAX, STD, SUM)
- Write timing based on configured frequency
- Field stacking for sliced variables
Public Functions Documentation
function EmulatorOutputStream
emulator::EmulatorOutputStream::EmulatorOutputStream () = default
function config
Get the stream configuration.
inline const OutputStreamConfig & emulator::EmulatorOutputStream::config () const
function finalize
Finalize and close any open files.
void emulator::EmulatorOutputStream::finalize ()
function init_timestep
Called at the start of each timestep.
void emulator::EmulatorOutputStream::init_timestep (
int current_step,
double dt
)
Parameters:
current_stepCurrent model step numberdtTimestep in seconds
function initialize
Initialize the output stream.
void emulator::EmulatorOutputStream::initialize (
const OutputStreamConfig & config,
MPI_Comm comm,
const std::vector< int > & col_gids,
int nlat,
int nlon,
Logger & logger
)
Parameters:
configStream configurationcommMPI communicatorcol_gidsGlobal IDs of local columnsnlatNumber of latitudes (for global grid)nlonNumber of longitudesloggerLogger reference
function is_write_step
Check if this step is a write step.
inline bool emulator::EmulatorOutputStream::is_write_step () const
function needs_history_restart
Check if stream needs history restart (non-instant averaging).
inline bool emulator::EmulatorOutputStream::needs_history_restart () const
function read_history_restart
Read averaging state from history restart file.
bool emulator::EmulatorOutputStream::read_history_restart (
const std::string & filename
)
Parameters:
filenameInput filename
Returns:
true if successful
function run
Process fields at current timestep.
void emulator::EmulatorOutputStream::run (
int current_step,
const FieldDataProvider & fields,
const std::string & case_name
)
Updates averaging buffers if not an instant stream. Writes output if this is a write step.
Parameters:
current_stepCurrent step numberfieldsField data providercase_nameCase name for filename generation
function write_history_restart
Write averaging state to history restart file.
bool emulator::EmulatorOutputStream::write_history_restart (
const std::string & filename
)
Parameters:
filenameOutput filename
Returns:
true if successful
function ~EmulatorOutputStream
emulator::EmulatorOutputStream::~EmulatorOutputStream () = default
The documentation for this class was generated from the following file components/emulator_comps/common/src/emulator_output_stream.hpp