Skip to content
Snippets Groups Projects
Commit e86f181d authored by Moritz Hanke's avatar Moritz Hanke
Browse files

adds support for configurable yaxt exchanger to instance.c

parent e9a64f8f
No related branches found
No related tags found
No related merge requests found
......@@ -149,6 +149,8 @@ struct field_config {
double scale_factor, scale_summand;
char const * yaxt_exchanger_name;
size_t collection_size;
};
......@@ -368,6 +370,11 @@ int compare_field_config(const void * a, const void * b) {
(a_->scale_factor < b_->scale_factor))) return ret;
if ((ret = (a_->scale_summand > b_->scale_summand) -
(a_->scale_summand < b_->scale_summand))) return ret;
if ((ret = (a_->yaxt_exchanger_name == NULL) -
(b_->yaxt_exchanger_name == NULL))) return ret;
if (a_->yaxt_exchanger_name != NULL)
if ((ret = strcmp(a_->yaxt_exchanger_name, b_->yaxt_exchanger_name)))
return ret;
// use memcmp to compare frac_mask_fallback_value, because they can be nan
return
......@@ -588,6 +595,10 @@ static void get_field_configuration(
double scale_summand =
yac_couple_config_get_scale_summand(
couple_config, couple_idx, field_couple_idx);
char const * yaxt_exchanger_name =
// yac_couple_config_get_yaxt_exchanger_name(
// couple_config, couple_idx, field_couple_idx);
NULL;
size_t collection_size =
yac_couple_config_get_field_collection_size(
couple_config, src_config.comp_name, src_config.grid_name,
......@@ -637,6 +648,7 @@ static void get_field_configuration(
frac_mask_fallback_value;
field_configs[field_config_idx].scale_factor = scale_factor;
field_configs[field_config_idx].scale_summand = scale_summand;
field_configs[field_config_idx].yaxt_exchanger_name = yaxt_exchanger_name;
field_configs[field_config_idx].collection_size = collection_size;
field_configs[field_config_idx].src_interp_config.name = src_field_name;
field_configs[field_config_idx].tgt_interp_config.name = tgt_field_name;
......@@ -1174,6 +1186,11 @@ static void generate_interpolations(
curr_field_config->scale_factor) ||
(curr_field_config[-1].scale_summand !=
curr_field_config->scale_summand) ||
((curr_field_config[-1].yaxt_exchanger_name == NULL) !=
(curr_field_config->yaxt_exchanger_name == NULL)) ||
((curr_field_config->yaxt_exchanger_name != NULL) &&
strcmp(curr_field_config[-1].yaxt_exchanger_name,
curr_field_config->yaxt_exchanger_name)) ||
memcmp(
&(curr_field_config[-1].frac_mask_fallback_value),
&(curr_field_config->frac_mask_fallback_value),
......@@ -1188,7 +1205,8 @@ static void generate_interpolations(
curr_field_config->collection_size,
curr_field_config->frac_mask_fallback_value,
curr_field_config->scale_factor,
curr_field_config->scale_summand, NULL);
curr_field_config->scale_summand,
curr_field_config->yaxt_exchanger_name);
}
if (is_active) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment