YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
config_yaml.c File Reference
#include "config.h"
#include <libfyaml.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "yac.h"
#include "utils_mci.h"
#include "config_yaml.h"
#include "mtime_calendar.h"
#include "geometry.h"
#include "io_utils.h"
#include "interp_method_avg.h"
#include "interp_method_callback.h"
#include "interp_method_check.h"
#include "interp_method_conserv.h"
#include "interp_method_creep.h"
#include "interp_method_file.h"
#include "interp_method_fixed.h"
#include "interp_method_hcsbb.h"
#include "interp_method_ncc.h"
#include "interp_method_nnn.h"
#include "interp_method_spmap.h"
#include "interp_stack_config.h"
#include "instance.h"
#include "fields.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
 
struct  interp_method_parameter
 

Macros

#define CAST_NAME_TYPE_PAIRS(...)   (struct yac_name_type_pair[]) {__VA_ARGS__}
 
#define COUNT_NAME_TYPE_PAIRS(...)    sizeof(CAST_NAME_TYPE_PAIRS(__VA_ARGS__)) / sizeof(struct yac_name_type_pair)
 
#define DEF_NAME_TYPE_PAIR(NAME, TYPE)   {.name = #NAME, .type = (int)(TYPE)}
 
#define DEF_NAME_TYPE_PAIRS(NAME, ...)
 
#define DEF_INTERP_METHOD_ADD_FUNC(NAME, FUNC)
 
#define DEF_INTERP_METHOD_GET_FUNC(NAME, FUNC)
 
#define DEF_ENUM_PARAM(NAME, DEFAULT, ...)
 
#define DEF_INT_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
 
#define DEF_DBLE_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
 
#define DEF_DEG_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
 
#define DEF_BOOL_PARAM(NAME, DEFAULT)
 
#define DEF_STR_PARAM(NAME, DEFAULT, MAX_STR_LEN)
 
#define DEF_INTERP_METHOD_PARAM(NAME, ...)
 
#define YAML_ASSERT(CHECK, MSG)
 
#define YAML_ASSERT_F(CHECK, MSG, ...)
 
#define DEF_INTERP_STACK_ADD(NAME, ...)
 
#define DEF_INTERP_STACK_ADD_NO_PARAM(NAME)
 
#define DEF_INTERP_STACK_GET(NAME, ...)
 
#define DEF_INTERP_STACK_GET_NO_PARAM(NAME)    {}
 
#define DEF_INTERP_METHOD(NAME, FUNC_ADD, FUNC_GET, ...)
 
#define ADD_INTERPOLATION(NAME, TYPE)
 
#define ADD_INTERPOLATION_NO_PARAM(NAME, TYPE)
 

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_NAMES , SOURCE_COMPONENT , SOURCE_GRID , TARGET_NAMES ,
  TARGET_COMPONENT , TARGET_GRID , FIELD , COUPLING_PERIOD ,
  TIME_REDUCTION , SOURCE_LAG , TARGET_LAG , WEIGHT_FILE_NAME ,
  MAPPING_SIDE , SCALE_FACTOR , SCALE_SUMMAND , INTERPOLATION ,
  SOURCE_MASK_NAME , SOURCE_MASK_NAMES , TARGET_MASK_NAME , YAXT_EXCHANGER_NAME
}
 
enum  yaml_debug_key_types { GLOBAL_CONFIG , GLOBAL_DEFS , OUTPUT_GRIDS , MISSING_DEF }
 
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_debug_output_grid_key_types { OUTPUT_GRID_GRID_NAME , OUTPUT_GRID_FILE_NAME }
 
enum  interp_method_parameter_value_type {
  ENUM_PARAM , INT_PARAM , DBLE_PARAM , BOOL_PARAM ,
  STR_PARAM , DEG_PARAM
}
 
