Skip to content

Namespace emulator

Namespace List > emulator

Namespaces

Type Name
namespace impl
namespace inference

Classes

Type Name
struct BuildConfig
Build-time configuration (set by buildnml, fixed for a case).
struct CouplingConfig
Coupling configuration options.
class CouplingFieldsBase
Base utility class for coupling field index management.
class DataView <typename T>
Non-owning view over contiguous data.
class DerivedDiagnostic
Base class for derived diagnostics.
struct DiagnosticConfig
Complete diagnostic output configuration.
struct DiagnosticMetadata
Metadata for creating diagnostics.
class EmulatorAtm
Atmosphere emulator component.
class EmulatorComp
Abstract base class for all emulated E3SM components.
struct EmulatorConfig
Base configuration structure for all emulator components.
class EmulatorContext
Singleton context for managing emulator component instances.
class EmulatorIO
Static class providing parallel I/O using SCORPIO/PIO.
class EmulatorOutputManager
Manages all diagnostic output for an emulator component.
class EmulatorOutputStream
Manages a single diagnostic output stream.
class FieldDataProvider
Interface for providing field data to output streams.
struct HistoryRestartConfig
History restart configuration for averaging buffers.
class HorizAvgDiagnostic
Computes area-weighted horizontal average of a field.
class Logger
Simple logger with optional file output.
struct ModelIOConfig
Model I/O variable configuration.
struct OutputControl
Controls output timing and tracks averaging state.
struct OutputStreamConfig
Configuration for a single output stream.
struct RestartConfig
Restart output configuration.
struct RuntimeConfig
Runtime configuration (can change per run via atm_in YAML).
class VertSliceDiagnostic
Extracts a single vertical level from a 3D field.

Public Types

Type Name
enum CompType
Enumeration of component types in E3SM.
enum DataLayout
Memory layout for multi-dimensional data.
typedef DataView< double > DoubleView
Convenience type aliases.
enum FileType
File type indicator for restart discovery.
typedef DataView< float > FloatView
enum FrequencyUnit
Output frequency units.
enum LogLevel
Log level enumeration.
enum OutputAvgType
Output averaging type.
enum OutputPrecision
Output data precision.

Public Attributes

Type Name
double FILLVALUE = 1.0e20
Default fill value for missing data.

Public Functions

Type Name
std::string avg_type_to_str (OutputAvgType t)
Convert OutputAvgType to string.
void cleanup_emulator_context ()
Convenience function to clean up the global emulator context.
std::unique_ptr< DerivedDiagnostic > create_diagnostic (const std::string & diag_name, const DiagnosticMetadata & metadata)
Parse a field name and create appropriate diagnostic if needed.
std::string file_type_suffix (FileType t)
Get file type suffix string.
std::string freq_unit_to_str (FrequencyUnit u)
Convert FrequencyUnit to string.
std::string get_base_field_name (const std::string & diag_name)
Extract base field name from diagnostic name.
std::string get_comp_name (CompType type)
Get the short name for a component type.
std::string get_export_prefix (CompType type)
Get the coupling export prefix for a component type.
std::string get_import_prefix (CompType type)
Get the coupling import prefix for a component type.
bool is_derived_diagnostic (const std::string & name)
Check if a field name is a derived diagnostic pattern.
EmulatorConfig parse_emulator_config (const std::string & yaml_file, const std::string & section_name)
Parse configuration from a YAML file.
EmulatorConfig parse_emulator_config_with_defaults (const std::string & yaml_file, const std::string & section_name, bool verbose)
Parse configuration with fallback to defaults.
std::string precision_to_str (OutputPrecision p)
Convert OutputPrecision to string.
OutputAvgType str_to_avg_type (const std::string & s)
Convert string to OutputAvgType .
FrequencyUnit str_to_freq_unit (const std::string & s)
Convert string to FrequencyUnit .
OutputPrecision str_to_precision (const std::string & s)
Convert string to OutputPrecision .

Public Types Documentation

enum CompType

Enumeration of component types in E3SM.

enum emulator::CompType {
    ATM = 0,
    OCN = 1,
    ICE = 2,
    LND = 3
};


enum DataLayout

Memory layout for multi-dimensional data.

enum emulator::DataLayout {
    ROW_MAJOR,
    COLUMN_MAJOR,
    UNKNOWN
};


typedef DoubleView

Convenience type aliases.

using emulator::DoubleView =  DataView<double>;


enum FileType

File type indicator for restart discovery.

enum emulator::FileType {
    HISTORY,
    RESTART,
    HISTORY_RESTART
};


typedef FloatView

using emulator::FloatView =  DataView<float>;

enum FrequencyUnit

Output frequency units.

enum emulator::FrequencyUnit {
    NSTEPS,
    NSECS,
    NMINS,
    NHOURS,
    NDAYS,
    NMONTHS,
    NYEARS,
    NONE
};

Specifies the time unit for output frequency. Follows EAMxx conventions.


enum LogLevel

Log level enumeration.

enum emulator::LogLevel {
    DEBUG,
    VERBOSE,
    INFO,
    WARNING,
    ERROR
};


enum OutputAvgType

Output averaging type.

