9from types
import coroutine
11from libc.stdlib cimport malloc, free
13cdef
import from "<mpi.h>" nogil:
14 ctypedef struct _mpi_comm_t
15 ctypedef _mpi_comm_t* MPI_Comm
16 int MPI_Comm_c2f(MPI_Comm)
17 MPI_Comm MPI_Comm_f2c(int)
19cdef extern
from "Python.h":
20 int Py_AtExit(void (*)())
22cdef extern
from "yac.h":
23 cdef const int _LOCATION_CELL
"YAC_LOCATION_CELL"
24 cdef const int _LOCATION_CORNER
"YAC_LOCATION_CORNER"
25 cdef const int _LOCATION_EDGE
"YAC_LOCATION_EDGE"
27 cdef const int _EXCHANGE_TYPE_NONE
"YAC_EXCHANGE_TYPE_NONE"
28 cdef const int _EXCHANGE_TYPE_SOURCE
"YAC_EXCHANGE_TYPE_SOURCE"
29 cdef const int _EXCHANGE_TYPE_TARGET
"YAC_EXCHANGE_TYPE_TARGET"
31 cdef const int _ACTION_NONE
"YAC_ACTION_NONE"
32 cdef const int _ACTION_REDUCTION
"YAC_ACTION_REDUCTION"
33 cdef const int _ACTION_COUPLING
"YAC_ACTION_COUPLING"
34 cdef const int _ACTION_GET_FOR_RESTART
"YAC_ACTION_GET_FOR_RESTART"
35 cdef const int _ACTION_PUT_FOR_RESTART
"YAC_ACTION_PUT_FOR_RESTART"
36 cdef const int _ACTION_OUT_OF_BOUND
"YAC_ACTION_OUT_OF_BOUND"
38 cdef const int _REDUCTION_TIME_NONE
"YAC_REDUCTION_TIME_NONE"
39 cdef const int _REDUCTION_TIME_ACCUMULATE
"YAC_REDUCTION_TIME_ACCUMULATE"
40 cdef const int _REDUCTION_TIME_AVERAGE
"YAC_REDUCTION_TIME_AVERAGE"
41 cdef const int _REDUCTION_TIME_MINIMUM
"YAC_REDUCTION_TIME_MINIMUM"
42 cdef const int _REDUCTION_TIME_MAXIMUM
"YAC_REDUCTION_TIME_MAXIMUM"
44 cdef const int _CALENDAR_NOT_SET
"YAC_CALENDAR_NOT_SET"
45 cdef const int _PROLEPTIC_GREGORIAN
"YAC_PROLEPTIC_GREGORIAN"
46 cdef const int _YEAR_OF_365_DAYS
"YAC_YEAR_OF_365_DAYS"
47 cdef const int _YEAR_OF_360_DAYS
"YAC_YEAR_OF_365_DAYS"
49 cdef const int _TIME_UNIT_MILLISECOND
"YAC_TIME_UNIT_MILLISECOND"
50 cdef const int _TIME_UNIT_SECOND
"YAC_TIME_UNIT_SECOND"
51 cdef const int _TIME_UNIT_MINUTE
"YAC_TIME_UNIT_MINUTE"
52 cdef const int _TIME_UNIT_HOUR
"YAC_TIME_UNIT_HOUR"
53 cdef const int _TIME_UNIT_DAY
"YAC_TIME_UNIT_DAY"
54 cdef const int _TIME_UNIT_MONTH
"YAC_TIME_UNIT_MONTH"
55 cdef const int _TIME_UNIT_YEAR
"YAC_TIME_UNIT_YEAR"
56 cdef const int _TIME_UNIT_ISO_FORMAT
"YAC_TIME_UNIT_ISO_FORMAT"
58 cdef const int _AVG_ARITHMETIC
"YAC_AVG_ARITHMETIC"
59 cdef const int _AVG_DIST
"YAC_AVG_DIST"
60 cdef const int _AVG_BARY
"YAC_AVG_BARY"
62 cdef const int _NCC_AVG
"YAC_NCC_AVG"
63 cdef const int _NCC_DIST
"YAC_NCC_DIST"
65 cdef const int _NNN_AVG
"YAC_NNN_AVG"
66 cdef const int _NNN_DIST
"YAC_NNN_DIST"
67 cdef const int _NNN_GAUSS
"YAC_NNN_GAUSS"
68 cdef const int _NNN_RBF
"YAC_NNN_RBF"
70 cdef const int _CONSERV_DESTAREA
"YAC_CONSERV_DESTAREA"
71 cdef const int _CONSERV_FRACAREA
"YAC_CONSERV_FRACAREA"
73 cdef const int _SPMAP_AVG
"YAC_SPMAP_AVG"
74 cdef const int _SPMAP_DIST
"YAC_SPMAP_DIST"
76 cdef const int _SPMAP_NONE
"YAC_SPMAP_NONE"
77 cdef const int _SPMAP_SRCAREA
"YAC_SPMAP_SRCAREA"
78 cdef const int _SPMAP_INVTGTAREA
"YAC_SPMAP_INVTGTAREA"
79 cdef const int _SPMAP_FRACAREA
"YAC_SPMAP_FRACAREA"
82 void yac_cinit_instance ( int * yac_instance_id )
83 void yac_cinit_comm (MPI_Comm comm )
84 void yac_cinit_comm_instance (MPI_Comm comm, int * yac_instance_id )
86 void yac_ccleanup_instance (int yac_instance_id)
87 void yac_cdef_comp_instance ( int yac_instance_id,
88 const char * comp_name,
90 void yac_cdef_comps_instance ( int yac_instance_id,
91 const char ** comp_names,
94 void yac_cpredef_comp_instance ( int yac_instance_id,
95 const char * comp_name,
97 void yac_cget_comp_comm ( int comp_id, MPI_Comm* comp_comm )
98 void yac_cdef_datetime_instance ( int yac_instance_id,
99 const char * start_datetime,
100 const char * end_datetime )
102 const char ** comp_names,
104 MPI_Comm * comps_comm)
105 void yac_cdef_calendar ( int calendar )
106 void yac_cenddef_instance ( int yac_instance_id )
107 int yac_cget_nbr_comps_instance ( int yac_instance_id )
108 int yac_cget_nbr_grids_instance ( int yac_instance_id )
109 int yac_cget_comp_nbr_grids_instance ( int yac_instance_id, const char* comp_name )
110 int yac_cget_nbr_fields_instance ( int yac_instance_id, const char * comp_name,
111 const char* grid_name)
112 void yac_cget_comp_names_instance ( int yac_instance_id, int nbr_comps,
113 const char ** comp_names )
114 void yac_cget_grid_names_instance ( int yac_instance_id, int nbr_grids,
115 const char ** grid_names )
116 void yac_cget_comp_grid_names_instance ( int yac_instance_id, const char* comp_name,
117 int nbr_grids, const char ** grid_names )
118 void yac_cget_field_names_instance ( int yac_instance_id, const char* comp_name,
119 const char* grid_name,
120 int nbr_fields, const char ** field_names )
121 int yac_cget_field_id_instance ( int yac_instance_id, const char* comp_name,
122 const char* grid_name,
123 const char * field_name )
124 const char* yac_cget_field_timestep_instance ( int yac_instance_id, const char* comp_name,
125 const char* grid_name,
126 const char * field_name )
127 int yac_cget_field_role_instance ( int yac_instance_id, const char* comp_name,
128 const char* grid_name, const char* field_name )
129 void yac_cenable_field_frac_mask_instance ( int yac_instance_id,
130 const char* comp_name,
131 const char* grid_name,
132 const char * field_name,
133 double frac_mask_fallback_value)
134 int yac_cget_field_collection_size_instance ( int yac_instance_id,
135 const char* comp_name,
136 const char* grid_name,
137 const char * field_name )
138 double yac_cget_field_frac_mask_fallback_value_instance ( int yac_instance_id,
139 const char* comp_name,
140 const char* grid_name,
141 const char * field_name )
142 void yac_cdef_component_metadata_instance ( int yac_instance_id,
143 const char* comp_name,
144 const char* metadata)
145 void yac_cdef_grid_metadata_instance ( int yac_instance_id,
146 const char* grid_name,
147 const char* metadata)
148 void yac_cdef_field_metadata_instance ( int yac_instance_id,
149 const char* comp_name,
150 const char* grid_name,
151 const char* field_name,
152 const char* metadata)
154 const char* comp_name)
156 const char* grid_name)
158 const char* comp_name,
159 const char* grid_name,
160 const char* field_name)
161 char * yac_cget_start_datetime_instance ( int yac_instance_id )
162 char * yac_cget_end_datetime_instance ( int yac_instance_id )
163 char * yac_cget_version ()
164 void yac_cdef_grid_reg2d ( const char * grid_name,
170 void yac_cdef_points_reg2d ( const int grid_id,
173 const double *x_points,
174 const double *y_points,
176 void yac_cdef_grid_curve2d ( const char * grid_name,
182 void yac_cdef_points_curve2d ( const int grid_id,
185 const double *x_points,
186 const double *y_points,
188 void yac_cdef_grid_unstruct ( const char * grid_name,
191 int *num_vertices_per_cell,
196 void yac_cdef_grid_unstruct_ll ( const char * grid_name,
199 int *num_vertices_per_cell,
204 void yac_cdef_points_unstruct ( const int grid_id,
205 const int nbr_points,
207 const double *x_points,
208 const double *y_points,
210 void yac_cset_global_index ( const int * global_index,
213 void yac_cdef_field ( const char * field_name,
214 const int component_id,
215 const int * point_ids,
216 const int num_pointsets,
218 const char* timestep,
221 void yac_cdef_field_mask ( const char * field_name,
222 const int component_id,
223 const int * point_ids,
224 const int * mask_ids,
225 const int num_pointsets,
227 const char* timestep,
230 void yac_csync_def_instance ( int yac_instance_id )
233 const char * weight_file)
239 double scale_summand)
241 int ext_couple_config_id, size_t num_src_mask_names,
242 const char * const * src_mask_names)
244 int ext_couple_config_id, const char * tgt_mask_name)
247 const char * src_comp_name,
248 const char * src_grid_name,
249 const char * src_field_name,
250 const char * tgt_comp_name,
251 const char * tgt_grid_name,
252 const char * tgt_field_name,
253 const char * coupling_timestep,
254 int time_unit, int time_reduction,
255 int interp_stack_config_id,
256 int src_lag, int tgt_lag,
257 int ext_couple_config_id)
258 void yac_cget_ ( const int field_id,
259 const int collection_size,
263 void yac_cget_async_ ( const int field_id,
264 const int collection_size,
268 void yac_cput_ ( const int field_id,
269 const int collection_size,
270 const double * send_field,
273 void yac_cput_frac_ ( const int field_id,
274 const int collection_size,
276 double *send_frac_mask,
279 void yac_ctest ( int field_id, int * flag )
280 void yac_cwait ( int field_id ) nogil
282 const char* yac_cget_field_name_from_field_id ( int field_id )
283 int yac_cget_role_from_field_id ( int field_id )
284 const char* yac_cget_timestep_from_field_id ( int field_id )
285 size_t yac_cget_grid_size ( int location, int grid_id )
286 size_t yac_cget_points_size ( int points_id )
287 int yac_cget_collection_size_from_field_id ( const int field_id )
291 int interp_stack_config_id, int reduction_type, int partial_coverage)
293 int interp_stack_config_id, int weight_type, int partial_coverage)
295 unsigned int n, double scale)
297 int interp_stack_config_id, int order, int enforced_conserv,
298 int partial_coverage, int normalisation)
300 int interp_stack_config_id, double spread_distance,
301 double max_search_distance, int weight_type, int scale_type,
302 double src_sphere_radius, double tgt_sphere_radius)
305 int interp_stack_config_id, char * filename, char * src_grid_name,
306 char * tgt_grid_name)
308 int interp_stack_config_id, double value)
310 int interp_stack_config_id, char * constructor_key, char * do_search_key)
312 int interp_stack_config_id, int creep_distance)
314 void yac_cset_core_mask ( const int * is_core,
317 void yac_cset_mask ( const int * is_valid,
319 void yac_cdef_mask_named ( const int grid_id,
320 const int nbr_points,
322 const int * is_valid,
326 ctypedef void (*yac_abort_func)(MPI_Comm comm, const char *msg,
327 const char *source, int line)
except *
331 const char * yaml_file)
338_logger = logging.getLogger(
"yac")
339_logger.addHandler(logging.NullHandler())
345 Refers to @ref YAC_LOCATION_CELL, @ref YAC_LOCATION_CORNER and @ref YAC_LOCATION_EDGE
347 CELL = _LOCATION_CELL
348 CORNER = _LOCATION_CORNER
349 EDGE = _LOCATION_EDGE
353 Exchange type of a field
355 Refers to @ref YAC_EXCHANGE_TYPE_NONE, @ref YAC_EXCHANGE_TYPE_SOURCE and @ref YAC_EXCHANGE_TYPE_TARGET
357 NONE = _EXCHANGE_TYPE_NONE
358 SOURCE = _EXCHANGE_TYPE_SOURCE
359 TARGET = _EXCHANGE_TYPE_TARGET
363 Refers to @ref YAC_ACTION_NONE, @ref YAC_ACTION_REDUCTION etc.
366 REDUCTION = _ACTION_REDUCTION
367 COUPLING = _ACTION_COUPLING
368 GET_FOR_RESTART = _ACTION_GET_FOR_RESTART
369 PUT_FOR_RESTART = _ACTION_PUT_FOR_RESTART
370 OUT_OF_BOUND = _ACTION_OUT_OF_BOUND
374 Reduction type for the definition of interpolations
376 Refers to @ref YAC_REDUCTION_TIME_NONE, @ref YAC_REDUCTION_TIME_ACCUMULATE etc.
378 TIME_NONE = _REDUCTION_TIME_NONE
379 TIME_ACCUMULATE = _REDUCTION_TIME_ACCUMULATE
380 TIME_AVERAGE = _REDUCTION_TIME_AVERAGE
381 TIME_MINIMUM = _REDUCTION_TIME_MINIMUM
382 TIME_MAXIMUM = _REDUCTION_TIME_MAXIMUM
386 Calendar type for use in def_calendar
388 Refers to @ref YAC_CALENDAR_NOT_SET, @ref YAC_PROLEPTIC_GREGORIAN etc.
390 CALENDAR_NOT_SET = _CALENDAR_NOT_SET
391 PROLEPTIC_GREGORIAN = _PROLEPTIC_GREGORIAN
392 YEAR_OF_365_DAYS = _YEAR_OF_365_DAYS
393 YEAR_OF_360_DAYS = _YEAR_OF_360_DAYS
397 @see yac_cdef_calendar
404 Refers to @ref YAC_TIME_UNIT_MILLISECOND, @ref YAC_TIME_UNIT_SECOND etc.
406 MILLISECOND = _TIME_UNIT_MILLISECOND
407 SECOND = _TIME_UNIT_SECOND
408 MINUTE = _TIME_UNIT_MINUTE
409 HOUR = _TIME_UNIT_HOUR
411 MONTH = _TIME_UNIT_MONTH
412 YEAR = _TIME_UNIT_YEAR
413 ISO_FORMAT = _TIME_UNIT_ISO_FORMAT
417 Reduction type for average interpolation
419 Refers to @ref YAC_AVG_ARITHMETIC, @ref YAC_AVG_DIST and @ref YAC_AVG_BARY
421 AVG_ARITHMETIC = _AVG_ARITHMETIC
427 Reduction type for ncc interpolation
429 Refers to @ref YAC_NCC_AVG and @ref YAC_NCC_DIST
436 Reduction type for nnn interpolation
438 Refers to @ref YAC_NNN_AVG, @ref YAC_NNN_DIST etc.
447 Normalization type for conservative interpolation
449 Refers to @ref YAC_CONSERV_DESTAREA and @ref YAC_CONSERV_FRACAREA
451 DESTAREA = _CONSERV_DESTAREA
452 FRACAREA = _CONSERV_FRACAREA
456 Refers to @ref YAC_SPMAP_AVG and @ref YAC_SPMAP_DIST
463 Refers to @ref YAC_SPMAP_NONE, YAC_SPMAP_SRCAREA
464 YAC_SPMAP_INVTGTAREA, and @ref YAC_SPMAP_FRACAREA
467 SRCAREA = _SPMAP_SRCAREA
468 INVTGTAREA = _SPMAP_INVTGTAREA
469 FRACAREA = _SPMAP_FRACAREA
473 Initializies a YAC instance and provides further functionality
475 The destructor finalizes the YAC instance by calling yac_cfinalize_instance
477 def __init__(self, comm = None, default_instance = False):
479 @see yac_cinit_instance
485 _logger.debug(
"init")
489 _logger.debug(
"init_instance")
492 from mpi4py
import MPI
493 if type(comm)
is MPI.Intracomm:
494 comm = MPI.Comm.py2f(comm)
496 _logger.debug(
"init_comm")
500 _logger.debug(
"init_comm_instance")
502 _logger.debug(f
"instance_id={instance_id}")
509 yac = cls.__new__(cls)
511 yac.initialized =
False
519 @see yac_ccleanup_instance
522 _logger.debug(f
"cleanup instance_id={self.instance_id}")
528 @see yac_cdef_comp_instance
531 _logger.debug(f
"def_comp: comp_name={comp_name}")
533 _logger.debug(f
"comp_id={comp_id}")
538 @see yac_cdef_comps_instance
540 cdef int comp_len = len(comp_names)
541 cdef const char **c_comp_names = <const char **>malloc(comp_len * sizeof(const char *))
542 cdef int *c_comp_ids = <int*>malloc(comp_len * sizeof(int))
543 _logger.debug(f
"def_comps: comp_names={comp_names}")
544 byte_comp_names = [c.encode()
for c
in comp_names]
545 for i
in range(comp_len):
546 c_comp_names[i] = byte_comp_names[i]
548 comp_list = [
Component(c_comp_ids[i])
for i
in range(comp_len) ]
551 _logger.debug(
"comp_list={comp_list}")
556 @see yac_cpredef_comp_instance
559 _logger.debug(f
"predef_comp: comp_name={comp_name}")
561 _logger.debug(
"comp_id={comp_id}")
566 @see yac_cdef_datetime_instance
568 The parameters can be given either as a string in iso8601
569 format or as datetime objects
573 if(
type(start_datetime)
is datetime.datetime):
574 start_datetime = start_datetime.isoformat()
577 if start_datetime
is not None:
578 _logger.debug(f
"def_datetime start: {start_datetime}")
580 start_datetime.encode(),
584 if(
type(end_datetime)
is datetime.datetime):
585 end_datetime = end_datetime.isoformat()
588 if end_datetime
is not None:
589 _logger.debug(f
"def_datetime end: {end_datetime}")
592 end_datetime.encode())
597 @see yac_cget_start_datetime_instance (`datetime.datetime`, read-only).
600 return bytes.decode(start)
605 @see yac_cget_end_datetime_instance (`datetime.datetime`, read-only).
608 return bytes.decode(end)
612 @see yac_csync_def_instance
614 _logger.debug(
"sync_def")
618 src_comp : str, src_grid : str, src_field,
619 tgt_comp : str, tgt_grid : str, tgt_field,
620 coupling_timestep : str, timeunit : TimeUnit,
621 time_reduction : Reduction,
622 interp_stack, src_lag = 0, tgt_lag = 0,
623 weight_file =
None, mapping_on_source = 1,
624 scale_factor = 1.0, scale_summand = 0.0,
625 src_masks_names =
None, tgt_mask_name =
None):
627 @see yac_cdef_couple_instance
629 cdef char * weight_file_ptr
630 if weight_file
is None:
631 weight_file_ptr = NULL
633 weight_file_bytes = weight_file.encode()
634 weight_file_ptr = weight_file_bytes
635 cdef const char ** src_mask_names_ptr = NULL
636 cdef const char * tgt_mask_name_ptr = NULL
637 if tgt_mask_name
is not None:
638 tgt_mask_enc = tgt_mask_name.encode()
639 tgt_mask_name = tgt_mask_enc
640 cdef int couple_config_id
650 if src_masks_names
is not None:
651 if type(src_masks_names)
is str:
652 src_masks = [src_masks_names]
653 src_masks_enc = [s.encode()
for s
in src_masks_names]
654 src_mask_names_ptr = <const char **>malloc(len(src_masks_enc) * sizeof(char*))
655 for i
in range(len(src_masks_enc)):
656 src_mask_names_ptr[i] = src_masks_enc[i]
660 free(src_mask_names_ptr)
661 if tgt_mask_name
is not None:
663 _logger.debug(f
"def_couple {(src_comp.encode(), src_grid.encode(), src_field.encode())}, {(tgt_comp.encode(), tgt_grid.encode(), tgt_field.encode())}")
665 src_comp.encode(), src_grid.encode(), src_field.encode(),
666 tgt_comp.encode(), tgt_grid.encode(), tgt_field.encode(),
667 coupling_timestep.encode(),
TimeUnit(timeunit).value,
669 interp_stack.interp_stack_id, src_lag, tgt_lag,
675 @see yac_cenddef_instance
677 _logger.debug(
"enddef")
683 @see yac_cget_comp_names
686 cdef const char **ret = <const char **>malloc(nbr_components * sizeof(const char *))
688 comp_list = [bytes(ret[i]).decode(
'UTF-8')
for i
in range(nbr_components) ]
695 @see yac_cget_grid_names
698 cdef const char **ret = <const char **>malloc(nbr_grids * sizeof(const char *))
700 grid_list = [bytes(ret[i]).decode(
'UTF-8')
for i
in range(nbr_grids) ]
706 @see yac_cget_comp_grid_names
709 cdef const char **ret = <const char **>malloc(nbr_grids * sizeof(const char *))
711 grid_list = [bytes(ret[i]).decode(
'UTF-8')
for i
in range(nbr_grids) ]
717 @see yac_cget_field_names
722 cdef const char **ret = <const char **>malloc(nbr_fields * sizeof(const char *))
724 grid_name.encode(), nbr_fields, ret)
725 field_list = [bytes(ret[i]).decode(
'UTF-8')
for i
in range(nbr_fields) ]
729 def get_field_id(self, comp_name : str, grid_name : str, field_name : str):
731 @see yac_cget_field_id
733 return yac_cget_field_id_instance (self.
instance_id,
740 @see yac_cget_field_timestep
745 field_name.encode()).decode(
'UTF-8')
749 @see yac_cget_field_role
754 field_name.encode()))
758 @see yac_cget_field_collection_size
767 @see yac_cget_field_frac_mask_fallback_value
775 frac_mask_fallback_value : _np.float64):
777 @see yac_cenable_field_frac_mask
779 _logger.debug(f
"enable_field_frac_mask {(comp_name, grid_name, field_name)})")
784 frac_mask_fallback_value)
788 @see yac_cdef_component_metadata
790 _logger.debug(f
"def_component_metadata comp_name={comp_name}")
792 comp_name.encode(), metadata)
796 @see yac_cdef_grid_metadata
798 _logger.debug(f
"def_grid_metadata grid_name={grid_name}")
800 grid_name.encode(), metadata)
803 field_name : str,metadata : bytes):
805 @see yac_cdef_field_metadata
807 _logger.debug(
"def_field_metadata (comp_name, grid_name, field_name)="
808 f
"{(comp_name, grid_name, field_name)}")
810 grid_name.encode(), field_name.encode(),
815 @see yac_cget_component_metadata
819 return bytes(metadata).decode(
'UTF-8')
if metadata != NULL
else None
823 @see yac_cget_grid_metadata
827 return bytes(metadata).decode(
'UTF-8')
if metadata != NULL
else None
831 @see yac_cget_field_metadata
837 return bytes(metadata).decode(
'UTF-8')
if metadata != NULL
else None
841 @see yac_cget_comps_comm
843 from mpi4py
import MPI
845 cptr = [c.encode()
for c
in comp_names]
846 cdef const char ** comp_names_c_ptr = <const char **>malloc(len(comp_names) * sizeof(const char *))
847 for i
in range(len(comp_names)):
848 comp_names_c_ptr[i] = cptr[i]
850 free(comp_names_c_ptr)
852 return MPI.Comm.f2py(MPI_Comm_c2f(comm))
856 @see yac_cread_config_yaml_instance
858 _logger.debug(f
"read_config_yaml yaml_file={yaml_file}")
863 Stores the component_id and provides further functionality
871 @see yac_cget_comp_comm (`MPI.Comm`, read-only)
873 from mpi4py
import MPI
877 return MPI.Comm.f2py(MPI_Comm_c2f(comm))
882 number of processes in this component
891 process index in the component
906 Stores the grid_id and provides further functionality
908 Base class for Reg2dGrid and UnstructuredGrid
915 @see yac_cset_global_index
917 cdef int[::1] global_index_view = _np.ascontiguousarray(global_index, dtype=_np.intc)
918 _logger.debug(f
"set_global_index grid_id={self.grid_id}")
924 @see yac_cget_grid_size (`int`, read-only)
926 return yac_cget_grid_size ( Location.CELL.value, self.
grid_id )
931 @see yac_cget_grid_size (`int`, read-only)
933 return yac_cget_grid_size ( Location.CORNER.value, self.
grid_id )
938 @see yac_cget_grid_size (`int`, read-only)
940 return yac_cget_grid_size ( Location.EDGE.value, self.
grid_id )
944 @see yac_cset_core_mask
946 cdef size_t len_is_core = len(is_core)
948 cdef int[::1] np_mask = _np.ascontiguousarray(is_core, dtype=_np.intc)
949 _logger.debug(f
"set_core_mask grid_id={self.grid_id}")
950 yac_cset_core_mask ( &np_mask[0], location.value, self.
grid_id)
953 is_valid, name =
None):
954 cdef int len_is_valid = len(is_valid)
955 cdef int[::1] np_mask = _np.ascontiguousarray(is_valid, dtype=_np.int32)
957 cdef char* c_name = NULL
959 name_enc = name.encode()
961 _logger.debug(f
"def_mask_named grid_id={self.grid_id}, name={name}")
962 yac_cdef_mask_named ( self.
grid_id,
972 Stores the points_id and provides further functionality
980 @see yac_cget_points_size (`int`, read-only)
982 return yac_cget_points_size ( self.
points_id )
988 cdef size_t len_is_valid = len(is_valid)
989 assert len_is_valid==self.
size
990 cdef int[::1] np_mask = _np.ascontiguousarray(is_valid, dtype=_np.intc)
991 _logger.debug(f
"set_mask points_id={self.points_id}")
992 yac_cset_mask ( &np_mask[0],
999 def __init__(self, grid_name : str, x_vertices, y_vertices,
1000 cyclic = [
False,
False]):
1002 @see yac_cdef_grid_reg2d
1005 cdef double[::1] x = _np.ascontiguousarray(x_vertices, dtype=_np.double)
1006 cdef double[::1] y = _np.ascontiguousarray(y_vertices, dtype=_np.double)
1007 cdef int[2] cyclic_view = cyclic
1008 _logger.debug(f
"def_grid_reg2d grid_name={grid_name}")
1010 cyclic_view, &x[0], &y[0], &grid_id)
1011 _logger.debug(f
"grid_id={grid_id}")
1015 x_vertices, y_vertices):
1017 @see yac_cdef_points_reg2d
1020 cdef double[::1] x = _np.ascontiguousarray(x_vertices, dtype=_np.double)
1021 cdef double[::1] y = _np.ascontiguousarray(y_vertices, dtype=_np.double)
1022 _logger.debug(f
"def_points_reg2d grid_id={self.grid_id}")
1024 location.value, &x[0], &y[0], &points_id)
1025 _logger.debug(f
"points_id={points_id}")
1029 x_vertices, y_vertices):
1031 @see yac_cdef_points_unstruct
1033 assert len(x_vertices) == len(y_vertices)
1035 cdef double[::1] x = _np.ascontiguousarray(x_vertices, dtype=_np.double)
1036 cdef double[::1] y = _np.ascontiguousarray(y_vertices, dtype=_np.double)
1037 _logger.debug(f
"def_points_unstruct grid_id={self.grid_id}")
1039 location.value, &x[0], &y[0], &points_id)
1040 _logger.debug(f
"points_id={points_id}")
1045 A curvilinear stuctured 2d Grid
1047 def __init__(self, grid_name : str, x_vertices, y_vertices,
1048 cyclic = [
False,
False]):
1050 @see yac_cdef_grid_curve2d
1053 cdef double[::1] x = _np.ascontiguousarray(x_vertices.flatten(), dtype=_np.double)
1054 cdef double[::1] y = _np.ascontiguousarray(y_vertices.flatten(), dtype=_np.double)
1055 cdef int[2] cyclic_view = cyclic
1056 _logger.debug(f
"def_grid_curve2d grid_name={grid_name}")
1058 [_np.shape(x_vertices)[1], _np.shape(y_vertices)[0]],
1059 cyclic_view, &x[0], &y[0], &grid_id)
1060 _logger.debug(f
"grid_id={grid_id}")
1064 x_vertices, y_vertices):
1066 @see yac_cdef_points_curve2d
1068 assert x_vertices.shape == y_vertices.shape
1070 cdef double[::1] x = _np.ascontiguousarray(x_vertices.flatten(), dtype=_np.double)
1071 cdef double[::1] y = _np.ascontiguousarray(y_vertices.flatten(), dtype=_np.double)
1072 _logger.debug(f
"def_points_curve2d grid_id={self.grid_id}")
1074 [_np.shape(x_vertices)[1], _np.shape(x_vertices)[0]],
1075 location.value, &x[0], &y[0], &points_id)
1076 _logger.debug(f
"points_id={points_id}")
1080 x_vertices, y_vertices):
1082 @see yac_cdef_points_unstruct
1084 assert len(x_vertices) == len(y_vertices)
1086 cdef double[::1] x = _np.ascontiguousarray(x_vertices, dtype=_np.double)
1087 cdef double[::1] y = _np.ascontiguousarray(y_vertices, dtype=_np.double)
1088 _logger.debug(f
"def_points_unstruct grid_id={self.grid_id}")
1090 location.value, &x[0], &y[0], &points_id)
1091 _logger.debug(f
"points_id={points_id}")
1096 An unstuctured 2d Grid
1098 def __init__(self, grid_name : str, num_vertices_per_cell,
1099 x_vertices, y_vertices, cell_to_vertex, use_ll_edges=
False):
1101 @see yac_cdef_grid_unstruct and @see yac_cdef_grid_unstruct_ll
1104 cdef int[::1] num_vertices_per_cell_view = _np.ascontiguousarray(num_vertices_per_cell, dtype=_np.intc)
1105 cdef double[::1] x_vertices_view = _np.ascontiguousarray(x_vertices, dtype=_np.double)
1106 cdef double[::1] y_vertices_view = _np.ascontiguousarray(y_vertices, dtype=_np.double)
1107 cdef int[::1] cell_to_vertex_view = _np.ascontiguousarray(cell_to_vertex, dtype=_np.intc)
1108 if not use_ll_edges:
1109 _logger.debug(f
"def_grid_unstruct grid_name={grid_name}")
1111 len(num_vertices_per_cell_view),
1112 &num_vertices_per_cell_view[0],
1113 &x_vertices_view[0], &y_vertices_view[0],
1114 &cell_to_vertex_view[0], &grid_id)
1116 _logger.debug(f
"def_grid_unstruct_ll grid_name={grid_name}")
1118 len(num_vertices_per_cell_view),
1119 &num_vertices_per_cell_view[0],
1120 &x_vertices_view[0], &y_vertices_view[0],
1121 &cell_to_vertex_view[0], &grid_id)
1122 _logger.debug(f
"grid_id={grid_id}")
1126 x_points, y_points):
1128 @see yac_cdef_points_unstruct
1131 cdef double[::1] x_points_view = _np.ascontiguousarray(x_points, dtype=_np.double)
1132 cdef double[::1] y_points_view = _np.ascontiguousarray(y_points, dtype=_np.double)
1133 _logger.debug(f
"yac_cdef_points_unstruct grid_id={self.grid_id}")
1135 &x_points_view[0], &y_points_view[0], &points_id)
1136 _logger.debug(f
"points_id={points_id}")
1148 def create(cls, field_name : str, comp : Component, points, collection_size,
1149 timestep : str, timeunit : TimeUnit, masks =
None):
1153 from collections.abc
import Iterable
1155 if not isinstance(points, Iterable):
1157 cdef int[:] point_ids_array = _np.array([p.points_id
for p
in points], dtype=_np.intc)
1158 size = sum(p.size
for p
in points)
1159 cdef int[:] mask_ids_array
1161 _logger.debug(f
"def_field field_name={field_name}, comp_id={comp.comp_id}, point_ids={[p.points_id for p in points]}")
1163 &point_ids_array[0], len(point_ids_array),
1164 collection_size, timestep.encode(),
TimeUnit(timeunit).value, &field_id)
1166 if not isinstance(masks, Iterable):
1168 mask_ids_array = _np.array([m.mask_id
for m
in masks], dtype=_np.intc)
1169 _logger.debug(f
"def_field_mask field_name={field_name}, comp_id={comp.comp_id}, point_ids={[p.points_id for p in points]}")
1171 &point_ids_array[0], &mask_ids_array[0],
1172 len(point_ids_array),
1173 collection_size, timestep.encode(),
TimeUnit(timeunit).value, &field_id)
1174 _logger.debug(f
"field_id={field_id}")
1175 return Field(field_id, size)
1183 _logger.debug(f
"test field_id={self.field_id}")
1185 _logger.debug(f
"flag={flag}")
1194 _logger.debug(f
"wait field_id={field_id}")
1196 yac_cwait ( field_id )
1201 Coroutine. Blocks until the communication is completed.
1203 while self.
test() == 0:
1206 @cython.boundscheck(False)
1207 def get(self, buf=None, asyn=False):
1211 @param[out] buf receive buffer, if `None` a numpy array of correct size is allocated
1212 @param[in] asyn if True the call returns immidiatly and must be completed
1213 with `test` or `wait`
1221 if buf_in
is not None and buf.base
is None:
1222 _logger.warning(
"get: non-contiguous buffer passed to get. Reallocated memory.")
1223 cdef double[:,::1] buf_view = buf
1227 _logger.debug(f
"get_async_ field_id={self.field_id}")
1228 yac_cget_async_(field_id, collection_size, &buf_view[0,0], &info, &ierror)
1230 _logger.debug(f
"get_ field_id={self.field_id}")
1232 yac_cget_(field_id, collection_size, &buf_view[0,0], &info, &ierror)
1234 raise RuntimeError(
"yac_cget returned error number " + str(ierror))
1235 _logger.debug(f
"info={info}")
1240 Coroutine. Executes a get operation.
1242 @see yac_cget_async_
1244 @param[out] buf receive buffer, if `None` a numpy array of correct size is allocated
1246 buf, info = self.
get(buf, asyn=
True)
1250 @cython.boundscheck(False)
1251 def put(self, buf, frac_mask = None):
1258 cdef double[:,:,::1] frac_mask_view
1261 if frac_mask
is not None:
1262 frac_mask_view = _np.ascontiguousarray(
1264 _logger.debug(f
"put_frac_ field_id={self.field_id}")
1267 &frac_mask_view[0,0,0], &info, &ierror)
1269 _logger.debug(f
"put_ field_id={self.field_id}")
1271 yac_cput_(field_id, collection_size, &buf_view[0,0,0], &info, &ierror)
1273 raise RuntimeError(
"yac_cput returned error number " + str(ierror))
1274 _logger.debug(f
"info={info}")
1279 Coroutine. Executes a put operation.
1284 return self.
put(buf, frac_mask)
1290 _logger.debug(f
"update field_id={self.field_id}")
1296 @see yac_cget_field_name_from_field_id
1298 return bytes.decode(yac_cget_field_name_from_field_id ( self.
field_id ))
1303 @see yac_cget_role_from_field_id
1310 @see yac_cget_timestep_from_field_id
1312 return bytes.decode(yac_cget_timestep_from_field_id ( self.
field_id ))
1317 @see yac_cget_collection_size_from_field_id
1324 The size of the corresponding points object
1331 @see yac_cget_field_datetime
1338 @see yac_cget_action
1347 @see yac_cget_interp_stack_config
1349 cdef int interp_stack_config_id
1350 _logger.debug(f
"get_interp_stack_config")
1352 _logger.debug(f
"interp_stack_config_id={interp_stack_config_id}")
1355 def add_average(self, reduction_type : AverageReductionType, partial_coverage):
1357 @see yac_cadd_interp_stack_config_average
1359 _logger.debug(f
"add_interp_stack_config_average interp_stack_id={self.interp_stack_id}")
1364 def add_ncc(self, reduction_type : NCCReductionType, partial_coverage):
1366 @see yac_cadd_interp_stack_config_ncc
1368 _logger.debug(f
"add_interp_stack_config_ncc interp_stack_id={self.interp_stack_id}")
1373 def add_nnn(self, reduction_type : NNNReductionType, n : int, scale : _np.float64):
1375 @see yac_cadd_interp_stack_config_nnn
1377 _logger.debug(f
"add_interp_stack_config_nnn interp_stack_id={self.interp_stack_id}")
1383 partial_coverage : int, normalisation : ConservNormalizationType):
1385 @see yac_cadd_interp_stack_config_conservative
1387 _logger.debug(f
"add_interp_stack_config_conservative interp_stack_id={self.interp_stack_id}")
1389 order, enforced_conserv,
1393 def add_spmap(self, spread_distance : _np.float64, max_search_distance : _np.float64,
1394 weight_type : SPMAPWeightType, scale_type : SPMAPScaleType,
1395 src_sphere_radius : _np.float64, tgt_sphere_radius : _np.float64):
1397 @see yac_cadd_interp_stack_config_spmap
1399 _logger.debug(f
"add_interp_stack_config_spmap interp_stack_id={self.interp_stack_id}")
1401 spread_distance, max_search_distance,
1404 src_sphere_radius, tgt_sphere_radius)
1408 @see yac_cadd_interp_stack_config_hcsbb
1410 _logger.debug(f
"add_interp_stack_config_hcsbb interp_stack_id={self.interp_stack_id}")
1414 tgt_grid_name : str):
1416 @see yac_cadd_interp_stack_config_user_file
1418 _logger.debug(f
"add_interp_stack_config_user_file interp_stack_id={self.interp_stack_id}")
1420 filename.encode(), src_grid_name.encode(),
1421 tgt_grid_name.encode())
1425 @see yac_cadd_interp_stack_config_fixed
1427 _logger.debug(f
"add_interp_stack_config_fixed interp_stack_id={self.interp_stack_id}")
1430 def add_check(self, constructor_key : str, do_search_key : str):
1432 @see yac_cadd_interp_stack_config_check
1434 _logger.debug(f
"add_interp_stack_config_check interp_stack_id={self.interp_stack_id}")
1436 constructor_key.encode(), do_search_key.encode())
1440 @see yac_cadd_interp_stack_config_creep
1442 _logger.debug(f
"add_interp_stack_config_creep interp_stack_id={self.interp_stack_id}")
1448 @see yac_cfree_interp_stack_config
1450 _logger.debug(f
"free_interp_stack_config interp_stack_id={self.interp_stack_id}")
1455 @see yac_cget_version
1460if Py_AtExit(yac_cfinalize) < 0:
1463 b
"could not register yac_cfinalize with Py_AtExit()",
1468cdef void yac_python_abort(MPI_Comm comm, const char* msg,
1469 const char* source, int line)
except *:
1471 traceback.print_stack()
Refers to YAC_ACTION_NONE, YAC_ACTION_REDUCTION etc.
Reduction type for average interpolation.
Calendar type for use in def_calendar.
Stores the component_id and provides further functionality.
size(self)
number of processes in this component
rank(self)
process index in the component
Normalization type for conservative interpolation.
A curvilinear stuctured 2d Grid.
def_points_unstruct(self, Location location, x_vertices, y_vertices)
def_points(self, Location location, x_vertices, y_vertices)
__init__(self, str grid_name, x_vertices, y_vertices, cyclic=[False, False])
Exchange type of a field.
put_coro(self, buf, frac_mask=None)
Coroutine.
get_coro(self, buf=None)
Coroutine.
size(self)
The size of the corresponding points object.
wait_coro(self)
Coroutine.
get(self, buf=None, asyn=False)
create(cls, str field_name, Component comp, points, collection_size, str timestep, TimeUnit timeunit, masks=None)
__init__(self, field_id, size=None)
put(self, buf, frac_mask=None)
Stores the grid_id and provides further functionality.
set_core_mask(self, is_core, Location location)
set_global_index(self, global_index, Location location)
def_mask(self, Location location, is_valid, name=None)
add_user_file(self, str filename, str src_grid_name, str tgt_grid_name)
add_check(self, str constructor_key, str do_search_key)
add_average(self, AverageReductionType reduction_type, partial_coverage)
add_spmap(self, _np.float64 spread_distance, _np.float64 max_search_distance, SPMAPWeightType weight_type, SPMAPScaleType scale_type, _np.float64 src_sphere_radius, _np.float64 tgt_sphere_radius)
add_conservative(self, int order, int enforced_conserv, int partial_coverage, ConservNormalizationType normalisation)
add_creep(self, int creep_distance)
add_nnn(self, NNNReductionType reduction_type, int n, _np.float64 scale)
add_fixed(self, _np.float64 value)
add_ncc(self, NCCReductionType reduction_type, partial_coverage)
Reduction type for ncc interpolation.
Reduction type for nnn interpolation.
Stores the points_id and provides further functionality.
__init__(self, points_id)
Reduction type for the definition of interpolations.
__init__(self, str grid_name, x_vertices, y_vertices, cyclic=[False, False])
def_points(self, Location location, x_vertices, y_vertices)
def_points_unstruct(self, Location location, x_vertices, y_vertices)
Refers to YAC_SPMAP_NONE, YAC_SPMAP_SRCAREA YAC_SPMAP_INVTGTAREA, and YAC_SPMAP_FRACAREA.
Refers to YAC_SPMAP_AVG and YAC_SPMAP_DIST.
Refers to YAC_TIME_UNIT_MILLISECOND, YAC_TIME_UNIT_SECOND etc.
def_points(self, Location location, x_points, y_points)
__init__(self, str grid_name, num_vertices_per_cell, x_vertices, y_vertices, cell_to_vertex, use_ll_edges=False)
Initializies a YAC instance and provides further functionality.
read_config_yaml(self, str yaml_file)
def_comp(self, str comp_name)
predef_comp(self, str comp_name)
get_grid_metadata(self, str grid_name)
def_component_metadata(self, str comp_name, bytes metadata)
def_field_metadata(self, str comp_name, str grid_name, str field_name, bytes metadata)
def_grid_metadata(self, str grid_name, bytes metadata)
get_field_metadata(self, str comp_name, str grid_name, str field_name)
get_comps_comm(self, comp_names)
get_field_names(self, str comp_name, str grid_name)
get_field_id(self, str comp_name, str grid_name, str field_name)
def_comps(self, comp_names=[])
get_component_metadata(self, str comp_name)
def_datetime(self, start_datetime, end_datetime)
get_field_role(self, str comp_name, str grid_name, str field_name)
enable_field_frac_mask(self, str comp_name, str grid_name, str field_name, _np.float64 frac_mask_fallback_value)
get_comp_grid_names(self, comp_name)
def_couple(self, str src_comp, str src_grid, src_field, str tgt_comp, str tgt_grid, tgt_field, str coupling_timestep, TimeUnit timeunit, Reduction time_reduction, interp_stack, src_lag=0, tgt_lag=0, weight_file=None, mapping_on_source=1, scale_factor=1.0, scale_summand=0.0, src_masks_names=None, tgt_mask_name=None)
get_field_timestep(self, str comp_name, str grid_name, str field_name)
get_field_frac_mask_fallback_value(self, str comp_name, str grid_name, str field_name)
__init__(self, comm=None, default_instance=False)
get_field_collection_size(self, str comp_name, str grid_name, str field_name)
def_calendar(Calendar calendar)
void yac_cadd_interp_stack_config_ncc(int interp_stack_config_id, int weight_type, int partial_coverage)
const char * yac_cget_field_metadata_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name)
void yac_cadd_interp_stack_config_spmap(int interp_stack_config_id, double spread_distance, double max_search_distance, int weight_type, int scale_type, double src_sphere_radius, double tgt_sphere_radius)
void yac_cpredef_comp_instance(int yac_instance_id, char const *name, int *comp_id)
char * yac_cget_start_datetime_instance(int yac_instance_id)
void yac_cdef_field_mask(char const *name, int const comp_id, int const *point_ids, int const *mask_ids, int const num_pointsets, int collection_size, const char *timestep, int time_unit, int *field_id)
void yac_cset_global_index(int const *global_index, int location, int grid_id)
void yac_cget_(int const field_id, int const collection_size, double *recv_field, int *info, int *ierr)
int yac_cget_nbr_grids_instance(int yac_instance_id)
void yac_cfree_ext_couple_config(int ext_couple_config_id)
const char * yac_cget_grid_metadata_instance(int yac_instance_id, const char *grid_name)
char * yac_cget_end_datetime_instance(int yac_instance_id)
void yac_cset_ext_couple_config_tgt_mask_name(int ext_couple_config_id, char const *tgt_mask_name)
void yac_cdef_grid_curve2d(const char *grid_name, int nbr_vertices[2], int cyclic[2], double *x_vertices, double *y_vertices, int *grid_id)
void yac_cget_grid_names_instance(int yac_instance_id, int nbr_grids, const char **grid_names)
void yac_cset_ext_couple_config_scale_factor(int ext_couple_config_id, double scale_factor)
void yac_cadd_interp_stack_config_creep(int interp_stack_config_id, int creep_distance)
void yac_cput_frac_(int const field_id, int const collection_size, double *send_field, double *send_frac_mask, int *info, int *ierr)
void yac_cget_comp_rank_c2py(int comp_id, int *rank)
void yac_cget_comp_size_c2py(int comp_id, int *size)
int yac_cget_comp_nbr_grids_instance(int yac_instance_id, const char *comp_name)
void yac_cdef_grid_unstruct_ll(const char *grid_name, int nbr_vertices, int nbr_cells, int *num_vertices_per_cell, double *x_vertices, double *y_vertices, int *cell_to_vertex, int *grid_id)
void yac_csync_def_instance(int yac_instance_id)
void yac_cadd_interp_stack_config_check(int interp_stack_config_id, char const *constructor_key, char const *do_search_key)
void yac_cenddef_instance(int yac_instance_id)
void yac_cset_ext_couple_config_src_mask_names(int ext_couple_config_id, size_t num_src_mask_names, char const *const *src_mask_names)
int yac_cget_nbr_comps_instance(int yac_instance_id)
int yac_cget_nbr_fields_instance(int yac_instance_id, const char *comp_name, const char *grid_name)
void yac_cget_ext_couple_config(int *ext_couple_config_id)
void yac_cdef_grid_metadata_instance(int yac_instance_id, const char *grid_name, const char *metadata)
void yac_cset_ext_couple_config_weight_file(int ext_couple_config_id, char const *weight_file)
const char * yac_cget_component_metadata_instance(int yac_instance_id, const char *comp_name)
void yac_cread_config_yaml_instance(int yac_instance_id, const char *yaml_filename)
const char * yac_cget_field_timestep_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name)
void yac_cset_ext_couple_config_scale_summand(int ext_couple_config_id, double scale_summand)
void yac_cget_comp_comm(int comp_id, MPI_Comm *comp_comm)
const char * yac_cget_field_datetime(int field_id)
void yac_cdef_comp_instance(int yac_instance_id, char const *comp_name, int *comp_id)
void yac_cupdate(int field_id)
void yac_cget_action(int field_id, int *action)
int yac_cget_collection_size_from_field_id(int field_id)
void yac_cdef_grid_reg2d(const char *grid_name, int nbr_vertices[2], int cyclic[2], double *x_vertices, double *y_vertices, int *grid_id)
void yac_cdef_couple_custom_instance(int yac_instance_id, 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_timestep, int time_unit, int time_reduction, int interp_stack_config_id, int src_lag, int tgt_lag, int ext_couple_config_id)
void yac_cdef_points_reg2d(int const grid_id, int const *nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
void yac_cinit_comm_instance(MPI_Comm comm, int *yac_instance_id)
void yac_cadd_interp_stack_config_nnn(int interp_stack_config_id, int type, size_t n, double scale)
void yac_cenable_field_frac_mask_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name, double frac_mask_fallback_value)
void yac_cadd_interp_stack_config_conservative(int interp_stack_config_id, int order, int enforced_conserv, int partial_coverage, int normalisation)
void yac_cdef_grid_unstruct(const char *grid_name, int nbr_vertices, int nbr_cells, int *num_vertices_per_cell, double *x_vertices, double *y_vertices, int *cell_to_vertex, int *grid_id)
void yac_cdef_points_unstruct(int const grid_id, int const nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
char * yac_cget_version(void)
int yac_cget_default_instance_id()
void yac_cdef_component_metadata_instance(int yac_instance_id, const char *comp_name, const char *metadata)
void yac_cdef_calendar(int calendar)
void yac_cput_(int const field_id, int const collection_size, double *send_field, int *info, int *ierr)
void yac_cget_comp_grid_names_instance(int yac_instance_id, const char *comp_name, int nbr_grids, const char **grid_names)
void yac_cget_async_(int const field_id, int const collection_size, double *recv_field, int *info, int *ierr)
void yac_cadd_interp_stack_config_hcsbb(int interp_stack_config_id)
void yac_cget_comps_comm_instance(int yac_instance_id, char const **comp_names, int num_comps, MPI_Comm *comps_comm)
void yac_cadd_interp_stack_config_fixed(int interp_stack_config_id, double value)
double yac_cget_field_frac_mask_fallback_value_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name)
void yac_cdef_points_curve2d(int const grid_id, int const *nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
void yac_cset_ext_couple_config_mapping_side(int ext_couple_config_id, int mapping_side)
void yac_ccleanup_instance(int yac_instance_id)
int yac_cget_field_collection_size_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name)
void yac_cfree_interp_stack_config(int interp_stack_config_id)
void yac_cadd_interp_stack_config_user_file(int interp_stack_config_id, char const *filename, char const *src_grid_name, char const *tgt_grid_name)
size_t yac_cget_grid_size(int located, int grid_id)
void yac_cinit_instance(int *yac_instance_id)
void yac_cget_interp_stack_config(int *interp_stack_config_id)
void yac_cadd_interp_stack_config_average(int interp_stack_config_id, int reduction_type, int partial_coverage)
void yac_cdef_field(char const *name, int const comp_id, int const *point_ids, int const num_pointsets, int collection_size, const char *timestep, int time_unit, int *field_id)
void yac_cdef_field_metadata_instance(int yac_instance_id, const char *comp_name, const char *grid_name, const char *field_name, const char *metadata)
void yac_cget_field_names_instance(int yac_instance_id, const char *comp_name, const char *grid_name, int nbr_fields, const char **field_names)
void yac_cdef_comps_instance(int yac_instance_id, char const **comp_names, int num_comps, int *comp_ids)
void yac_cget_comp_names_instance(int yac_instance_id, int nbr_comps, const char **comp_names)
void yac_cinit_comm(MPI_Comm comm)
yac_abort_func yac_get_abort_handler(void)
void yac_set_abort_handler(yac_abort_func custom_abort)