enum  { NUM_INTERPOLATION_METHODS }
 

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(end_date, 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))
 
 DEF_INTERP_METHOD (average, DEF_INTERP_STACK_ADD(average,(enum yac_interp_avg_weight_type) parameters[0].enum_value, parameters[1].bool_value), enum yac_interp_avg_weight_type reduction_type;DEF_INTERP_STACK_GET(average, &reduction_type, &parameter_values[1].bool_value) parameter_values[0].enum_value=(int) reduction_type;, DEF_ENUM_PARAM(weighted, YAC_INTERP_AVG_WEIGHT_TYPE_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_AVG_DIST), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_AVG_ARITHMETIC), DEF_NAME_TYPE_PAIR(barycentric_coordinate, YAC_INTERP_AVG_BARY)), DEF_BOOL_PARAM(partial_coverage, YAC_INTERP_AVG_PARTIAL_COVERAGE_DEFAULT)) DEF_INTERP_METHOD(ncc
 
 DEF_INTERP_STACK_ADD (ncc,(enum yac_interp_ncc_weight_type) parameters[0].enum_value, parameters[1].bool_value)
 
 DEF_INTERP_STACK_GET (ncc, &weight_type, &parameter_values[1].bool_value) parameter_values[0].enum_value
 
 DEF_ENUM_PARAM (weighted, YAC_INTERP_NCC_WEIGHT_TYPE_DEFAULT, DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_NCC_AVG), DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_NCC_DIST))
 
 DEF_BOOL_PARAM (partial_coverage, YAC_INTERP_NCC_PARTIAL_COVERAGE_DEFAULT)
 
 DEF_INTERP_METHOD (source_to_target_map, double src_sphere_radius=parameters[4].dble_value;char const *src_filename=parameters[5].str_value;char const *src_varname=parameters[6].str_value;int src_min_global_id=parameters[7].int_value;double tgt_sphere_radius=parameters[8].dble_value;char const *tgt_filename=parameters[9].str_value;char const *tgt_varname=parameters[10].str_value;int tgt_min_global_id=parameters[11].int_value;get_spmap_parameters(&src_sphere_radius, src_filename, src_varname, routine_name, yaml_filename, "source");get_spmap_parameters(&tgt_sphere_radius, tgt_filename, tgt_varname, routine_name, yaml_filename, "target");DEF_INTERP_STACK_ADD(spmap, parameters[0].dble_value, parameters[1].dble_value,(enum yac_interp_spmap_weight_type) parameters[2].enum_value,(enum yac_interp_spmap_scale_type) parameters[3].enum_value, src_sphere_radius, src_filename, src_varname, src_min_global_id, tgt_sphere_radius, tgt_filename, tgt_varname, tgt_min_global_id), enum yac_interp_spmap_weight_type weight_type;enum yac_interp_spmap_scale_type scale_type;DEF_INTERP_STACK_GET(spmap, &parameter_values[0].dble_value, &parameter_values[1].dble_value, &weight_type, &scale_type, &parameter_values[4].dble_value, &parameter_values[5].str_value, &parameter_values[6].str_value, &parameter_values[7].int_value, &parameter_values[8].dble_value, &parameter_values[9].str_value, &parameter_values[10].str_value, &parameter_values[11].int_value) parameter_values[0].dble_value/=YAC_RAD;parameter_values[1].dble_value/=YAC_RAD;parameter_values[2].enum_value=(int) weight_type;parameter_values[3].enum_value=(int) scale_type;, DEF_DEG_PARAM(spread_distance, YAC_INTERP_SPMAP_SPREAD_DISTANCE_DEFAULT, 0.0, 89.9999), DEF_DEG_PARAM(max_search_distance, YAC_INTERP_SPMAP_MAX_SEARCH_DISTANCE_DEFAULT, 0.0, 179.9999), DEF_ENUM_PARAM(weighted, YAC_INTERP_SPMAP_WEIGHTED_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_SPMAP_DIST), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_SPMAP_AVG)), DEF_ENUM_PARAM(scale, YAC_INTERP_SPMAP_SCALE_TYPE_DEFAULT, DEF_NAME_TYPE_PAIR(none, YAC_INTERP_SPMAP_NONE), DEF_NAME_TYPE_PAIR(srcarea, YAC_INTERP_SPMAP_SRCAREA), DEF_NAME_TYPE_PAIR(invtgtarea, YAC_INTERP_SPMAP_INVTGTAREA), DEF_NAME_TYPE_PAIR(fracarea, YAC_INTERP_SPMAP_FRACAREA)), DEF_DBLE_PARAM(src_cell_area:yac:sphere_radius, 0.0, 1e-9, DBL_MAX), DEF_STR_PARAM(src_cell_area:file:filename, NULL, YAC_MAX_FILE_NAME_LENGTH), DEF_STR_PARAM(src_cell_area:file:varname, NULL, 128), DEF_INT_PARAM(src_cell_area:file:min_global_id, YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT, -INT_MAX, INT_MAX), DEF_DBLE_PARAM(tgt_cell_area:yac:sphere_radius, 0.0, 1e-9, DBL_MAX), DEF_STR_PARAM(tgt_cell_area:file:filename, NULL, YAC_MAX_FILE_NAME_LENGTH), DEF_STR_PARAM(tgt_cell_area:file:varname, NULL, 128), DEF_INT_PARAM(tgt_cell_area:file:min_global_id, YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT, -INT_MAX, INT_MAX)) DEF_INTERP_METHOD(fixed
 
 YAML_ASSERT (parameters[0].dble_value !=DBL_MAX, "parameter 'user_value' of interpolation method 'fixed' is unset")
 
 DEF_INTERP_STACK_ADD (fixed, parameters[0].dble_value)
 
 DEF_INTERP_STACK_GET (fixed, &parameter_values[0].dble_value)
 
 DEF_DBLE_PARAM (user_value, YAC_INTERP_FIXED_VALUE_DEFAULT, -DBL_MAX, DBL_MAX)) DEF_INTERP_METHOD(user_file
 
 YAML_ASSERT (parameters[0].str_value, "parameter \"filename\" of interpolation method \"user file\" is unset") DEF_INTERP_STACK_ADD(user_file
 
char *parameters[0] DEF_INTERP_STACK_GET (user_file, &parameter_values[0].str_value)
 
char *parameters[0] DEF_STR_PARAM (filename, YAC_INTERP_FILE_WEIGHT_FILE_NAME_DEFAULT, YAC_MAX_FILE_NAME_LENGTH)
 
static char const * yaml_parse_string_value (fy_node_t value_node, char const *name, char const *yaml_filename)
 
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 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)
 
static interp_method_parameter_value yaml_parse_interp_method_parameter_value (struct interp_method_parameter const *parameter, fy_node_t value_node, char const *interpolation_name, char const *yaml_filename)
 
static void yaml_parse_interp_method_parameter (interp_method_parameter_value *parameter_values, struct interp_method_parameter const *parameters, size_t num_parameters, fy_node_pair_t parameter_pair, char const *interpolation_name, char const *parameter_name_prefix, char const *yaml_filename)
 
static void yaml_parse_interp_method_parameters (interp_method_parameter_value *parameter_values, struct yac_interpolation_method const *interp_method, fy_node_t parameter_node, 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_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)
 
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_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 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_configyac_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_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 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_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 void yac_yaml_map_append_parameter (fy_node_t map, struct interp_method_parameter const *parameter, interp_method_parameter_value value)
 
static int compare_parameter_values (interp_method_parameter_value const *a, interp_method_parameter_value const *b, enum interp_method_parameter_value_type type)
 
static fy_node_t yac_yaml_create_interpolation_node (fy_document_t document, union yac_interp_stack_config_entry const *interp_stack_entry)
 
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
 
 interp_method_parameter_value
 
enum yac_interp_ncc_weight_type weight_type
 
char *parameters[0] str_value
 
const interpolation_methods []
 

Macro Definition Documentation

◆ ADD_INTERPOLATION

#define ADD_INTERPOLATION ( NAME,
TYPE )
Value:
{.name = #NAME , \
.type = TYPE , \
.add_interpolation = add_interp_method_ ## NAME , \
.get_interpolation = get_interp_method_ ## NAME , \
.parameters = interp_method_parameters_ ## NAME , \
.num_parameters = \
sizeof(interp_method_parameters_ ## NAME ) / \
sizeof(interp_method_parameters_ ## NAME [0])}

◆ ADD_INTERPOLATION_NO_PARAM

#define ADD_INTERPOLATION_NO_PARAM ( NAME,
TYPE )
Value:
{.name = #NAME , \
.type = TYPE , \
.add_interpolation = add_interp_method_ ## NAME , \
.get_interpolation = get_interp_method_ ## NAME , \
.parameters = interp_method_parameters_ ## NAME , \
.num_parameters = 0}

◆ CAST_NAME_TYPE_PAIRS

#define CAST_NAME_TYPE_PAIRS ( ...)    (struct yac_name_type_pair[]) {__VA_ARGS__}

Definition at line 165 of file config_yaml.c.

◆ COUNT_NAME_TYPE_PAIRS

#define COUNT_NAME_TYPE_PAIRS ( ...)     sizeof(CAST_NAME_TYPE_PAIRS(__VA_ARGS__)) / sizeof(struct yac_name_type_pair)

Definition at line 166 of file config_yaml.c.

◆ DEF_BOOL_PARAM

#define DEF_BOOL_PARAM ( NAME,
DEFAULT )
Value:
{.name = #NAME, \
.type = BOOL_PARAM, \
.default_value.bool_value = (int)(DEFAULT)}
@ BOOL_PARAM

Definition at line 398 of file config_yaml.c.

◆ DEF_DBLE_PARAM

#define DEF_DBLE_PARAM ( NAME,
DEFAULT,
VALID_MIN,
VALID_MAX )
Value:
{.name = #NAME, \
.type = DBLE_PARAM, \
.data.dble_param = \
{.valid_min = (double)(VALID_MIN), \
.valid_max = (double)(VALID_MAX)}, \
.default_value.dble_value = (double)(DEFAULT)}
@ DBLE_PARAM

