YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
config_yaml.c File Reference
#include "config.h"
#include <libfyaml.h>
#include <inttypes.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include "yac.h"
#include "utils_mci.h"
#include "config_yaml.h"
#include "mtime_calendar.h"
#include "geometry.h"
#include "io_utils.h"
#include "interpolation/methods/interp_method_config.h"
#include "interpolation/interpolation_internal.h"
#include "interpolation/interp_stack_config.h"
#include "parameter/param.h"
#include "instance.h"
#include "fields.h"
#include "collection_selection_internal.h"
Include dependency graph for config_yaml.c:

Go to the source code of this file.

Data Structures

struct  field_couple_buffer
 
struct  field_couple_buffer::field_couple_field_names
 
struct  debug_config_file_buffer
 
struct  debug_config_file_buffer::debug_config_file
 

Macros

#define OUTPUT_GRIDS_FILE_NAME_STR   "file_name"
 
#define YAML_ASSERT(CHECK, MSG)
 
#define YAML_ASSERT_F(CHECK, MSG, ...)
 
#define YAML_UNREACHABLE_DEFAULT(MSG)
 
#define YAML_UNREACHABLE_DEFAULT_F(MSG, ...)
 

Typedefs

typedef struct fy_document * fy_document_t
 
typedef struct fy_node * fy_node_t
 
typedef struct fy_node_pair * fy_node_pair_t
 

Enumerations

enum  {
  EMITTER_DEFAULT = FYECF_DEFAULT , EMITTER_JSON = FYECF_MODE_JSON , PARSER_DEFAULT = 0 , PARSER_JSON_AUTO = FYPCF_JSON_AUTO ,
  PARSER_JSON_FORCE = FYPCF_JSON_FORCE
}
 
enum  yaml_base_key_types {
  START_DATE , END_DATE , CALENDAR , TIMESTEP_UNIT ,
  COUPLING , DEBUG
}
 
enum  yaml_couple_key_types {
  SOURCE_NAME , SOURCE_COMPONENT , SOURCE_GRID , TARGET_NAMES ,
  TARGET_COMPONENT , TARGET_GRID , FIELD , COUPLING_PERIOD ,
  TIME_REDUCTION , SOURCE_LAG , TARGET_LAG , WEIGHT_FILE_DATA ,
  WEIGHT_FILE_NAME , WEIGHT_FILE_ON_EXISTING , MAPPING_SIDE , SCALE_FACTOR ,
  SCALE_SUMMAND , INTERPOLATION , SOURCE_MASK_NAME , SOURCE_MASK_NAMES ,
  TARGET_MASK_NAME , YAXT_EXCHANGER_NAME , COLLECTION_SELECTION , USE_RAW_EXCHANGE
}
 
enum  yaml_debug_key_types {
  GLOBAL_CONFIG , GLOBAL_DEFS , OUTPUT_GRIDS , MISSING_DEF ,
  APPLY_COORD_CHECK , COORDS_MISMATCH_FATAL
}
 
enum  yaml_debug_sync_loc_key_types { SYNC_LOC_DEF_COMP , SYNC_LOC_SYNC_DEF , SYNC_LOC_ENDDEF , SYNC_LOC_COUNT }
 
enum  yaml_comp_grid_names_key_types { COMP_NAME , GRID_NAMES }
 
enum  yaml_weight_file_data_key_types { WEIGHT_FILE_DATA_NAME , WEIGHT_FILE_DATA_ON_EXISTING }
 
enum  yaml_debug_output_grid_key_types { OUTPUT_GRID_GRID_NAME , OUTPUT_GRID_FILE_NAME }
 

Functions

char const * yac_time_to_ISO (char const *time, enum yac_time_unit_type time_unit)
 
 DEF_NAME_TYPE_PAIRS (yaml_base_keys, DEF_NAME_TYPE_PAIR(start_date, START_DATE), DEF_NAME_TYPE_PAIR(start_datetime, START_DATE), DEF_NAME_TYPE_PAIR(end_date, END_DATE), DEF_NAME_TYPE_PAIR(end_datetime, END_DATE), DEF_NAME_TYPE_PAIR(calendar, CALENDAR), DEF_NAME_TYPE_PAIR(timestep_unit, TIMESTEP_UNIT), DEF_NAME_TYPE_PAIR(coupling, COUPLING), DEF_NAME_TYPE_PAIR(debug, DEBUG))
 
static calendarType yaml_parse_calendar_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static char const * yaml_parse_timestep_value (fy_node_t value_node, char const *key_name, char const *yaml_filename, enum yac_time_unit_type time_unit)
 
