YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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 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
 
union  interp_method_parameter_value
 
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)
 

Typedefs

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

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
}
 
enum  yaml_couple_key_types {
  SOURCE_COMPONENT , SOURCE_GRID , 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
}
 
enum  interp_method_parameter_value_type {
  ENUM_PARAM , INT_PARAM , DBLE_PARAM , BOOL_PARAM ,
  STR_PARAM , DEG_PARAM
}
 

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_PAIRS (yaml_couple_keys, DEF_NAME_TYPE_PAIR(src_component, SOURCE_COMPONENT), DEF_NAME_TYPE_PAIR(src_grid, SOURCE_GRID), DEF_NAME_TYPE_PAIR(tgt_component, TARGET_COMPONENT), DEF_NAME_TYPE_PAIR(tgt_grid, TARGET_GRID), DEF_NAME_TYPE_PAIR(field, FIELD), DEF_NAME_TYPE_PAIR(coupling_period, COUPLING_PERIOD), DEF_NAME_TYPE_PAIR(time_reduction, TIME_REDUCTION), DEF_NAME_TYPE_PAIR(src_lag, SOURCE_LAG), DEF_NAME_TYPE_PAIR(tgt_lag, TARGET_LAG), DEF_NAME_TYPE_PAIR(weight_file_name, WEIGHT_FILE_NAME), DEF_NAME_TYPE_PAIR(mapping_side, MAPPING_SIDE), DEF_NAME_TYPE_PAIR(scale_factor, SCALE_FACTOR), DEF_NAME_TYPE_PAIR(scale_summand, SCALE_SUMMAND), DEF_NAME_TYPE_PAIR(interpolation, INTERPOLATION), DEF_NAME_TYPE_PAIR(src_mask_name, SOURCE_MASK_NAME), DEF_NAME_TYPE_PAIR(src_mask_names, SOURCE_MASK_NAMES), DEF_NAME_TYPE_PAIR(tgt_mask_name, TARGET_MASK_NAME))
 
 DEF_NAME_TYPE_PAIRS (bool_names, DEF_NAME_TYPE_PAIR(true, true), DEF_NAME_TYPE_PAIR(TRUE, true), DEF_NAME_TYPE_PAIR(yes, true), DEF_NAME_TYPE_PAIR(YES, true), DEF_NAME_TYPE_PAIR(false, false), DEF_NAME_TYPE_PAIR(FALSE, false), DEF_NAME_TYPE_PAIR(no, false), DEF_NAME_TYPE_PAIR(NO, false))
 
 DEF_NAME_TYPE_PAIRS (timestep_units, DEF_NAME_TYPE_PAIR(millisecond, C_MILLISECOND), DEF_NAME_TYPE_PAIR(second, C_SECOND), DEF_NAME_TYPE_PAIR(minute, C_MINUTE), DEF_NAME_TYPE_PAIR(hour, C_HOUR), DEF_NAME_TYPE_PAIR(day, C_DAY), DEF_NAME_TYPE_PAIR(month, C_MONTH), DEF_NAME_TYPE_PAIR(year, C_YEAR), DEF_NAME_TYPE_PAIR(ISO_format, C_ISO_FORMAT))
 
 DEF_NAME_TYPE_PAIRS (time_operations, DEF_NAME_TYPE_PAIR(accumulate, TIME_ACCUMULATE), DEF_NAME_TYPE_PAIR(average, TIME_AVERAGE), DEF_NAME_TYPE_PAIR(minimum, TIME_MINIMUM), DEF_NAME_TYPE_PAIR(maximum, TIME_MAXIMUM), DEF_NAME_TYPE_PAIR(none, TIME_NONE))
 
 DEF_NAME_TYPE_PAIRS (calendar_types, DEF_NAME_TYPE_PAIR(proleptic-gregorian, PROLEPTIC_GREGORIAN), DEF_NAME_TYPE_PAIR(360d, YEAR_OF_360_DAYS), DEF_NAME_TYPE_PAIR(365d, YEAR_OF_365_DAYS))
 
 DEF_NAME_TYPE_PAIRS (mapping_sides, DEF_NAME_TYPE_PAIR(source, 1), DEF_NAME_TYPE_PAIR(target, 0))
 
 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), enum yac_interp_ncc_weight_type weight_type;DEF_INTERP_STACK_GET(ncc, &weight_type, &parameter_values[1].bool_value) parameter_values[0].enum_value=(int) weight_type;, 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 (nnn, DEF_INTERP_STACK_ADD(nnn,(enum yac_interp_nnn_weight_type) parameters[0].enum_value,(size_t) parameters[1].int_value, parameters[2].dble_value), enum yac_interp_nnn_weight_type type;size_t n;DEF_INTERP_STACK_GET(nnn, &type, &n, &parameter_values[2].dble_value) parameter_values[0].enum_value=(int) type;parameter_values[1].int_value=(int) n;, DEF_ENUM_PARAM(weighted, YAC_INTERP_NNN_WEIGHTED_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_NNN_DIST), DEF_NAME_TYPE_PAIR(gauss_weighted, YAC_INTERP_NNN_GAUSS), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_NNN_AVG), DEF_NAME_TYPE_PAIR(zero, YAC_INTERP_NNN_ZERO)), DEF_INT_PARAM(n, YAC_INTERP_NNN_N_DEFAULT, 1, INT_MAX), DEF_DBLE_PARAM(gauss_scale, YAC_INTERP_NNN_GAUSS_SCALE_DEFAULT, -DBL_MAX, DBL_MAX))
 
 DEF_INTERP_METHOD (conservative, DEF_INTERP_STACK_ADD(conservative, parameters[0].int_value, parameters[1].bool_value, parameters[2].bool_value,(enum yac_interp_method_conserv_normalisation) parameters[3].enum_value), enum yac_interp_method_conserv_normalisation normalisation;DEF_INTERP_STACK_GET(conservative, &parameter_values[0].int_value, &parameter_values[1].bool_value, &parameter_values[2].bool_value, &normalisation) parameter_values[3].enum_value=(int) normalisation;, DEF_INT_PARAM(order, YAC_INTERP_CONSERV_ORDER_DEFAULT, 1, 2), DEF_BOOL_PARAM(enforced_conservation, YAC_INTERP_CONSERV_ENFORCED_CONSERV_DEFAULT), DEF_BOOL_PARAM(partial_coverage, YAC_INTERP_CONSERV_PARTIAL_COVERAGE_DEFAULT), DEF_ENUM_PARAM(normalisation, YAC_INTERP_CONSERV_NORMALISATION_DEFAULT, DEF_NAME_TYPE_PAIR(fracarea, YAC_INTERP_CONSERV_FRACAREA), DEF_NAME_TYPE_PAIR(destarea, YAC_INTERP_CONSERV_DESTAREA)))
 
 DEF_INTERP_METHOD (source_to_target_map, 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, parameters[4].dble_value, parameters[5].dble_value), 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].dble_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_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_sphere_radius, YAC_INTERP_SPMAP_SRC_SPHERE_RADIUS_DEFAULT, DBL_MIN, DBL_MAX), DEF_DBLE_PARAM(tgt_sphere_radius, YAC_INTERP_SPMAP_TGT_SPHERE_RADIUS_DEFAULT, DBL_MIN, DBL_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") YAML_ASSERT(field_buffer->src.grid_name, "source grid name has to be defined before " "the definition of interpolation method \"user_file\"") YAML_ASSERT(field_buffer->tgt.grid_name, "target grid name has to be defined before " "the definition of interpolation method \"user_file\"") DEF_INTERP_STACK_ADD(user_file,(char *)(parameters[0].str_value),(char *)(field_buffer->src.grid_name),(char *)(field_buffer->tgt.grid_name)), char const *src_grid_name;char const *tgt_grid_name;DEF_INTERP_STACK_GET(user_file, &parameter_values[0].str_value, &src_grid_name, &tgt_grid_name), DEF_STR_PARAM(filename, YAC_INTERP_FILE_WEIGHT_FILE_NAME_DEFAULT, YAC_MAX_FILE_NAME_LENGTH))
 
 DEF_INTERP_METHOD (check, DEF_INTERP_STACK_ADD(check,(char *)(parameters[0].str_value),(char *)(parameters[1].str_value)), DEF_INTERP_STACK_GET(check, &parameter_values[0].str_value, &parameter_values[1].str_value), DEF_STR_PARAM(constructor_key, YAC_INTERP_CHECK_CONSTRUCTOR_KEY_DEFAULT, YAC_MAX_ROUTINE_NAME_LENGTH), DEF_STR_PARAM(do_search_key, YAC_INTERP_CHECK_DO_SEARCH_KEY_DEFAULT, YAC_MAX_ROUTINE_NAME_LENGTH))
 
 DEF_INTERP_METHOD (bernstein_bezier, DEF_INTERP_STACK_ADD_NO_PARAM(hcsbb), DEF_INTERP_STACK_GET_NO_PARAM(hcsbb))
 
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 *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 field_couple_buffer *field_buffer, fy_node_t interp_method_node, char const *yaml_filename)
 