Definition at line 384 of file config_yaml.c.

◆ DEF_DEG_PARAM

#define DEF_DEG_PARAM ( NAME,
DEFAULT,
VALID_MIN,
VALID_MAX )
Value:
{.name = #NAME, \
.type = DEG_PARAM, \
.data.dble_param = \
{.valid_min = (double)(VALID_MIN), \
.valid_max = (double)(VALID_MAX)}, \
.default_value.dble_value = (double)(DEFAULT)}
@ DEG_PARAM

Definition at line 391 of file config_yaml.c.

◆ DEF_ENUM_PARAM

#define DEF_ENUM_PARAM ( NAME,
DEFAULT,
... )
Value:
{.name = #NAME, \
.type = ENUM_PARAM, \
.data.enum_param = \
{.valid_values = CAST_NAME_TYPE_PAIRS(__VA_ARGS__), \
.num_valid_values = COUNT_NAME_TYPE_PAIRS(__VA_ARGS__)}, \
.default_value.enum_value = (int)(DEFAULT)}
@ ENUM_PARAM
#define CAST_NAME_TYPE_PAIRS(...)
#define COUNT_NAME_TYPE_PAIRS(...)

Definition at line 370 of file config_yaml.c.

◆ DEF_INT_PARAM

#define DEF_INT_PARAM ( NAME,
DEFAULT,
VALID_MIN,
VALID_MAX )
Value:
{.name = #NAME, \
.type = INT_PARAM, \
.data.int_param = \
{.valid_min = (int)(VALID_MIN), \
.valid_max = (int)(VALID_MAX)}, \
.default_value.int_value = (int)(DEFAULT)}
@ INT_PARAM

