YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
couple_config.c File Reference
#include "config.h"
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include "couple_config.h"
#include "couple_config_component.h"
#include "couple_config_config_output.h"
#include "couple_config_couple.h"
#include "couple_config_grid.h"
#include "couple_config_internal.h"
#include "yac_mpi_common.h"
#include "yac.h"
#include "mtime_calendar.h"
#include "utils_common.h"
#include "config_yaml.h"
#include "mtime_datetime.h"
#include "interpolation/interpolation_internal.h"
#include "interpolation/interpolation_gen_config.h"
#include "yac_mpi_internal.h"
#include "collection_selection_internal.h"
#include "instance.h"
Include dependency graph for couple_config.c:

Go to the source code of this file.

Macros

#define CHECK_COMPONENT_IDX()
 
#define CHECK_GRID_IDX()
 
#define CHECK_COUPLE_IDX()    YAC_ASSERT_F(couple_idx < couple_config->num_couples, "invalid couple_idx")
 

Functions

static size_t yac_couple_config_get_component_idx_unsafe (struct yac_couple_config const *couple_config, char const *component_name)
 
static size_t yac_couple_config_get_grid_idx_unsafe (struct yac_couple_config const *couple_config, char const *grid_name)
 
static size_t yac_couple_config_get_field_idx_unsafe (struct yac_couple_config const *couple_config, size_t component_idx, size_t grid_idx, char const *field_name)
 
struct yac_couple_configyac_couple_config_new ()
 
static struct yac_couple_config_componentyac_couple_config_get_component (struct yac_couple_config const *couple_config, char const *component_name)
 
static void couple_config_sync_calendar (MPI_Comm comm)
 
void yac_couple_config_delete (struct yac_couple_config *couple_config)
 
static size_t yac_couple_config_add_grid_ (struct yac_couple_config *couple_config, char const *name)
 
void yac_couple_config_add_grid (struct yac_couple_config *couple_config, char const *name)
 
static size_t yac_couple_config_add_component_ (struct yac_couple_config *couple_config, char const *name)
 
void yac_couple_config_add_component (struct yac_couple_config *couple_config, char const *name)
 
void yac_couple_config_set_component_metadata (struct yac_couple_config *couple_config, char const *comp_name, const char *metadata)
 
static void couple_config_check_grid_output_filename (char const *grid_name, char const *grid_output_filename, char const *all_grids_output_filename)
 
static void couple_config_check_grid_output_filenames (struct yac_couple_config *couple_config, char const *all_grids_output_filename)
 
void yac_couple_config_set_grid_output_filename (struct yac_couple_config *couple_config, char const *grid_name, const char *output_filename)
 
void yac_couple_config_set_all_grids_output_filename (struct yac_couple_config *couple_config, char const *output_filename)
 
void yac_couple_config_set_grid_metadata (struct yac_couple_config *couple_config, char const *grid_name, const char *metadata)
 
void yac_couple_config_set_field_metadata (struct yac_couple_config *couple_config, const char *comp_name, const char *grid_name, const char *field_name, const char *metadata)
 
const char * yac_couple_config_get_component_metadata (struct yac_couple_config const *couple_config, const char *comp_name)
 
const char * yac_couple_config_get_grid_output_filename (struct yac_couple_config const *couple_config, const char *grid_name)
 
const char * yac_couple_config_get_all_grids_output_filename (struct yac_couple_config const *couple_config)
 
const char * yac_couple_config_get_grid_metadata (struct yac_couple_config const *couple_config, const char *grid_name)
 
const char * yac_couple_config_get_field_metadata (struct yac_couple_config const *couple_config, const char *comp_name, const char *grid_name, const char *field_name)
 
static size_t yac_couple_config_add_component_field_ (struct yac_couple_config *couple_config, size_t component_idx, size_t grid_idx, char const *field_name, char const *timestep, size_t collection_size)
 
void yac_couple_config_add_component_field (struct yac_couple_config *couple_config, const char *component_name, const char *grid_name, const char *name, char const *timestep, size_t collection_size)
 
size_t yac_couple_config_get_num_couples (struct yac_couple_config const *couple_config)
 
int yac_couple_config_get_missing_definition_is_fatal (struct yac_couple_config const *couple_config)
 
