YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
couple_config.h
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef COUPLE_CONFIG_H
6#define COUPLE_CONFIG_H
7
21
33
41
46
47#define MISSING_DEFINITION_IS_FATAL_DEFAULT_VALUE (1)
48
50
51// general couple config routines
53void yac_couple_config_delete(struct yac_couple_config * couple_config);
54
55// basic run parameters
57 struct yac_couple_config * couple_config);
59 struct yac_couple_config * couple_config);
61 struct yac_couple_config * couple_config,
62 char const * start, char const * end);
63
64// components
66 struct yac_couple_config * couple_config);
68 struct yac_couple_config * couple_config, char const * component_name);
70 struct yac_couple_config * couple_config, char const * component_name);
72 struct yac_couple_config * couple_config, size_t component_idx);
74 struct yac_couple_config * couple_config, char const * name);
76 struct yac_couple_config * couple_config,
77 char const * comp_name, const char* metadata);
79 struct yac_couple_config * couple_config,
80 char const * comp_name);
82 struct yac_couple_config * couple_config, char const * component_name);
84 struct yac_couple_config * couple_config, size_t component_idx);
85
86// grids
88 struct yac_couple_config * couple_config);
90 struct yac_couple_config * couple_config, char const * grid_name);
92 struct yac_couple_config * couple_config, char const * name);
94 struct yac_couple_config * couple_config,
95 char const * grid_name, const char* metadata);
97 struct yac_couple_config * couple_config,
98 char const * grid_name);
100 struct yac_couple_config * couple_config, char const * grid_name);
102 struct yac_couple_config * couple_config, size_t grid_idx);
104 struct yac_couple_config * couple_config, const char * grid_name,
105 char const * output_filename);
107 struct yac_couple_config * couple_config, const char * grid_name);
108
109// fields
111 struct yac_couple_config * couple_config,
112 const char * component_name, const char * grid_name,
113 const char * name, const char * timestep, size_t collection_size);
115 struct yac_couple_config * couple_config,
116 char const * comp_name, char const * grid_name, char const * field_name,
117 const char* metadata);
119 struct yac_couple_config * couple_config,
120 char const * comp_name, char const * grid_name, char const * field_name);
122 struct yac_couple_config * couple_config, size_t component_idx,
123 size_t grid_idx, char const * field_name);
125 struct yac_couple_config * couple_config,
126 char const * comp_name, char const * grid_name, char const * field_name,
127 double frac_mask_fallback_value);
129 struct yac_couple_config * couple_config,
130 char const * component_name, char const * grid_name,
131 char const * field_name);
133 struct yac_couple_config * couple_config, size_t component_idx,
134 size_t field_idx);
136 struct yac_couple_config * couple_config, size_t component_idx,
137 size_t field_idx);
139 struct yac_couple_config * couple_config,
140 char const * component_name, char const * grid_name,
141 char const * field_name);
143 struct yac_couple_config * couple_config,
144 char const * component_name, char const * grid_name,
145 char const * field_name);
147 struct yac_couple_config * couple_config,
148 char const * component_name, char const * grid_name,
149 char const * field_name);
151 struct yac_couple_config * couple_config,
152 size_t component_idx, size_t field_idx);
153
154// couples
156 struct yac_couple_config * couple_config,
157 char const * src_comp_name, char const * src_grid_name, char const * src_field_name,
158 char const * tgt_comp_name, char const * tgt_grid_name, char const * tgt_field_name,
159 char const * coupling_period, int time_reduction,
160 struct yac_interp_stack_config * interp_stack, int src_lag, int tgt_lag,
161 char const * weight_file_name, int weight_file_on_existing,
162 int mapping_on_source, double scale_factor, double scale_summand,
163 size_t num_src_mask_names, char const * const * src_mask_names,
164 char const * tgt_mask_name, char const * yaxt_exchanger_name,
165 struct yac_collection_selection const * collection_selection,
166 int use_raw_exchange);
168 struct yac_couple_config * couple_config);
170 struct yac_couple_config * couple_config, size_t couple_idx);
172 struct yac_couple_config * couple_config, size_t couple_idx,
173 char const * couple_component_names[2]);
175 struct yac_couple_config * couple_config,
176 size_t couple_idx, size_t field_couple_idx,
177 char const ** src_component_name, char const ** tgt_component_name);
179 struct yac_couple_config * couple_config,
180 size_t couple_idx, size_t field_couple_idx,
181 char const ** src_grid_name, char const ** tgt_grid_name);
183 struct yac_couple_config * couple_config,
184 size_t couple_idx, size_t field_couple_idx,
185 const char ** src_field_name, const char ** tgt_field_name);
187 struct yac_couple_config * couple_config,
188 size_t couple_idx, size_t field_couple_idx);
190 struct yac_couple_config * couple_config,
191 size_t couple_idx, size_t field_couple_idx);
193 struct yac_couple_config * couple_config,
194 size_t couple_idx, size_t field_couple_idx);
196 struct yac_couple_config * couple_config,
197 size_t couple_idx, size_t field_couple_idx);
199 struct yac_couple_config * couple_config,
200 size_t couple_idx, size_t field_couple_idx);
202 struct yac_couple_config * couple_config,
203 size_t couple_idx, size_t field_couple_idx);
205 struct yac_couple_config * couple_config,
206 size_t couple_idx, size_t field_couple_idx);
208 struct yac_couple_config * couple_config,
209 size_t couple_idx, size_t field_couple_idx);
211 struct yac_couple_config * couple_config,
212 size_t couple_idx, size_t field_couple_idx);
214 struct yac_couple_config * couple_config,
215 size_t couple_idx, size_t field_couple_idx);
217 struct yac_couple_config * couple_config,
218 size_t couple_idx, size_t field_couple_idx);
220 struct yac_couple_config * couple_config,
221 size_t couple_idx, size_t field_couple_idx);
223 struct yac_couple_config * couple_config,
224 size_t couple_idx, size_t field_couple_idx);
226 struct yac_couple_config * couple_config,
227 size_t couple_idx, size_t field_couple_idx,
228 char const * const ** mask_names, size_t * num_mask_names);
230 struct yac_couple_config * couple_config,
231 size_t couple_idx, size_t field_couple_idx);
233 struct yac_couple_config * couple_config,
234 size_t couple_idx, size_t field_couple_idx);
236 struct yac_couple_config * couple_config,
237 char const * tgt_component_name, char const * tgt_grid_name,
238 char const * tgt_field_name, char const ** src_component_name,
239 char const ** src_grid_name, char const ** src_field_name);
241 struct yac_couple_config * couple_config,
242 size_t couple_idx, size_t field_couple_idx);
243struct yac_collection_selection const *
245 struct yac_couple_config * couple_config,
246 size_t couple_idx, size_t field_couple_idx);
249 struct yac_couple_config * couple_config,
250 size_t couple_idx, size_t field_couple_idx);
251
263 struct yac_couple_config * couple_config, MPI_Comm comm,
264 char const * output_ref);
265
266// output configuration
267
281 struct yac_couple_config * couple_config,
282 char const * filename, enum yac_text_filetype filetype, char const * ref,
283 int include_definitions);
284
292 struct yac_couple_config * couple_config);
293
301 struct yac_couple_config * couple_config,
302 int missing_definition_is_fatal);
303
304#endif // COUPLE_CONFIG_H
unsigned component_idx[3]
unsigned grid_idx[3]
void yac_couple_config_grid_set_metadata(struct yac_couple_config *couple_config, char const *grid_name, const char *metadata)
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, char const *weight_file_name, int weight_file_on_existing, 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, struct yac_collection_selection const *collection_selection, int use_raw_exchange)
int yac_couple_config_field_is_valid(struct yac_couple_config *couple_config, size_t component_idx, size_t field_idx)
void yac_couple_config_get_field_source(struct yac_couple_config *couple_config, char const *tgt_component_name, char const *tgt_grid_name, char const *tgt_field_name, char const **src_component_name, char const **src_grid_name, char const **src_field_name)
char const * yac_couple_config_get_yaxt_exchanger_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_sync(struct yac_couple_config *couple_config, MPI_Comm comm, char const *output_ref)
void yac_couple_config_field_enable_frac_mask(struct yac_couple_config *couple_config, char const *comp_name, char const *grid_name, char const *field_name, double frac_mask_fallback_value)
yac_text_filetype
@ YAC_TEXT_FILETYPE_YAML
YAML format.
@ YAC_TEXT_FILETYPE_JSON
JSON format.
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)
int yac_couple_config_contains_grid_name(struct yac_couple_config *couple_config, char const *grid_name)
yac_reduction_type
@ TIME_NONE
@ TIME_ACCUMULATE
@ TIME_MAXIMUM
@ TIME_MINIMUM
@ TIME_AVERAGE
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)
int yac_couple_config_component_name_is_valid(struct yac_couple_config *couple_config, char const *component_name)
struct yac_interpolation_gen_config * yac_couple_config_get_interpolation_gen_config(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
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)
enum yac_weight_file_on_existing yac_couple_config_get_weight_file_on_existing(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_idx(struct yac_couple_config *couple_config, size_t component_idx, size_t grid_idx, char const *field_name)
void yac_couple_config_component_set_metadata(struct yac_couple_config *couple_config, char const *comp_name, const char *metadata)
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)
int yac_couple_config_get_use_raw_exchange(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
size_t yac_couple_config_get_num_couples(struct yac_couple_config *couple_config)
const char * yac_couple_config_field_get_metadata(struct yac_couple_config *couple_config, char const *comp_name, char const *grid_name, char const *field_name)
int yac_couple_config_get_target_lag(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
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)
void yac_couple_config_get_couple_component_names(struct yac_couple_config *couple_config, size_t couple_idx, char const *couple_component_names[2])
double yac_couple_config_get_scale_factor(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
size_t yac_couple_config_get_grid_idx(struct yac_couple_config *couple_config, char const *grid_name)
size_t yac_couple_config_get_component_idx(struct yac_couple_config *couple_config, char const *component_name)
char const * yac_couple_config_get_tgt_mask_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
const char * yac_couple_config_component_get_metadata(struct yac_couple_config *couple_config, char const *comp_name)
const char * yac_couple_config_grid_get_metadata(struct yac_couple_config *couple_config, char const *grid_name)
yac_time_unit_type
@ C_SECOND
@ TIME_UNIT_UNDEFINED
@ C_HOUR
@ C_DAY
@ C_MILLISECOND
@ C_MINUTE
@ C_MONTH
@ C_ISO_FORMAT
@ C_YEAR
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)
struct yac_collection_selection const * yac_couple_config_get_collection_selection(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, const char *grid_name, char const *output_filename)
int yac_couple_config_enforce_write_weight_file(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
struct yac_couple_config * yac_couple_config_new()
char const * yac_couple_config_get_weight_file_name(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_get_field_names(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, const char **src_field_name, const char **tgt_field_name)
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)
char const * yac_couple_config_get_source_timestep(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_component_add_field(struct yac_couple_config *couple_config, const char *component_name, const char *grid_name, const char *name, const char *timestep, size_t collection_size)
void yac_couple_config_add_component(struct yac_couple_config *couple_config, char const *name)
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_field_set_metadata(struct yac_couple_config *couple_config, char const *comp_name, char const *grid_name, char const *field_name, const char *metadata)
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)
char const * yac_couple_config_get_target_timestep(struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_delete(struct yac_couple_config *couple_config)
size_t yac_couple_config_get_num_components(struct yac_couple_config *couple_config)
yac_weight_file_on_existing
Configuration structure for interpolation generation.
int collection_size
char const * weight_file_name
char const src_grid_name[]
char const tgt_grid_name[]
char const * name
Definition toy_scrip.c:114