static enum yac_time_unit_type yaml_parse_timestep_unit_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static enum yac_reduction_type yaml_parse_time_reduction_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static int yaml_parse_integer_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static size_t yaml_parse_size_t_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static double yaml_parse_double_value (fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static int yaml_parse_enum_value (struct yac_name_type_pair const *valid_values, size_t num_valid_values, fy_node_t value_node, char const *key_name, char const *yaml_filename)
 
static void yaml_parse_base_interp_method_node (char const **interpolation_type_str, fy_node_t *parameter_node, fy_node_t interp_method_node, char const *yaml_filename)
 reads interpolation name and user-provided parameters from YAML node
 
static void yaml_set_interp_method_config_param_from_node (struct yac_param *param, fy_node_t value_node, char const *interpolation_name, char const *yaml_filename)
 
static void yaml_parse_interp_method (struct yac_interp_stack_config *interp_stack, fy_node_t interp_method_node, char const *yaml_filename)
 
static void yaml_parse_interp_stack_value (struct yac_interp_stack_config *interp_stack, fy_node_t interp_stack_node, char const *yaml_filename)
 
static struct field_couple_field_names yaml_parse_field_name (fy_node_t field_node, const char *yaml_filename)
 
static void yaml_parse_size_t_sequence (size_t **values, size_t *num_values, fy_node_t values_node, char const *sequence_name, const char *yaml_filename)
 
static void yaml_parse_collection_selection_sequence (struct yac_collection_selection **collection_selection, fy_node_t values_node, char const *sequence_name, const char *yaml_filename)
 
static void yaml_parse_string_sequence (char const ***values, size_t *num_values, fy_node_t values_node, char const *sequence_name, const char *yaml_filename)
 
static void yaml_parse_field_names (struct field_couple_field_names **field_names, size_t *num_field_names, fy_node_t fields_node, const char *yaml_filename)
 
static void yaml_parse_comp_grid_names (char const **comp_name, char const ***grid_names, size_t *num_grid_names, fy_node_t values_node, char const *type_name, const char *yaml_filename, int allow_multiple_grids)
 
static void yaml_parse_weight_file_data (char const **weight_file_name, enum yac_weight_file_on_existing *on_existing, fy_node_t values_node, char const *type_name, const char *yaml_filename)
 
static void yaml_parse_couple_map_pair (struct field_couple_buffer *field_buffer, fy_node_pair_t couple_pair, const char *yaml_filename, enum yac_time_unit_type time_unit)
 
static void yaml_parse_couple (struct yac_couple_config *couple_config, fy_node_t couple_node, char const *yaml_filename, enum yac_time_unit_type time_unit)
 
static void yaml_parse_coupling (struct yac_couple_config *couple_config, fy_node_t coupling_node, char const *yaml_filename, enum yac_time_unit_type time_unit)
 
static struct debug_config_file yaml_parse_config_file_value (fy_node_t config_file_node, char const *file_type_name, const char *yaml_filename)
 
static void yaml_parse_debug_config_file_map_pair (struct debug_config_file_buffer *config_file_buffer, fy_node_pair_t config_file_pair, char const *config_file_type_name, const char *yaml_filename)
 
static struct debug_config_file_buffer yaml_parse_debug_config_file_buffer (fy_node_t config_file_node, char const *config_file_type_name, char const *yaml_filename)
 
static void yaml_parse_debug_global_config (struct yac_couple_config *couple_config, fy_node_t global_config_node, char const *yaml_filename)
 
static void yaml_parse_output_grid_pair (char const **grid_name, char const **file_name, fy_node_pair_t output_grid_pair, char const *yaml_filename)
 
static void yaml_parse_output_grid (struct yac_couple_config *couple_config, fy_node_t output_grid_node, char const *yaml_filename)
 
static void yaml_parse_all_output_grids (struct yac_couple_config *couple_config, fy_node_t output_grids_node, char const *yaml_filename)
 
static void yaml_parse_debug_output_grids (struct yac_couple_config *couple_config, fy_node_t output_grids_node, char const *yaml_filename)
 
static void yaml_parse_debug_map_pair (struct yac_couple_config *couple_config, fy_node_pair_t debug_pair, const char *yaml_filename)
 
static void yaml_parse_debug (struct yac_couple_config *couple_config, fy_node_t debug_node, char const *yaml_filename)
 
static size_t yaml_edit_distance (char const *a, char const *b)
 
static void yaml_check_base_key_typo (char const *unknown_key, char const *yaml_filename)
 
static void yaml_parse_base_map_pair (struct yac_couple_config *couple_config, fy_node_pair_t base_pair, const char *yaml_filename, enum yac_time_unit_type *time_unit, char const **start_datetime, char const **end_datetime)
 
static void yaml_parse_document (struct yac_couple_config *couple_config, fy_document_t document, const char *yaml_filename)
 
void yac_yaml_read_coupling (struct yac_couple_config *couple_config, const char *yaml_filename, int parse_flags)
 
struct yac_interp_stack_config * yac_yaml_parse_interp_stack_config_string (char const *str_interp_stack_config, int parse_flags)
 
static fy_node_t yac_yaml_create_scalar (fy_document_t document, char const *value)
 
static fy_node_t yac_yaml_create_scalar_int (fy_document_t document, int value)
 
static fy_node_t yac_yaml_create_scalar_size_t (fy_document_t document, size_t value)
 
static fy_node_t yac_yaml_create_scalar_dble (fy_document_t document, double value)
 
static fy_node_t yac_yaml_create_sequence_scalar (fy_document_t document, char const *const *values, size_t num_values)
 
static fy_node_t yac_yaml_create_sequence_scalar_size_t (fy_document_t document, size_t const *values, size_t num_values)
 
static void yac_yaml_map_append (fy_node_t map, char const *key, fy_node_t value)
 
static void yac_yaml_map_append_scalar (fy_node_t map, char const *key, char const *value)
 
static void yac_yaml_map_append_scalar_int (fy_node_t map, char const *key, int value)
 
static void yac_yaml_map_append_scalar_size_t (fy_node_t map, char const *key, size_t value)
 
static void yac_yaml_map_append_scalar_dble (fy_node_t map, char const *key, double value)
 
static fy_node_t yac_yaml_create_field_name_node (fy_document_t document, struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
 
static fy_node_t yac_yaml_create_non_default_param_node (fy_document_t document, struct yac_param *param)
 
static fy_node_t yac_yaml_create_non_default_scalar_param_node (fy_document_t document, struct yac_param const *param)
 
static fy_node_t yac_yaml_create_non_default_struct_param_node (fy_document_t document, struct yac_param *param)
 
static fy_node_t yac_yaml_create_non_default_list_param_node (fy_document_t document, struct yac_param *param)
 
static fy_node_t yac_yaml_create_interpolation_node (fy_document_t document, struct yac_interp_method_config const *method_config)
 
static fy_node_t yac_yaml_create_interpolation_stack_node (fy_document_t document, struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
 
static void yac_yaml_append_couple_field_nodes (fy_node_t coupling_node, struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
 
static void yac_yaml_append_couple_nodes (fy_node_t coupling_node, struct yac_couple_config *couple_config, size_t couple_idx)
 
static fy_node_t yac_yaml_create_output_grid_node (fy_document_t document, char const *grid_name, char const *file_name)
 
static fy_node_t yac_yaml_create_output_grids_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_debug_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_coupling_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_field_node (fy_document_t document, struct yac_couple_config *couple_config, size_t component_idx, size_t field_idx)
 
static fy_node_t yac_yaml_create_fields_node (fy_document_t document, struct yac_couple_config *couple_config, size_t component_idx)
 
static fy_node_t yac_yaml_create_component_node (fy_document_t document, struct yac_couple_config *couple_config, size_t component_idx)
 
static fy_node_t yac_yaml_create_components_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_grid_node (fy_document_t document, struct yac_couple_config *couple_config, size_t grid_idx)
 
static fy_node_t yac_yaml_create_grids_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_definitions_node (fy_document_t document, struct yac_couple_config *couple_config)
 
static fy_node_t yac_yaml_create_couple_config_nodes (fy_document_t document, struct yac_couple_config *couple_config, int include_definitions)
 
char * yac_yaml_emit_coupling (struct yac_couple_config *couple_config, int emit_flags, int include_definitions)
 

Variables

int const YAC_YAML_EMITTER_DEFAULT = EMITTER_DEFAULT
 emit to YAML format
 
int const YAC_YAML_EMITTER_JSON = EMITTER_JSON
 emit to JSON format
 
int const YAC_YAML_PARSER_DEFAULT = PARSER_DEFAULT
 default parse flags (YAML format)
 
int const YAC_YAML_PARSER_JSON_AUTO = PARSER_JSON_AUTO
 
int const YAC_YAML_PARSER_JSON_FORCE = PARSER_JSON_FORCE
 assume JSON format
 

Macro Definition Documentation

◆ OUTPUT_GRIDS_FILE_NAME_STR

#define OUTPUT_GRIDS_FILE_NAME_STR   "file_name"

Definition at line 184 of file config_yaml.c.

◆ YAML_ASSERT

#define YAML_ASSERT ( CHECK,
MSG )
Value:
CHECK, MSG "in YAML configuration file \"%s\"", yaml_filename)
char * yaml_filename
#define YAC_ASSERT_F(exp, format,...)
Definition yac_assert.h:39

◆ YAML_ASSERT_F

#define YAML_ASSERT_F ( CHECK,
MSG,
... )
Value:
CHECK, MSG "in YAML configuration file \"%s\"", __VA_ARGS__, yaml_filename)

