25 {{.name =
"TAUX", .collection_size = 2},
26 {.name =
"TAUY", .collection_size = 2},
27 {.name =
"SFWFLX", .collection_size = 3},
28 {.name =
"SFTEMP", .collection_size = 1},
29 {.name =
"THFLX", .collection_size = 4},
30 {.name =
"ICEATM", .collection_size = 4},
31 {.name =
"SST", .collection_size = 1},
32 {.name =
"OCEANU", .collection_size = 1},
33 {.name =
"OCEANV", .collection_size = 1},
34 {.name =
"ICEOCE", .collection_size = 5}};
71int main(
int argc,
char** argv) {
76 MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
77 MPI_Comm_size ( MPI_COMM_WORLD, &size );
80 PUT_ERR(
"ERROR: missing config file directory");
89 malloc(strlen(argv[1]) + 32), argv[1]),
"coupling_test.yaml");
106 PUT_ERR(
"Too many processes have been launched\n");
125 char * comp_name =
"dummy_atmosphere";
126 char * grid_name =
"dummy_atmosphere_grid";
134 MPI_Comm_rank ( local_comm, &rank );
135 MPI_Comm_size ( local_comm, &size );
177 for (
unsigned i = 0; i <
NBR_CELLS; ++i) cell_areas[i] = -1.0;
180 if (cell_areas[i] == -1.0)
181 PUT_ERR(
"ERROR in yac_ccompute_grid_cell_areas");
219 PUT_ERR(
"ERROR in yac_cget_calendar");
249 if (strcmp(timestep_string,
"PT10M"))
PUT_ERR (
"wrong model time step\n");
252 int const ref_collection_size[
NO_OF_FIELDS] = {2,2,3,1,4,4,1,1,1,5};
255 PUT_ERR (
"wrong collection size\n");
258 if ((i < 6) && (role != 1))
PUT_ERR(
"Wrong requested role\n" );
259 if ((i > 5) && (role != 2))
PUT_ERR(
"Wrong requested role\n" );
283 double *point_set_data[5];
284 double **collection_data[5];
286 for (
int i = 0; i < 5; ++i) {
288 collection_data[i] = &(point_set_data[i]);
343 double *collection_data[5];
345 for (
int i = 0; i < 5; ++i) {
353 PUT_ERR(
"wrong atmosphere CPL SST\n");
359 PUT_ERR(
"wrong atmosphere CPL OCEANU\n");
365 PUT_ERR(
"wrong atmosphere CPL OCEANV\n");
375 PUT_ERR (
"wrong atmosphere CPL ice 1\n");
377 PUT_ERR (
"wrong atmosphere CPL ice 2\n");
379 PUT_ERR (
"wrong atmosphere CPL ice 3\n");
381 PUT_ERR (
"wrong atmosphere CPL ice 4\n");
383 PUT_ERR (
"wrong atmosphere CPL ice 5\n");
395 MPI_Comm_free ( &local_comm );
406 char * comp_name =
"dummy_ocean";
407 char * grid_name =
"dummy_ocean_grid";
415 MPI_Comm_rank ( local_comm, &rank );
416 MPI_Comm_size ( local_comm, &size );
534 double *point_set_data[5];
535 double **collection_data[5];
537 for (
unsigned i = 0; i < 5; ++i) {
539 collection_data[i] = &(point_set_data[i]);
574 double *collection_data[5];
576 for (
unsigned i = 0; i < 5; ++i) {
608 MPI_Comm_free ( &local_comm );
621 char * comp_name =
"dummy_io";
628 MPI_Comm_rank ( local_comm, &rank );
629 MPI_Comm_size ( local_comm, &size );
637 MPI_Comm_free ( &local_comm );
int double_are_unequal(double a, double b)
static void dummy_atmosphere()
int nbr_vertices_per_cell[NBR_CELLS]
int global_index[NBR_CELLS]
int cell_core_mask[NBR_CELLS]
static void dummy_ocean()
void yac_ccompute_grid_cell_areas(int grid_id, double *cell_areas)
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)
int yac_cget_role_from_field_id(int field_id)
const char * yac_cget_timestep_from_field_id(int field_id)
void yac_cfinalize()
Finalises YAC.
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)
int yac_cget_collection_size_from_field_id(int field_id)
int const YAC_TIME_UNIT_SECOND
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)
void yac_cput(int const field_id, int const collection_size, double ***const send_field, int *info, int *ierr)
void yac_cget_async(int const field_id, int collection_size, double **recv_field, int *info, int *ierr)
void yac_cread_config_yaml(const char *yaml_filename)
void yac_cdef_calendar(int calendar)
void yac_cset_core_mask(int const *is_core, int location, int grid_id)
void yac_cwait(int field_id)
int const YAC_PROLEPTIC_GREGORIAN
void yac_cset_mask(int const *is_valid, int points_id)
void yac_cdef_mask(int const grid_id, int const nbr_points, int const located, int const *is_valid, int *mask_id)
void yac_ctest(int field_id, int *flag)
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)