static void yaml_parse_interp_stack_value (struct field_couple_buffer *field_buffer, 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_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 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)
 
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)
 
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_coupling_node (fy_document_t document, struct yac_couple_config *couple_config)
 
char * yac_yaml_emit_coupling (struct yac_couple_config *couple_config, int emit_flags)
 

Variables

int YAC_YAML_EMITTER_DEFAULT = EMITTER_DEFAULT
 emit to YAML format
 
int YAC_YAML_EMITTER_JSON = EMITTER_JSON
 emit to JSON format
 
int YAC_YAML_PARSER_DEFAULT = PARSER_DEFAULT
 default parse flags (YAML format)
 
int YAC_YAML_PARSER_JSON_AUTO = PARSER_JSON_AUTO
 
int YAC_YAML_PARSER_JSON_FORCE = PARSER_JSON_FORCE
 assume JSON format
 
const interpolation_methods []
 
size_t num_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])}

◆ CAST_NAME_TYPE_PAIRS

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

Definition at line 106 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 107 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 293 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), \
.data.dble_param.valid_max = (double)(VALID_MAX), \
.default_value.dble_value = (double)(DEFAULT)}
@ DBLE_PARAM

Definition at line 281 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), \
.data.dble_param.valid_max = (double)(VALID_MAX), \
.default_value.dble_value = (double)(DEFAULT)}
@ DEG_PARAM