◆ YAML_UNREACHABLE_DEFAULT

#define YAML_UNREACHABLE_DEFAULT ( MSG)
Value:
MSG "in YAML configuration file \"%s\"", yaml_filename)
#define YAC_UNREACHABLE_DEFAULT_F(format,...)
Definition yac_assert.h:77

◆ YAML_UNREACHABLE_DEFAULT_F

#define YAML_UNREACHABLE_DEFAULT_F ( MSG,
... )
Value:
MSG "in YAML configuration file \"%s\"", __VA_ARGS__, yaml_filename)

Typedef Documentation

◆ fy_document_t

typedef struct fy_document* fy_document_t

Definition at line 47 of file config_yaml.c.

◆ fy_node_pair_t

typedef struct fy_node_pair* fy_node_pair_t

Definition at line 49 of file config_yaml.c.

◆ fy_node_t

typedef struct fy_node* fy_node_t

Definition at line 48 of file config_yaml.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EMITTER_DEFAULT 
EMITTER_JSON 
PARSER_DEFAULT 
PARSER_JSON_AUTO 
PARSER_JSON_FORCE 

Definition at line 51 of file config_yaml.c.

◆ yaml_base_key_types

Enumerator
START_DATE 
END_DATE 
CALENDAR 
TIMESTEP_UNIT 
COUPLING 
DEBUG 

Definition at line 108 of file config_yaml.c.

◆ yaml_comp_grid_names_key_types

Enumerator
COMP_NAME 
GRID_NAMES 

Definition at line 160 of file config_yaml.c.

◆ yaml_couple_key_types

Enumerator
SOURCE_NAME 
SOURCE_COMPONENT 
SOURCE_GRID 
TARGET_NAMES 
TARGET_COMPONENT 
TARGET_GRID 
FIELD 
COUPLING_PERIOD 
TIME_REDUCTION 
SOURCE_LAG 
TARGET_LAG 
WEIGHT_FILE_DATA 
WEIGHT_FILE_NAME 
WEIGHT_FILE_ON_EXISTING 
MAPPING_SIDE 
SCALE_FACTOR 
SCALE_SUMMAND 
INTERPOLATION 
SOURCE_MASK_NAME 
SOURCE_MASK_NAMES 
TARGET_MASK_NAME 
YAXT_EXCHANGER_NAME 
COLLECTION_SELECTION 
USE_RAW_EXCHANGE 

Definition at line 117 of file config_yaml.c.

◆ yaml_debug_key_types

Enumerator
GLOBAL_CONFIG 
GLOBAL_DEFS 
OUTPUT_GRIDS 
MISSING_DEF 
APPLY_COORD_CHECK 
COORDS_MISMATCH_FATAL 

Definition at line 144 of file config_yaml.c.

◆ yaml_debug_output_grid_key_types

Enumerator
OUTPUT_GRID_GRID_NAME 
OUTPUT_GRID_FILE_NAME 

Definition at line 179 of file config_yaml.c.

◆ yaml_debug_sync_loc_key_types

Enumerator
SYNC_LOC_DEF_COMP 
SYNC_LOC_SYNC_DEF 
SYNC_LOC_ENDDEF 
SYNC_LOC_COUNT 

Definition at line 153 of file config_yaml.c.

◆ yaml_weight_file_data_key_types

Enumerator
WEIGHT_FILE_DATA_NAME 
WEIGHT_FILE_DATA_ON_EXISTING 

Definition at line 165 of file config_yaml.c.

Function Documentation

◆ DEF_NAME_TYPE_PAIRS()

DEF_NAME_TYPE_PAIRS ( yaml_base_keys ,
DEF_NAME_TYPE_PAIR(start_date, START_DATE) ,
DEF_NAME_TYPE_PAIR(start_datetime, START_DATE) ,
DEF_NAME_TYPE_PAIR(end_date, END_DATE) ,
DEF_NAME_TYPE_PAIR(end_datetime, END_DATE) ,
DEF_NAME_TYPE_PAIR(calendar, CALENDAR) ,
DEF_NAME_TYPE_PAIR(timestep_unit, TIMESTEP_UNIT) ,
DEF_NAME_TYPE_PAIR(coupling, COUPLING) ,
DEF_NAME_TYPE_PAIR(debug, DEBUG)  )

