YAC 3.21.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
9
21
29
34
35#define MISSING_DEFINITION_IS_FATAL_DEFAULT_VALUE (1)
36#define APPLY_COORDINATE_CHECK_DEFAULT_VALUE (1)
37#define COORDINATES_MISMATCH_IS_FATAL_DEFAULT_VALUE (1)
38
40
41// general couple config routines
43void yac_couple_config_delete(struct yac_couple_config * couple_config);
44
45// basic run parameters
47 struct yac_couple_config const * couple_config);
49 struct yac_couple_config const * couple_config);
51 struct yac_couple_config * couple_config,
52 char const * start, char const * end);
53
54// components
56 struct yac_couple_config const * couple_config);
58 struct yac_couple_config const * couple_config, char const * component_name);
60 struct yac_couple_config const * couple_config, char const * component_name);
62 struct yac_couple_config const * couple_config, size_t component_idx);
64 struct yac_couple_config * couple_config, char const * name);
66 struct yac_couple_config * couple_config,
67 char const * comp_name, const char* metadata);
69 struct yac_couple_config const * couple_config,
70 char const * comp_name);
72 struct yac_couple_config const * couple_config, size_t component_idx);
73
74// grids
76 struct yac_couple_config const * couple_config);
78 struct yac_couple_config const * couple_config, char const * grid_name);
80 struct yac_couple_config * couple_config, char const * name);
82 struct yac_couple_config * couple_config,
83 char const * grid_name, const char* metadata);
85 struct yac_couple_config const * couple_config,
86 char const * grid_name);
88 struct yac_couple_config const * couple_config, char const * grid_name);
90 struct yac_couple_config const * couple_config, size_t grid_idx);
92 struct yac_couple_config * couple_config, const char * grid_name,
93 char const * output_filename);
109 struct yac_couple_config * couple_config, char const * output_filename);
116 struct yac_couple_config const * couple_config, const char * grid_name);
121 struct yac_couple_config const * couple_config);
122
123// fields
125 struct yac_couple_config * couple_config,
126 const char * component_name, const char * grid_name,
127 const char * name, const char * timestep, size_t collection_size);
129 struct yac_couple_config * couple_config,
130 char const * comp_name, char const * grid_name, char const * field_name,
131 const char* metadata);
133 struct yac_couple_config const * couple_config,
134 char const * comp_name, char const * grid_name, char const * field_name);
136 struct yac_couple_config const * couple_config, size_t component_idx,
137 size_t grid_idx, char const * field_name);
139 struct yac_couple_config * couple_config,
140 char const * comp_name, char const * grid_name, char const * field_name,
141 double frac_mask_fallback_value);
143 struct yac_couple_config const * couple_config,
144 char const * component_name, char const * grid_name,
145 char const * field_name);
147 struct yac_couple_config const * couple_config, size_t component_idx,
148 size_t field_idx);
150 struct yac_couple_config const * couple_config, size_t component_idx,
151 size_t field_idx);
153 struct yac_couple_config const * couple_config,
154 char const * component_name, char const * grid_name,
155 char const * field_name);
157 struct yac_couple_config const * couple_config,
158 char const * component_name, char const * grid_name,
159 char const * field_name);
161 struct yac_couple_config const * couple_config,
162 char const * component_name, char const * grid_name,
163 char const * field_name);
165 struct yac_couple_config const * couple_config,
166 size_t component_idx, size_t field_idx);
167
168// couples
170 struct yac_couple_config * couple_config,
171 char const * src_comp_name, char const * src_grid_name, char const * src_field_name,
172 char const * tgt_comp_name, char const * tgt_grid_name, char const * tgt_field_name,
173 char const * coupling_period, int time_reduction,
174 struct yac_interp_stack_config * interp_stack, int src_lag, int tgt_lag,
175 char const * weight_file_name, int weight_file_on_existing,
176 int mapping_on_source, double scale_factor, double scale_summand,
177 size_t num_src_mask_names, char const * const * src_mask_names,
178 char const * tgt_mask_name, char const * yaxt_exchanger_name,
179 struct yac_collection_selection const * collection_selection,
180 int use_raw_exchange);
182 struct yac_couple_config const * couple_config);
184 struct yac_couple_config const * couple_config, size_t couple_idx);
186 struct yac_couple_config const * couple_config, size_t couple_idx,
187 char const * couple_component_names[2]);
189 struct yac_couple_config const * couple_config,
190 size_t couple_idx, size_t field_couple_idx,
191 char const ** src_component_name, char const ** tgt_component_name);
193 struct yac_couple_config const * couple_config,
194 size_t couple_idx, size_t field_couple_idx,
195 char const ** src_grid_name, char const ** tgt_grid_name);
197 struct yac_couple_config const * couple_config,
198 size_t couple_idx, size_t field_couple_idx,
199 const char ** src_field_name, const char ** tgt_field_name);
201 struct yac_couple_config const * couple_config,
202 size_t couple_idx, size_t field_couple_idx);
204 struct yac_couple_config const * couple_config,
205 size_t couple_idx, size_t field_couple_idx);
207 struct yac_couple_config const * couple_config,
208 size_t couple_idx, size_t field_couple_idx);
210 struct yac_couple_config const * couple_config,
211 size_t couple_idx, size_t field_couple_idx);
213 struct yac_couple_config const * couple_config,
214 size_t couple_idx, size_t field_couple_idx);
216 struct yac_couple_config const * couple_config,
217 size_t couple_idx, size_t field_couple_idx);
219 struct yac_couple_config const * couple_config,
220 size_t couple_idx, size_t field_couple_idx);
222 struct yac_couple_config const * couple_config,
223 size_t couple_idx, size_t field_couple_idx);
225 struct yac_couple_config const * couple_config,
226 size_t couple_idx, size_t field_couple_idx);
228 struct yac_couple_config const * couple_config,
229 size_t couple_idx, size_t field_couple_idx);
231 struct yac_couple_config const * couple_config,
232 size_t couple_idx, size_t field_couple_idx);
234 struct yac_couple_config const * couple_config,
235 size_t couple_idx, size_t field_couple_idx);
237 struct yac_couple_config const * couple_config,
238 size_t couple_idx, size_t field_couple_idx);
240 struct yac_couple_config const * couple_config,
241 size_t couple_idx, size_t field_couple_idx,
242 char const * const ** mask_names, size_t * num_mask_names);
244 struct yac_couple_config const * couple_config,
245 size_t couple_idx, size_t field_couple_idx);
247 struct yac_couple_config const * couple_config,
248 size_t couple_idx, size_t field_couple_idx);
250 struct yac_couple_config const * couple_config,
251 char const * tgt_component_name, char const * tgt_grid_name,
252 char const * tgt_field_name, char const ** src_component_name,
253 char const ** src_grid_name, char const ** src_field_name);
255 struct yac_couple_config const * couple_config,
256 size_t couple_idx, size_t field_couple_idx);
257struct yac_collection_selection const *
259 struct yac_couple_config const * couple_config,
260 size_t couple_idx, size_t field_couple_idx);
263 struct yac_couple_config * couple_config,
264 size_t couple_idx, size_t field_couple_idx);
265
277 struct yac_couple_config * couple_config, MPI_Comm comm,
278 char const * output_ref);
279
280// output configuration
281
295 struct yac_couple_config * couple_config,
296 char const * filename, enum yac_text_filetype filetype, char const * ref,
297 int include_definitions);
298
306 struct yac_couple_config const * couple_config);
307
315 struct yac_couple_config * couple_config,
316 int missing_definition_is_fatal);
317
324 struct yac_couple_config const * couple_config);
325
332 struct yac_couple_config * couple_config,
333 int apply_coordinate_check);
334
341 struct yac_couple_config const * couple_config);
342
350 struct yac_couple_config * couple_config,
351 int coordinates_mismatch_is_fatal);
352
353#endif // COUPLE_CONFIG_H
unsigned component_idx[3]
unsigned grid_idx[3]
int yac_couple_config_get_enforce_write_weight_file(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
double yac_couple_config_get_scale_summand(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_get_couple_component_names(struct yac_couple_config const *couple_config, size_t couple_idx, char const *couple_component_names[2])
void yac_couple_config_get_field_couple_component_names(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_component_name, char const **tgt_component_name)
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)
struct yac_interp_stack_config * yac_couple_config_get_interp_stack(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
int yac_couple_config_get_missing_definition_is_fatal(struct yac_couple_config const *couple_config)
int yac_couple_config_get_use_raw_exchange(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
char * yac_couple_config_get_end_datetime(struct yac_couple_config const *couple_config)
void yac_couple_config_set_component_metadata(struct yac_couple_config *couple_config, char const *comp_name, const char *metadata)
void yac_couple_config_sync(struct yac_couple_config *couple_config, MPI_Comm comm, char const *output_ref)
void yac_couple_config_set_field_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_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.
const char * yac_couple_config_get_grid_output_filename(struct yac_couple_config const *couple_config, const char *grid_name)
char const * yac_couple_config_get_yaxt_exchanger_name(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
char const * yac_couple_config_get_field_grid_name(struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
char const * yac_couple_config_get_field_timestep(struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
double yac_couple_config_get_scale_factor(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
yac_reduction_type
@ TIME_NONE
@ TIME_ACCUMULATE
@ TIME_MAXIMUM
@ TIME_MINIMUM
@ TIME_AVERAGE
char const * yac_couple_config_get_source_timestep(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_set_datetime(struct yac_couple_config *couple_config, char const *start, char const *end)
size_t yac_couple_config_get_num_grids(struct yac_couple_config const *couple_config)
size_t yac_couple_config_get_component_idx(struct yac_couple_config const *couple_config, char const *component_name)
char const * yac_couple_config_get_target_timestep(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_set_apply_coordinate_check(struct yac_couple_config *couple_config, int apply_coordinate_check)
char const * yac_couple_config_get_weight_file_name(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
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)
int yac_couple_config_is_valid_component_name(struct yac_couple_config const *couple_config, char const *component_name)
const char * yac_couple_config_get_field_metadata(struct yac_couple_config const *couple_config, char const *comp_name, char const *grid_name, char const *field_name)
void yac_couple_config_get_src_mask_names(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const *const **mask_names, size_t *num_mask_names)
char const * yac_couple_config_get_grid_name(struct yac_couple_config const *couple_config, size_t grid_idx)
double yac_couple_config_get_frac_mask_fallback_value(struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
const char * yac_couple_config_get_all_grids_output_filename(struct yac_couple_config const *couple_config)
size_t yac_couple_config_get_grid_idx(struct yac_couple_config const *couple_config, char const *grid_name)
size_t yac_couple_config_get_num_couples(struct yac_couple_config const *couple_config)
struct yac_collection_selection const * yac_couple_config_get_collection_selection(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
char const * yac_couple_config_get_tgt_mask_name(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_add_component_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)
int yac_couple_config_get_source_lag(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
size_t yac_couple_config_get_field_collection_size(struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
void yac_couple_config_set_grid_output_filename(struct yac_couple_config *couple_config, const char *grid_name, char const *output_filename)
char * yac_couple_config_get_start_datetime(struct yac_couple_config const *couple_config)
int yac_couple_config_get_field_role(struct yac_couple_config const *couple_config, char const *component_name, char const *grid_name, char const *field_name)
size_t yac_couple_config_get_num_components(struct yac_couple_config const *couple_config)
void yac_couple_config_set_coordinates_mismatch_is_fatal(struct yac_couple_config *couple_config, int coordinates_mismatch_is_fatal)
char const * yac_couple_config_get_field_name(struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
size_t yac_couple_config_get_num_couple_fields(struct yac_couple_config const *couple_config, size_t couple_idx)
size_t yac_couple_config_get_num_fields(struct yac_couple_config const *couple_config, size_t component_idx)
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)
void yac_couple_config_set_grid_metadata(struct yac_couple_config *couple_config, char const *grid_name, const char *metadata)
int yac_couple_config_contains_grid_name(struct yac_couple_config const *couple_config, char const *grid_name)
size_t yac_couple_config_get_field_idx(struct yac_couple_config const *couple_config, size_t component_idx, size_t grid_idx, char const *field_name)
int yac_couple_config_get_target_lag(struct yac_couple_config const *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 const *couple_config, size_t couple_idx, size_t field_couple_idx)
struct yac_couple_config * yac_couple_config_new()
void yac_couple_config_get_field_names(struct yac_couple_config const *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_coordinates_mismatch_is_fatal(struct yac_couple_config const *couple_config)
int yac_couple_config_get_mapping_on_source(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
const char * yac_couple_config_get_grid_metadata(struct yac_couple_config const *couple_config, char const *grid_name)
void yac_couple_config_get_field_grid_names(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx, char const **src_grid_name, char const **tgt_grid_name)
char const * yac_couple_config_get_component_name(struct yac_couple_config const *couple_config, size_t component_idx)
int yac_couple_config_get_apply_coordinate_check(struct yac_couple_config const *couple_config)
void yac_couple_config_set_all_grids_output_filename(struct yac_couple_config *couple_config, char const *output_filename)
int yac_couple_config_is_valid_field(struct yac_couple_config const *couple_config, size_t component_idx, size_t field_idx)
void yac_couple_config_set_missing_definition_is_fatal(struct yac_couple_config *couple_config, int missing_definition_is_fatal)
void yac_couple_config_add_component(struct yac_couple_config *couple_config, char const *name)
void yac_couple_config_get_field_source(struct yac_couple_config const *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)
const char * yac_couple_config_get_component_metadata(struct yac_couple_config const *couple_config, char const *comp_name)
char const * yac_couple_config_get_coupling_period(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_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)
enum yac_reduction_type yac_couple_config_get_coupling_period_operation(struct yac_couple_config const *couple_config, size_t couple_idx, size_t field_couple_idx)
void yac_couple_config_delete(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