Definition at line 287 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__), \
.data.enum_param.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 269 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), \
.data.int_param.valid_max = (int)(VALID_MAX), \
.default_value.int_value = (int)(DEFAULT)}
@ INT_PARAM

Definition at line 275 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 330 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 field_couple_buffer * field_buffer, \
char const * yaml_filename) { \
char const * routine_name = "add_interp_method_" #NAME; \
(void)parameters; \
(void)yaml_filename; \
(void)routine_name; \
{FUNC} }

Definition at line 249 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 259 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 302 of file config_yaml.c.

◆ DEF_INTERP_STACK_ADD

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

Definition at line 315 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 ( \
field_buffer->interp_stack);

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

◆ DEF_INTERP_STACK_GET_NO_PARAM

#define DEF_INTERP_STACK_GET_NO_PARAM (   NAME)     {}

Definition at line 327 of file config_yaml.c.

◆ DEF_NAME_TYPE_PAIR

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

Definition at line 109 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 110 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 297 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:18

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

Typedef Documentation

◆ fy_document_t

typedef struct fy_document* fy_document_t

Definition at line 34 of file config_yaml.c.

◆ fy_node_pair_t

typedef struct fy_node_pair* fy_node_pair_t

Definition at line 36 of file config_yaml.c.

◆ fy_node_t

typedef struct fy_node* fy_node_t

Definition at line 35 of file config_yaml.c.

◆ interp_method_parameter_value

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EMITTER_DEFAULT 
EMITTER_JSON 
PARSER_DEFAULT 
PARSER_JSON_AUTO 
PARSER_JSON_FORCE 

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

◆ yaml_base_key_types

Enumerator
START_DATE 
END_DATE 
CALENDAR 
TIMESTEP_UNIT 
COUPLING 

Definition at line 78 of file config_yaml.c.

◆ yaml_couple_key_types

Enumerator
SOURCE_COMPONENT 
SOURCE_GRID 
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 

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

Here is the caller graph for this function:

◆ DEF_INTERP_METHOD() [1/9]

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/9]

DEF_INTERP_METHOD ( bernstein_bezier  ,
DEF_INTERP_STACK_ADD_NO_PARAM(hcsbb)  ,
DEF_INTERP_STACK_GET_NO_PARAM(hcsbb)   
)

Definition at line 509 of file config_yaml.c.