Definition at line 186 of file config_yaml.c.

◆ yac_time_to_ISO()

char const * yac_time_to_ISO ( char const * time,
enum yac_time_unit_type time_unit )

Definition at line 353 of file event.c.

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

◆ yac_yaml_append_couple_field_nodes()

static void yac_yaml_append_couple_field_nodes ( fy_node_t coupling_node,
struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx )
static

Definition at line 2272 of file config_yaml.c.

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

◆ yac_yaml_append_couple_nodes()

static void yac_yaml_append_couple_nodes ( fy_node_t coupling_node,
struct yac_couple_config * couple_config,
size_t couple_idx )
static

Definition at line 2510 of file config_yaml.c.

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

◆ yac_yaml_create_component_node()

static fy_node_t yac_yaml_create_component_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t component_idx )
static

Definition at line 2744 of file config_yaml.c.

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

◆ yac_yaml_create_components_node()

static fy_node_t yac_yaml_create_components_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2773 of file config_yaml.c.

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

◆ yac_yaml_create_couple_config_nodes()

static fy_node_t yac_yaml_create_couple_config_nodes ( fy_document_t document,
struct yac_couple_config * couple_config,
int include_definitions )
static

Definition at line 2864 of file config_yaml.c.

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

◆ yac_yaml_create_coupling_node()

static fy_node_t yac_yaml_create_coupling_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2633 of file config_yaml.c.

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

◆ yac_yaml_create_debug_node()

static fy_node_t yac_yaml_create_debug_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2589 of file config_yaml.c.

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

◆ yac_yaml_create_definitions_node()

static fy_node_t yac_yaml_create_definitions_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2845 of file config_yaml.c.

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

◆ yac_yaml_create_field_name_node()

static fy_node_t yac_yaml_create_field_name_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx )
static

Definition at line 2054 of file config_yaml.c.

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

◆ yac_yaml_create_field_node()

static fy_node_t yac_yaml_create_field_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t component_idx,
size_t field_idx )
static

Definition at line 2653 of file config_yaml.c.

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

◆ yac_yaml_create_fields_node()

static fy_node_t yac_yaml_create_fields_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t component_idx )
static

Definition at line 2719 of file config_yaml.c.

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

◆ yac_yaml_create_grid_node()

static fy_node_t yac_yaml_create_grid_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t grid_idx )
static

Definition at line 2798 of file config_yaml.c.

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

◆ yac_yaml_create_grids_node()

static fy_node_t yac_yaml_create_grids_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2821 of file config_yaml.c.

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

◆ yac_yaml_create_interpolation_node()

static fy_node_t yac_yaml_create_interpolation_node ( fy_document_t document,
struct yac_interp_method_config const * method_config )
static

Definition at line 2207 of file config_yaml.c.

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

◆ yac_yaml_create_interpolation_stack_node()

static fy_node_t yac_yaml_create_interpolation_stack_node ( fy_document_t document,
struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx )
static

Definition at line 2240 of file config_yaml.c.

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

◆ yac_yaml_create_non_default_list_param_node()

static fy_node_t yac_yaml_create_non_default_list_param_node ( fy_document_t document,
struct yac_param * param )
static

Definition at line 2158 of file config_yaml.c.

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

◆ yac_yaml_create_non_default_param_node()

static fy_node_t yac_yaml_create_non_default_param_node ( fy_document_t document,
struct yac_param * param )
static

Definition at line 2184 of file config_yaml.c.

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

◆ yac_yaml_create_non_default_scalar_param_node()

static fy_node_t yac_yaml_create_non_default_scalar_param_node ( fy_document_t document,
struct yac_param const * param )
static

Definition at line 2084 of file config_yaml.c.

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

◆ yac_yaml_create_non_default_struct_param_node()

static fy_node_t yac_yaml_create_non_default_struct_param_node ( fy_document_t document,
struct yac_param * param )
static

Definition at line 2107 of file config_yaml.c.

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

◆ yac_yaml_create_output_grid_node()

static fy_node_t yac_yaml_create_output_grid_node ( fy_document_t document,
char const * grid_name,
char const * file_name )
static

Definition at line 2523 of file config_yaml.c.

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

◆ yac_yaml_create_output_grids_node()

static fy_node_t yac_yaml_create_output_grids_node ( fy_document_t document,
struct yac_couple_config * couple_config )
static

Definition at line 2545 of file config_yaml.c.

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

◆ yac_yaml_create_scalar()