Definition at line 377 of file config_yaml.c.

◆ DEF_INTERP_METHOD

#define DEF_INTERP_METHOD ( NAME,
FUNC_ADD,
FUNC_GET,
... )
Value:
DEF_INTERP_METHOD_ADD_FUNC(NAME, FUNC_ADD) \
DEF_INTERP_METHOD_GET_FUNC(NAME, FUNC_GET) \
DEF_INTERP_METHOD_PARAM(NAME, __VA_ARGS__)
#define DEF_INTERP_METHOD_ADD_FUNC(NAME, FUNC)

Definition at line 435 of file config_yaml.c.

◆ DEF_INTERP_METHOD_ADD_FUNC

#define DEF_INTERP_METHOD_ADD_FUNC ( NAME,
FUNC )
Value:
static void add_interp_method_ ## NAME ( \
struct yac_interp_stack_config * interp_stack, \
char const * yaml_filename) { \
char const * routine_name = "add_interp_method_" #NAME; \
(void)parameters; \
(void)yaml_filename; \
(void)routine_name; \
{FUNC} }
interp_method_parameter_value

Definition at line 350 of file config_yaml.c.

◆ DEF_INTERP_METHOD_GET_FUNC

#define DEF_INTERP_METHOD_GET_FUNC ( NAME,
FUNC )
Value:
static void get_interp_method_ ## NAME ( \
union yac_interp_stack_config_entry const * interp_stack_entry, \
interp_method_parameter_value * parameter_values) { \
char const * routine_name = "get_interp_method_" #NAME; \
(void)interp_stack_entry; \
(void)parameter_values; \
(void)routine_name; \
{FUNC} }

Definition at line 360 of file config_yaml.c.

◆ DEF_INTERP_METHOD_PARAM