enum emulator::OutputAvgType {
    INSTANT,
    AVERAGE,
    MIN,
    MAX,
    STD,
    SUM
};

Specifies how to combine multiple timesteps in the output window.


enum OutputPrecision

Output data precision.

enum emulator::OutputPrecision {
    FLOAT32,
    FLOAT64
};


Public Attributes Documentation

variable FILLVALUE

Default fill value for missing data.

double emulator::FILLVALUE;


Public Functions Documentation

function avg_type_to_str

Convert OutputAvgType to string.

std::string emulator::avg_type_to_str (
    OutputAvgType t
) 


function cleanup_emulator_context

Convenience function to clean up the global emulator context.

inline void emulator::cleanup_emulator_context () 

Equivalent to EmulatorContext::singleton().clean_up().


function create_diagnostic

Parse a field name and create appropriate diagnostic if needed.

std::unique_ptr< DerivedDiagnostic > emulator::create_diagnostic (
    const std::string & diag_name,
    const DiagnosticMetadata & metadata
) 

Recognized patterns: * "{field}_horiz_avg" or "{field}_global_mean" → HorizAvgDiagnostic * "{field}_at_lev{N}" → VertSliceDiagnostic at level N

Parameters:

  • diag_name Requested diagnostic/field name
  • metadata Context for creating diagnostics

Returns:

Unique pointer to diagnostic, or nullptr if name is not a diagnostic


function file_type_suffix

Get file type suffix string.

std::string emulator::file_type_suffix (
    FileType t
) 

Returns:

".atm.h.", ".atm.r.", or ".atm.rh."


function freq_unit_to_str

Convert FrequencyUnit to string.

std::string emulator::freq_unit_to_str (
    FrequencyUnit u
) 


function get_base_field_name

Extract base field name from diagnostic name.

std::string emulator::get_base_field_name (
    const std::string & diag_name
) 

Examples: * "T_horiz_avg" → "T" * "T_at_lev3" → "T"

Parameters:

  • diag_name Diagnostic name

Returns:

Base field name


function get_comp_name

Get the short name for a component type.

inline std::string emulator::get_comp_name (
    CompType type
) 

Parameters:

  • type Component type

Returns:

Short name string (e.g., "atm" for atmosphere)


function get_export_prefix

Get the coupling export prefix for a component type.

inline std::string emulator::get_export_prefix (
    CompType type
) 

Parameters:

  • type Component type

Returns:

Prefix string (e.g., "a2x" for atmosphere)


function get_import_prefix

Get the coupling import prefix for a component type.

inline std::string emulator::get_import_prefix (
    CompType type
) 

Parameters:

  • type Component type

Returns:

Prefix string (e.g., "x2a" for atmosphere)


function is_derived_diagnostic

Check if a field name is a derived diagnostic pattern.

bool emulator::is_derived_diagnostic (
    const std::string & name
) 

Parameters:

  • name Field name to check

Returns:

true if name matches a diagnostic pattern


function parse_emulator_config

Parse configuration from a YAML file.

EmulatorConfig emulator::parse_emulator_config (
    const std::string & yaml_file,
    const std::string & section_name
) 

Parse emulator configuration from a YAML file.

Reads the YAML file and extracts configuration for the specified component section (e.g., "eatm"). All subsections (build, runtime, model_io, coupling) are parsed if present.

Reads the specified YAML file and extracts the configuration for the given component section.

Parameters:

  • yaml_file Path to YAML configuration file
  • section_name Name of the component section (e.g., "eatm", "eocn")

Returns:

Parsed configuration structure

Exception:

  • std::runtime_error if file cannot be read or section is missing

function parse_emulator_config_with_defaults

Parse configuration with fallback to defaults.

EmulatorConfig emulator::parse_emulator_config_with_defaults (
    const std::string & yaml_file,
    const std::string & section_name,
    bool verbose
) 

Parse emulator configuration with fallback to defaults.

Gracefully handles missing or malformed config files by returning default configuration values.

Attempts to parse the YAML file. If the file doesn't exist or parsing fails, returns default configuration values.

Parameters:

  • yaml_file Path to YAML configuration file
  • section_name Name of the component section (e.g., "eatm", "eocn")
  • verbose Print debug information if true

Returns:

Parsed configuration structure (or defaults on failure)


function precision_to_str

Convert OutputPrecision to string.

std::string emulator::precision_to_str (
    OutputPrecision p
) 


function str_to_avg_type

Convert string to OutputAvgType .

OutputAvgType emulator::str_to_avg_type (
    const std::string & s
) 

Parameters:

  • s String like "instant", "average", "min", "max", "std", "sum"

Returns:

Corresponding OutputAvgType


function str_to_freq_unit

Convert string to FrequencyUnit .

FrequencyUnit emulator::str_to_freq_unit (
    const std::string & s
) 

Parameters:

  • s String like "nsteps", "ndays", "nmonths", etc.

Returns:

Corresponding FrequencyUnit (NONE if invalid)


function str_to_precision

Convert string to OutputPrecision .

OutputPrecision emulator::str_to_precision (
    const std::string & s
) 



The documentation for this class was generated from the following file components/emulator_comps/common/src/coupling_fields.cpp