YetAnotherCoupler 3.4.0
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
9#ifndef COUPLE_CONFIG_H
10#define COUPLE_CONFIG_H
11
12#include "interp_method_avg.h"
14#include "interp_method_check.h"
16#include "interp_method_creep.h"
17#include "interp_method_file.h"
18#include "interp_method_fixed.h"
19#include "interp_method_hcsbb.h"
20#include "interp_method_ncc.h"
21#include "interp_method_nnn.h"
22#include "interp_method_spmap.h"
23#include "interp_stack_config.h"
24
36
44
49
50#define MISSING_DEFINITION_IS_FATAL_DEFAULT_VALUE (1)
51
53
54// general couple config routines
56void yac_couple_config_delete(struct yac_couple_config * couple_config);
57
58// basic run parameters
60 struct yac_couple_config * couple_config);
62 struct yac_couple_config * couple_config);
64 struct yac_couple_config * couple_config,
65 char const * start, char const * end);
66
67// components
69 struct yac_couple_config * couple_config);
71 struct yac_couple_config * couple_config, char const * component_name);
73 struct yac_couple_config * couple_config, char const * component_name);
75 struct yac_couple_config * couple_config, size_t component_idx);
77 struct yac_couple_config * couple_config, char const * name);
79 struct yac_couple_config * couple_config,
80 char const * comp_name, const char* metadata);
82 struct yac_couple_config * couple_config,
83 char const * comp_name);
85 struct yac_couple_config * couple_config, char const * component_name);
87 struct yac_couple_config * couple_config, size_t component_idx);
88
89// grids
91 struct yac_couple_config * couple_config);
93 struct yac_couple_config * couple_config, char const * grid_name);
95 struct yac_couple_config * couple_config, char const * name);
97 struct yac_couple_config * couple_config,
98 char const * grid_name, const char* metadata);
100 struct yac_couple_config * couple_config,
101 char const * grid_name);
103 struct yac_couple_config * couple_config, char const * grid_name);
105 struct yac_couple_config * couple_config, size_t grid_idx);
107 struct yac_couple_config * couple_config, const char * grid_name,
108 char const * output_filename);
110 struct yac_couple_config * couple_config, const char * grid_name);
111
112// fields
114 struct yac_couple_config * couple_config,
115 const char * component_name, const char * grid_name,
116 const char * name, const char * timestep, size_t collection_size);
118 struct yac_couple_config * couple_config,
119 char const * comp_name, char const * grid_name, char const * field_name,
120 const char* metadata);
122 struct yac_couple_config * couple_config,
123 char const * comp_name, char const * grid_name, char const * field_name);
125 struct yac_couple_config * couple_config, size_t component_idx,
126 size_t grid_idx, char const * field_name);
128 struct yac_couple_config * couple_config,
129 char const * comp_name, char const * grid_name, char const * field_name,
130 double frac_mask_fallback_value);
132 struct yac_couple_config * couple_config,
133 char const * component_name, char const * grid_name,
134 char const * field_name);
136 struct yac_couple_config * couple_config, size_t component_idx,
137 size_t field_idx);
139 struct yac_couple_config * couple_config, size_t component_idx,
140 size_t field_idx);
142 struct yac_couple_config * couple_config,
143 char const * component_name, char const * grid_name,
144 char const * field_name);
146 struct yac_couple_config * couple_config,
147 char const * component_name, char const * grid_name,
148 char const * field_name);
150 struct yac_couple_config * couple_config,
151 char const * component_name, char const * grid_name,
152 char const * field_name);
154 struct yac_couple_config * couple_config,
155 size_t component_idx, size_t field_idx);
156
157// couples
159 struct yac_couple_config * couple_config,
160 char const * src_comp_name, char const * src_grid_name, char const * src_field_name,
161 char const * tgt_comp_name, char const * tgt_grid_name, char const * tgt_field_name,
162 char const * coupling_period, int time_reduction,
163 struct yac_interp_stack_config * interp_stack,
164 int src_lag, int tgt_lag,
165 char const * weight_file_name, int mapping_on_source,
166 double scale_factor, double scale_summand,
167 size_t num_src_mask_names, char const * const * src_mask_names,
168 char const * tgt_mask_name);
170 struct yac_couple_config * couple_config);
172 struct yac_couple_config * couple_config, size_t couple_idx);
174 struct yac_couple_config * couple_config, size_t couple_idx,
175 char const * couple_component_names[2]);
177 struct yac_couple_config * couple_config,
178 size_t couple_idx, size_t field_couple_idx,
179 char const ** src_component_name, char const ** tgt_component_name);
181 struct yac_couple_config * couple_config,
182 size_t couple_idx, size_t field_couple_idx,
183 char const ** src_grid_name, char const ** tgt_grid_name);
185 struct yac_couple_config * couple_config,
186 size_t couple_idx, size_t field_couple_idx,
187 const char ** src_field_name, const char ** tgt_field_name);
189 struct yac_couple_config * couple_config,
190 size_t couple_idx, size_t field_couple_idx);
192 struct yac_couple_config * couple_config,
193 size_t couple_idx, size_t field_couple_idx);
195 struct yac_couple_config * couple_config,
196 size_t couple_idx, size_t field_couple_idx);
198 struct yac_couple_config * couple_config,
199 size_t couple_idx, size_t field_couple_idx);
201 struct yac_couple_config * couple_config,
202 size_t couple_idx, size_t field_couple_idx);
204 struct yac_couple_config * couple_config,
205 size_t couple_idx, size_t field_couple_idx);
207 struct yac_couple_config * couple_config,
208 size_t couple_idx, size_t field_couple_idx);
210 struct yac_couple_config * couple_config,
211 size_t couple_idx, size_t field_couple_idx);
213 struct yac_couple_config * couple_config,
214 size_t couple_idx, size_t field_couple_idx);
216 struct yac_couple_config * couple_config,
217 size_t couple_idx, size_t field_couple_idx);
219 struct yac_couple_config * couple_config,
220 size_t couple_idx, size_t field_couple_idx);
222 struct yac_couple_config * couple_config,
223 size_t couple_idx, size_t field_couple_idx);
225 struct yac_couple_config * couple_config,
226 size_t couple_idx, size_t field_couple_idx,
227 char const * const ** mask_names, size_t * num_mask_names);
229 struct yac_couple_config * couple_config,
230 size_t couple_idx, size_t field_couple_idx);
231
243 struct yac_couple_config * couple_config, MPI_Comm comm,
244 char const * output_ref);
245
246// output configuration
247
261 struct yac_couple_config * couple_config,
262 char const * filename, enum yac_text_filetype filetype, char const * ref,
263 int include_definitions);
264
272 struct yac_couple_config * couple_config);
273
281 struct yac_couple_config * couple_config,
282 int missing_definition_is_fatal);
283
284#endif // COUPLE_CONFIG_H
void yac_couple_config_grid_set_metadata(struct yac_couple_config *couple_config, char const *grid_name, const char *metadata)
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_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)
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_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)
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 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)
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)
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)