◆ DEF_INTERP_METHOD() [3/9]

DEF_INTERP_METHOD ( check  ,
DEF_INTERP_STACK_ADD(check,(char *)(parameters[0].str_value),(char *)(parameters[1].str_value))  ,
DEF_INTERP_STACK_GET(check, &parameter_values[0].str_value, &parameter_values[1].str_value)  ,
DEF_STR_PARAM(constructor_key, YAC_INTERP_CHECK_CONSTRUCTOR_KEY_DEFAULT, YAC_MAX_ROUTINE_NAME_LENGTH ,
DEF_STR_PARAM(do_search_key, YAC_INTERP_CHECK_DO_SEARCH_KEY_DEFAULT, YAC_MAX_ROUTINE_NAME_LENGTH  
)

◆ DEF_INTERP_METHOD() [4/9]

DEF_INTERP_METHOD ( conservative  ,
DEF_INTERP_STACK_ADD(conservative, parameters[0].int_value, parameters[1].bool_value, parameters[2].bool_value,(enum yac_interp_method_conserv_normalisation) parameters[3].enum_value)  ,
enum yac_interp_method_conserv_normalisation normalisation;DEF_INTERP_STACK_GET(conservative, &parameter_values[0].int_value, &parameter_values[1].bool_value, &parameter_values[2].bool_value, &normalisation) parameter_values.  enum_value[3] = (int) normalisation;,
DEF_INT_PARAM(order, YAC_INTERP_CONSERV_ORDER_DEFAULT, 1, 2)  ,
DEF_BOOL_PARAM(enforced_conservation, YAC_INTERP_CONSERV_ENFORCED_CONSERV_DEFAULT ,
DEF_BOOL_PARAM(partial_coverage, YAC_INTERP_CONSERV_PARTIAL_COVERAGE_DEFAULT ,
DEF_ENUM_PARAM(normalisation, YAC_INTERP_CONSERV_NORMALISATION_DEFAULT, DEF_NAME_TYPE_PAIR(fracarea, YAC_INTERP_CONSERV_FRACAREA), DEF_NAME_TYPE_PAIR(destarea, YAC_INTERP_CONSERV_DESTAREA))   
)

◆ DEF_INTERP_METHOD() [5/9]

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() [6/9]

DEF_INTERP_METHOD ( ncc  ,
DEF_INTERP_STACK_ADD(ncc,(enum yac_interp_ncc_weight_type) parameters[0].enum_value, parameters[1].bool_value)  ,
enum yac_interp_ncc_weight_type weight_type;DEF_INTERP_STACK_GET(ncc, &weight_type, &parameter_values[1].bool_value) parameter_values.  enum_value[0] = (int) weight_type;,
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() [7/9]

DEF_INTERP_METHOD ( nnn  ,
DEF_INTERP_STACK_ADD(nnn,(enum yac_interp_nnn_weight_type) parameters[0].enum_value,(size_t) parameters[1].int_value, parameters[2].dble_value)  ,
enum yac_interp_nnn_weight_type type;size_t n;DEF_INTERP_STACK_GET(nnn, &type, &n, &parameter_values[2].dble_value) parameter_values.  enum_value[0] = (int) type;parameter_values[1].int_value=(int) n;,
DEF_ENUM_PARAM(weighted, YAC_INTERP_NNN_WEIGHTED_DEFAULT, DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_NNN_DIST), DEF_NAME_TYPE_PAIR(gauss_weighted, YAC_INTERP_NNN_GAUSS), DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_NNN_AVG), DEF_NAME_TYPE_PAIR(zero, YAC_INTERP_NNN_ZERO))  ,
DEF_INT_PARAM(n, YAC_INTERP_NNN_N_DEFAULT, 1, INT_MAX)  ,
DEF_DBLE_PARAM(gauss_scale, YAC_INTERP_NNN_GAUSS_SCALE_DEFAULT, -DBL_MAX, DBL_MAX)   
)

◆ DEF_INTERP_METHOD() [8/9]

DEF_INTERP_METHOD ( source_to_target_map  ,
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, parameters[4].dble_value, parameters[5].dble_value)  ,
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].dble_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_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_sphere_radius, YAC_INTERP_SPMAP_SRC_SPHERE_RADIUS_DEFAULT, DBL_MIN, DBL_MAX)  ,
DEF_DBLE_PARAM(tgt_sphere_radius, YAC_INTERP_SPMAP_TGT_SPHERE_RADIUS_DEFAULT, DBL_MIN, DBL_MAX)   
)