#define DEF_INTERP_METHOD_PARAM ( NAME,
... )
Value:
static struct interp_method_parameter \
interp_method_parameters_ ## NAME [] = {__VA_ARGS__};

Definition at line 407 of file config_yaml.c.

◆ DEF_INTERP_STACK_ADD

#define DEF_INTERP_STACK_ADD ( NAME,
... )
Value:
yac_interp_stack_config_add_ ## NAME ( \
interp_stack, __VA_ARGS__);

Definition at line 420 of file config_yaml.c.

◆ DEF_INTERP_STACK_ADD_NO_PARAM

#define DEF_INTERP_STACK_ADD_NO_PARAM ( NAME)
Value:
yac_interp_stack_config_add_ ## NAME ( \
interp_stack);

Definition at line 424 of file config_yaml.c.

◆ DEF_INTERP_STACK_GET

#define DEF_INTERP_STACK_GET ( NAME,
... )
Value:
yac_interp_stack_config_entry_get_ ## NAME ( \
interp_stack_entry, __VA_ARGS__);

Definition at line 428 of file config_yaml.c.

◆ DEF_INTERP_STACK_GET_NO_PARAM

#define DEF_INTERP_STACK_GET_NO_PARAM ( NAME)     {}

Definition at line 432 of file config_yaml.c.

◆ DEF_NAME_TYPE_PAIR

#define DEF_NAME_TYPE_PAIR ( NAME,
TYPE )   {.name = #NAME, .type = (int)(TYPE)}

Definition at line 168 of file config_yaml.c.

◆ DEF_NAME_TYPE_PAIRS

#define DEF_NAME_TYPE_PAIRS ( NAME,
... )
Value:
static const struct yac_name_type_pair NAME [] = {__VA_ARGS__}; \
static const size_t num_ ## NAME = COUNT_NAME_TYPE_PAIRS(__VA_ARGS__);

Definition at line 169 of file config_yaml.c.

◆ DEF_STR_PARAM

#define DEF_STR_PARAM ( NAME,
DEFAULT,
MAX_STR_LEN )
Value:
{.name = #NAME, \
.type = STR_PARAM, \
.data.str_param.max_str_len = (MAX_STR_LEN), \
.default_value.str_value = (DEFAULT)}
@ STR_PARAM

Definition at line 402 of file config_yaml.c.

◆ YAML_ASSERT

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

Definition at line 411 of file config_yaml.c.

◆ YAML_ASSERT_F

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

Definition at line 415 of file config_yaml.c.

Typedef Documentation

◆ fy_document_t

typedef struct fy_document* fy_document_t

Definition at line 51 of file config_yaml.c.

◆ fy_node_pair_t

typedef struct fy_node_pair* fy_node_pair_t

Definition at line 53 of file config_yaml.c.

◆ fy_node_t

typedef struct fy_node* fy_node_t

Definition at line 52 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 55 of file config_yaml.c.

◆ anonymous enum

anonymous enum
Enumerator
NUM_INTERPOLATION_METHODS 

Definition at line 754 of file config_yaml.c.

◆ interp_method_parameter_value_type

Enumerator
ENUM_PARAM 
INT_PARAM 
DBLE_PARAM 
BOOL_PARAM 
STR_PARAM 
DEG_PARAM 

Definition at line 306 of file config_yaml.c.

◆ yaml_base_key_types

Enumerator
START_DATE 
END_DATE 
CALENDAR 
TIMESTEP_UNIT 
COUPLING 
DEBUG 

Definition at line 100 of file config_yaml.c.

◆ yaml_comp_grid_names_key_types

Enumerator
COMP_NAME 
GRID_NAMES 

Definition at line 146 of file config_yaml.c.

◆ yaml_couple_key_types

Enumerator
SOURCE_NAMES 
SOURCE_COMPONENT 
SOURCE_GRID 
TARGET_NAMES 
TARGET_COMPONENT 
TARGET_GRID 
FIELD 
COUPLING_PERIOD 
TIME_REDUCTION 
SOURCE_LAG 
TARGET_LAG 
WEIGHT_FILE_NAME 
MAPPING_SIDE 
SCALE_FACTOR 
SCALE_SUMMAND 
INTERPOLATION 
SOURCE_MASK_NAME 
SOURCE_MASK_NAMES 
TARGET_MASK_NAME 
YAXT_EXCHANGER_NAME 

Definition at line 109 of file config_yaml.c.

◆ yaml_debug_key_types

Enumerator
GLOBAL_CONFIG 
GLOBAL_DEFS 
OUTPUT_GRIDS 
MISSING_DEF 

Definition at line 132 of file config_yaml.c.

◆ yaml_debug_output_grid_key_types

Enumerator
OUTPUT_GRID_GRID_NAME 
OUTPUT_GRID_FILE_NAME 

Definition at line 160 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 139 of file config_yaml.c.

Function Documentation

◆ compare_parameter_values()

static int compare_parameter_values ( interp_method_parameter_value const * a,
interp_method_parameter_value const * b,
enum interp_method_parameter_value_type type )
static

Definition at line 2314 of file config_yaml.c.

Here is the caller graph for this function:

◆ DEF_BOOL_PARAM()

DEF_BOOL_PARAM ( partial_coverage ,
YAC_INTERP_NCC_PARTIAL_COVERAGE_DEFAULT  )

Definition at line 470 of file config_yaml.c.

◆ DEF_DBLE_PARAM()

DEF_DBLE_PARAM ( user_value ,
YAC_INTERP_FIXED_VALUE_DEFAULT ,
- DBL_MAX,
DBL_MAX  )

◆ DEF_ENUM_PARAM()

DEF_ENUM_PARAM ( weighted ,
YAC_INTERP_NCC_WEIGHT_TYPE_DEFAULT ,
DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_NCC_AVG) ,
DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_NCC_DIST)  )

◆ DEF_INTERP_METHOD() [1/2]

DEF_INTERP_METHOD ( average ,
DEF_INTERP_STACK_ADD(average,(enum yac_interp_avg_weight_type) parameters[0].enum_value, parameters[1].bool_value) ,
enum yac_interp_avg_weight_type reduction_type;DEF_INTERP_STACK_GET(average, &reduction_type, &parameter_values[1].bool_value) parameter_values. enum_value[0] = (int)reduction_type;,
DEF_ENUM_PARAM( weighted, YAC_INTERP_AVG_WEIGHT_TYPE_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_AVG_DIST), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_AVG_ARITHMETIC), DEF_NAME_TYPE_PAIR(barycentric_coordinate, YAC_INTERP_AVG_BARY)) ,
DEF_BOOL_PARAM( partial_coverage, YAC_INTERP_AVG_PARTIAL_COVERAGE_DEFAULT)  )

◆ DEF_INTERP_METHOD() [2/2]

DEF_INTERP_METHOD ( source_to_target_map ,
double src_sphere_radius = parameters[4].dble_value; char const * src_filename = parameters[5].str_value; char const * src_varname = parameters[6].str_value; int src_min_global_id = parameters[7].int_value; double tgt_sphere_radius = parameters[8].dble_value; char const * tgt_filename = parameters[9].str_value; char const * tgt_varname = parameters[10].str_value; int tgt_min_global_id = parameters[11].int_value; get_spmap_parameters(    &src_sphere_radius, src_filename, src_varname,    routine_name, yaml_filename, "source"); get_spmap_parameters(    &tgt_sphere_radius, tgt_filename, tgt_varname,    routine_name, yaml_filename, "target"); DEF_INTERP_STACK_ADD(spmap,    parameters[0].dble_value,    parameters[1].dble_value,    (enum yac_interp_spmap_weight_type)parameters[2].enum_value,    (enum yac_interp_spmap_scale_type)parameters[3].enum_value,    src_sphere_radius, src_filename, src_varname, src_min_global_id,    tgt_sphere_radius, tgt_filename, tgt_varname, tgt_min_global_id),
enum yac_interp_spmap_weight_type weight_type;enum yac_interp_spmap_scale_type scale_type;DEF_INTERP_STACK_GET(spmap, &parameter_values[0].dble_value, &parameter_values[1].dble_value, &weight_type, &scale_type, &parameter_values[4].dble_value, &parameter_values[5].str_value, &parameter_values[6].str_value, &parameter_values[7].int_value, &parameter_values[8].dble_value, &parameter_values[9].str_value, &parameter_values[10].str_value, &parameter_values[11].int_value) parameter_values.dble_value/ [0] = YAC_RAD; parameter_values[1].dble_value /= YAC_RAD; parameter_values[2].enum_value = (int)weight_type; parameter_values[3].enum_value = (int)scale_type;,
DEF_DEG_PARAM( spread_distance, YAC_INTERP_SPMAP_SPREAD_DISTANCE_DEFAULT, 0.0, 89.9999) ,
DEF_DEG_PARAM( max_search_distance, YAC_INTERP_SPMAP_MAX_SEARCH_DISTANCE_DEFAULT, 0.0, 179.9999) ,
DEF_ENUM_PARAM( weighted, YAC_INTERP_SPMAP_WEIGHTED_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_SPMAP_DIST), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_SPMAP_AVG)) ,
DEF_ENUM_PARAM( scale, YAC_INTERP_SPMAP_SCALE_TYPE_DEFAULT, DEF_NAME_TYPE_PAIR(none, YAC_INTERP_SPMAP_NONE), DEF_NAME_TYPE_PAIR(srcarea, YAC_INTERP_SPMAP_SRCAREA), DEF_NAME_TYPE_PAIR(invtgtarea, YAC_INTERP_SPMAP_INVTGTAREA), DEF_NAME_TYPE_PAIR(fracarea, YAC_INTERP_SPMAP_FRACAREA)) ,
DEF_DBLE_PARAM( src_cell_area:yac:sphere_radius, 0.0, 1e-9, DBL_MAX) ,
DEF_STR_PARAM( src_cell_area:file:filename, NULL, YAC_MAX_FILE_NAME_LENGTH) ,
DEF_STR_PARAM(src_cell_area:file:varname, NULL, 128) ,
DEF_INT_PARAM( src_cell_area:file:min_global_id, YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT, -INT_MAX, INT_MAX) ,
DEF_DBLE_PARAM( tgt_cell_area:yac:sphere_radius, 0.0, 1e-9, DBL_MAX) ,
DEF_STR_PARAM( tgt_cell_area:file:filename, NULL, YAC_MAX_FILE_NAME_LENGTH) ,
DEF_STR_PARAM(tgt_cell_area:file:varname, NULL, 128) ,
DEF_INT_PARAM( tgt_cell_area:file:min_global_id, YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT, -INT_MAX, INT_MAX)  )