void yac_couple_config_set_missing_definition_is_fatal (struct yac_couple_config *couple_config, int missing_definition_is_fatal)
 
int yac_couple_config_get_apply_coordinate_check (struct yac_couple_config const *couple_config)
 
void yac_couple_config_set_apply_coordinate_check (struct yac_couple_config *couple_config, int apply_coordinate_check)
 
int yac_couple_config_get_coordinates_mismatch_is_fatal (struct yac_couple_config const *couple_config)
 
void yac_couple_config_set_coordinates_mismatch_is_fatal (struct yac_couple_config *couple_config, int coordinates_mismatch_is_fatal)
 
size_t yac_couple_config_get_num_couple_fields (struct yac_couple_config const *couple_config, size_t couple_idx)
 
void yac_couple_config_get_couple_component_names (struct yac_couple_config const *couple_config, size_t couple_idx, char const *couple_component_names[2])
 
int yac_couple_config_is_valid_component_name (struct yac_couple_config const *couple_config, char const *component_name)
 
size_t yac_couple_config_get_num_components (struct yac_couple_config const *couple_config)
 
size_t yac_couple_config_get_num_grids (struct yac_couple_config const *couple_config)
 
size_t yac_couple_config_get_num_fields (struct yac_couple_config const *couple_config, size_t component_idx)
 
size_t yac_couple_config_get_component_idx (struct yac_couple_config const *couple_config, char const *component_name)
 
size_t yac_couple_config_get_grid_idx (struct yac_couple_config const *couple_config, char const *grid_name)
 
size_t yac_couple_config_get_field_idx (struct yac_couple_config const *couple_config, size_t component_idx, size_t grid_idx, char const *field_name)
 
char const * yac_couple_config_get_component_name (struct yac_couple_config const *couple_config, size_t component_idx)
 