◆ DEF_INTERP_METHOD() [9/9]

DEF_INTERP_METHOD ( user_file  ,
YAML_ASSERT(parameters[0].str_value, "parameter \"filename\" of interpolation method \"user file\" is unset") YAML_ASSERT(field_buffer->src.grid_name, "source grid name has to be defined before " "the definition of interpolation method \"user_file\"") YAML_ASSERT(field_buffer->tgt.grid_name, "target grid name has to be defined before " "the definition of interpolation method \"user_file\"") DEF_INTERP_STACK_ADD(user_file,(char *)(parameters[0].str_value),(char *)(field_buffer->src.grid_name),(char *)(field_buffer->tgt.grid_name))  ,
char const *src_grid_name;char const *tgt_grid_name;  DEF_INTERP_STACK_GETuser_file, &parameter_values[0].str_value, &src_grid_name, &tgt_grid_name,
DEF_STR_PARAM(filename, YAC_INTERP_FILE_WEIGHT_FILE_NAME_DEFAULT, YAC_MAX_FILE_NAME_LENGTH  
)

◆ DEF_NAME_TYPE_PAIRS() [1/7]

DEF_NAME_TYPE_PAIRS ( bool_names  ,
DEF_NAME_TYPE_PAIR(true, true)  ,
DEF_NAME_TYPE_PAIR(TRUE, true)  ,
DEF_NAME_TYPE_PAIR(yes, true)  ,
DEF_NAME_TYPE_PAIR(YES, true)  ,
DEF_NAME_TYPE_PAIR(false, false)  ,
DEF_NAME_TYPE_PAIR(FALSE, false)  ,
DEF_NAME_TYPE_PAIR(no, false)  ,
DEF_NAME_TYPE_PAIR(NO, false)   
)

◆ DEF_NAME_TYPE_PAIRS() [2/7]

DEF_NAME_TYPE_PAIRS ( calendar_types  ,
DEF_NAME_TYPE_PAIR(proleptic-gregorian, PROLEPTIC_GREGORIAN)  ,
DEF_NAME_TYPE_PAIR(360d, YEAR_OF_360_DAYS)  ,
DEF_NAME_TYPE_PAIR(365d, YEAR_OF_365_DAYS)   
)

◆ DEF_NAME_TYPE_PAIRS() [3/7]

DEF_NAME_TYPE_PAIRS ( mapping_sides  ,
DEF_NAME_TYPE_PAIR(source, 1)  ,
DEF_NAME_TYPE_PAIR(target, 0)   
)

◆ DEF_NAME_TYPE_PAIRS() [4/7]

DEF_NAME_TYPE_PAIRS ( time_operations  ,
DEF_NAME_TYPE_PAIR(accumulate, TIME_ACCUMULATE ,
DEF_NAME_TYPE_PAIR(average, TIME_AVERAGE ,
DEF_NAME_TYPE_PAIR(minimum, TIME_MINIMUM ,
DEF_NAME_TYPE_PAIR(maximum, TIME_MAXIMUM ,
DEF_NAME_TYPE_PAIR(none, TIME_NONE  
)

◆ DEF_NAME_TYPE_PAIRS() [5/7]

DEF_NAME_TYPE_PAIRS ( timestep_units  ,
DEF_NAME_TYPE_PAIR(millisecond, C_MILLISECOND ,
DEF_NAME_TYPE_PAIR(second, C_SECOND ,
DEF_NAME_TYPE_PAIR(minute, C_MINUTE ,
DEF_NAME_TYPE_PAIR(hour, C_HOUR ,
DEF_NAME_TYPE_PAIR(day, C_DAY ,
DEF_NAME_TYPE_PAIR(month, C_MONTH ,
DEF_NAME_TYPE_PAIR(year, C_YEAR ,
DEF_NAME_TYPE_PAIR(ISO_format, C_ISO_FORMAT  
)

◆ DEF_NAME_TYPE_PAIRS() [6/7]

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_PAIRS() [7/7]

DEF_NAME_TYPE_PAIRS ( yaml_couple_keys  ,
DEF_NAME_TYPE_PAIR(src_component, SOURCE_COMPONENT ,
DEF_NAME_TYPE_PAIR(src_grid, SOURCE_GRID ,
DEF_NAME_TYPE_PAIR(tgt_component, TARGET_COMPONENT ,
DEF_NAME_TYPE_PAIR(tgt_grid, TARGET_GRID ,
DEF_NAME_TYPE_PAIR(field, FIELD ,
DEF_NAME_TYPE_PAIR(coupling_period, COUPLING_PERIOD ,
DEF_NAME_TYPE_PAIR(time_reduction, TIME_REDUCTION ,
DEF_NAME_TYPE_PAIR(src_lag, SOURCE_LAG ,
DEF_NAME_TYPE_PAIR(tgt_lag, TARGET_LAG ,
DEF_NAME_TYPE_PAIR(weight_file_name, WEIGHT_FILE_NAME ,
DEF_NAME_TYPE_PAIR(mapping_side, MAPPING_SIDE ,
DEF_NAME_TYPE_PAIR(scale_factor, SCALE_FACTOR ,
DEF_NAME_TYPE_PAIR(scale_summand, SCALE_SUMMAND ,
DEF_NAME_TYPE_PAIR(interpolation, INTERPOLATION ,
DEF_NAME_TYPE_PAIR(src_mask_name, SOURCE_MASK_NAME ,
DEF_NAME_TYPE_PAIR(src_mask_names, SOURCE_MASK_NAMES ,
DEF_NAME_TYPE_PAIR(tgt_mask_name, TARGET_MASK_NAME  
)

◆ 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 1802 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 1984 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 1997 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 1578 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 1695 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 1760 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 1448 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 1476 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 1463 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 1489 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 
)

Emit coupling configuration to string

Parameters
[in]couple_configcoupling configuration
[in]emit_flagsflags to be used for emitting the coupling configuration
Returns
string containing coupling configuration
Examples
test_couple_config.c.

Definition at line 2019 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 1520 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 1607 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 1543 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 1566 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 1554 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 1400 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

Definition at line 737 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 
)
static

Definition at line 1307 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 606 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 1192 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 1091 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 1286 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 1377 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 701 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 718 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 997 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 1066 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 683 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 field_couple_buffer field_buffer,
fy_node_t  interp_method_node,
char const *  yaml_filename 
)
static

Definition at line 946 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 *  yaml_filename 
)
static

Definition at line 890 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 791 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 916 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 field_couple_buffer field_buffer,
fy_node_t  interp_stack_node,
char const *  yaml_filename 
)
static

Definition at line 978 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 1036 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 594 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 665 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 647 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 624 of file config_yaml.c.

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

Variable Documentation

◆ interpolation_methods

const interpolation_methods[]
Initial value:
=
#define ADD_INTERPOLATION(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 578 of file config_yaml.c.

◆ num_interpolation_methods

size_t num_interpolation_methods
Initial value:
=
const interpolation_methods[]

Definition at line 591 of file config_yaml.c.

◆ YAC_YAML_EMITTER_DEFAULT

int YAC_YAML_EMITTER_DEFAULT = EMITTER_DEFAULT

emit to YAML format

Examples
test_couple_config.c, and test_restart_c.c.

Definition at line 46 of file config_yaml.c.

◆ YAC_YAML_EMITTER_JSON

int YAC_YAML_EMITTER_JSON = EMITTER_JSON

emit to JSON format

Examples
test_couple_config.c.

Definition at line 47 of file config_yaml.c.

◆ YAC_YAML_PARSER_DEFAULT

int YAC_YAML_PARSER_DEFAULT = PARSER_DEFAULT

default parse flags (YAML format)

Examples
test_couple_config.c, and test_instance_parallel1.c.

Definition at line 48 of file config_yaml.c.

◆ YAC_YAML_PARSER_JSON_AUTO

int YAC_YAML_PARSER_JSON_AUTO = PARSER_JSON_AUTO

switch to JSON format, if indicated by file extension

Definition at line 49 of file config_yaml.c.

◆ YAC_YAML_PARSER_JSON_FORCE

int YAC_YAML_PARSER_JSON_FORCE = PARSER_JSON_FORCE

assume JSON format

Examples
test_couple_config.c.

Definition at line 50 of file config_yaml.c.