◆ DEF_INTERP_STACK_ADD() [1/2]

DEF_INTERP_STACK_ADD ( fixed ,
parameters. dble_value[0] )

◆ DEF_INTERP_STACK_ADD() [2/2]

DEF_INTERP_STACK_ADD ( ncc ,
(enum yac_interp_ncc_weight_type) parameters. enum_value[0],
parameters. bool_value[1] )

◆ DEF_INTERP_STACK_GET() [1/3]

DEF_INTERP_STACK_GET ( fixed ,
&parameter_values. dble_value[0] )

◆ DEF_INTERP_STACK_GET() [2/3]

DEF_INTERP_STACK_GET ( ncc ,
& weight_type,
&parameter_values. bool_value[1] )

◆ DEF_INTERP_STACK_GET() [3/3]

char *parameters[0] DEF_INTERP_STACK_GET ( user_file ,
&parameter_values. str_value[0] )

◆ DEF_NAME_TYPE_PAIRS()

DEF_NAME_TYPE_PAIRS ( yaml_base_keys ,
DEF_NAME_TYPE_PAIR(start_date, START_DATE) ,
DEF_NAME_TYPE_PAIR(end_date, 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 173 of file config_yaml.c.

◆ DEF_STR_PARAM()

char *parameters[0] DEF_STR_PARAM ( filename ,
YAC_INTERP_FILE_WEIGHT_FILE_NAME_DEFAULT ,
YAC_MAX_FILE_NAME_LENGTH  )

Definition at line 638 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 )
Examples
test_couple_config.c, test_events.c, test_instance_parallel1.c, test_instance_parallel2.c, and test_instance_parallel3.c.

Definition at line 329 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 2459 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 2652 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 2882 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 2913 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 3017 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 2763 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 2735 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 2995 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 2235 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 2785 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 2853 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 2942 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 2967 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,
union yac_interp_stack_config_entry const * interp_stack_entry )
static

Definition at line 2352 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 2417 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 2665 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 2689 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 2103 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 2132 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 2118 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 2146 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 user definitions (components, grids, and fields) in the output file
Returns
string containing coupling configuration
Examples
test_couple_config.c.

Definition at line 3083 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 2177 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_parameter()

static void yac_yaml_map_append_parameter ( fy_node_t map,
struct interp_method_parameter const * parameter,
interp_method_parameter_value value )
static

Definition at line 2264 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 2200 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 2223 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 2211 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 a interpolation stack configuration

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

