YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_basic_grid_parallel.c
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#include <stdlib.h>
6
7#include "tests.h"
8#include "test_common.h"
9#include "grids/basic_grid.h"
10#include "io_utils.h"
11#include "geometry.h"
12#include "grid_file_common.h"
13
14#include <mpi.h>
15#include <netcdf.h>
16#include <string.h>
17#include <unistd.h>
18#include <math.h>
19
25static void utest_delete_file(char const * filename);
26
27int main(void) {
28
29 MPI_Init(NULL, NULL);
30
31 xt_initialize(MPI_COMM_WORLD);
32
33 int comm_rank, comm_size;
34 MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
35 MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
36 MPI_Barrier(MPI_COMM_WORLD);
37
38 enum {NUM_PROCS = 3};
39 if (comm_size != NUM_PROCS) {
40 PUT_ERR("ERROR: wrong number of processes");
41 xt_finalize();
42 MPI_Finalize();
43 return TEST_EXIT_CODE;
44 }
45
46 {
47 struct {
48 size_t nbr_vertices[NUM_PROCS][2];
49 double lon_vertices[NUM_PROCS][6];
50 double lat_vertices[NUM_PROCS][6];
51 yac_int cell_global_ids[NUM_PROCS][25];
52 int core_cell_mask[NUM_PROCS][25];
53 int has_vertex_data;
54 yac_int vertex_global_ids[NUM_PROCS][36];
55 int core_vertex_mask[NUM_PROCS][36];
56 int has_edge_data;
57 yac_int edge_global_ids[NUM_PROCS][60];
58 int core_edge_mask[NUM_PROCS][60];
59 } decomp[] =
60 {{.nbr_vertices = {{2,5},{5,5},{6,2}},
61 .lon_vertices = {{0,1},{1,2,3,4,5},{0,1,2,3,4,5}},
62 .lat_vertices = {{0,1,2,3,4},{0,1,2,3,4},{4,5}},
63 .cell_global_ids = {{0,5,10,15},
64 {1,2,3,4, 6,7,8,9, 11,12,13,14, 16,17,18,19},
65 {20,21,22,23,24}},
66 .core_cell_mask = {{1,0,1,0},
67 {0,1,0,1, 1,0,1,0, 0,1,0,1, 1,0,1,0},
68 {1,0,1,0,1}},
69 .vertex_global_ids = {{0,1,6,7,12,13,18,19,24,25},
70 {1,2,3,4,5, 7,8,9,10,11, 13,14,15,16,17,
71 19,20,21,22,23, 25,26,27,28,29},
72 {24,25,26,27,28,29, 30,31,32,33,34,35}},
73 .core_vertex_mask = {{1,0,
74 0,1,
75 1,0,
76 0,1,
77 1,0},
78 {0,1,0,1,0,
79 1,0,1,0,1,
80 0,1,0,1,0,
81 1,0,1,0,1,
82 0,1,0,1,0},
83 {1,0,1,0,1,0,
84 0,1,0,1,0,1}},
85 .edge_global_ids = {{0,1,3,
86 11,12,14,
87 22,23,25,
88 33,34,36,
89 44},
90 {2,3,4,5,6,7,8,9,10,
91 13,14,15,16,17,18,19,20,21,
92 24,25,26,27,28,29,30,31,32,
93 35,36,37,38,39,40,41,42,43,
94 46,48,50,52},
95 {44,45,46,47,48,49,50,51,52,53,54,
96 55,56,57,58,59}},
97 .core_edge_mask = {{1,0,0,
98 1,0,0,
99 1,0,0,
100 1,0,0,
101 1},
102 {1,0,1,0,1,0,1,0,0,
103 1,0,1,0,1,0,1,0,0,
104 1,0,1,0,1,0,1,0,0,
105 1,0,1,0,1,0,1,0,0,
106 1,1,1,1},
107 {1,0,1,0,1,0,1,0,1,0,0,
108 1,1,1,1,1}},
109 .has_vertex_data = 1,
110 .has_edge_data = 1},
111 {.nbr_vertices = {{6,6},{0,0},{0,0}},
112 .lon_vertices = {{0,1,2,3,4,5},{-1},{-1}},
113 .lat_vertices = {{0,1,2,3,4,5},{-1},{-1}},
114 .cell_global_ids = {{0,1,2,3,4,
115 5,6,7,8,9,
116 10,11,12,13,14,
117 15,16,17,18,19,
118 20,21,22,23,24}, {-1}, {-1}},
119 .core_cell_mask = {{1,0,1,0,1,
120 0,1,0,1,0,
121 1,0,1,0,1,
122 0,1,0,1,0,
123 1,0,1,0,1}, {-1}, {-1}},
124 .core_vertex_mask = {{1,0,1,0,1,0,
125 0,1,0,1,0,1,
126 1,0,1,0,1,0,
127 0,1,0,1,0,1,
128 1,0,1,0,1,0,
129 0,1,0,1,0,1},
130 {-1},{-1}},
131 .vertex_global_ids = {{0,1,2,3,4,5,
132 6,7,8,9,10,11,
133 12,13,14,15,16,17,
134 18,19,20,21,22,23,
135 24,25,26,27,28,29,
136 30,31,32,33,34,35},
137 {-1},{-1}},
138 .has_vertex_data = 1,
139 .has_edge_data = 0},
140 {.nbr_vertices = {{3,3},{6,6},{0,0}},
141 .lon_vertices = {{0,1,2},{0,1,2,3,4,5},{-1}},
142 .lat_vertices = {{0,1,2},{0,1,2,3,4,5},{-1}},
143 .cell_global_ids = {{0,1,
144 5,6},
145 {0,1,2,3,4,
146 5,6,7,8,9,
147 10,11,12,13,14,
148 15,16,17,18,19,
149 20,21,22,23,24}, {-1}},
150 .core_cell_mask = {{1,0,
151 0,1},
152 {1,0,1,0,1,
153 0,1,0,1,0,
154 1,0,1,0,1,
155 0,1,0,1,0,
156 1,0,1,0,1}, {-1}},
157 .has_vertex_data = 0,
158 .has_edge_data = 0}};
159 enum {NUM_DECOMP = sizeof(decomp) / sizeof(decomp[0])};
160 char const * grid_filename = "test_basic_grid_parallel.nc";
161
162 if (yac_file_exists(grid_filename)) utest_delete_file(grid_filename);
163
164 // for all grid decompositions
165 for (size_t decomp_idx = 0; decomp_idx < NUM_DECOMP; ++decomp_idx) {
166 for (int with_cell_centers = 0; with_cell_centers <= 1; ++with_cell_centers) {
167 for (int with_core_cell_mask = 0; with_core_cell_mask <= 1; ++with_core_cell_mask) {
168 for (int with_cell_global_ids = 0; with_cell_global_ids <= 1; ++with_cell_global_ids) {
169 for (int with_core_vertex_mask = 0; with_core_vertex_mask <= 1; ++with_core_vertex_mask) {
170 for (int with_vertex_global_ids = 0; with_vertex_global_ids <= 1; ++with_vertex_global_ids) {
171 for (int with_core_edge_mask = 0; with_core_edge_mask <= 1; ++with_core_edge_mask) {
172 for (int with_edge_global_ids = 0; with_edge_global_ids <= 1; ++with_edge_global_ids) {
173
174 if ((!decomp[decomp_idx].has_vertex_data &&
175 with_core_vertex_mask) ||
176 (!decomp[decomp_idx].has_vertex_data &&
177 with_vertex_global_ids) ||
178 (!decomp[decomp_idx].has_edge_data &&
179 with_core_edge_mask) ||
180 (!decomp[decomp_idx].has_edge_data &&
181 with_edge_global_ids)) continue;
182
183 // set up distributed grid
184 int cyclic[2] = {0,0};
185
186 struct yac_basic_grid * grid;
187 char const * grid_name = "test_grid";
188 if (decomp[decomp_idx].nbr_vertices[comm_rank][0] *
189 decomp[decomp_idx].nbr_vertices[comm_rank][1] > 0) {
192 decomp[decomp_idx].nbr_vertices[comm_rank], cyclic,
193 decomp[decomp_idx].lon_vertices[comm_rank],
194 decomp[decomp_idx].lat_vertices[comm_rank]);
195 grid = yac_basic_grid_new(grid_name, grid_data);
196 } else {
197 grid = yac_basic_grid_empty_new(grid_name);
198 }
199
200 // compute cell centers
201 struct yac_basic_grid_data * basic_grid_data =
203 yac_coordinate_pointer cell_center_coords =
204 malloc(basic_grid_data->num_cells * sizeof(*cell_center_coords));
205 for (size_t i = 0; i < basic_grid_data->num_cells; ++i) {
206 cell_center_coords[i][0] = 0.0;
207 cell_center_coords[i][1] = 0.0;
208 cell_center_coords[i][2] = 0.0;
209 for (int j = 0; j < basic_grid_data->num_vertices_per_cell[i]; ++j)
210 for (size_t k = 0; k < 3; ++k)
211 cell_center_coords[i][k] +=
212 basic_grid_data->vertex_coordinates[
213 basic_grid_data->cell_to_vertex[
214 basic_grid_data->cell_to_vertex_offsets[i] + j]][k];
215 normalise_vector(cell_center_coords[i]);
216 }
217 if (with_cell_centers && (basic_grid_data->num_cells > 0))
219 grid, YAC_LOC_CELL, cell_center_coords, basic_grid_data->num_cells);
220 free(cell_center_coords);
221 if (with_cell_global_ids && (basic_grid_data->num_cells > 0))
222 basic_grid_data->cell_ids =
224 decomp[decomp_idx].cell_global_ids[comm_rank],
225 basic_grid_data->num_cells * sizeof(decomp[0].cell_global_ids[0]));
226 if (with_core_cell_mask && (basic_grid_data->num_cells > 0))
227 basic_grid_data->core_cell_mask =
229 decomp[decomp_idx].core_cell_mask[comm_rank],
230 basic_grid_data->num_cells * sizeof(decomp[0].core_cell_mask[0]));
231 if (with_vertex_global_ids && (basic_grid_data->num_vertices > 0))
232 basic_grid_data->vertex_ids =
234 decomp[decomp_idx].vertex_global_ids[comm_rank],
235 basic_grid_data->num_vertices * sizeof(decomp[0].vertex_global_ids[0]));
236 if (with_core_vertex_mask && (basic_grid_data->num_vertices > 0))
237 basic_grid_data->core_vertex_mask =
239 decomp[decomp_idx].core_vertex_mask[comm_rank],
240 basic_grid_data->num_vertices * sizeof(decomp[0].core_vertex_mask[0]));
241 if (with_edge_global_ids && (basic_grid_data->num_edges > 0))
242 basic_grid_data->edge_ids =
244 decomp[decomp_idx].edge_global_ids[comm_rank],
245 basic_grid_data->num_edges * sizeof(decomp[0].edge_global_ids[0]));
246 if (with_core_edge_mask && (basic_grid_data->num_edges > 0))
247 basic_grid_data->core_edge_mask =
249 decomp[decomp_idx].core_edge_mask[comm_rank],
250 basic_grid_data->num_edges * sizeof(decomp[0].core_edge_mask[0][0]));
251
252 // set up io configuration
254 setenv("YAC_IO_RANK_LIST", "0,2", 1);
255 setenv("YAC_IO_MAX_NUM_RANKS_PER_NODE", "3", 1);
256
257 // write distributed grid to file
258 yac_basic_grid_to_file_parallel(grid, grid_filename, MPI_COMM_WORLD);
259
261
262 // check generated grid file
263
264 if (comm_rank == 0) {
265 enum {NUM_CELLS = 25, NUM_CRN = 4};
266 double ref_cla[NUM_CELLS][NUM_CRN] =
267 {{0,0,1,1},{0,0,1,1},{0,0,1,1},{0,0,1,1},{0,0,1,1},
268 {1,1,2,2},{1,1,2,2},{1,1,2,2},{1,1,2,2},{1,1,2,2},
269 {2,2,3,3},{2,2,3,3},{2,2,3,3},{2,2,3,3},{2,2,3,3},
270 {3,3,4,4},{3,3,4,4},{3,3,4,4},{3,3,4,4},{3,3,4,4},
271 {4,4,5,5},{4,4,5,5},{4,4,5,5},{4,4,5,5},{4,4,5,5}};
272 double ref_clo[NUM_CELLS][NUM_CRN] =
273 {{0,1,1,0},{1,2,2,1},{2,3,3,2},{3,4,4,3},{4,5,5,4},
274 {0,1,1,0},{1,2,2,1},{2,3,3,2},{3,4,4,3},{4,5,5,4},
275 {0,1,1,0},{1,2,2,1},{2,3,3,2},{3,4,4,3},{4,5,5,4},
276 {0,1,1,0},{1,2,2,1},{2,3,3,2},{3,4,4,3},{4,5,5,4},
277 {0,1,1,0},{1,2,2,1},{2,3,3,2},{3,4,4,3},{4,5,5,4}};
278 double ref_lat[NUM_CELLS] =
279 {0.5,0.5,0.5,0.5,0.5,
280 1.5,1.5,1.5,1.5,1.5,
281 2.5,2.5,2.5,2.5,2.5,
282 3.5,3.5,3.5,3.5,3.5,
283 4.5,4.5,4.5,4.5,4.5};
284 double ref_lon[NUM_CELLS] =
285 {0.5,1.5,2.5,3.5,4.5,
286 0.5,1.5,2.5,3.5,4.5,
287 0.5,1.5,2.5,3.5,4.5,
288 0.5,1.5,2.5,3.5,4.5,
289 0.5,1.5,2.5,3.5,4.5};
290 int ref_cell_global_ids[NUM_CELLS] =
291 {0,1,2,3,4,
292 5,6,7,8,9,
293 10,11,12,13,14,
294 15,16,17,18,19,
295 20,21,22,23,24};
296 int ref_core_cell_mask[NUM_CELLS] =
297 {1,0,1,0,1,
298 0,1,0,1,0,
299 1,0,1,0,1,
300 0,1,0,1,0,
301 1,0,1,0,1};
302 int ref_vertex_global_ids[NUM_CELLS][NUM_CRN] =
303 {{0,1,7,6},{1,2,8,7},{2,3,9,8},{3,4,10,9},{4,5,11,10},
304 {6,7,13,12},{7,8,14,13},{8,9,15,14},{9,10,16,15},{10,11,17,16},
305 {12,13,19,18},{13,14,20,19},{14,15,21,20},{15,16,22,21},{16,17,23,22},
306 {18,19,25,24},{19,20,26,25},{20,21,27,26},{21,22,28,27},{22,23,29,28},
307 {24,25,31,30},{25,26,32,31},{26,27,33,32},{27,28,34,33},{28,29,35,34}};
308 int ref_core_vertex_mask[NUM_CELLS][NUM_CRN] =
309 {{1,0,1,0},{0,1,0,1},{1,0,1,0},{0,1,0,1},{1,0,1,0},
310 {0,1,0,1},{1,0,1,0},{0,1,0,1},{1,0,1,0},{0,1,0,1},
311 {1,0,1,0},{0,1,0,1},{1,0,1,0},{0,1,0,1},{1,0,1,0},
312 {0,1,0,1},{1,0,1,0},{0,1,0,1},{1,0,1,0},{0,1,0,1},
313 {1,0,1,0},{0,1,0,1},{1,0,1,0},{0,1,0,1},{1,0,1,0}};
314 int ref_edge_global_ids[NUM_CELLS][NUM_CRN] =
315 {{0,3,11,1},{2,5,13,3},{4,7,15,5},{6,9,17,7},{8,10,19,9},
316 {11,14,22,12},{13,16,24,14},{15,18,26,16},{17,20,28,18},{19,21,30,20},
317 {22,25,33,23},{24,27,35,25},{26,29,37,27},{28,31,39,29},{30,32,41,31},
318 {33,36,44,34},{35,38,46,36},{37,40,48,38},{39,42,50,40},{41,43,52,42},
319 {44,47,55,45},{46,49,56,47},{48,51,57,49},{50,53,58,51},{52,54,59,53}};
320 int ref_core_edge_mask[NUM_CELLS][NUM_CRN] =
321 {{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},
322 {1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},
323 {1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},
324 {1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},
325 {1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0},{1,0,1,0}};
326
328 grid_filename, grid_name, NUM_CELLS, NUM_CRN,
329 &ref_cla[0][0], &ref_clo[0][0],
330 with_cell_centers?ref_lat:NULL,
331 with_cell_centers?ref_lon:NULL,
332 with_cell_global_ids?ref_cell_global_ids:NULL,
333 with_core_cell_mask?ref_core_cell_mask:NULL,
334 with_vertex_global_ids?&ref_vertex_global_ids[0][0]:NULL,
335 with_core_vertex_mask?&ref_core_vertex_mask[0][0]:NULL,
336 with_edge_global_ids?&ref_edge_global_ids[0][0]:NULL,
337 with_core_edge_mask?&ref_core_edge_mask[0][0]:NULL);
338 } // comm_rank == 0
339 MPI_Barrier(MPI_COMM_WORLD);
340 } // with edge global ids
341 } // with core edge mask
342 } // with vertex global ids
343 } // with core vertex mask
344 utest_delete_file(grid_filename);
345 } // with cell global ids
346 } // with core cell mask
347 } // with cell centers
348 } // decomp
349 }
350
351 { // check grid with varying number of corners per cell
352
353 size_t nbr_vertices[NUM_PROCS] = {4,5,3};
354 size_t nbr_cells[NUM_PROCS] = {1,1,1};
355 int num_vertices_per_cell[NUM_PROCS][1] = {{4},{5},{3}};
356 double lon_vertices[NUM_PROCS][5] = {{0,1,1,0}, {1,2,2,1.5,1}, {0,1,1.5}};
357 double lat_vertices[NUM_PROCS][5] = {{0,0,1,1}, {0,0,1,1.5,1}, {1,1,1.5}};
358 int cell_to_vertex[NUM_PROCS][5] = {{0,1,2,3}, {0,1,2,3,4}, {0,1,2}};
359
360 char const * grid_name = "test_grid";
361 struct yac_basic_grid * grid =
363 grid_name, nbr_vertices[comm_rank], nbr_cells[comm_rank],
364 num_vertices_per_cell[comm_rank], lon_vertices[comm_rank],
365 lat_vertices[comm_rank], cell_to_vertex[comm_rank]);
366
367 yac_int cell_global_ids[NUM_PROCS][1] = {{0}, {1}, {2}};
368 int core_cell_mask[NUM_PROCS][1] = {{1}, {1}, {1}};
369 yac_int vertex_global_ids[NUM_PROCS][5] = {{0,1,4,3}, {1,2,5,6,4}, {3,4,6}};
370 int core_vertex_mask[NUM_PROCS][5] = {{1,1,1,1}, {1,1,1,1,1}, {1,1,1}};
371 yac_int edge_global_ids[NUM_PROCS][5] = {{0,1,3,5}, {2,3,4,8,7}, {5,6,7}};
372 int core_edge_mask[NUM_PROCS][5] = {{1,1,1,1}, {1,1,1,1,1}, {1,1,1}};
373
375
376 grid_data->cell_ids =
378 cell_global_ids[comm_rank],
379 grid_data->num_cells * sizeof(cell_global_ids[0]));
380 grid_data->core_cell_mask =
382 core_cell_mask[comm_rank],
383 grid_data->num_cells * sizeof(core_cell_mask[0]));
384 grid_data->vertex_ids =
386 vertex_global_ids[comm_rank],
387 grid_data->num_vertices * sizeof(vertex_global_ids[0]));
388 grid_data->core_vertex_mask =
390 core_vertex_mask[comm_rank],
391 grid_data->num_vertices * sizeof(core_vertex_mask[0]));
392 grid_data->edge_ids =
394 edge_global_ids[comm_rank],
395 grid_data->num_edges * sizeof(edge_global_ids[0]));
396 grid_data->core_edge_mask =
398 core_edge_mask[comm_rank],
399 grid_data->num_edges * sizeof(core_edge_mask[0][0]));
400
401 // set up io configuration
403 setenv("YAC_IO_RANK_LIST", "0,2", 1);
404 setenv("YAC_IO_MAX_NUM_RANKS_PER_NODE", "3", 1);
405
406 // write distributed grid to file
407 char const * grid_filename = "test_basic_grid_parallel.nc";
408 yac_basic_grid_to_file_parallel(grid, grid_filename, MPI_COMM_WORLD);
409
411
412 MPI_Barrier(MPI_COMM_WORLD);
413
414 if (comm_rank == 0) {
415 enum {NUM_CELLS = 3, NUM_CRN = 5};
416 double ref_clo[NUM_CELLS][NUM_CRN] =
417 {{0,1,1,0,DBL_MAX},{1,2,2,1.5,1},{0,1,1.5,DBL_MAX,DBL_MAX}};
418 double ref_cla[NUM_CELLS][NUM_CRN] =
419 {{0,0,1,1,DBL_MAX},{0,0,1,1.5,1},{1,1,1.5,DBL_MAX,DBL_MAX}};
420 int ref_cell_global_ids[NUM_CELLS] = {0,1,2};
421 int ref_core_cell_mask[NUM_CELLS] = {1,1,1};
422 int ref_vertex_global_ids[NUM_CELLS][NUM_CRN] =
423 {{0,1,4,3,INT_MAX},{1,2,5,6,4},{3,4,6,INT_MAX,INT_MAX}};
424 int ref_core_vertex_mask[NUM_CELLS][NUM_CRN] =
425 {{1,1,1,1,INT_MAX},{1,1,1,1,1},{1,1,1,INT_MAX,INT_MAX}};
426 int ref_edge_global_ids[NUM_CELLS][NUM_CRN] =
427 {{0,3,5,1,INT_MAX}, {2,4,8,7,3}, {5,7,6,INT_MAX,INT_MAX}};
428 int ref_core_edge_mask[NUM_CELLS][NUM_CRN] =
429 {{1,1,1,1,INT_MAX},{1,1,1,1,1},{1,1,1,INT_MAX,INT_MAX}};
430
432 grid_filename, grid_name, NUM_CELLS, NUM_CRN,
433 &ref_cla[0][0], &ref_clo[0][0], NULL, NULL,
434 ref_cell_global_ids, ref_core_cell_mask,
435 &ref_vertex_global_ids[0][0], &ref_core_vertex_mask[0][0],
436 &ref_edge_global_ids[0][0], &ref_core_edge_mask[0][0]);
437 }
438
439 MPI_Barrier(MPI_COMM_WORLD);
440 utest_delete_file(grid_filename);
441 }
442
443 xt_finalize();
444 MPI_Finalize();
445
446 return TEST_EXIT_CODE;
447}
448
449static void utest_delete_file(char const * filename) {
450
451 int rank;
452 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
453 MPI_Barrier(MPI_COMM_WORLD);
454 if (rank == 0) unlink(filename);
455 MPI_Barrier(MPI_COMM_WORLD);
456}
struct yac_basic_grid * yac_basic_grid_new(char const *name, struct yac_basic_grid_data grid_data)
Definition basic_grid.c:50
void yac_basic_grid_to_file_parallel(struct yac_basic_grid *grid, char const *filename, MPI_Comm comm)
Definition basic_grid.c:768
struct yac_basic_grid * yac_basic_grid_unstruct_deg_new(char const *name, size_t nbr_vertices, size_t nbr_cells, int *num_vertices_per_cell, double *x_vertices, double *y_vertices, int *cell_to_vertex)
Definition basic_grid.c:381
struct yac_basic_grid_data * yac_basic_grid_get_data(struct yac_basic_grid *grid)
Definition basic_grid.c:137
size_t yac_basic_grid_add_coordinates(struct yac_basic_grid *grid, enum yac_location location, yac_coordinate_pointer coordinates, size_t count)
Definition basic_grid.c:232
struct yac_basic_grid * yac_basic_grid_empty_new(char const *name)
Definition basic_grid.c:63
void yac_basic_grid_delete(struct yac_basic_grid *grid)
Definition basic_grid.c:70
struct yac_basic_grid_data yac_generate_basic_grid_data_reg_2d_deg(size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices)
Definition grid_reg2d.c:74
static void normalise_vector(double v[])
Definition geometry.h:635
void check_grid_file(char const *filename, char const *grid_name, size_t ref_num_cells, size_t ref_num_corners_per_cell, double *ref_cla, double *ref_clo, double *ref_lat, double *ref_lon, int *ref_cell_global_ids, int *ref_core_cell_mask, int *ref_vertex_global_ids, int *ref_core_vertex_mask, int *ref_edge_global_ids, int *ref_core_edge_mask)
int yac_file_exists(const char *filename)
Definition utils_core.c:12
@ YAC_LOC_CELL
Definition location.h:14
yac_coordinate_pointer vertex_coordinates
size_t * cell_to_vertex_offsets
void * to_pointer(void *data, size_t size_data)
void clear_yac_io_env()
int * cell_to_vertex
unsigned cyclic[2]
#define TEST_EXIT_CODE
Definition tests.h:14
#define PUT_ERR(string)
Definition tests.h:10
YAC_INT yac_int
Definition yac_types.h:15
double(* yac_coordinate_pointer)[3]
Definition yac_types.h:19