static fy_node_t yac_yaml_create_scalar ( fy_document_t document,
char const * value )
static

Definition at line 1891 of file config_yaml.c.

Here is the caller graph for this function:

◆ yac_yaml_create_scalar_dble()

static fy_node_t yac_yaml_create_scalar_dble ( fy_document_t document,
double value )
static

Definition at line 1930 of file config_yaml.c.

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

◆ yac_yaml_create_scalar_int()

static fy_node_t yac_yaml_create_scalar_int ( fy_document_t document,
int value )
static

Definition at line 1904 of file config_yaml.c.

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

◆ yac_yaml_create_scalar_size_t()

static fy_node_t yac_yaml_create_scalar_size_t ( fy_document_t document,
size_t value )
static

Definition at line 1917 of file config_yaml.c.

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

◆ yac_yaml_create_sequence_scalar()

static fy_node_t yac_yaml_create_sequence_scalar ( fy_document_t document,
char const *const * values,
size_t num_values )
static

Definition at line 1943 of file config_yaml.c.

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

◆ yac_yaml_create_sequence_scalar_size_t()

static fy_node_t yac_yaml_create_sequence_scalar_size_t ( fy_document_t document,
size_t const * values,
size_t num_values )
static

Definition at line 1967 of file config_yaml.c.

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

◆ yac_yaml_emit_coupling()

char * yac_yaml_emit_coupling ( struct yac_couple_config * couple_config,
int emit_flags,
int include_definitions )

Emit coupling configuration to string

Parameters
[in]couple_configcoupling configuration
[in]emit_flagsflags to be used for emitting the coupling configuration
[in]include_definitionsinclude debug definitions (components, grids, and fields) in the output file
Returns
string containing coupling configuration

Definition at line 2927 of file config_yaml.c.

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

◆ yac_yaml_map_append()

static void yac_yaml_map_append ( fy_node_t map,
char const * key,
fy_node_t value )
static

Definition at line 1997 of file config_yaml.c.

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

◆ yac_yaml_map_append_scalar()

static void yac_yaml_map_append_scalar ( fy_node_t map,
char const * key,
char const * value )
static

Definition at line 2015 of file config_yaml.c.

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

◆ yac_yaml_map_append_scalar_dble()

static void yac_yaml_map_append_scalar_dble ( fy_node_t map,
char const * key,
double value )
static

Definition at line 2044 of file config_yaml.c.

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

◆ yac_yaml_map_append_scalar_int()

static void yac_yaml_map_append_scalar_int ( fy_node_t map,
char const * key,
int value )
static

Definition at line 2024 of file config_yaml.c.

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

◆ yac_yaml_map_append_scalar_size_t()

static void yac_yaml_map_append_scalar_size_t ( fy_node_t map,
char const * key,
size_t value )
static

Definition at line 2034 of file config_yaml.c.

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

◆ yac_yaml_parse_interp_stack_config_string()

struct yac_interp_stack_config * yac_yaml_parse_interp_stack_config_string ( char const * interp_stack_config,
int parse_flags )

Parse a "0"-terminated string that contains an interpolation stack configuration

Parameters
[in]interp_stack_configstring containing interpolation stack configuration
[in]parse_flagsflags to be used for parsing the string

Definition at line 1849 of file config_yaml.c.

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

◆ yac_yaml_read_coupling()

void yac_yaml_read_coupling ( struct yac_couple_config * couple_config,
const char * yaml_filename,
int parse_flags )

Reader for yaml while, which parses the given yaml file and adds the coupling from the file to the coupling configuration data

Parameters
[in,out]couple_configcoupling configuration data
[in]yaml_filenamename of yaml configuration file
[in]parse_flagsflags to be used for parsing the configuration file

Definition at line 1806 of file config_yaml.c.

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

◆ yaml_check_base_key_typo()

static void yaml_check_base_key_typo ( char const * unknown_key,
char const * yaml_filename )
static

Definition at line 1675 of file config_yaml.c.

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

◆ yaml_edit_distance()

static size_t yaml_edit_distance ( char const * a,
char const * b )
static

Definition at line 1639 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_all_output_grids()

static void yaml_parse_all_output_grids ( struct yac_couple_config * couple_config,
fy_node_t output_grids_node,
char const * yaml_filename )
static

Parses an output grids mapping, which applies to all grids and therefore only supports the key "file_name".

Definition at line 1510 of file config_yaml.c.

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

◆ yaml_parse_base_interp_method_node()

static void yaml_parse_base_interp_method_node ( char const ** interpolation_type_str,
fy_node_t * parameter_node,
fy_node_t interp_method_node,
char const * yaml_filename )
static

reads interpolation name and user-provided parameters from YAML node

Parameters
[out]interpolation_type_strname of the interpolation
[out]parameter_nodeYAML node containing user-provided interpolation method configuration
[in]interp_method_nodeYAML node containing interpolation
[in]yaml_filenamename of the YAML file (used for error messages)
Remarks
interp_method_node can be either a scalar not (only interpolation name and no parameters) or a map (interpolation name and parameters)

Definition at line 495 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_base_map_pair()

static void yaml_parse_base_map_pair ( struct yac_couple_config * couple_config,
fy_node_pair_t base_pair,
const char * yaml_filename,
enum yac_time_unit_type * time_unit,
char const ** start_datetime,
char const ** end_datetime )
static

Definition at line 1701 of file config_yaml.c.

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

◆ yaml_parse_calendar_value()

static calendarType yaml_parse_calendar_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 344 of file config_yaml.c.

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

◆ yaml_parse_collection_selection_sequence()

static void yaml_parse_collection_selection_sequence ( struct yac_collection_selection ** collection_selection,
fy_node_t values_node,
char const * sequence_name,
const char * yaml_filename )
static

Definition at line 794 of file config_yaml.c.

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

◆ yaml_parse_comp_grid_names()

static void yaml_parse_comp_grid_names ( char const ** comp_name,
char const *** grid_names,
size_t * num_grid_names,
fy_node_t values_node,
char const * type_name,
const char * yaml_filename,
int allow_multiple_grids )
static

Definition at line 870 of file config_yaml.c.

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

◆ yaml_parse_config_file_value()

static struct debug_config_file yaml_parse_config_file_value ( fy_node_t config_file_node,
char const * file_type_name,
const char * yaml_filename )
static

Definition at line 1275 of file config_yaml.c.

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

◆ yaml_parse_couple()

static void yaml_parse_couple ( struct yac_couple_config * couple_config,
fy_node_t couple_node,
char const * yaml_filename,
enum yac_time_unit_type time_unit )
static

Definition at line 1137 of file config_yaml.c.

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

◆ yaml_parse_couple_map_pair()

static void yaml_parse_couple_map_pair ( struct field_couple_buffer * field_buffer,
fy_node_pair_t couple_pair,
const char * yaml_filename,
enum yac_time_unit_type time_unit )
static

Definition at line 980 of file config_yaml.c.

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

◆ yaml_parse_coupling()

static void yaml_parse_coupling ( struct yac_couple_config * couple_config,
fy_node_t coupling_node,
char const * yaml_filename,
enum yac_time_unit_type time_unit )
static

Definition at line 1255 of file config_yaml.c.

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

◆ yaml_parse_debug()

static void yaml_parse_debug ( struct yac_couple_config * couple_config,
fy_node_t debug_node,
char const * yaml_filename )
static

Definition at line 1617 of file config_yaml.c.

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

◆ yaml_parse_debug_config_file_buffer()

static struct debug_config_file_buffer yaml_parse_debug_config_file_buffer ( fy_node_t config_file_node,
char const * config_file_type_name,
char const * yaml_filename )
static

Definition at line 1383 of file config_yaml.c.

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

◆ yaml_parse_debug_config_file_map_pair()

static void yaml_parse_debug_config_file_map_pair ( struct debug_config_file_buffer * config_file_buffer,
fy_node_pair_t config_file_pair,
char const * config_file_type_name,
const char * yaml_filename )
static

Definition at line 1351 of file config_yaml.c.

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

◆ yaml_parse_debug_global_config()

static void yaml_parse_debug_global_config ( struct yac_couple_config * couple_config,
fy_node_t global_config_node,
char const * yaml_filename )
static

Definition at line 1420 of file config_yaml.c.

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

◆ yaml_parse_debug_map_pair()

static void yaml_parse_debug_map_pair ( struct yac_couple_config * couple_config,
fy_node_pair_t debug_pair,
const char * yaml_filename )
static

Definition at line 1569 of file config_yaml.c.

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

◆ yaml_parse_debug_output_grids()

static void yaml_parse_debug_output_grids ( struct yac_couple_config * couple_config,
fy_node_t output_grids_node,
char const * yaml_filename )
static

Definition at line 1542 of file config_yaml.c.

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

◆ yaml_parse_document()

static void yaml_parse_document ( struct yac_couple_config * couple_config,
fy_document_t document,
const char * yaml_filename )
static

Definition at line 1769 of file config_yaml.c.

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

◆ yaml_parse_double_value()

static double yaml_parse_double_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 452 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_enum_value()

static int yaml_parse_enum_value ( struct yac_name_type_pair const * valid_values,
size_t num_valid_values,
fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 468 of file config_yaml.c.

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

◆ yaml_parse_field_name()

static struct field_couple_field_names yaml_parse_field_name ( fy_node_t field_node,
const char * yaml_filename )
static

Definition at line 719 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_field_names()

static void yaml_parse_field_names ( struct field_couple_field_names ** field_names,
size_t * num_field_names,
fy_node_t fields_node,
const char * yaml_filename )
static

Definition at line 845 of file config_yaml.c.

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

◆ yaml_parse_integer_value()

static int yaml_parse_integer_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 417 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_interp_method()

static void yaml_parse_interp_method ( struct yac_interp_stack_config * interp_stack,
fy_node_t interp_method_node,
char const * yaml_filename )
static

Definition at line 672 of file config_yaml.c.

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

◆ yaml_parse_interp_stack_value()

static void yaml_parse_interp_stack_value ( struct yac_interp_stack_config * interp_stack,
fy_node_t interp_stack_node,
char const * yaml_filename )
static

Definition at line 701 of file config_yaml.c.

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

◆ yaml_parse_output_grid()

static void yaml_parse_output_grid ( struct yac_couple_config * couple_config,
fy_node_t output_grid_node,
char const * yaml_filename )
static

Definition at line 1477 of file config_yaml.c.

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

◆ yaml_parse_output_grid_pair()

static void yaml_parse_output_grid_pair ( char const ** grid_name,
char const ** file_name,
fy_node_pair_t output_grid_pair,
char const * yaml_filename )
static

Definition at line 1445 of file config_yaml.c.

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

◆ yaml_parse_size_t_sequence()

static void yaml_parse_size_t_sequence ( size_t ** values,
size_t * num_values,
fy_node_t values_node,
char const * sequence_name,
const char * yaml_filename )
static

Definition at line 764 of file config_yaml.c.

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

◆ yaml_parse_size_t_value()

static size_t yaml_parse_size_t_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 434 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_string_sequence()

static void yaml_parse_string_sequence ( char const *** values,
size_t * num_values,
fy_node_t values_node,
char const * sequence_name,
const char * yaml_filename )
static

Definition at line 816 of file config_yaml.c.

Here is the caller graph for this function:

◆ yaml_parse_time_reduction_value()

static enum yac_reduction_type yaml_parse_time_reduction_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 400 of file config_yaml.c.

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

◆ yaml_parse_timestep_unit_value()

static enum yac_time_unit_type yaml_parse_timestep_unit_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename )
static

Definition at line 383 of file config_yaml.c.

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

◆ yaml_parse_timestep_value()

static char const * yaml_parse_timestep_value ( fy_node_t value_node,
char const * key_name,
char const * yaml_filename,
enum yac_time_unit_type time_unit )
static

Definition at line 361 of file config_yaml.c.

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

◆ yaml_parse_weight_file_data()

static void yaml_parse_weight_file_data ( char const ** weight_file_name,
enum yac_weight_file_on_existing * on_existing,
fy_node_t values_node,
char const * type_name,
const char * yaml_filename )
static

Definition at line 927 of file config_yaml.c.

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

◆ yaml_set_interp_method_config_param_from_node()

static void yaml_set_interp_method_config_param_from_node ( struct yac_param * param,
fy_node_t value_node,
char const * interpolation_name,
char const * yaml_filename )
static

Definition at line 547 of file config_yaml.c.

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

Variable Documentation

◆ YAC_YAML_EMITTER_DEFAULT

int const YAC_YAML_EMITTER_DEFAULT = EMITTER_DEFAULT

emit to YAML format

Definition at line 59 of file config_yaml.c.

◆ YAC_YAML_EMITTER_JSON

int const YAC_YAML_EMITTER_JSON = EMITTER_JSON

emit to JSON format

Definition at line 60 of file config_yaml.c.

◆ YAC_YAML_PARSER_DEFAULT

int const YAC_YAML_PARSER_DEFAULT = PARSER_DEFAULT

default parse flags (YAML format)

Definition at line 61 of file config_yaml.c.

◆ YAC_YAML_PARSER_JSON_AUTO

int const YAC_YAML_PARSER_JSON_AUTO = PARSER_JSON_AUTO

switch to JSON format, if indicated by file extension

Definition at line 62 of file config_yaml.c.

◆ YAC_YAML_PARSER_JSON_FORCE

int const YAC_YAML_PARSER_JSON_FORCE = PARSER_JSON_FORCE

assume JSON format

Definition at line 63 of file config_yaml.c.