File emulator_atm_interface.cpp
FileList > components > emulator_comps > eatm > src > emulator_atm_interface.cpp
Go to the source code of this file
C interface for the atmosphere emulator (Fortran-callable). More...
#include "../../common/src/emulator_comp.hpp"#include "../../common/src/emulator_context.hpp"#include "emulator_atm.hpp"
Public Functions
| Type | Name |
|---|---|
| void | emulator_atm_create_instance (const MPI_Fint f_comm, const int comp_id, const char * input_file, const char * log_file, const int run_type, const int start_ymd, const int start_tod) Create and initialize the atmosphere emulator instance. |
| void | emulator_atm_finalize () Finalize and clean up the atmosphere emulator. |
| void | emulator_atm_get_cols_area (double * area) Get cell areas for local columns. |
| void | emulator_atm_get_cols_latlon (double * lat, double * lon) Get latitude/longitude for local columns. |
| void | emulator_atm_get_local_cols_gids (int * gids) Get global IDs for local columns. |
| int | emulator_atm_get_num_global_cols () Get total number of global columns. |
| int | emulator_atm_get_num_local_cols () Get number of local columns on this rank. |
| int | emulator_atm_get_nx () Get grid size in x-direction. |
| int | emulator_atm_get_ny () Get grid size in y-direction. |
| void | emulator_atm_init () Initialize the atmosphere emulator (phase 2). |
| void | emulator_atm_init_coupling_indices (const char * export_fields, const char * import_fields) Initialize coupling field index mappings. |
| void | emulator_atm_run (const int dt) Execute one time step. |
| void | emulator_atm_set_grid_data (const int nx, const int ny, const int num_local_cols, const int num_global_cols, const int * col_gids, const double * lat, const double * lon, const double * area) Set grid decomposition data from driver. |
| void | emulator_atm_setup_coupling (double * import_data, double * export_data, const int num_imports, const int num_exports, const int field_size) Set up coupling buffer pointers from MCT. |
Detailed Description
Provides extern "C" functions that can be called from Fortran via ISO_C_BINDING. These functions wrap the EmulatorAtm C++ class methods.
The interface follows the E3SM component lifecycle: * create_instance - Initialize MPI and component * set_grid_data - Set grid decomposition * init_coupling_indices - Parse MCT field lists * setup_coupling - Set coupling buffer pointers * init - Load model and prepare for time stepping * run - Execute time steps * finalize - Clean up resources
See also: EmulatorAtm for the C++ implementation
See also: emulator_atm_f2c.F90 for the Fortran interface module
Public Functions Documentation
function emulator_atm_create_instance
Create and initialize the atmosphere emulator instance.
void emulator_atm_create_instance (
const MPI_Fint f_comm,
const int comp_id,
const char * input_file,
const char * log_file,
const int run_type,
const int start_ymd,
const int start_tod
)
Parameters:
f_commFortran MPI communicatorcomp_idComponent ID from driverinput_filePath to atm_in configuration filelog_filePath to log file (NULL for stdout)run_typeRun type (startup, continue, branch)start_ymdStart date as YYYYMMDDstart_todStart time of day in seconds
function emulator_atm_finalize
Finalize and clean up the atmosphere emulator.
void emulator_atm_finalize ()
function emulator_atm_get_cols_area
Get cell areas for local columns.
void emulator_atm_get_cols_area (
double * area
)
Parameters:
areaOutput area array
function emulator_atm_get_cols_latlon
Get latitude/longitude for local columns.
void emulator_atm_get_cols_latlon (
double * lat,
double * lon
)
Parameters:
latOutput latitude array [radians]lonOutput longitude array [radians]
function emulator_atm_get_local_cols_gids
Get global IDs for local columns.
void emulator_atm_get_local_cols_gids (
int * gids
)
Parameters:
gidsOutput array (must be pre-allocated)
function emulator_atm_get_num_global_cols
Get total number of global columns.
int emulator_atm_get_num_global_cols ()
function emulator_atm_get_num_local_cols
Get number of local columns on this rank.
int emulator_atm_get_num_local_cols ()
function emulator_atm_get_nx
Get grid size in x-direction.
int emulator_atm_get_nx ()
function emulator_atm_get_ny
Get grid size in y-direction.
int emulator_atm_get_ny ()
function emulator_atm_init
Initialize the atmosphere emulator (phase 2).
void emulator_atm_init ()
function emulator_atm_init_coupling_indices
Initialize coupling field index mappings.
void emulator_atm_init_coupling_indices (
const char * export_fields,
const char * import_fields
)
function emulator_atm_run
Execute one time step.
void emulator_atm_run (
const int dt
)
Parameters:
dtTime step size in seconds
function emulator_atm_set_grid_data
Set grid decomposition data from driver.
void emulator_atm_set_grid_data (
const int nx,
const int ny,
const int num_local_cols,
const int num_global_cols,
const int * col_gids,
const double * lat,
const double * lon,
const double * area
)
function emulator_atm_setup_coupling
Set up coupling buffer pointers from MCT.
void emulator_atm_setup_coupling (
double * import_data,
double * export_data,
const int num_imports,
const int num_exports,
const int field_size
)
The documentation for this class was generated from the following file components/emulator_comps/eatm/src/emulator_atm_interface.cpp