11#if defined(__NVCOMPILER)
12# pragma diag_suppress unsigned_compare_with_zero
13#elif defined(__GNUC__)
14# pragma GCC diagnostic push
15# pragma GCC diagnostic ignored "-Wpedantic"
16# pragma GCC diagnostic ignored "-Wall"
17# pragma GCC diagnostic ignored "-Wextra"
20#if defined(__NVCOMPILER)
21# pragma diag_default unsigned_compare_with_zero
22#elif defined(__GNUC__)
23# pragma GCC diagnostic pop
33#include "mtime_calendar.h"
165#define CAST_NAME_TYPE_PAIRS(...) (struct yac_name_type_pair[]) {__VA_ARGS__}
166#define COUNT_NAME_TYPE_PAIRS(...) \
167 sizeof(CAST_NAME_TYPE_PAIRS(__VA_ARGS__)) / sizeof(struct yac_name_type_pair)
168#define DEF_NAME_TYPE_PAIR(NAME, TYPE) {.name = #NAME, .type = (int)(TYPE)}
169#define DEF_NAME_TYPE_PAIRS(NAME, ...) \
170 static const struct yac_name_type_pair NAME [] = {__VA_ARGS__}; \
171 static const size_t num_ ## NAME = COUNT_NAME_TYPE_PAIRS(__VA_ARGS__);
207 yaml_debug_sync_loc_keys,
218 yaml_debug_output_grid_keys,
283 yaml_comp_grid_names_keys,
288#if defined __NVCOMPILER && (__NVCOMPILER_MAJOR__ <= 23 || __NVCOMPILER_MAJOR__ == 24 && __NVCOMPILER_MINOR__ <= 3)
320#if defined __NVCOMPILER && (__NVCOMPILER_MAJOR__ <= 23 || __NVCOMPILER_MAJOR__ == 24 && __NVCOMPILER_MINOR__ <= 3)
350#define DEF_INTERP_METHOD_ADD_FUNC(NAME, FUNC) \
351 static void add_interp_method_ ## NAME ( \
352 struct yac_interp_stack_config * interp_stack, \
353 interp_method_parameter_value * parameters, \
354 char const * yaml_filename) { \
355 char const * routine_name = "add_interp_method_" #NAME; \
357 (void)yaml_filename; \
358 (void)routine_name; \
360#define DEF_INTERP_METHOD_GET_FUNC(NAME, FUNC) \
361 static void get_interp_method_ ## NAME ( \
362 union yac_interp_stack_config_entry const * interp_stack_entry, \
363 interp_method_parameter_value * parameter_values) { \
364 char const * routine_name = "get_interp_method_" #NAME; \
365 (void)interp_stack_entry; \
366 (void)parameter_values; \
367 (void)routine_name; \
370#define DEF_ENUM_PARAM(NAME, DEFAULT, ...) \
372 .type = ENUM_PARAM, \
374 {.valid_values = CAST_NAME_TYPE_PAIRS(__VA_ARGS__), \
375 .num_valid_values = COUNT_NAME_TYPE_PAIRS(__VA_ARGS__)}, \
376 .default_value.enum_value = (int)(DEFAULT)}
377#define DEF_INT_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX) \
381 {.valid_min = (int)(VALID_MIN), \
382 .valid_max = (int)(VALID_MAX)}, \
383 .default_value.int_value = (int)(DEFAULT)}
384#define DEF_DBLE_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX) \
386 .type = DBLE_PARAM, \
388 {.valid_min = (double)(VALID_MIN), \
389 .valid_max = (double)(VALID_MAX)}, \
390 .default_value.dble_value = (double)(DEFAULT)}
391#define DEF_DEG_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX) \
395 {.valid_min = (double)(VALID_MIN), \
396 .valid_max = (double)(VALID_MAX)}, \
397 .default_value.dble_value = (double)(DEFAULT)}
398#define DEF_BOOL_PARAM(NAME, DEFAULT) \
400 .type = BOOL_PARAM, \
401 .default_value.bool_value = (int)(DEFAULT)}
402#define DEF_STR_PARAM(NAME, DEFAULT, MAX_STR_LEN) \
405 .data.str_param.max_str_len = (MAX_STR_LEN), \
406 .default_value.str_value = (DEFAULT)}
407#define DEF_INTERP_METHOD_PARAM(NAME, ...) \
408 static struct interp_method_parameter \
409 interp_method_parameters_ ## NAME [] = {__VA_ARGS__};
411#define YAML_ASSERT(CHECK, MSG) \
412 YAC_ASSERT_F((CHECK), \
413 "ERROR(%s): " MSG " in YAML configuration file \"%s\"", \
414 routine_name, yaml_filename)
415#define YAML_ASSERT_F(CHECK, MSG, ...) \
416 YAC_ASSERT_F((CHECK), \
417 "ERROR(%s): " MSG " in YAML configuration file \"%s\"", \
418 routine_name, __VA_ARGS__, yaml_filename)
420#define DEF_INTERP_STACK_ADD(NAME, ...) \
421 yac_interp_stack_config_add_ ## NAME ( \
422 interp_stack, __VA_ARGS__);
424#define DEF_INTERP_STACK_ADD_NO_PARAM(NAME) \
425 yac_interp_stack_config_add_ ## NAME ( \
428#define DEF_INTERP_STACK_GET(NAME, ...) \
429 yac_interp_stack_config_entry_get_ ## NAME ( \
430 interp_stack_entry, __VA_ARGS__);
432#define DEF_INTERP_STACK_GET_NO_PARAM(NAME) \
435#define DEF_INTERP_METHOD(NAME, FUNC_ADD, FUNC_GET, ...) \
436 DEF_INTERP_METHOD_ADD_FUNC(NAME, FUNC_ADD) \
437 DEF_INTERP_METHOD_GET_FUNC(NAME, FUNC_GET) \
438 DEF_INTERP_METHOD_PARAM(NAME, __VA_ARGS__)
444 parameters[1].bool_value),
447 &reduction_type, ¶meter_values[1].bool_value)
448 parameter_values[0].enum_value = (int)reduction_type;,
461 parameters[1].bool_value),
465 parameter_values[0].enum_value = (int)
weight_type;,
477 (
size_t)parameters[1].int_value,
478 parameters[2].dble_value,
479 parameters[3].dble_value),
483 &
type, &n, ¶meter_values[2].dble_value,
484 ¶meter_values[3].dble_value)
485 parameter_values[0].enum_value = (int)
type;
486 parameter_values[1].int_value = (int)n;
487 parameter_values[2].dble_value /=
YAC_RAD;,
504 parameters[0].int_value,
505 parameters[1].bool_value,
506 parameters[2].bool_value,
510 ¶meter_values[0].int_value,
511 ¶meter_values[1].bool_value,
512 ¶meter_values[2].bool_value, &normalisation)
513 parameter_values[3].enum_value = (int)normalisation;,
524static void get_spmap_parameters(
525 double * sphere_radius,
char const * filename,
char const * varname,
526 char const * routine_name,
char const * yaml_filename,
char const *
type) {
529 if ((*sphere_radius == 0.0) && (filename == NULL) && (varname == NULL)) {
534 (*sphere_radius != 0.0) ^ ((filename != NULL) || (varname != NULL)),
535 "configurations for the computation and reading of %s cell areas "
536 "were provided (only one is allowed)",
type);
539 (*sphere_radius != 0.0) || ((filename != NULL) && (varname != NULL)),
540 "incomplete information for read of %s cell areas "
541 "(filename: \"%s\" varname: \"%s\")",
542 type, filename?filename:
"missing", varname?varname:
"missing");
547 double src_sphere_radius = parameters[4].dble_value;
548 char const * src_filename = parameters[5].str_value;
549 char const * src_varname = parameters[6].str_value;
550 int src_min_global_id = parameters[7].int_value;
551 double tgt_sphere_radius = parameters[8].dble_value;
552 char const * tgt_filename = parameters[9].str_value;
553 char const * tgt_varname = parameters[10].str_value;
554 int tgt_min_global_id = parameters[11].int_value;
555 get_spmap_parameters(
556 &src_sphere_radius, src_filename, src_varname,
557 routine_name, yaml_filename,
"source");
558 get_spmap_parameters(
559 &tgt_sphere_radius, tgt_filename, tgt_varname,
560 routine_name, yaml_filename,
"target");
562 parameters[0].dble_value,
563 parameters[1].dble_value,
566 src_sphere_radius, src_filename, src_varname, src_min_global_id,
567 tgt_sphere_radius, tgt_filename, tgt_varname, tgt_min_global_id),
571 ¶meter_values[0].dble_value,
572 ¶meter_values[1].dble_value,
574 ¶meter_values[4].dble_value,
577 ¶meter_values[7].int_value,
578 ¶meter_values[8].dble_value,
581 ¶meter_values[11].int_value)
582 parameter_values[0].dble_value /=
YAC_RAD;
583 parameter_values[1].dble_value /=
YAC_RAD;
585 parameter_values[3].enum_value = (int)scale_type;,
602 src_cell_area:
yac:sphere_radius, 0.0, 1e-9, DBL_MAX),
610 tgt_cell_area:
yac:sphere_radius, 0.0, 1e-9, DBL_MAX),
621 parameters[0].dble_value != DBL_MAX,
622 "parameter 'user_value' of interpolation method 'fixed' is unset");
625 ¶meter_values[0].dble_value),
633 "parameter \"filename\" of interpolation method \"user file\" is unset")
667 (
size_t)parameters[0].int_value,
668 parameters[1].dble_value,
669 parameters[2].dble_value),
673 &
type, &n, ¶meter_values[1].dble_value,
674 ¶meter_values[2].dble_value)
677 "ERROR(get_interp_method_nnn): n-nearest-neighbor type missmatch");
678 parameter_values[0].int_value = (int)n;
679 parameter_values[1].dble_value /=
YAC_RAD;
680 parameter_values[3].enum_value = (int)0;,
694 ¶meter_values[0].int_value),
702 "parameter \"func_compute_weights\" "
703 "of interpolation method \"user callback\" is unset")
712#define ADD_INTERPOLATION(NAME, TYPE) \
715 .add_interpolation = add_interp_method_ ## NAME , \
716 .get_interpolation = get_interp_method_ ## NAME , \
717 .parameters = interp_method_parameters_ ## NAME , \
719 sizeof(interp_method_parameters_ ## NAME ) / \
720 sizeof(interp_method_parameters_ ## NAME [0])}
721#define ADD_INTERPOLATION_NO_PARAM(NAME, TYPE) \
724 .add_interpolation = add_interp_method_ ## NAME , \
725 .get_interpolation = get_interp_method_ ## NAME , \
726 .parameters = interp_method_parameters_ ## NAME , \
729struct yac_interpolation_method {
732 void(*add_interpolation)(
735 char const * yaml_filename);
736 void(*get_interpolation)(
740 size_t num_parameters;
760 fy_node_t value_node,
char const *
name,
char const * yaml_filename) {
761 char const * routine_name =
"yaml_parse_string_value";
764 value_node && fy_node_is_scalar(value_node),
765 "unsupported node type for \"%s\" (the node is expected to be scalar)",
768 return fy_node_get_scalar0(value_node);
772 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
773 char const * routine_name =
"yaml_parse_calendar_value";
775 char const * calendar_name =
780 calendar_types, num_calendar_types, calendar_name);
783 calendar_type != INT_MAX,
784 "\"%s\" is not a valid calendar name", calendar_name);
786 return (calendarType)calendar_type;
790 fy_node_t value_node,
char const * key_name,
char const * yaml_filename,
792 char const * routine_name =
"yaml_parse_timestep_value";
797 value_node && fy_node_is_scalar(value_node),
798 "unsupported node type for \"%s\" (the node is expected to be scalar)",
800 char const * timestep =
802 char const * timestep_iso =
806 timestep_iso,
"valid to convert timestep \"%s\" to ISO 8601 format",
809 return strdup(timestep_iso);
813 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
814 char const * routine_name =
"yaml_parse_timestep_unit_value";
816 char const * timestep_unit_str =
821 timestep_units, num_timestep_units, timestep_unit_str);
824 timestep_unit != INT_MAX,
825 "\"%s\" is not a valid time step unit", timestep_unit_str);
831 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
832 char const * routine_name =
"yaml_parse_time_reduction_value";
834 char const * time_reduction_str =
839 time_operations, num_time_operations, time_reduction_str);
842 time_reduction != INT_MAX,
843 "\"%s\" is not a valid time reduction type in", time_reduction_str);
849 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
850 char const * routine_name =
"yaml_parse_integer_value";
852 char const * integer_str =
856 long int long_value = strtol(integer_str, &endptr, 10);
859 (endptr != integer_str) && (*endptr ==
'\0') &&
860 (long_value >= INT_MIN) && (long_value <= INT_MAX),
861 "\"%s\" is not a valid integer value", integer_str);
863 return (
int)long_value;
867 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
868 char const * routine_name =
"yaml_parse_double_value";
870 char const * double_str =
874 double dble_value = strtod(double_str, &endptr);
877 (endptr != double_str) && (*endptr ==
'\0'),
878 "\"%s\" is not a valid double value", double_str);
885 fy_node_t value_node,
char const * key_name,
char const * yaml_filename) {
886 char const * routine_name =
"yaml_parse_enum_value";
888 char const * value_str =
897 "\"%s\" is not a valid enum value for \"%s\" ", value_str, key_name);
903 char const ** interpolation_type_str,
fy_node_t * parameter_node,
904 fy_node_t interp_method_node,
char const * yaml_filename) {
905 char const * routine_name =
"yaml_parse_base_interp_method_node";
908 fy_node_is_scalar(interp_method_node) ||
909 fy_node_is_mapping(interp_method_node),
910 "unsupported interpolation method node type "
911 "(interpolation methods are expected to be defined as either scalar "
914 switch(fy_node_get_type(interp_method_node)) {
917 *interpolation_type_str =
919 interp_method_node,
"interpolation method name", yaml_filename);
920 *parameter_node = NULL;
926 fy_node_mapping_item_count(interp_method_node) == 1,
927 "base interpolation method node is only allowed to have one pair ");
930 fy_node_mapping_get_by_index(interp_method_node, 0);
933 fy_node_pair_key(base_interp_method_pair);
935 *interpolation_type_str =
937 base_interp_method_key_node,
"interpolation method name",
940 fy_node_t base_interp_method_value_node =
941 fy_node_pair_value(base_interp_method_pair);
944 fy_node_is_mapping(base_interp_method_value_node),
945 "unsupported base interpolation method value node type "
946 "for interpolation method \"%s\" "
947 "(interpolation method parameters are expected to be "
948 "defined as maps)", *interpolation_type_str);
950 *parameter_node = base_interp_method_value_node;
958 fy_node_t value_node,
char const * interpolation_name,
959 char const * yaml_filename) {
960 char const * routine_name =
"yaml_parse_interp_method_parameter_value";
969 "unsupported parameter type for interpolation method \"%s\"",
974 switch(parameter->
type) {
977 parameter_value.enum_value =
981 value_node,
"interpolation method enum parameter value",
985 parameter_value.int_value =
987 value_node,
"interpolation method integer parameter value",
992 "\"%d\" is not a valid integer parameter value for parameter \"%s\" "
993 "of interpolation method \"%s\" "
994 "(valid range: %d <= value <= %d)",
995 parameter_value.int_value, parameter->
name, interpolation_name,
1000 parameter_value.dble_value =
1002 value_node,
"interpolation method double parameter value",
1007 "\"%lf\" is not a valid double parameter value for parameter \"%s\" "
1008 "of interpolation method \"%s\" "
1009 "(valid range: %e <= value <= %e)",
1010 parameter_value.dble_value, parameter->
name, interpolation_name,
1015 parameter_value.dble_value =
1017 value_node,
"interpolation method degree parameter value",
1022 "\"%lf\" is not a valid degree parameter value for parameter \"%s\" "
1023 "of interpolation method \"%s\" "
1024 "(valid range: %e <= value <= %e)",
1025 parameter_value.dble_value, parameter->
name, interpolation_name,
1028 parameter_value.dble_value *=
YAC_RAD;
1031 parameter_value.bool_value =
1033 bool_names, num_bool_names, value_node,
1034 "interpolation method bool parameter value", yaml_filename);
1037 parameter_value.str_value =
1039 value_node,
"interpolation method string parameter value",
1042 strlen(parameter_value.str_value) <
1044 "\"%s\" is not a valid string parameter value for parameter \"%s\" "
1045 "of interpolation method \"%s\" "
1046 "(maximum string length: %d)",
1047 parameter_value.str_value, parameter->
name, interpolation_name,
1052 return parameter_value;
1059 char const * parameter_name_prefix,
char const * yaml_filename) {
1060 char const * routine_name =
"yaml_parse_interp_method_parameter";
1062 char const * parameter_name_ =
1064 fy_node_pair_key(parameter_pair),
1065 "interpolation method parameter name", yaml_filename);
1067 char const * parameter_name;
1068 if (parameter_name_prefix) {
1070 xmalloc(strlen(parameter_name_prefix) + strlen(parameter_name_) + 2);
1072 (
char*)parameter_name,
"%s:%s", parameter_name_prefix, parameter_name_);
1074 parameter_name = parameter_name_;
1078 fy_node_pair_value(parameter_pair);
1081 parameter_value_node &&
1082 (fy_node_is_scalar(parameter_value_node) ||
1083 fy_node_is_mapping(parameter_value_node)),
1084 "unsupported parameter node type for interpolation \"%s\" "
1085 "(the node is expected to be either scalar or a map)", interpolation_name);
1087 if (fy_node_is_scalar(parameter_value_node)) {
1090 for (
size_t i = 0; (i < num_parameters) && !found_flag; ++i)
1091 if ((found_flag = !strcmp(parameter_name, parameters[i].
name)))
1092 parameter_values[i] =
1094 ¶meters[i], fy_node_pair_value(parameter_pair),
1095 interpolation_name, yaml_filename);
1099 "\"%s\" is not a valid parameter for interpolation method \"%s\"",
1100 parameter_name, interpolation_name);
1107 while ((pair = fy_node_mapping_iterate(parameter_value_node, &iter)))
1109 parameter_values, parameters, num_parameters, pair, interpolation_name,
1110 parameter_name, yaml_filename);
1113 if (parameter_name_prefix) free((
void*)parameter_name);
1119 fy_node_t parameter_node,
char const * yaml_filename) {
1120 char const * routine_name =
"yaml_parse_interp_method_parameters";
1124 parameter_values[i] =
interp_method->parameters[i].default_value;
1127 if (!parameter_node)
return;
1130 fy_node_is_mapping(parameter_node),
1131 "unsupported interpolation method parameter node type "
1132 "for interpolation method \"%s\" "
1133 "(interpolation method parameters are expected to be defined as maps)",
1139 while ((pair = fy_node_mapping_iterate(parameter_node, &iter)))
1148 fy_node_t interp_method_node,
char const * yaml_filename) {
1149 char const * routine_name =
"yaml_parse_interp_method";
1151 char const * interpolation_type_str;
1155 &interpolation_type_str, ¶meter_node,
1156 interp_method_node, yaml_filename);
1158 struct yac_interpolation_method const *
interp_method = NULL;
1166 "\"%s\" is not a valid interpolation method",
1167 interpolation_type_str);
1170 interp_method_paramter_values[
interp_method->num_parameters];
1173 parameter_node, yaml_filename);
1175 interp_stack, interp_method_paramter_values, yaml_filename);
1180 fy_node_t interp_stack_node,
char const * yaml_filename) {
1181 char const * routine_name =
"yaml_parse_interp_stack_value";
1184 fy_node_is_sequence(interp_stack_node),
1185 "unsupported interpolation stack node type"
1186 "(interpolation stacks are expected to be defined as a sequence)");
1191 while ((interp_stack_item =
1192 fy_node_sequence_iterate(interp_stack_node, &iter)))
1194 interp_stack, interp_stack_item, yaml_filename);
1198 fy_node_t field_node, const char * yaml_filename) {
1199 char const * routine_name =
"yaml_parse_field_name";
1202 fy_node_is_scalar(field_node) ||
1203 fy_node_is_mapping(field_node),
1204 "unsupported field name node type "
1205 "(field name is either scalars or a map)");
1207 struct field_couple_field_names field_name;
1210 if (fy_node_is_scalar(field_node)) {
1219 fy_node_mapping_lookup_scalar0_by_simple_key(
1220 field_node,
"src", (
size_t)-1);
1222 fy_node_mapping_lookup_scalar0_by_simple_key(
1223 field_node,
"tgt", (
size_t)-1);
1226 field_name.src && field_name.tgt &&
1227 (fy_node_mapping_item_count(field_node) == 2),
1228 "invalid field name mapping node "
1229 "(field name mapping node has to contain two maps "
1230 "with the keys \"src\" and \"tgt\")")
1237 char const *** values,
size_t * num_values,
1238 fy_node_t values_node,
char const * sequence_name,
1239 const char * yaml_filename) {
1240 char const * routine_name =
"yaml_parse_string_sequence";
1243 (*values == NULL) && (*num_values == 0),
1244 "values have already been set for sequence \"%s\"",
1248 if (fy_node_is_sequence(values_node)) {
1250 *num_values = (size_t)fy_node_sequence_item_count(values_node);
1251 *values =
xmalloc(*num_values *
sizeof(**values));
1252 for (
size_t value_idx = 0; value_idx < *num_values; ++value_idx)
1253 (*values)[value_idx] =
1255 fy_node_sequence_get_by_index(values_node, value_idx),
1256 sequence_name, yaml_filename);
1259 *values =
xmalloc(
sizeof(**values));
1262 values_node, sequence_name, yaml_filename);
1267 struct field_couple_field_names ** field_names,
1268 size_t * num_field_names,
fy_node_t fields_node,
1269 const char * yaml_filename) {
1272 if (fy_node_is_sequence(fields_node)) {
1274 size_t start_idx = *num_field_names;
1275 *num_field_names += (size_t)fy_node_sequence_item_count(fields_node);
1277 xrealloc(*field_names, *num_field_names *
sizeof(**field_names));
1278 for (
size_t i = start_idx; i < *num_field_names; ++i)
1281 fy_node_sequence_get_by_index(fields_node, i), yaml_filename);
1285 xrealloc(*field_names, *num_field_names *
sizeof(**field_names));
1286 (*field_names)[*num_field_names-1] =
1292 char const ** comp_name,
char const *** grid_names,
size_t * num_grid_names,
1293 fy_node_t values_node,
char const * type_name,
const char * yaml_filename) {
1294 char const * routine_name =
"yaml_parse_comp_grids_names";
1297 *comp_name == NULL,
"%s component name already set", type_name);
1299 (*grid_names == NULL) && (*num_grid_names == 0),
1300 "%s grid names already set", type_name);
1303 fy_node_is_mapping(values_node),
1304 "unsupported component/grid names node type (has to be a map)");
1309 while((pair = fy_node_mapping_iterate(values_node, &iter))) {
1314 yaml_comp_grid_names_keys, num_yaml_comp_grid_names_keys,
1315 fy_node_pair_key(pair),
1316 "component/grid names parameter name", yaml_filename);
1317 char const * comp_grid_names_key_name =
1319 yaml_comp_grid_names_keys, num_yaml_comp_grid_names_keys,
1320 comp_grid_names_key_type);
1322 fy_node_t name_node = fy_node_pair_value(pair);
1324 switch(comp_grid_names_key_type) {
1329 name_node, comp_grid_names_key_name, yaml_filename);
1333 grid_names, num_grid_names,
1334 name_node, comp_grid_names_key_name, yaml_filename);
1348 yaml_couple_keys, num_yaml_couple_keys,
1349 fy_node_pair_key(couple_pair),
1350 "couple configuration parameter name", yaml_filename);
1351 char const * couple_key_name =
1353 yaml_couple_keys, num_yaml_couple_keys, couple_key_type);
1355 fy_node_t value_node = fy_node_pair_value(couple_pair);
1357 switch (couple_key_type) {
1364 value_node, couple_key_name, yaml_filename);
1373 value_node, couple_key_name, yaml_filename);
1380 value_node, couple_key_name, yaml_filename);
1389 value_node, couple_key_name, yaml_filename);
1395 value_node, yaml_filename);
1400 value_node, couple_key_name, yaml_filename, time_unit);
1405 value_node, couple_key_name, yaml_filename);
1410 value_node, couple_key_name, yaml_filename);
1415 value_node, couple_key_name, yaml_filename);
1420 value_node, couple_key_name, yaml_filename);
1425 mapping_sides, num_mapping_sides,
1426 value_node, couple_key_name, yaml_filename);
1431 value_node, couple_key_name, yaml_filename);
1436 value_node, couple_key_name, yaml_filename);
1440 field_buffer->
interp_stack, value_node, yaml_filename);
1447 value_node, couple_key_name, yaml_filename);
1452 value_node, couple_key_name, yaml_filename);
1457 value_node, couple_key_name, yaml_filename);
1465 char const * routine_name =
"yaml_parse_couple";
1468 fy_node_is_mapping(couple_node),
1469 "unsupported couple node type "
1470 "(couples are expected to be defined as a mapping)");
1475 .src.grid.name = NULL,
1476 .src.grid.count = 0,
1477 .tgt.comp_name = NULL,
1478 .tgt.grid.name = NULL,
1479 .tgt.grid.count = 0,
1480 .field_names = NULL,
1481 .num_field_names = 0,
1482 .coupling_period = NULL,
1487 .weight_file_name = NULL,
1488 .mapping_on_source = 1,
1489 .scale_factor = 1.0,
1490 .scale_summand = 0.0,
1491 .src_mask_names = NULL,
1492 .num_src_mask_names = 0,
1493 .tgt_mask_name = NULL,
1494 .yaxt_exchanger_name = NULL};
1499 while ((pair = fy_node_mapping_iterate(couple_node, &iter)))
1501 &field_buffer, pair, yaml_filename, time_unit);
1504 field_buffer.
src.
comp_name,
"missing source component name");
1507 "missing source grid name (component \"%s\")",
1509 for (
size_t i = 0; i < field_buffer.
src.
grid.
count; ++i)
1513 "invalid source grid name (component \"%s\" grid idx %zu)",
1517 "missing target component name");
1520 "missing target grid name (component \"%s\")",
1522 for (
size_t i = 0; i < field_buffer.
tgt.
grid.
count; ++i)
1526 "invalid target grid name (component \"%s\" grid idx %zu)",
1530 "missing field names "
1531 "(source component \"%s\" source grid \"%s\" "
1532 "target component \"%s\" target grid \"%s\")",
1537 "missing coupling period "
1538 "(source component \"%s\" source grid \"%s\" "
1539 "target component \"%s\" target grid \"%s\")",
1544 for (
size_t j = 0; j < field_buffer.
src.
grid.
count; ++j)
1545 for (
size_t k = 0; k < field_buffer.
tgt.
grid.
count; ++k)
1579 fy_node_t coupling_node,
char const * yaml_filename,
1581 char const * routine_name =
"yaml_parse_coupling";
1584 if (!coupling_node)
return;
1587 fy_node_is_sequence(coupling_node),
1588 "unsupported coupling node type "
1589 "(couplings are expected to be defined as a sequence)");
1594 while ((couple_node = fy_node_sequence_iterate(coupling_node, &iter)))
1599 fy_node_t config_file_node, char const * file_type_name,
1600 const char * yaml_filename) {
1601 char const * routine_name =
"yaml_parse_config_file_value";
1604 fy_node_is_scalar(config_file_node) ||
1605 fy_node_is_mapping(config_file_node),
1606 "unsupported config file node type "
1607 "(%s is either scalar or a map)", file_type_name);
1609 struct debug_config_file config_file =
1612 char * str_buffer =
xmalloc(strlen(file_type_name) + 32);
1615 if (fy_node_is_scalar(config_file_node)) {
1620 strcat(strcpy(str_buffer, file_type_name),
" name"),
1627 fy_node_mapping_lookup_by_string(
1628 config_file_node,
"filename", (
size_t)-1);
1630 fy_node_mapping_lookup_by_string(
1631 config_file_node,
"filetype", (
size_t)-1);
1633 fy_node_mapping_lookup_by_string(
1634 config_file_node,
"include_definitions", (
size_t)-1);
1638 "invalid %s mapping node "
1639 "(global config file mapping node has to include a map "
1640 "with the keys \"filename\")", file_type_name)
1644 filename_node, strcat(strcpy(str_buffer, file_type_name),
" name"),
1650 config_filetypes, num_config_filetypes,
1651 filetype_node, strcat(strcpy(str_buffer, file_type_name),
" type"),
1653 config_file.include_definitions =
1654 (include_definitions_node)?
1656 bool_names, num_bool_names,
1657 include_definitions_node,
1658 strcat(strcpy(str_buffer, file_type_name),
" include definitions"),
1663 config_file.name,
"missing filename for %s", file_type_name);
1672 fy_node_pair_t config_file_pair,
char const * config_file_type_name,
1673 const char * yaml_filename) {
1676 debug_sync_loc_key_type =
1679 yaml_debug_sync_loc_keys,
1680 num_yaml_debug_sync_loc_keys,
1681 fy_node_pair_key(config_file_pair),
1682 "config synchronisation location parameter name",
1684 char const * debug_sync_loc_key_name =
1686 yaml_debug_sync_loc_keys, num_yaml_debug_sync_loc_keys,
1687 debug_sync_loc_key_type);
1689 fy_node_t value_node = fy_node_pair_value(config_file_pair);
1691 char config_file_type_name_sync[
1692 strlen(config_file_type_name) + strlen(debug_sync_loc_key_name) + 8];
1694 config_file_type_name_sync,
"%s (%s)",
1695 config_file_type_name, debug_sync_loc_key_name);
1697 config_file_buffer->
config_file[debug_sync_loc_key_type] =
1699 value_node, config_file_type_name_sync, yaml_filename);
1703 fy_node_t config_file_node, char const * config_file_type_name,
1704 char const * yaml_filename) {
1705 char const * routine_name =
"yaml_parse_debug_config_file_buffer";
1708 fy_node_is_mapping(config_file_node),
1709 "unsupported %s node type "
1710 "(%s is expected to be defined as a mapping)",
1711 config_file_type_name, config_file_type_name);
1726 "invalid unsupported synchronisation location (%d) for %s",
1727 i, config_file_type_name);
1733 while ((pair = fy_node_mapping_iterate(config_file_node, &iter)))
1735 &config_file_buffer, pair, config_file_type_name, yaml_filename);
1737 return config_file_buffer;
1742 char const * yaml_filename) {
1743 char const * routine_name =
"yaml_parse_debug_global_config";
1745 char const * config_file_type_name =
"debug global config file";
1748 fy_node_is_mapping(global_config_node),
1749 "unsupported %s node type "
1750 "(%s is expected to be defined as a mapping)",
1751 config_file_type_name, config_file_type_name);
1755 global_config_node, config_file_type_name, yaml_filename);
1768 char const ** grid_name,
char const ** file_name,
1774 yaml_debug_output_grid_keys, num_yaml_debug_output_grid_keys,
1775 fy_node_pair_key(output_grid_pair),
1776 "output grid parameter name", yaml_filename);
1777 char const * debug_output_key_name =
1779 yaml_debug_output_grid_keys, num_yaml_debug_output_grid_keys,
1780 output_grid_key_type);
1782 fy_node_t value_node = fy_node_pair_value(output_grid_pair);
1784 switch(output_grid_key_type) {
1801 char const * yaml_filename) {
1802 char const * routine_name =
"yaml_parse_output_grid";
1805 fy_node_is_mapping(output_grid_node),
1806 "unsupported output grid node type "
1807 "(output grids are expected to be defined as a mapping)");
1809 char const * grid_name = NULL;
1810 char const * file_name = NULL;
1815 while ((pair = fy_node_mapping_iterate(output_grid_node, &iter)))
1819 YAML_ASSERT_F(file_name,
"missing file name for grid \"%s\"", grid_name);
1823 couple_config, grid_name, file_name);
1828 char const * yaml_filename) {
1829 char const * routine_name =
"yaml_parse_debug_output_grids";
1832 fy_node_is_sequence(output_grids_node),
1833 "unsupported debug output grids node type "
1834 "(debug output grids is expected to be defined as a sequence)");
1839 while ((output_grid_node =
1840 fy_node_sequence_iterate(output_grids_node, &iter)))
1842 couple_config, output_grid_node, yaml_filename);
1847 const char * yaml_filename) {
1852 yaml_debug_keys, num_yaml_debug_keys,
1853 fy_node_pair_key(debug_pair),
1854 "debug configuration parameter name", yaml_filename);
1856 fy_node_t value_node = fy_node_pair_value(debug_pair);
1858 switch (debug_key_type) {
1862 couple_config, value_node, yaml_filename);
1866 couple_config, value_node, yaml_filename);
1872 bool_names, num_bool_names, value_node,
1873 "\"missing definition is fatal\" bool value", yaml_filename));
1880 fy_node_t debug_node,
char const * yaml_filename) {
1881 char const * routine_name =
"yaml_parse_debug";
1884 if (!debug_node)
return;
1887 fy_node_is_mapping(debug_node),
1888 "unsupported debug node type "
1889 "(debug is expected to be defined as a mapping)");
1894 while ((pair = fy_node_mapping_iterate(debug_node, &iter)))
1901 char const ** start_datetime,
char const ** end_datetime) {
1902 char const * routine_name =
"yaml_parse_base_map_pair";
1904 fy_node_t key_node = fy_node_pair_key(base_pair);
1907 fy_node_is_scalar(key_node),
1908 "unsupported key node type "
1909 "(key nodes are expected to be scalar nodes)");
1911 char const * base_key_name = fy_node_get_scalar0(key_node);
1914 yaml_base_keys, num_yaml_base_keys, base_key_name);
1917 (base_key_type == INT_MAX) ||
1923 (base_key_type ==
DEBUG),
1924 "unsupported base key name \"%s\"",
1927 fy_node_t value_node = fy_node_pair_value(base_pair);
1929 switch (base_key_type) {
1933 value_node, base_key_name, yaml_filename);
1938 value_node, base_key_name, yaml_filename);
1943 value_node, base_key_name, yaml_filename));
1948 value_node, base_key_name, yaml_filename);
1951 "inconsistent redefinition of time unit")
1952 *time_unit = time_unit_;
1958 "time unit has to be defined before the couplings")
1960 couple_config, value_node, yaml_filename, *time_unit);
1964 couple_config, value_node, yaml_filename);
1973 const char * yaml_filename) {
1974 char const * routine_name =
"yaml_parse_document";
1977 fy_node_t root_node = fy_document_root(document);
1980 if (!root_node)
return;
1983 fy_node_is_mapping(root_node),
1984 "unsupported root node type (root node is expected to be a mapping node)");
1986 char const * start_datetime = NULL;
1987 char const * end_datetime = NULL;
1993 while ((pair = fy_node_mapping_iterate(root_node, &iter)))
1995 couple_config, pair, yaml_filename, &time_unit,
1996 &start_datetime, &end_datetime);
1998 if ((start_datetime != NULL) || (end_datetime != NULL)) {
2002 "ERROR(yaml_parse_document): "
2003 "cannot set start/end datetime because calendar has not yet been set");
2006 couple_config, start_datetime, end_datetime);
2013 char const * routine_name =
"yac_yaml_read_coupling";
2018 "ERROR(%s): YAML configuration file could not be found \"%s\"",
2019 routine_name, yaml_filename);
2025 "ERROR(%s): could not open YAML configuration file \"%s\"",
2026 routine_name, yaml_filename);
2029 struct fy_parse_cfg parse_config =
2030 {.search_path =
".",
2033 parse_config.flags =
2034 (
enum fy_parse_cfg_flags)parse_flags;
2037 fy_document_build_from_fp(&parse_config, config_file);
2040 "ERROR(%s): could not parse YAML configuration file \"%s\"",
2041 routine_name, yaml_filename);
2045 !fy_document_resolve(document),
2046 "could not resolve anchors and merge keys");
2052 fy_document_destroy(document);
2060 char const * str_interp_stack_config,
int parse_flags) {
2061 char const * routine_name =
2062 "yac_yaml_parse_interp_stack_config_string";
2063 char const * yaml_filename =
2064 "user provided interp stack config string";
2067 str_interp_stack_config != NULL,
"interpolation stack string is NULL");
2070 struct fy_parse_cfg parse_config =
2071 {.search_path =
".",
2074 parse_config.flags =
2075 (
enum fy_parse_cfg_flags)parse_flags;
2078 fy_document_build_from_string(
2079 &parse_config, str_interp_stack_config, (
size_t)-1);
2084 !fy_document_resolve(document),
2085 "could not resolve anchors and merge keys");
2087 fy_node_t interp_stack_config_node = fy_document_root(document);
2088 YAML_ASSERT(interp_stack_config_node,
"invalid root node");
2094 interp_stack_config, interp_stack_config_node,
2098 fy_document_destroy(document);
2100 return interp_stack_config;
2110 fy_node_create_scalar_copy(document,
value, strlen(
value));
2113 "ERROR(yac_yaml_create_scalar): failed to create scalar node");
2124 (value_size >= 0) && ((
size_t)value_size <
sizeof(
str_value)),
2125 "ERROR(yac_yaml_create_scalar_int): "
2126 "could not write \"%d\" to string buffer of size %zu",
2138 (value_size >= 0) && ((
size_t)value_size <
sizeof(
str_value)),
2139 "ERROR(yac_yaml_create_scalar_dble): "
2140 "could not write \"%g\" to string buffer of size %zu",
2147 fy_document_t document,
char const *
const * values,
size_t num_values) {
2150 if (num_values == 0)
return (
fy_node_t)NULL;
2153 values,
"ERROR(yac_yaml_create_sequence_scalar): no values provided");
2156 fy_node_t sequence_node = fy_node_create_sequence(document);
2158 sequence_node,
"ERROR(yac_yaml_create_sequence_scalar): "
2159 "failed to create sequence node");
2161 for (
size_t value_idx = 0; value_idx < num_values; ++value_idx) {
2162 char const *
value = values[value_idx];
2164 value,
"ERROR(yac_yaml_create_sequence_scalar): "
2165 "invalid value at idx %zu", value_idx);
2166 int appending_failed =
2167 fy_node_sequence_append(
2170 !appending_failed,
"ERROR(yac_yaml_create_sequence_scalar): "
2171 "failed to append interpolation node");
2174 return sequence_node;
2184 key,
"ERROR(yac_yaml_map_append): NULL key is not supported");
2189 "ERROR(yac_yaml_map_append): failed to get document from node");
2192 int appending_failed =
2193 fy_node_mapping_append(
2197 "ERROR(yac_yaml_map_append): failed to append mapping node pair");
2205 document,
"ERROR(yac_yaml_map_append_scalar): "
2206 "failed to get document from node");
2216 document,
"ERROR(yac_yaml_map_append_scalar_int): "
2217 "failed to get document from node");
2228 document,
"ERROR(yac_yaml_map_append_scalar_dble): "
2229 "failed to get document from node");
2237 size_t couple_idx,
size_t field_couple_idx) {
2239 const char * src_field_name;
2240 const char * tgt_field_name;
2242 couple_config, couple_idx, field_couple_idx,
2243 &src_field_name, &tgt_field_name);
2246 if (!strcmp(src_field_name, tgt_field_name))
2250 fy_node_t field_name_node = fy_node_create_mapping(document);
2252 field_name_node,
"ERROR(yac_yaml_create_field_name_node): "
2253 "failed to create mapping node");
2261 return field_name_node;
2276 "ERROR(yac_yaml_map_append_parameter): unsupported parameter type");
2278 char const *
key = parameter->
name;
2280 switch (parameter->
type) {
2304 bool_names, num_bool_names,
value.bool_value));
2326 "ERROR(compare_parameter_values): "
2327 "invalid interpolation method parameter value type");
2333 (a->enum_value > b->enum_value) - (a->enum_value < b->enum_value);
2336 (a->int_value > b->int_value) - (a->int_value < b->int_value);
2340 (a->dble_value > b->dble_value) - (a->dble_value < b->dble_value);
2343 (a->bool_value > b->bool_value) - (a->bool_value < b->bool_value);
2345 if ((a->str_value != NULL) && (b->str_value != NULL))
2346 return strcmp(a->str_value, b->str_value);
2348 return (a->str_value != NULL) - (b->str_value != NULL);
2359 struct yac_interpolation_method const *
interp_method = NULL;
2370 parameter_values[
MAX(num_parameters,1)];
2371 for (
size_t param_idx = 0; param_idx < num_parameters; ++param_idx)
2372 parameter_values[param_idx] = parameters[param_idx].
default_value;
2374 interp_method->get_interpolation(interp_stack_entry, parameter_values);
2377 fy_node_t parameter_node = fy_node_create_mapping(document);
2379 parameter_node,
"ERROR(yac_yaml_create_interpolation_node): "
2380 "failed to create mapping node");
2382 size_t num_non_default_parameters = 0;
2383 for (
size_t param_idx = 0; param_idx < num_parameters; ++param_idx) {
2386 parameter_values + param_idx, parameters[param_idx].
type)) {
2387 ++num_non_default_parameters;
2389 parameter_node, parameters + param_idx,
2390 parameter_values[param_idx]);
2395 if (num_non_default_parameters) {
2398 interpolation_node = fy_node_create_mapping(document);
2400 interpolation_node,
"ERROR(yac_yaml_create_interpolation_node): "
2401 "failed to create mapping node");
2408 fy_node_free(parameter_node);
2410 interpolation_node =
2414 return interpolation_node;
2419 size_t couple_idx,
size_t field_couple_idx) {
2423 couple_config, couple_idx, field_couple_idx);
2426 interp_stack,
"ERROR(yac_yaml_create_interpolation_stack_node): "
2427 "invalid interpolation stack");
2430 fy_node_t interp_stack_node = fy_node_create_sequence(document);
2432 interp_stack_node,
"ERROR(yac_yaml_create_interpolation_stack_node): "
2433 "failed to create sequence node");
2435 size_t interp_stack_size =
2438 interp_stack_size,
"ERROR(yac_yaml_create_interpolation_stack_node): "
2439 "invalid interpolation stack size");
2441 for (
size_t interp_stack_idx = 0; interp_stack_idx < interp_stack_size;
2442 ++interp_stack_idx) {
2443 int appending_failed =
2444 fy_node_sequence_append(
2449 interp_stack, interp_stack_idx)));
2452 "ERROR(yac_yaml_create_interpolation_stack_node): "
2453 "failed to append interpolation node");
2456 return interp_stack_node;
2461 size_t couple_idx,
size_t field_couple_idx) {
2465 document,
"ERROR(yac_yaml_append_couple_field_nodes): "
2466 "failed to get document from node");
2469 fy_node_t field_couple_node = fy_node_create_mapping(document);
2471 coupling_node,
"ERROR(yac_yaml_append_couple_field_nodes): "
2472 "failed to create mapping node");
2475 char const * src_component_name;
2476 char const * tgt_component_name;
2478 couple_config, couple_idx, field_couple_idx,
2479 &src_component_name, &tgt_component_name);
2486 src_component_name);
2493 tgt_component_name);
2496 char const * src_grid_name;
2497 char const * tgt_grid_name;
2499 couple_config, couple_idx, field_couple_idx,
2500 &src_grid_name, &tgt_grid_name);
2506 yaml_couple_keys, num_yaml_couple_keys,
SOURCE_GRID),
2513 yaml_couple_keys, num_yaml_couple_keys,
TARGET_GRID),
2520 yaml_couple_keys, num_yaml_couple_keys,
FIELD),
2522 document, couple_config, couple_idx, field_couple_idx));
2530 couple_config, couple_idx, field_couple_idx));
2538 time_operations, num_time_operations,
2540 couple_config, couple_idx, field_couple_idx)));
2546 yaml_couple_keys, num_yaml_couple_keys,
SOURCE_LAG),
2548 couple_config, couple_idx, field_couple_idx));
2554 yaml_couple_keys, num_yaml_couple_keys,
TARGET_LAG),
2556 couple_config, couple_idx, field_couple_idx));
2560 couple_config, couple_idx, field_couple_idx))
2566 couple_config, couple_idx, field_couple_idx));
2574 mapping_sides, num_mapping_sides,
2576 couple_config, couple_idx, field_couple_idx)));
2584 couple_config, couple_idx, field_couple_idx));
2592 couple_config, couple_idx, field_couple_idx));
2600 document, couple_config, couple_idx, field_couple_idx));
2603 char const *
const * src_mask_names;
2604 size_t num_src_mask_names;
2606 couple_config, couple_idx, field_couple_idx,
2607 &src_mask_names, &num_src_mask_names);
2608 if (num_src_mask_names == 1)
2614 else if (num_src_mask_names > 1)
2620 document, src_mask_names, num_src_mask_names));
2623 char const * tgt_mask_name =
2625 couple_config, couple_idx, field_couple_idx);
2634 char const * yaxt_exchanger_name =
2636 couple_config, couple_idx, field_couple_idx);
2637 if (yaxt_exchanger_name)
2642 yaxt_exchanger_name);
2644 int appending_failed =
2645 fy_node_sequence_append(coupling_node, field_couple_node);
2648 "ERROR(yac_yaml_append_couple_field_nodes): "
2649 "failed to append field couple node");
2654 size_t couple_idx) {
2656 size_t num_couple_fields =
2659 for (
size_t field_couple_idx = 0;
2660 field_couple_idx < num_couple_fields; ++field_couple_idx)
2662 coupling_node, couple_config, couple_idx, field_couple_idx);
2666 fy_document_t document,
char const * grid_name,
char const * file_name) {
2668 fy_node_t output_grid_node = fy_node_create_mapping(document);
2670 output_grid_node,
"ERROR(yac_yaml_create_output_grid_node): "
2671 "failed to create mapping node");
2676 yaml_debug_output_grid_keys, num_yaml_debug_output_grid_keys,
2682 yaml_debug_output_grid_keys, num_yaml_debug_output_grid_keys,
2686 return output_grid_node;
2693 size_t num_output_grids = 0;
2696 for (
size_t grid_idx = 0; grid_idx <
num_grids; ++grid_idx)
2704 if (num_output_grids > 0) {
2707 output_grids_node = fy_node_create_sequence(document);
2709 output_grids_node,
"ERROR(yac_yaml_create_output_grids_node): "
2710 "failed to create sequence node");
2713 for (
size_t grid_idx = 0; grid_idx <
num_grids; ++grid_idx) {
2715 char const * grid_name =
2717 char const * file_name =
2720 if (file_name != NULL) {
2721 int appending_failed =
2722 fy_node_sequence_append(
2726 !appending_failed,
"ERROR(yac_yaml_create_output_grids_node): "
2727 "failed to append output grid node");
2732 return output_grids_node;
2739 fy_node_t debug_node = fy_node_create_mapping(document);
2741 debug_node,
"ERROR(yac_yaml_create_debug_node): "
2742 "failed to create mapping node");
2755 yaml_debug_keys, num_yaml_debug_keys,
MISSING_DEF),
2757 bool_names, num_bool_names,
2766 size_t num_couples =
2769 if (!num_couples)
return NULL;
2772 fy_node_t coupling_node = fy_node_create_sequence(document);
2774 coupling_node,
"ERROR(yac_yaml_create_coupling_node): "
2775 "failed to create sequence node");
2778 for (
size_t couple_idx = 0; couple_idx < num_couples; ++couple_idx)
2780 coupling_node, couple_config, couple_idx);
2782 return coupling_node;
2787 size_t component_idx,
size_t field_idx) {
2789 fy_node_t field_node = fy_node_create_mapping(document);
2791 field_node,
"ERROR(yac_yaml_create_field_node): "
2792 "failed to create mapping node");
2795 char const * component_name =
2797 couple_config, component_idx);
2798 char const * field_name =
2800 couple_config, component_idx, field_idx);
2801 char const * grid_name =
2803 couple_config, component_idx, field_idx);
2804 char const * metadata =
2806 couple_config, component_name, grid_name, field_name);
2807 size_t collection_size =
2809 couple_config, component_name, grid_name, field_name);
2810 char const * timestep =
2812 couple_config, component_name, grid_name, field_name);
2815 couple_config, component_name, grid_name, field_name);
2816 double frac_mask_fallback_value =
2818 couple_config, component_name, grid_name, field_name);
2831 if (collection_size != SIZE_MAX)
2833 field_node,
"collection_size", (
int)collection_size);
2848 field_node,
"frac_mask_fallback_value", frac_mask_fallback_value);
2855 size_t component_idx) {
2860 if (num_fields == 0)
return (
fy_node_t)NULL;
2862 fy_node_t fields_node = fy_node_create_sequence(document);
2864 fields_node,
"ERROR(yac_yaml_create_fields_node): "
2865 "failed to create sequence node");
2867 for (
size_t field_idx = 0; field_idx < num_fields; ++field_idx) {
2869 int appending_failed =
2870 fy_node_sequence_append(
2873 document, couple_config, component_idx, field_idx));
2875 !appending_failed,
"ERROR(yac_yaml_create_fields_node): "
2876 "failed to append field node");
2884 size_t component_idx) {
2886 fy_node_t component_node = fy_node_create_mapping(document);
2888 component_node,
"ERROR(yac_yaml_create_component_node): "
2889 "failed to create mapping node");
2892 char const * component_name =
2894 char const * metadata =
2898 document, couple_config, component_idx);
2910 return component_node;
2922 fy_node_t components_node = fy_node_create_sequence(document);
2924 components_node,
"ERROR(yac_yaml_create_components_node): "
2925 "failed to create sequence node");
2930 int appending_failed =
2931 fy_node_sequence_append(
2935 !appending_failed,
"ERROR(yac_yaml_create_components_node): "
2936 "failed to append component node");
2939 return components_node;
2946 fy_node_t grid_node = fy_node_create_mapping(document);
2948 grid_node,
"ERROR(yac_yaml_create_grid_node): "
2949 "failed to create mapping node");
2952 char const * grid_name =
2954 char const * metadata =
2976 fy_node_t grids_node = fy_node_create_sequence(document);
2978 grids_node,
"ERROR(yac_yaml_create_grids_node): "
2979 "failed to create sequence node");
2981 for (
size_t grids_idx = 0; grids_idx <
num_grids; ++grids_idx) {
2983 int appending_failed =
2984 fy_node_sequence_append(
2988 !appending_failed,
"ERROR(yac_yaml_create_grids_node): "
2989 "failed to append grid node");
2999 fy_node_t definition_node = fy_node_create_mapping(document);
3002 "ERROR(yac_yaml_create_definitions_node): "
3003 "failed to create mapping node");
3014 return definition_node;
3019 int include_definitions) {
3022 fy_node_t root_node = fy_node_create_mapping(document);
3025 "ERROR(yac_yaml_create_couple_config_nodes): "
3026 "failed to create mapping node");
3032 yaml_base_keys, num_yaml_base_keys,
DEBUG),
3036 if (include_definitions)
3038 root_node,
"definitions",
3046 yaml_base_keys, num_yaml_base_keys,
START_DATE), start_datetime);
3047 free(start_datetime);
3054 yaml_base_keys, num_yaml_base_keys,
END_DATE), end_datetime);
3061 yaml_base_keys, num_yaml_base_keys,
CALENDAR),
3063 calendar_types, num_calendar_types, getCalendarType()));
3077 yaml_base_keys, num_yaml_base_keys,
COUPLING),
3085 int include_definitions) {
3090 document,
"ERROR(yac_yaml_emit): failed to create document");
3095 document, couple_config, include_definitions);
3098 int setting_root_failed =
3099 fy_document_set_root(document, root_node);
3101 !setting_root_failed,
3102 "ERROR(yac_yaml_emit): failed to add root node to document");
3105 char * str_document =
3106 fy_emit_document_to_string(
3107 document, (
enum fy_emitter_cfg_flags)emit_flags);
3110 str_document,
"ERROR(yac_yaml_emit): failed to emit document to string");
3113 fy_document_destroy(document);
3115 return str_document;
static double yaml_parse_double_value(fy_node_t value_node, char const *key_name, char const *yaml_filename)
yaml_debug_sync_loc_key_types
#define DEF_DEG_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
#define DEF_ENUM_PARAM(NAME, DEFAULT,...)
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)
#define DEF_INTERP_STACK_GET_NO_PARAM(NAME)
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)
#define DEF_STR_PARAM(NAME, DEFAULT, MAX_STR_LEN)
#define DEF_INTERP_STACK_ADD_NO_PARAM(NAME)
struct yac_interp_stack_config * yac_yaml_parse_interp_stack_config_string(char const *str_interp_stack_config, int parse_flags)
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 yac_yaml_append_couple_nodes(fy_node_t coupling_node, struct yac_couple_config *couple_config, size_t couple_idx)
interp_method_parameter_value
static fy_node_t yac_yaml_create_scalar_dble(fy_document_t document, double 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)
#define DEF_INTERP_STACK_ADD(NAME,...)
static fy_node_t yac_yaml_create_interpolation_node(fy_document_t document, union yac_interp_stack_config_entry const *interp_stack_entry)
struct fy_node_pair * fy_node_pair_t
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)
interp_method_parameter_value_type
static calendarType yaml_parse_calendar_value(fy_node_t value_node, char const *key_name, char const *yaml_filename)
static fy_node_t yac_yaml_create_grids_node(fy_document_t document, struct yac_couple_config *couple_config)
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_string_sequence(char const ***values, size_t *num_values, fy_node_t values_node, char const *sequence_name, const char *yaml_filename)
static fy_node_t yac_yaml_create_output_grids_node(fy_document_t document, struct yac_couple_config *couple_config)
static int compare_parameter_values(interp_method_parameter_value const *a, interp_method_parameter_value const *b, enum interp_method_parameter_value_type type)
int const YAC_YAML_PARSER_JSON_AUTO
char * yac_yaml_emit_coupling(struct yac_couple_config *couple_config, int emit_flags, int include_definitions)
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_couple_config_nodes(fy_document_t document, struct yac_couple_config *couple_config, int include_definitions)
static fy_node_t yac_yaml_create_grid_node(fy_document_t document, struct yac_couple_config *couple_config, size_t grid_idx)
static void yac_yaml_map_append_scalar_dble(fy_node_t map, char const *key, double value)
static void yaml_parse_document(struct yac_couple_config *couple_config, fy_document_t document, const char *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)
int const YAC_YAML_EMITTER_DEFAULT
emit to YAML format
void yac_yaml_read_coupling(struct yac_couple_config *couple_config, const char *yaml_filename, int parse_flags)
static int yaml_parse_integer_value(fy_node_t value_node, char const *key_name, 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)
int const YAC_YAML_EMITTER_JSON
emit to JSON format
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 void yac_yaml_map_append_scalar(fy_node_t map, char const *key, char const *value)
struct fy_document * fy_document_t
int const YAC_YAML_PARSER_DEFAULT
default parse flags (YAML format)
static fy_node_t yac_yaml_create_output_grid_node(fy_document_t document, char const *grid_name, char const *file_name)
#define DEF_INTERP_STACK_GET(NAME,...)
static struct field_couple_field_names yaml_parse_field_name(fy_node_t field_node, const char *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)
char *parameters[0] str_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 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)
#define ADD_INTERPOLATION(NAME, TYPE)
#define DEF_DBLE_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
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)
#define DEF_NAME_TYPE_PAIR(NAME, TYPE)
#define YAML_ASSERT_F(CHECK, MSG,...)
static fy_node_t yac_yaml_create_component_node(fy_document_t document, struct yac_couple_config *couple_config, size_t component_idx)
static void yac_yaml_map_append_parameter(fy_node_t map, struct interp_method_parameter const *parameter, interp_method_parameter_value value)
yaml_debug_output_grid_key_types
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 fy_node_t yac_yaml_create_coupling_node(fy_document_t document, struct yac_couple_config *couple_config)
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)
#define DEF_INT_PARAM(NAME, DEFAULT, VALID_MIN, VALID_MAX)
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 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 enum yac_reduction_type yaml_parse_time_reduction_value(fy_node_t value_node, char const *key_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)
#define DEF_INTERP_METHOD(NAME, FUNC_ADD, FUNC_GET,...)
char const * yac_time_to_ISO(char const *time, enum yac_time_unit_type time_unit)
int const YAC_YAML_PARSER_JSON_FORCE
assume JSON format
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 yaml_parse_interp_stack_value(struct yac_interp_stack_config *interp_stack, fy_node_t interp_stack_node, char const *yaml_filename)
static fy_node_t yac_yaml_create_debug_node(fy_document_t document, struct yac_couple_config *couple_config)
struct fy_node * fy_node_t
static void yaml_parse_debug(struct yac_couple_config *couple_config, fy_node_t debug_node, char const *yaml_filename)
static void yac_yaml_map_append(fy_node_t map, char const *key, fy_node_t value)
static fy_node_t yac_yaml_create_sequence_scalar(fy_document_t document, char const *const *values, size_t num_values)
const interpolation_methods[]
static char const * yaml_parse_string_value(fy_node_t value_node, char const *name, 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 yac_yaml_map_append_scalar_int(fy_node_t map, char const *key, int value)
#define ADD_INTERPOLATION_NO_PARAM(NAME, TYPE)
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)
#define YAML_ASSERT(CHECK, MSG)
static fy_node_t yac_yaml_create_fields_node(fy_document_t document, struct yac_couple_config *couple_config, size_t component_idx)
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)
enum yac_interp_ncc_weight_type weight_type
static void yaml_parse_interp_method(struct yac_interp_stack_config *interp_stack, fy_node_t interp_method_node, char const *yaml_filename)
#define DEF_NAME_TYPE_PAIRS(NAME,...)
yaml_comp_grid_names_key_types
static fy_node_t yac_yaml_create_scalar(fy_document_t document, char const *value)
static void yaml_parse_output_grid(struct yac_couple_config *couple_config, fy_node_t output_grid_node, char const *yaml_filename)
static fy_node_t yac_yaml_create_scalar_int(fy_document_t document, int 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)
#define DEF_BOOL_PARAM(NAME, DEFAULT)
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)
@ NUM_INTERPOLATION_METHODS
static fy_node_t yac_yaml_create_definitions_node(fy_document_t document, struct yac_couple_config *couple_config)
char const * yac_couple_config_get_yaxt_exchanger_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
size_t yac_couple_config_get_num_fields(struct yac_couple_config *couple_config, size_t component_idx)
void yac_couple_config_get_field_grid_names(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_grid_name, char const **tgt_grid_name)
const char * yac_couple_config_grid_get_output_filename(struct yac_couple_config *couple_config, const char *grid_name)
char * yac_couple_config_get_start_datetime(struct yac_couple_config *couple_config)
void yac_couple_config_set_datetime(struct yac_couple_config *couple_config, char const *start, char const *end)
char const * yac_couple_config_get_field_timestep(struct yac_couple_config *couple_config, char const *component_name, char const *grid_name, char const *field_name)
int yac_couple_config_mapping_on_source(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
int yac_couple_config_get_field_role(struct yac_couple_config *couple_config, char const *component_name, char const *grid_name, char const *field_name)
char const * yac_couple_config_get_coupling_period(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
struct yac_interp_stack_config * yac_couple_config_get_interp_stack(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
char const * yac_couple_config_get_field_name(struct yac_couple_config *couple_config, size_t component_idx, size_t field_idx)
size_t yac_couple_config_get_field_collection_size(struct yac_couple_config *couple_config, char const *component_name, char const *grid_name, char const *field_name)
size_t yac_couple_config_get_num_couple_fields(struct yac_couple_config *couple_config, size_t couple_idx)
void yac_couple_config_get_src_mask_names(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, char const *const **mask_names, size_t *num_mask_names)
size_t yac_couple_config_get_num_couples(struct yac_couple_config *couple_config)
int yac_couple_config_get_target_lag(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_def_couple(struct yac_couple_config *couple_config, char const *src_comp_name, char const *src_grid_name, char const *src_field_name, char const *tgt_comp_name, char const *tgt_grid_name, char const *tgt_field_name, char const *coupling_period, int time_reduction, struct yac_interp_stack_config *interp_stack, int src_lag, int tgt_lag, const char *weight_file_name, int mapping_on_source, double scale_factor, double scale_summand, size_t num_src_mask_names, char const *const *src_mask_names, char const *tgt_mask_name, char const *yaxt_exchanger_name)
double yac_couple_config_get_frac_mask_fallback_value(struct yac_couple_config *couple_config, char const *component_name, char const *grid_name, char const *field_name)
int yac_couple_config_get_source_lag(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
const char * yac_couple_config_field_get_metadata(struct yac_couple_config *couple_config, const char *comp_name, const char *grid_name, const char *field_name)
const char * yac_couple_config_grid_get_metadata(struct yac_couple_config *couple_config, const char *grid_name)
const char * yac_couple_config_component_get_metadata(struct yac_couple_config *couple_config, const char *comp_name)
double yac_couple_config_get_scale_factor(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
char const * yac_couple_config_get_tgt_mask_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_add_grid(struct yac_couple_config *couple_config, char const *name)
char const * yac_couple_config_get_grid_name(struct yac_couple_config *couple_config, size_t grid_idx)
double yac_couple_config_get_scale_summand(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
enum yac_reduction_type yac_couple_config_get_coupling_period_operation(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
int yac_couple_config_enforce_write_weight_file(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_grid_set_output_filename(struct yac_couple_config *couple_config, char const *grid_name, const char *output_filename)
void yac_couple_config_get_field_names(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_field_name, const char **tgt_field_name)
char const * yac_couple_config_get_weight_file_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
int yac_couple_config_get_missing_definition_is_fatal(struct yac_couple_config *couple_config)
void yac_couple_config_get_field_couple_component_names(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_component_name, char const **tgt_component_name)
char const * yac_couple_config_get_component_name(struct yac_couple_config *couple_config, size_t component_idx)
void yac_couple_config_set_missing_definition_is_fatal(struct yac_couple_config *couple_config, int missing_definition_is_fatal)
size_t yac_couple_config_get_num_grids(struct yac_couple_config *couple_config)
char const * yac_couple_config_get_field_grid_name(struct yac_couple_config *couple_config, size_t component_idx, size_t field_idx)
void yac_couple_config_set_config_output_filename(struct yac_couple_config *couple_config, char const *filename, enum yac_text_filetype filetype, char const *ref, int include_definitions)
char * yac_couple_config_get_end_datetime(struct yac_couple_config *couple_config)
size_t yac_couple_config_get_num_components(struct yac_couple_config *couple_config)
@ YAC_TEXT_FILETYPE_YAML
YAML format.
@ YAC_TEXT_FILETYPE_JSON
JSON format.
#define YAC_INSTANCE_CONFIG_OUTPUT_REF_ENDDEF
#define YAC_INSTANCE_CONFIG_OUTPUT_REF_COMP
#define YAC_INSTANCE_CONFIG_OUTPUT_REF_SYNC
int(* func_compute_weights)(double[3], size_t, yac_const_coordinate_pointer, int *, double *, enum yac_cell_type cell_type)
#define YAC_INTERP_AVG_PARTIAL_COVERAGE_DEFAULT
yac_interp_avg_weight_type
@ YAC_INTERP_AVG_ARITHMETIC
#define YAC_INTERP_AVG_WEIGHT_TYPE_DEFAULT
#define YAC_INTERP_CALLBACK_COMPUTE_WEIGHTS_KEY_DEFAULT
#define YAC_INTERP_CHECK_CONSTRUCTOR_KEY_DEFAULT
#define YAC_INTERP_CHECK_DO_SEARCH_KEY_DEFAULT
#define YAC_INTERP_CONSERV_NORMALISATION_DEFAULT
#define YAC_INTERP_CONSERV_ENFORCED_CONSERV_DEFAULT
#define YAC_INTERP_CONSERV_PARTIAL_COVERAGE_DEFAULT
#define YAC_INTERP_CONSERV_ORDER_DEFAULT
yac_interp_method_conserv_normalisation
@ YAC_INTERP_CONSERV_DESTAREA
@ YAC_INTERP_CONSERV_FRACAREA
#define YAC_INTERP_CREEP_DISTANCE_DEFAULT
#define YAC_INTERP_FILE_WEIGHT_FILE_NAME_DEFAULT
#define YAC_INTERP_FIXED_VALUE_DEFAULT
#define YAC_INTERP_NCC_PARTIAL_COVERAGE_DEFAULT
#define YAC_INTERP_NCC_WEIGHT_TYPE_DEFAULT
yac_interp_ncc_weight_type
@ YAC_INTERP_NCC_DIST
distance weighted average of n source points
@ YAC_INTERP_NCC_AVG
average of n source points
#define YAC_INTERP_NNN_WEIGHTED_DEFAULT
yac_interp_nnn_weight_type
@ YAC_INTERP_NNN_GAUSS
distance with Gauss weights of n source points
@ YAC_INTERP_NNN_RBF
radial basis functions
@ YAC_INTERP_NNN_AVG
average of n source points
@ YAC_INTERP_NNN_DIST
distance weighted average of n source points
@ YAC_INTERP_NNN_ZERO
all weights are set to zero
#define YAC_INTERP_RBF_MAX_SEARCH_DISTANCE_DEFAULT
#define YAC_INTERP_RBF_N_DEFAULT
#define YAC_INTERP_NNN_MAX_SEARCH_DISTANCE_DEFAULT
#define YAC_INTERP_NNN_GAUSS_SCALE_DEFAULT
#define YAC_INTERP_RBF_SCALE_DEFAULT
#define YAC_INTERP_NNN_N_DEFAULT
#define YAC_INTERP_RBF_KERNEL_DEFAULT
#define YAC_INTERP_SPMAP_MAX_SEARCH_DISTANCE_DEFAULT
yac_interp_spmap_scale_type
@ YAC_INTERP_SPMAP_NONE
weights are not scaled
@ YAC_INTERP_SPMAP_INVTGTAREA
@ YAC_INTERP_SPMAP_SRCAREA
@ YAC_INTERP_SPMAP_FRACAREA
#define YAC_INTERP_SPMAP_WEIGHTED_DEFAULT
#define YAC_INTERP_SPMAP_SPREAD_DISTANCE_DEFAULT
#define YAC_INTERP_SPMAP_SPHERE_RADIUS_DEFAULT
#define YAC_INTERP_SPMAP_SCALE_TYPE_DEFAULT
yac_interp_spmap_weight_type
#define YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT
size_t yac_interp_stack_config_get_size(struct yac_interp_stack_config *interp_stack)
union yac_interp_stack_config_entry const * yac_interp_stack_config_get_entry(struct yac_interp_stack_config *interp_stack, size_t interp_stack_idx)
enum yac_interpolation_list yac_interp_stack_config_entry_get_type(union yac_interp_stack_config_entry const *interp_stack_entry)
void yac_interp_stack_config_delete(struct yac_interp_stack_config *interp_stack_config)
struct yac_interp_stack_config * yac_interp_stack_config_new()
@ YAC_SOURCE_TO_TARGET_MAP
@ YAC_NEAREST_CORNER_CELLS
@ YAC_RADIAL_BASIS_FUNCTION
#define YAC_MAX_ROUTINE_NAME_LENGTH
#define YAC_MAX_FILE_NAME_LENGTH
#define YAC_FRAC_MASK_VALUE_IS_VALID(value)
int yac_file_exists(const char *filename)
#define xrealloc(ptr, size)
#define xfopen(path, mode)
enum yac_text_filetype type
struct debug_config_file_buffer::debug_config_file config_file[SYNC_LOC_COUNT]
char const * sync_loc_ref[SYNC_LOC_COUNT]
char const ** src_mask_names
char const * yaxt_exchanger_name
char const * coupling_period
struct field_couple_buffer::@52::@53 grid
struct field_couple_buffer::@52 tgt
char const * weight_file_name
char const * tgt_mask_name
struct yac_interp_stack_config * interp_stack
struct field_couple_buffer::@52 src
struct field_couple_buffer::field_couple_field_names * field_names
size_t num_src_mask_names
enum yac_reduction_type time_reduction
struct yac_name_type_pair const * valid_values
struct interp_method_parameter::@54::@59 bool_param
struct interp_method_parameter::@54::@56 int_param
enum interp_method_parameter_value_type type
union interp_method_parameter::@54 data
struct interp_method_parameter::@54::@58 str_param
struct interp_method_parameter::@54::@55 enum_param
interp_method_parameter_value const default_value
struct interp_method_parameter::@54::@57 dble_param
int yac_name_type_pair_get_type(struct yac_name_type_pair const *pairs, size_t count, char const *name)
char const * yac_name_type_pair_get_name(struct yac_name_type_pair const *pairs, size_t count, int type)
static size_t num_components
void yac_cdef_calendar(int calendar)
int const YAC_CALENDAR_NOT_SET
#define YAC_ASSERT_F(exp, format,...)
#define YAC_ASSERT(exp, msg)