char const * yac_couple_config_get_field_grid_name (struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
 
char const * yac_couple_config_get_field_name (struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
 
char const * yac_couple_config_get_field_timestep (struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
 
int yac_couple_config_get_field_role (struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
 
int yac_couple_config_is_valid_field (struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
 
struct yac_interp_stack_configyac_couple_config_get_interp_stack (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
int yac_couple_config_get_mapping_on_source (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
int yac_couple_config_get_source_lag (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
int yac_couple_config_get_target_lag (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
char const * yac_couple_config_get_coupling_period (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
enum yac_reduction_type yac_couple_config_get_coupling_period_operation (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
int yac_couple_config_get_enforce_write_weight_file (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
char const * yac_couple_config_get_weight_file_name (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
enum yac_weight_file_on_existing yac_couple_config_get_weight_file_on_existing (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
double yac_couple_config_get_scale_factor (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
double yac_couple_config_get_scale_summand (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
void yac_couple_config_get_src_mask_names (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const *const **mask_names, size_t *num_mask_names)
 
char const * yac_couple_config_get_tgt_mask_name (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
char const * yac_couple_config_get_yaxt_exchanger_name (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
struct yac_collection_selection const * yac_couple_config_get_collection_selection (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
int yac_couple_config_get_use_raw_exchange (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
void yac_couple_config_get_field_grid_names (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_grid_name, char const **tgt_grid_name)
 
void yac_couple_config_field_enable_frac_mask (struct yac_couple_config *couple_config, char const *comp_name, char const *grid_name, char const *field_name, double frac_mask_fallback_value)
 
double yac_couple_config_get_frac_mask_fallback_value (struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
 
size_t yac_couple_config_get_field_collection_size (struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
 
void yac_couple_config_get_field_couple_component_names (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_component_name, char const **tgt_component_name)
 
void yac_couple_config_get_field_names (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_field_name, const char **tgt_field_name)
 
char const * yac_couple_config_get_source_timestep (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
char const * yac_couple_config_get_target_timestep (struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
 
static char * normalise_utc_suffix (const char *src)
 
static struct _datetime * newDateTime_utc_patch (const char *str_new)
 
static void set_datetime (char const *type_datetime, struct _datetime **old, char const *str_new)
 
void yac_couple_config_set_datetime (struct yac_couple_config *couple_config, char const *start, char const *end)
 
char * yac_couple_config_get_start_datetime (struct yac_couple_config const *couple_config)
 
char * yac_couple_config_get_end_datetime (struct yac_couple_config const *couple_config)
 
char const * yac_couple_config_get_grid_name (struct yac_couple_config const *couple_config, size_t grid_idx)
 
int yac_couple_config_contains_grid_name (struct yac_couple_config const *couple_config, char const *grid_name)
 
static size_t yac_couple_config_add_couple_ (struct yac_couple_config *couple_config, size_t src_comp_idx, size_t tgt_comp_idx)
 
void yac_couple_config_def_couple (struct yac_couple_config *couple_config, char const *src_comp_name, char const *src_grid_name, char const *src_field_name, char const *tgt_comp_name, char const *tgt_grid_name, char const *tgt_field_name, char const *coupling_period, int time_reduction, struct yac_interp_stack_config *interp_stack, int src_lag, int tgt_lag, const char *weight_file_name, int weight_file_on_existing, int mapping_on_source, double scale_factor, double scale_summand, size_t num_src_mask_names, char const *const *src_mask_names, char const *tgt_mask_name, char const *yaxt_exchanger_name, struct yac_collection_selection const *collection_selection, int use_raw_exchange)
 
static void couple_config_sync_datetime (char const *type_datetime, struct _datetime **datetime, MPI_Comm comm)
 
static void couple_config_sync_time (struct yac_couple_config *couple_config, MPI_Comm comm)
 
void yac_couple_config_sync (struct yac_couple_config *couple_config, MPI_Comm comm, char const *output_ref)
 
void yac_couple_config_set_config_output_filename (struct yac_couple_config *couple_config, char const *filename, enum yac_text_filetype filetype, char const *ref, int include_definitions)
 
static void yac_couple_config_find_field_couple_with_target (struct yac_couple_config const *couple_config, char const *tgt_component_name, char const *tgt_grid_name, char const *tgt_field_name, size_t *result_couple_idx, size_t *result_field_couple_idx)
 
void yac_couple_config_get_field_source (struct yac_couple_config const *couple_config, char const *tgt_component_name, char const *tgt_grid_name, char const *tgt_field_name, char const **src_component_name, char const **src_grid_name, char const **src_field_name)
 
struct yac_interpolation_gen_configyac_couple_config_get_interpolation_gen_config (struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
 

Macro Definition Documentation

◆ CHECK_COMPONENT_IDX

#define CHECK_COMPONENT_IDX ( )
Value:
unsigned component_idx[3]
unsigned num_components
#define YAC_ASSERT_F(exp, format,...)
Definition yac_assert.h:39

Definition at line 316 of file couple_config.c.

◆ CHECK_COUPLE_IDX

#define CHECK_COUPLE_IDX ( )     YAC_ASSERT_F(couple_idx < couple_config->num_couples, "invalid couple_idx")

Definition at line 497 of file couple_config.c.

◆ CHECK_GRID_IDX

#define CHECK_GRID_IDX ( )
Value:
grid_idx < couple_config->num_grids, "invalid grid_idx")
unsigned grid_idx[3]

Definition at line 320 of file couple_config.c.

Function Documentation

◆ couple_config_check_grid_output_filename()

static void couple_config_check_grid_output_filename ( char const * grid_name,
char const * grid_output_filename,
char const * all_grids_output_filename )
static

Checks that a grid specific output file name does not conflict with the output file name that applies to all grids.

This complements the checks of yac_couple_config_set_grid_output_filename_value, which only sees a single grid and can therefore only detect a conflict between the previous and the new output file name of that grid.

A NULL value for either file name means that it has not been set, which cannot conflict.

Definition at line 176 of file couple_config.c.

Here is the caller graph for this function:

◆ couple_config_check_grid_output_filenames()

static void couple_config_check_grid_output_filenames ( struct yac_couple_config * couple_config,
char const * all_grids_output_filename )
static

Checks that no grid has a grid specific output file name that conflicts with the provided output file name for all grids.

The provided file name is passed explicitly, because yac_couple_config_set_all_grids_output_filename has to check a candidate file name before storing it.

Definition at line 196 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ couple_config_sync_calendar()

static void couple_config_sync_calendar ( MPI_Comm comm)
static

Definition at line 93 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ couple_config_sync_datetime()

static void couple_config_sync_datetime ( char const * type_datetime,
struct _datetime ** datetime,
MPI_Comm comm )
static

Definition at line 1483 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ couple_config_sync_time()

static void couple_config_sync_time ( struct yac_couple_config * couple_config,
MPI_Comm comm )
static

Definition at line 1505 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newDateTime_utc_patch()

static struct _datetime * newDateTime_utc_patch ( const char * str_new)
static

Definition at line 1188 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalise_utc_suffix()

static char * normalise_utc_suffix ( const char * src)
static

Definition at line 1169 of file couple_config.c.

Here is the caller graph for this function:

◆ set_datetime()

static void set_datetime ( char const * type_datetime,
struct _datetime ** old,
char const * str_new )
static

Definition at line 1199 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_component()

void yac_couple_config_add_component ( struct yac_couple_config * couple_config,
char const * name )

Definition at line 150 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_component_()

static size_t yac_couple_config_add_component_ ( struct yac_couple_config * couple_config,
char const * name )
static

Definition at line 142 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_component_field()

void yac_couple_config_add_component_field ( struct yac_couple_config * couple_config,
const char * component_name,
const char * grid_name,
const char * name,
char const * timestep,
size_t collection_size )

Definition at line 340 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_component_field_()

static size_t yac_couple_config_add_component_field_ ( struct yac_couple_config * couple_config,
size_t component_idx,
size_t grid_idx,
char const * field_name,
char const * timestep,
size_t collection_size )
static

Definition at line 324 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_couple_()

static size_t yac_couple_config_add_couple_ ( struct yac_couple_config * couple_config,
size_t src_comp_idx,
size_t tgt_comp_idx )
static

Definition at line 1282 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_grid()

void yac_couple_config_add_grid ( struct yac_couple_config * couple_config,
char const * name )

Definition at line 136 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_add_grid_()

static size_t yac_couple_config_add_grid_ ( struct yac_couple_config * couple_config,
char const * name )
static

Definition at line 128 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_contains_grid_name()

int yac_couple_config_contains_grid_name ( struct yac_couple_config const * couple_config,
char const * grid_name )

Definition at line 1270 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_def_couple()

void yac_couple_config_def_couple ( struct yac_couple_config * couple_config,
char const * src_comp_name,
char const * src_grid_name,
char const * src_field_name,
char const * tgt_comp_name,
char const * tgt_grid_name,
char const * tgt_field_name,
char const * coupling_period,
int time_reduction,
struct yac_interp_stack_config * interp_stack,
int src_lag,
int tgt_lag,
const char * weight_file_name,
int weight_file_on_existing,
int mapping_on_source,
double scale_factor,
double scale_summand,
size_t num_src_mask_names,
char const *const * src_mask_names,
char const * tgt_mask_name,
char const * yaxt_exchanger_name,
struct yac_collection_selection const * collection_selection,
int use_raw_exchange )

Definition at line 1310 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_delete()

void yac_couple_config_delete ( struct yac_couple_config * couple_config)

Definition at line 111 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_field_enable_frac_mask()

void yac_couple_config_field_enable_frac_mask ( struct yac_couple_config * couple_config,
char const * comp_name,
char const * grid_name,
char const * field_name,
double frac_mask_fallback_value )

Definition at line 1012 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_find_field_couple_with_target()

static void yac_couple_config_find_field_couple_with_target ( struct yac_couple_config const * couple_config,
char const * tgt_component_name,
char const * tgt_grid_name,
char const * tgt_field_name,
size_t * result_couple_idx,
size_t * result_field_couple_idx )
static

Find the couple index and field couple index for a given target field.

If no match is found both output indices are set to SIZE_MAX. An assertion failure occurs if multiple field couples match.

Definition at line 1623 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_all_grids_output_filename()

const char * yac_couple_config_get_all_grids_output_filename ( struct yac_couple_config const * couple_config)

Returns the output file name that applies to all grids (NULL if unset).

Definition at line 291 of file couple_config.c.

◆ yac_couple_config_get_apply_coordinate_check()

int yac_couple_config_get_apply_coordinate_check ( struct yac_couple_config const * couple_config)

returns whether YAC checks point coordinates at enddef

Parameters
[in]couple_configcoupling configuration
Returns
apply_coordinate_check flag

Definition at line 401 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_collection_selection()

struct yac_collection_selection const * yac_couple_config_get_collection_selection ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 952 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_component()

static struct yac_couple_config_component * yac_couple_config_get_component ( struct yac_couple_config const * couple_config,
char const * component_name )
static

Returns the component with the given name from the coupling configuration.

Definition at line 77 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_component_idx()

size_t yac_couple_config_get_component_idx ( struct yac_couple_config const * couple_config,
char const * component_name )

Definition at line 557 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_component_idx_unsafe()

static size_t yac_couple_config_get_component_idx_unsafe ( struct yac_couple_config const * couple_config,
char const * component_name )
static

Definition at line 571 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_component_metadata()

const char * yac_couple_config_get_component_metadata ( struct yac_couple_config const * couple_config,
const char * comp_name )

Definition at line 275 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_component_name()

char const * yac_couple_config_get_component_name ( struct yac_couple_config const * couple_config,
size_t component_idx )

Definition at line 640 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_coordinates_mismatch_is_fatal()

int yac_couple_config_get_coordinates_mismatch_is_fatal ( struct yac_couple_config const * couple_config)

returns whether a coordinate mismatch triggers a fatal error

Parameters
[in]couple_configcoupling configuration
Returns
coordinates_mismatch_is_fatal flag

Definition at line 447 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_couple_component_names()

void yac_couple_config_get_couple_component_names ( struct yac_couple_config const * couple_config,
size_t couple_idx,
char const * couple_component_names[2] )

Definition at line 508 of file couple_config.c.

◆ yac_couple_config_get_coupling_period()

char const * yac_couple_config_get_coupling_period ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 820 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_coupling_period_operation()

enum yac_reduction_type yac_couple_config_get_coupling_period_operation ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 833 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_end_datetime()

char * yac_couple_config_get_end_datetime ( struct yac_couple_config const * couple_config)

Definition at line 1246 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_enforce_write_weight_file()

int yac_couple_config_get_enforce_write_weight_file ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 846 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_collection_size()

size_t yac_couple_config_get_field_collection_size ( struct yac_couple_config const * couple_config,
char const * component_name,
char const * grid_name,
char const * field_name )

Definition at line 1047 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_couple_component_names()

void yac_couple_config_get_field_couple_component_names ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx,
char const ** src_component_name,
char const ** tgt_component_name )

Definition at line 1060 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_grid_name()

char const * yac_couple_config_get_field_grid_name ( struct yac_couple_config const * couple_config,
size_t component_idx,
size_t field_idx )

Definition at line 651 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_grid_names()

void yac_couple_config_get_field_grid_names ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx,
char const ** src_grid_name,
char const ** tgt_grid_name )

Definition at line 978 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_idx()

size_t yac_couple_config_get_field_idx ( struct yac_couple_config const * couple_config,
size_t component_idx,
size_t grid_idx,
char const * field_name )

Definition at line 611 of file couple_config.c.

Here is the call graph for this function:

◆ yac_couple_config_get_field_idx_unsafe()

static size_t yac_couple_config_get_field_idx_unsafe ( struct yac_couple_config const * couple_config,
size_t component_idx,
size_t grid_idx,
char const * field_name )
static

Definition at line 627 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_metadata()

const char * yac_couple_config_get_field_metadata ( struct yac_couple_config const * couple_config,
const char * comp_name,
const char * grid_name,
const char * field_name )

Definition at line 303 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_name()

char const * yac_couple_config_get_field_name ( struct yac_couple_config const * couple_config,
size_t component_idx,
size_t field_idx )

Definition at line 671 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_names()

void yac_couple_config_get_field_names ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx,
char const ** src_field_name,
const char ** tgt_field_name )

Definition at line 1079 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_role()

int yac_couple_config_get_field_role ( struct yac_couple_config const * couple_config,
char const * component_name,
char const * grid_name,
char const * field_name )

Definition at line 697 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_source()

void yac_couple_config_get_field_source ( struct yac_couple_config const * couple_config,
char const * tgt_component_name,
char const * tgt_grid_name,
char const * tgt_field_name,
char const ** src_component_name,
char const ** src_grid_name,
char const ** src_field_name )

Definition at line 1659 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_field_timestep()

char const * yac_couple_config_get_field_timestep ( struct yac_couple_config const * couple_config,
char const * component_name,
char const * grid_name,
char const * field_name )

Definition at line 683 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_frac_mask_fallback_value()

double yac_couple_config_get_frac_mask_fallback_value ( struct yac_couple_config const * couple_config,
char const * component_name,
char const * grid_name,
char const * field_name )

Definition at line 1031 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_grid_idx()

size_t yac_couple_config_get_grid_idx ( struct yac_couple_config const * couple_config,
char const * grid_name )

Definition at line 585 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_grid_idx_unsafe()

static size_t yac_couple_config_get_grid_idx_unsafe ( struct yac_couple_config const * couple_config,
char const * grid_name )
static

Definition at line 597 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_grid_metadata()

const char * yac_couple_config_get_grid_metadata ( struct yac_couple_config const * couple_config,
const char * grid_name )

Definition at line 296 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_grid_name()

char const * yac_couple_config_get_grid_name ( struct yac_couple_config const * couple_config,
size_t grid_idx )

Definition at line 1257 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_grid_output_filename()

const char * yac_couple_config_get_grid_output_filename ( struct yac_couple_config const * couple_config,
const char * grid_name )

Returns the effective output file name of a grid, which is the grid specific one, if available, and the one that applies to all grids otherwise (NULL if neither was set).

Definition at line 281 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_interp_stack()

struct yac_interp_stack_config * yac_couple_config_get_interp_stack ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 768 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_interpolation_gen_config()

struct yac_interpolation_gen_config * yac_couple_config_get_interpolation_gen_config ( struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 1698 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_mapping_on_source()

int yac_couple_config_get_mapping_on_source ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 781 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_missing_definition_is_fatal()

int yac_couple_config_get_missing_definition_is_fatal ( struct yac_couple_config const * couple_config)

returns whether YAC aborts if for a defined couple at least one associated field was not defined by the user

Parameters
[in]couple_configcoupling configuration
Returns
missing_definition_is_fatal flag

Definition at line 358 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_num_components()

size_t yac_couple_config_get_num_components ( struct yac_couple_config const * couple_config)

Definition at line 539 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_num_couple_fields()

size_t yac_couple_config_get_num_couple_fields ( struct yac_couple_config const * couple_config,
size_t couple_idx )

Definition at line 500 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_num_couples()

size_t yac_couple_config_get_num_couples ( struct yac_couple_config const * couple_config)

Definition at line 352 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_num_fields()

size_t yac_couple_config_get_num_fields ( struct yac_couple_config const * couple_config,
size_t component_idx )

Definition at line 551 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_num_grids()

size_t yac_couple_config_get_num_grids ( struct yac_couple_config const * couple_config)

Definition at line 545 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_scale_factor()

double yac_couple_config_get_scale_factor ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 885 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_scale_summand()

double yac_couple_config_get_scale_summand ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 898 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_source_lag()

int yac_couple_config_get_source_lag ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 794 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_source_timestep()

char const * yac_couple_config_get_source_timestep ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 1110 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_src_mask_names()

void yac_couple_config_get_src_mask_names ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx,
char const *const ** mask_names,
size_t * num_mask_names )

Definition at line 911 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_start_datetime()

char * yac_couple_config_get_start_datetime ( struct yac_couple_config const * couple_config)

Definition at line 1235 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_get_target_lag()

int yac_couple_config_get_target_lag ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 807 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_target_timestep()

char const * yac_couple_config_get_target_timestep ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 1140 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_tgt_mask_name()

char const * yac_couple_config_get_tgt_mask_name ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 925 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_use_raw_exchange()

int yac_couple_config_get_use_raw_exchange ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 965 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_weight_file_name()

char const * yac_couple_config_get_weight_file_name ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 859 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_weight_file_on_existing()

enum yac_weight_file_on_existing yac_couple_config_get_weight_file_on_existing ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 872 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_get_yaxt_exchanger_name()

char const * yac_couple_config_get_yaxt_exchanger_name ( struct yac_couple_config const * couple_config,
size_t couple_idx,
size_t field_couple_idx )

Definition at line 938 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_is_valid_component_name()

int yac_couple_config_is_valid_component_name ( struct yac_couple_config const * couple_config,
char const * component_name )

Definition at line 520 of file couple_config.c.

◆ yac_couple_config_is_valid_field()

int yac_couple_config_is_valid_field ( struct yac_couple_config const * couple_config,
size_t component_idx,
size_t field_idx )

Definition at line 756 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_new()

struct yac_couple_config * yac_couple_config_new ( )

Definition at line 45 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_set_all_grids_output_filename()

void yac_couple_config_set_all_grids_output_filename ( struct yac_couple_config * couple_config,
char const * output_filename )

Sets an output file name that applies to all grids of the coupling configuration.

This also covers grids that are added after this call. It is a fatal error if a grid has a grid specific output file name that differs from the provided one. Unlike yac_couple_config_set_grid_output_filename this does not implicitly add a grid.

Parameters
[in,out]couple_configCoupling configuration.
[in]output_filenameOutput file name (must not be NULL or an empty string).

Definition at line 228 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_apply_coordinate_check()

void yac_couple_config_set_apply_coordinate_check ( struct yac_couple_config * couple_config,
int apply_coordinate_check )

sets whether YAC checks point coordinates at enddef

Parameters
[in]couple_configcoupling configuration
[in]apply_coordinate_checkapply_coordinate_check flag

Definition at line 425 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_set_component_metadata()

void yac_couple_config_set_component_metadata ( struct yac_couple_config * couple_config,
char const * comp_name,
const char * metadata )

Definition at line 156 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_config_output_filename()

void yac_couple_config_set_config_output_filename ( struct yac_couple_config * couple_config,
char const * filename,
enum yac_text_filetype filetype,
char const * ref,
int include_definitions )

enables the writing of the synchronised coupling configuration to file by yac_couple_config_sync

Parameters
[in]couple_configcoupling configuration
[in]filenamename of the output file
[in]filetypetype of the output file
[in]refreference, which has to be provided to yac_couple_config_sync in order to select the filename
[in]include_definitionsinclude debug definitions (components, grids, and fields) in the output file

Definition at line 1606 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_coordinates_mismatch_is_fatal()

void yac_couple_config_set_coordinates_mismatch_is_fatal ( struct yac_couple_config * couple_config,
int coordinates_mismatch_is_fatal )

sets whether a coordinate mismatch triggers a fatal error

Parameters
[in]couple_configcoupling configuration
[in]coordinates_mismatch_is_fatalcoordinates_mismatch_is_fatal flag

Definition at line 474 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_set_datetime()

void yac_couple_config_set_datetime ( struct yac_couple_config * couple_config,
char const * start,
char const * end )

Definition at line 1227 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_field_metadata()

void yac_couple_config_set_field_metadata ( struct yac_couple_config * couple_config,
const char * comp_name,
const char * grid_name,
const char * field_name,
const char * metadata )

Definition at line 263 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_grid_metadata()

void yac_couple_config_set_grid_metadata ( struct yac_couple_config * couple_config,
char const * grid_name,
const char * metadata )

Definition at line 249 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_grid_output_filename()

void yac_couple_config_set_grid_output_filename ( struct yac_couple_config * couple_config,
char const * grid_name,
const char * output_filename )

Definition at line 207 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_couple_config_set_missing_definition_is_fatal()

void yac_couple_config_set_missing_definition_is_fatal ( struct yac_couple_config * couple_config,
int missing_definition_is_fatal )

sets whether YAC aborts if for a defined couple at least one associated field was not defined by the user

Parameters
[in]couple_configcoupling configuration
[in]missing_definition_is_fatalmissing_definition_is_fatal flag

Definition at line 379 of file couple_config.c.

Here is the caller graph for this function:

◆ yac_couple_config_sync()

void yac_couple_config_sync ( struct yac_couple_config * couple_config,
MPI_Comm comm,
char const * output_ref )

synchronises the coupling configuration across all processes in comm

Parameters
[in]couple_configcoupling configuration
[in]commMPI communicator
[in]output_refThe coupling configuration will be written to file after it has been synchronised between all processes, if a filename and -type have been set for the provided reference (see yac_couple_config_set_config_output_filename)

Definition at line 1515 of file couple_config.c.

Here is the call graph for this function:
Here is the caller graph for this function: