12#define YAC_RAD (0.01745329251994329576923690768489)
21 printf (
". main: calling yac_cinit\n");
29 int global_rank, global_size;
30 MPI_Comm_rank(MPI_COMM_WORLD,&global_rank);
31 MPI_Comm_size(MPI_COMM_WORLD,&global_size);
36 printf (
". main: calling yac_cdef_comp\n");
42 comp_name =
"ICON-atmosphere";
43 else if(global_rank == 1)
44 comp_name =
"ICON-ocean";
45 else if(global_rank == 2)
52 printf (
". main: defined %s with local comp ID %i \n", comp_name,
comp_id );
58 MPI_Comm_size(localcomm, &comp_size);
60 printf (
". main: component %s has %i processes\n", comp_name, comp_size );
63 MPI_Comm_free(&localcomm);
66 int num_vert[2] = {3,3};
77 int t_id, t2_id, s_id;
91 int interp_stack_config_id;
97 "ICON-ocean",
"ICON-ocean",
"t",
99 interp_stack_config_id, 0, 0);
101 "ICON-ocean",
"ICON-ocean",
"t2",
103 interp_stack_config_id, 0, 0);
105 "ICON-atmosphere",
"ICON-atmosphere",
"s",
107 interp_stack_config_id, 0, 0);
110 }
else if (global_rank == 2){
111 int interp_stack_config_id;
118 interp_stack_config_id, 0, 0);
121 "OUTPUT",
"OUTPUT",
"t",
123 interp_stack_config_id, 0, 0);
130 double *
data = malloc(
sizeof(
double) * num_vert[0]*num_vert[1]);
132 if(global_rank == 0){
133 for(
int i = 0; i < num_vert[0]*num_vert[1]; ++i)
135 double ** data_ptr = &
data;
136 yac_cput(t_id, 1, &data_ptr, &info, &ierr);
137 for(
int i = 0; i < num_vert[0]*num_vert[1]; ++i)
139 yac_cput(t2_id, 1, &data_ptr, &info, &ierr);
142 printf(
"info: %d\nerr: %d\n%f\n", info, ierr,
data[2]);
144 printf(
"info: %d\nerr: %d\n%f\n", info, ierr,
data[2]);
int const YAC_REDUCTION_TIME_AVERAGE
void yac_cdef_datetime(const char *start_datetime, const char *end_datetime)
void yac_cfinalize()
Finalises YAC.
int const YAC_LOCATION_CORNER
void yac_cget_comp_comm(int comp_id, MPI_Comm *comp_comm)
void yac_cget(int const field_id, int collection_size, double **recv_field, int *info, int *ierr)
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_points_reg2d(int const grid_id, int const *nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
int const YAC_TIME_UNIT_SECOND
void yac_cput(int const field_id, int const collection_size, double ***const send_field, int *info, int *ierr)
void yac_cdef_calendar(int calendar)
int const YAC_PROLEPTIC_GREGORIAN
void yac_cfree_interp_stack_config(int interp_stack_config_id)
void yac_cadd_interp_stack_config_nnn(int interp_stack_config_id, int type, size_t n, double max_search_distance, double scale)
void yac_cget_interp_stack_config(int *interp_stack_config_id)
void yac_cdef_comp(char const *comp_name, int *comp_id)
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_couple(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)