Definition at line 2059 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
Examples
test_couple_config.c, and test_instance_parallel1.c.

Definition at line 2010 of file config_yaml.c.

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

◆ YAML_ASSERT() [1/2]

YAML_ASSERT ( parameters.dble_value ! [0] = DBL_MAX,
"parameter 'user_value' of interpolation method 'fixed' is unset"  )

◆ YAML_ASSERT() [2/2]

YAML_ASSERT ( parameters. str_value[0],
"parameter \"filename\" of interpolation method \"user file\" is unset"  )

◆ 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

Definition at line 902 of file config_yaml.c.

Here is the call graph for this function:
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 1898 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 771 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 )
static

Definition at line 1291 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 1598 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 1462 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 1340 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 1577 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 1878 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 1702 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 1670 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 1740 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 1845 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 1826 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 1971 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 866 of file config_yaml.c.

Here is the call graph for this function:
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 883 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 1197 of file config_yaml.c.

Here is the call graph for this function:
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 1266 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 848 of file config_yaml.c.

Here is the call graph for this function:
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 1146 of file config_yaml.c.

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

◆ yaml_parse_interp_method_parameter()

static void yaml_parse_interp_method_parameter ( interp_method_parameter_value * parameter_values,
struct interp_method_parameter const * parameters,
size_t num_parameters,
fy_node_pair_t parameter_pair,
char const * interpolation_name,
char const * parameter_name_prefix,
char const * yaml_filename )
static

Definition at line 1055 of file config_yaml.c.

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

◆ yaml_parse_interp_method_parameter_value()

static interp_method_parameter_value yaml_parse_interp_method_parameter_value ( struct interp_method_parameter const * parameter,
fy_node_t value_node,
char const * interpolation_name,
char const * yaml_filename )
static

Definition at line 956 of file config_yaml.c.

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

◆ yaml_parse_interp_method_parameters()

static void yaml_parse_interp_method_parameters ( interp_method_parameter_value * parameter_values,
struct yac_interpolation_method const * interp_method,
fy_node_t parameter_node,
char const * yaml_filename )
static

Definition at line 1116 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 1178 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 1799 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 1767 of file config_yaml.c.

Here is the call graph for this function:
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 1236 of file config_yaml.c.

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

◆ yaml_parse_string_value()

static char const * yaml_parse_string_value ( fy_node_t value_node,
char const * name,
char const * yaml_filename )
static

Definition at line 759 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 830 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 812 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 789 of file config_yaml.c.

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

Variable Documentation

◆ interp_method_parameter_value

interp_method_parameter_value

Definition at line 304 of file config_yaml.c.

◆ interpolation_methods

const interpolation_methods[]
Initial value:
=
#define ADD_INTERPOLATION(NAME, TYPE)
#define ADD_INTERPOLATION_NO_PARAM(NAME, TYPE)
@ YAC_N_NEAREST_NEIGHBOR
@ YAC_CREEP
@ YAC_USER_FILE
@ YAC_USER_CALLBACK
@ YAC_SOURCE_TO_TARGET_MAP
@ YAC_CONSERVATIVE
@ YAC_FIXED_VALUE
@ YAC_CHECK
@ YAC_BERNSTEIN_BEZIER
@ YAC_NEAREST_CORNER_CELLS
@ YAC_RADIAL_BASIS_FUNCTION
@ YAC_AVERAGE

Definition at line 741 of file config_yaml.c.

◆ str_value

char* parameters [0] str_value

Definition at line 635 of file config_yaml.c.

◆ weight_type

◆ YAC_YAML_EMITTER_DEFAULT

int const YAC_YAML_EMITTER_DEFAULT = EMITTER_DEFAULT

emit to YAML format

Examples
test_couple_config.c, and test_restart_c.c.

Definition at line 63 of file config_yaml.c.

◆ YAC_YAML_EMITTER_JSON

int const YAC_YAML_EMITTER_JSON = EMITTER_JSON

emit to JSON format

Examples
test_couple_config.c.

Definition at line 64 of file config_yaml.c.

◆ YAC_YAML_PARSER_DEFAULT

int const YAC_YAML_PARSER_DEFAULT = PARSER_DEFAULT

default parse flags (YAML format)

Examples
test_couple_config.c, and test_instance_parallel1.c.

Definition at line 65 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

Examples
test_couple_config.c.

Definition at line 66 of file config_yaml.c.