YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
toy_scrip.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// #define VERBOSE
6
7#include <mpi.h>
8#include <stdlib.h>
9#include <stdio.h>
10#include <unistd.h>
11#include <math.h>
12#include <netcdf.h>
13#include <string.h>
14#include <stdbool.h>
15#include "yac.h"
16#include "yac_utils.h"
17
28
37
46 {// GEN_MASK
47 {.write_weights = 0,
48 .write_vtk = 1,
49 .component_names =
50 (char const*[]){"torc","bggd","nogt","sse7","icos","icoh"},
51 .num_components = 6,
52 .interpolations =
54 .num_interpolations = 1},
55 // NOICOH
56 {.write_weights = 1,
57 .write_vtk = 1,
58 .component_names =
59 (char const*[]){"torc","bggd","nogt","sse7","icos"},
60 .num_components = 5,
61 .interpolations =
69 .num_interpolations = 7},
70 // NOGT_ICOH
71 {.write_weights = 1,
72 .write_vtk = 1,
73 .component_names = (char const*[]){"nogt","icoh"},
74 .num_components = 2,
75 .interpolations =
83 .num_interpolations = 7},
84 // ICOS_ICOH
85 {.write_weights = 1,
86 .write_vtk = 1,
87 .component_names = (char const*[]){"icos","icoh"},
88 .num_components = 2,
89 .interpolations =
97 .num_interpolations = 7},
98 // DUMMY
99 {.write_weights = 0,
100 .write_vtk = 0,
101 .component_names = (char const*[]){"dummy"},
102 .num_components = 1,
103 .interpolations =
111 .num_interpolations = 7}};
112
113struct {
114 char const * name;
115 int id;
117
118struct {
119 double (*p)(double lon, double lat);
120 char const * name;
121} test_functions[] =
122 {{.p = yac_test_func,
123 .name = "yac"},
124 {.p = yac_test_ana_fcos,
125 .name = "fcos"},
127 .name = "fcossin"},
128 {.p = yac_test_one,
129 .name = "one"},
131 .name = "gulfstream"},
132 {.p = yac_test_harmonic,
133 .name = "harmonic"},
134 {.p = yac_test_vortex,
135 .name = "vortex"}};
137
138static void generate_interp_stacks(void);
139static void free_interp_stacks(void);
140static void LLtoXYZ(double lon, double lat, double p_out[]);
141
142static int * read_mask(char const * filename, char const * grid_name, int const valid_mask_value);
143
144#define STR_USAGE "Usage: %s -e experimentName\n"
145#define YAC_ASSERT_ARGS(exp, msg) \
146 { \
147 if(!((exp))) { \
148 fprintf(stderr, "ERROR: %s\n" STR_USAGE, msg, argv[0]); \
149 exit(EXIT_FAILURE); \
150 } \
151 }
152
153static void parse_arguments(
154 int argc, char ** argv, enum experiment_type * experiment);
155
156int main (int argc, char *argv[]) {
157
158 // Initialisation of MPI
159
160 MPI_Init (0, NULL);
161
162 /* Available experiment configurations
163 "gen_mask" : all the grids, only interpolate the constant one
164 function with conservative 1st ord destarea
165 "noicoh" : torc, nogt, bggd, sse7, icos grids, all the interpolations
166 "nogt_icoh" : nogt, icoh grids, all the interpolations
167 "icos_icoh" : icos, icoh grids, all the interpolations
168 */
169
170 // get experiment configuration
171 enum experiment_type experiment = NOICOH; // default experiment
172 parse_arguments(argc, argv, &experiment);
173 struct experiment_configuration exp_config = experiment_configs[experiment];
174
175 int rank, size;
176 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
177 MPI_Comm_size(MPI_COMM_WORLD,&size);
178
180 (size_t)size == exp_config.num_components,
181 "Wrong number of processes (has to be %zu)\n", exp_config.num_components);
182
183 yac_cinit();
185 yac_cdef_datetime("2008-03-09T16:05:07", "2008-03-10T16:05:07");
186
187 // generate interpolation stacks
189
190 // configure interpolations
191 for (size_t src_comp_idx = 0; src_comp_idx < exp_config.num_components;
192 ++src_comp_idx) {
193 char const * src_comp_name = exp_config.component_names[src_comp_idx];
194 for (size_t tgt_comp_idx = src_comp_idx + 1;
195 tgt_comp_idx < exp_config.num_components; ++tgt_comp_idx) {
196 char const * tgt_comp_name = exp_config.component_names[tgt_comp_idx];
197 for (size_t interp_idx = 0; interp_idx < exp_config.num_interpolations;
198 ++interp_idx) {
199 enum interp_stack_type interp_type =
200 exp_config.interpolations[interp_idx];
201 char field_name[256];
202 sprintf(field_name, "%s_%s_out",
203 src_comp_name, interp_stacks[interp_type].name);
204 char weight_filename[1024];
205 snprintf(
206 weight_filename, 1024, "./output/rmp_%s_to_%s_yac_%s.nc",
207 src_comp_name,
208 exp_config.component_names[tgt_comp_idx],
209 interp_stacks[interp_type].name);
210 int ext_couple_config_id;
211 yac_cget_ext_couple_config(&ext_couple_config_id);
212 if (exp_config.write_weights)
214 ext_couple_config_id, weight_filename);
216 src_comp_name, // src_comp_name
217 src_comp_name, // src_grid_name
218 field_name, // src_field_name
219 tgt_comp_name, // tgt_comp_name
220 tgt_comp_name, // tgt_grid_name
221 field_name, // tgt_field_name
222 "10", // coupling period
223 YAC_TIME_UNIT_SECOND, // time unit
224 YAC_REDUCTION_TIME_ACCUMULATE, // time reduction operation
225 interp_stacks[interp_type].id, // interpolation stack id
226 0, 0, // source and target lag
227 ext_couple_config_id); // additional configuration parameters
228 yac_cfree_ext_couple_config(ext_couple_config_id);
229 }
230 }
231 }
232
233 // register local component
234 int comp_id;
235 char const * comp_name = exp_config.component_names[rank];
236 yac_cdef_comp(comp_name, &comp_id);
237
238 // read grid information
239 char * grid_filename = "./input/grids.nc";
240 char * mask_filename = "./input/masks_no_atm.nc";
241 int valid_mask_value = 0;
242 size_t num_vertices = 0;
243 size_t num_cells = 0;
244 int * num_vertices_per_cell = NULL;
245 double * x_vertices = NULL;
246 double * y_vertices = NULL;
247 double * x_cell = NULL;
248 double * y_cell = NULL;
249 int * cell_to_vertex = NULL;
250 int * cell_core_mask = NULL;
251 if (strcmp(comp_name, "dummy"))
253 grid_filename, mask_filename, comp_name, valid_mask_value,
254 &num_vertices, &num_cells, &num_vertices_per_cell,
255 &x_vertices, &y_vertices, &x_cell, &y_cell, &cell_to_vertex,
256 &cell_core_mask, NULL, NULL, NULL);
257
258 // register local grid
259 int grid_id;
261 comp_name, (int)num_vertices, (int)num_cells, num_vertices_per_cell,
262 x_vertices, y_vertices, cell_to_vertex, &grid_id);
263
264 // set global ids and core masks
265 int * global_cell_ids = malloc(num_cells * sizeof(*global_cell_ids));
266 int * global_vertex_ids =
267 malloc(num_vertices * sizeof(*global_vertex_ids));
268 for (size_t i = 0; i < num_cells; ++i) global_cell_ids[i] = i;
269 for (size_t i = 0; i < num_vertices; ++i) global_vertex_ids[i] = i;
273
274 int * nogt_mask = read_mask("./input/masks_nogt_yac.nc", comp_name, 0);
275 int * torc_mask = read_mask("./input/masks_torc_yac.nc", comp_name, 0);
276
277 // register cell middle points and mask
278 int cell_point_id_no_mask,
279 cell_point_id_nogt_mask,
280 cell_point_id_torc_mask;
282 grid_id, (int)num_cells, YAC_LOCATION_CELL, x_cell, y_cell,
283 &cell_point_id_no_mask);
284 if (nogt_mask != NULL) {
286 grid_id, (int)num_cells, YAC_LOCATION_CELL, x_cell, y_cell,
287 &cell_point_id_nogt_mask);
288 yac_cset_mask(nogt_mask, cell_point_id_nogt_mask);
289 } else cell_point_id_nogt_mask = cell_point_id_no_mask;
290 if (torc_mask != NULL) {
292 grid_id, (int)num_cells, YAC_LOCATION_CELL, x_cell, y_cell,
293 &cell_point_id_torc_mask);
294 yac_cset_mask(torc_mask, cell_point_id_torc_mask);
295 } else cell_point_id_torc_mask = cell_point_id_no_mask;
296
297 // register in fields
298 int field_ids[exp_config.num_components][exp_config.num_interpolations];
299 for (size_t src_comp_idx = 0; src_comp_idx < exp_config.num_components;
300 ++src_comp_idx) {
301 int cell_point_id = cell_point_id_no_mask;
302 if (!strcmp("nogt", exp_config.component_names[src_comp_idx]))
303 cell_point_id = cell_point_id_nogt_mask;
304 if (!strcmp("torc", exp_config.component_names[src_comp_idx]))
305 cell_point_id = cell_point_id_torc_mask;
306 for (size_t interp_idx = 0; interp_idx < exp_config.num_interpolations;
307 ++interp_idx) {
308 enum interp_stack_type interp_type =
309 exp_config.interpolations[interp_idx];
310 char field_name[1024];
311 snprintf(
312 field_name, 1024, "%s_%s_out",
313 exp_config.component_names[src_comp_idx],
314 interp_stacks[interp_type].name);
316 field_name, comp_id, &cell_point_id, 1, 1, "10", YAC_TIME_UNIT_SECOND,
317 &field_ids[src_comp_idx][interp_idx]);
318 }
319 }
320
321 // initialise coupling
322 yac_cenddef( );
323
324 // initialise vtk output file
325 YAC_VTK_FILE *vtk_file = NULL;
326 if (exp_config.write_vtk) {
327
328 char vtk_filename[1024];
329 sprintf(vtk_filename, "./output/%s.vtk", comp_name);
330
331 double (*point_data)[3] = malloc(num_vertices * sizeof(*point_data));
332 for (size_t i = 0; i < num_vertices; ++i)
333 LLtoXYZ(x_vertices[i], y_vertices[i], point_data[i]);
334
335 vtk_file = yac_vtk_open(vtk_filename, comp_name);
336 yac_vtk_write_point_data(vtk_file, &point_data[0][0], (int)num_vertices);
338 vtk_file, (unsigned *)cell_to_vertex,
339 (unsigned*)num_vertices_per_cell, (int)num_cells);
341 vtk_file, global_vertex_ids, (int)num_vertices, "global_vertex_id");
343 vtk_file, cell_core_mask, (int)num_cells, "cell_core_mask");
345 vtk_file, global_cell_ids, (int)num_cells, "global_cell_id");
346 if (nogt_mask != NULL)
348 vtk_file, nogt_mask, (int)num_cells, "nogt_mask");
349 if (torc_mask != NULL)
351 vtk_file, torc_mask, (int)num_cells, "torc_mask");
352 free(point_data);
353 }
354
355 if (nogt_mask) free(nogt_mask);
356 if (torc_mask) free(torc_mask);
357
358 // allocate memory for field data
359 double * out_data = malloc(num_cells * sizeof(*out_data));
360 double * in_data = malloc(num_cells * sizeof(*in_data));
361
362 // "time loop"
363 for (size_t test_idx = 0; test_idx < NUM_TEST_FUNCTIONS; ++test_idx) {
364
365 int info, err;
366
367 // generate out data
368 for (size_t j = 0; j < num_cells; ++j)
369 out_data[j] = test_functions[test_idx].p(x_cell[j], y_cell[j]);
370
371 // write out field to vtk file
372 if (exp_config.write_vtk) {
373 char field_name[1024];
374 snprintf(field_name, 1024, "test_%s_out", test_functions[test_idx].name);
376 vtk_file, out_data, (int)num_cells, field_name);
377 }
378
379 // put out fields
380 double *point_set_data[1] = {out_data};
381 double **collection_data[1] = {point_set_data};
382 for (size_t tgt_comp_idx = 0; tgt_comp_idx < exp_config.num_interpolations;
383 ++tgt_comp_idx)
384 yac_cput(field_ids[rank][tgt_comp_idx], 1, collection_data, &info, &err);
385
386 // get in fields
387 for (size_t src_comp_idx = 0; src_comp_idx < exp_config.num_components;
388 ++src_comp_idx) {
389 if ((int)src_comp_idx == rank) continue;
390 for (size_t interp_idx = 0; interp_idx < exp_config.num_interpolations;
391 ++interp_idx) {
392 enum interp_stack_type interp_type =
393 exp_config.interpolations[interp_idx];
394 for (size_t l = 0; l < num_cells; ++l) in_data[l] = 0.0; //-10.0;
395 double *collection_data[1] = {in_data};
396 yac_cget(
397 field_ids[src_comp_idx][interp_idx], 1, collection_data, &info, &err);
398
399 // write in field to vtk file
400 if (exp_config.write_vtk) {
401 char field_name[1024];
402 snprintf(
403 field_name, 1024, "test_%s_%s_%s",
404 test_functions[test_idx].name,
405 exp_config.component_names[src_comp_idx],
406 interp_stacks[interp_type].name);
408 vtk_file, in_data, (int)num_cells, field_name);
409 }
410 }
411 }
412 }
413
414 // free interpolation stacks
416
417 // close vtk file
418 if (exp_config.write_vtk) {
419 yac_vtk_close(vtk_file);
420 }
421
422 // finalize YAC and MPI
424 MPI_Finalize();
425
426 free(in_data);
427 free(out_data);
428 free(num_vertices_per_cell);
429 free(x_vertices);
430 free(y_vertices);
431 free(x_cell);
432 free(y_cell);
433 free(cell_to_vertex);
434 free(cell_core_mask);
435 free(global_vertex_ids);
436 free(global_cell_ids);
437
438 return EXIT_SUCCESS;
439}
440
441static int * read_mask(
442 char const * filename, char const * grid_name, int const valid_mask_value) {
443
444 size_t grid_name_len = strlen(grid_name) + 1;
445 char x_dim_name[2 + grid_name_len];
446 char y_dim_name[2 + grid_name_len];
447 char mask_var_name[4 + grid_name_len];
448
449 snprintf(x_dim_name, 2 + grid_name_len, "x_%s", grid_name);
450 snprintf(y_dim_name, 2 + grid_name_len, "y_%s", grid_name);
451 snprintf(mask_var_name, 4 + grid_name_len, "%s.msk", grid_name);
452
453 if (!yac_file_exists(filename)) return NULL;
454
455 int ncid, status;
456 yac_nc_open(filename, 0, &ncid);
457
458 int mask_var_id;
459 status = nc_inq_varid(ncid, mask_var_name, &mask_var_id);
460
461 if (status == NC_ENOTVAR) {
462 YAC_HANDLE_ERROR(nc_close(ncid));
463 return NULL;
464 } else if (status != NC_NOERR)
465 YAC_HANDLE_ERROR(status);
466
467 int x_dim_id;
468 int y_dim_id;
469 yac_nc_inq_dimid(ncid, x_dim_name, &x_dim_id);
470 yac_nc_inq_dimid(ncid, y_dim_name, &y_dim_id);
471
472 size_t x_dim_len;
473 size_t y_dim_len;
474 YAC_HANDLE_ERROR(nc_inq_dimlen(ncid, x_dim_id, &x_dim_len));
475 YAC_HANDLE_ERROR(nc_inq_dimlen(ncid, y_dim_id, &y_dim_len));
476
477 size_t num_cells = x_dim_len * y_dim_len;
478
479 int * cell_mask = malloc(num_cells * sizeof(*cell_mask));
480 YAC_HANDLE_ERROR(nc_get_var_int(ncid, mask_var_id, cell_mask));
481 for (size_t i = 0; i < num_cells; ++i)
482 cell_mask[i] = cell_mask[i] == valid_mask_value;
483
484
485 YAC_HANDLE_ERROR(nc_close(ncid));
486
487 return cell_mask;
488}
489
490static void parse_arguments(
491 int argc, char ** argv, enum experiment_type * experiment) {
492
493 int opt;
494 while ((opt = getopt(argc, argv, "e:")) != -1) {
495 YAC_ASSERT_ARGS((opt == 'e'), "invalid command argument")
496 switch (opt) {
497 default:
498 case 'e':
499 if (!strcmp(optarg, "GEN_MASK")) *experiment = GEN_MASK;
500 else if (!strcmp(optarg, "NOICOH")) *experiment = NOICOH;
501 else if (!strcmp(optarg, "NOGT_ICOH")) *experiment = NOGT_ICOH;
502 else if (!strcmp(optarg, "ICOS_ICOH")) *experiment = ICOS_ICOH;
503 else if (!strcmp(optarg, "DUMMY")) *experiment = DUMMY;
504 else *experiment = NUM_EXPERIMENT;
506 *experiment != NUM_EXPERIMENT, "invalid experiment name")
507 break;
508 }
509 }
510}
511
512static void generate_interp_stacks(void) {
515 switch (interp_stack_type) {
516 default:
518 interp_stacks[interp_stack_type].name = strdup("CONSERV_DESTAREA");
524 break;
526 interp_stacks[interp_stack_type].name = strdup("CONSERV_FRACAREA");
532 break;
534 interp_stacks[interp_stack_type].name = strdup("CONS2ND_FRACAREA");
540 break;
542 interp_stacks[interp_stack_type].name = strdup("DISTWGT_4");
547 break;
549 interp_stacks[interp_stack_type].name = strdup("DISTWGT_1");
554 break;
555 case(INTERP_STACK_HCSBB):
556 interp_stacks[interp_stack_type].name = strdup("HCSBB");
564 break;
566 interp_stacks[interp_stack_type].name = strdup("AVG_DIST");
573 break;
574 }
575 }
576}
577
585
586
587static void LLtoXYZ(double lon, double lat, double p_out[]) {
588
589 while (lon < -M_PI) lon += 2.0 * M_PI;
590 while (lon >= M_PI) lon -= 2.0 * M_PI;
591
592 double cos_lat = cos(lat);
593 p_out[0] = cos_lat * cos(lon);
594 p_out[1] = cos_lat * sin(lon);
595 p_out[2] = sin(lat);
596}
#define YAC_INTERP_NNN_MAX_SEARCH_DISTANCE_DEFAULT
void yac_nc_open(const char *path, int omode, int *ncidp)
Definition io_utils.c:350
void yac_nc_inq_dimid(int ncid, char const *name, int *dimidp)
Definition io_utils.c:385
int yac_file_exists(const char *filename)
Definition utils_core.c:12
void yac_read_scrip_grid_information(char const *grid_filename, char const *mask_filename, char const *grid_name, int valid_mask_value, size_t *num_vertices, size_t *num_cells, int **num_vertices_per_cell, double **x_vertices, double **y_vertices, double **x_cells, double **y_cells, int **cell_to_vertex, int **cell_core_mask, size_t **duplicated_cell_idx, size_t **orig_cell_idx, size_t *nbr_duplicated_cells)
enum interp_stack_type * interpolations
Definition toy_scrip.c:43
char const ** component_names
Definition toy_scrip.c:41
int * cell_to_vertex
int * cell_mask
double yac_test_one(double lon, double lat)
double yac_test_ana_fcos(double lon, double lat)
double yac_test_harmonic(double lon, double lat)
double yac_test_vortex(double lon, double lat)
double yac_test_func(double lon, double lat)
double yac_test_ana_fcossin(double lon, double lat)
double yac_test_gulfstream(double lon, double lat)
size_t num_cells[2]
int info
int * cell_core_mask
int grid_id
int cell_point_id
int comp_id
#define YAC_HANDLE_ERROR(exp)
Definition toy_output.c:13
static void generate_interp_stacks(void)
Definition toy_scrip.c:512
struct @0 interp_stacks[NUM_INTERP_STACK_TYPES]
static void free_interp_stacks(void)
Definition toy_scrip.c:578
experiment_type
Definition toy_scrip.c:29
@ NOGT_ICOH
Definition toy_scrip.c:32
@ GEN_MASK
Definition toy_scrip.c:30
@ NUM_EXPERIMENT
Definition toy_scrip.c:35
@ DUMMY
Definition toy_scrip.c:34
@ NOICOH
Definition toy_scrip.c:31
@ ICOS_ICOH
Definition toy_scrip.c:33
static void parse_arguments(int argc, char **argv, enum experiment_type *experiment)
Definition toy_scrip.c:490
#define YAC_ASSERT_ARGS(exp, msg)
Definition toy_scrip.c:145
char const * name
Definition toy_scrip.c:114
int id
Definition toy_scrip.c:115
interp_stack_type
Definition toy_scrip.c:18
@ INTERP_STACK_CONSERV_DESTAREA
Definition toy_scrip.c:19
@ NUM_INTERP_STACK_TYPES
Definition toy_scrip.c:26
@ INTERP_STACK_CONS2ND_FRACAREA
Definition toy_scrip.c:21
@ INTERP_STACK_CONSERV_FRACAREA
Definition toy_scrip.c:20
@ INTERP_STACK_DISTWGT_1
Definition toy_scrip.c:23
@ INTERP_STACK_HCSBB
Definition toy_scrip.c:24
@ INTERP_STACK_AVG_DIST
Definition toy_scrip.c:25
@ INTERP_STACK_DISTWGT_4
Definition toy_scrip.c:22
double(* p)(double lon, double lat)
Definition toy_scrip.c:119
@ NUM_TEST_FUNCTIONS
Definition toy_scrip.c:136
static void LLtoXYZ(double lon, double lat, double p_out[])
Definition toy_scrip.c:587
struct @1 test_functions[]
struct experiment_configuration experiment_configs[]
static int * read_mask(char const *filename, char const *grid_name, int const valid_mask_value)
Definition toy_scrip.c:441
void yac_vtk_write_cell_scalars_double(YAC_VTK_FILE *vtk_file, double *scalars, unsigned num_cells, char *name)
Definition vtk_output.c:264
void yac_vtk_write_cell_scalars_int(YAC_VTK_FILE *vtk_file, int *scalars, unsigned num_cells, char *name)
Definition vtk_output.c:250
void yac_vtk_write_point_data(YAC_VTK_FILE *vtk_file, double *point_data, unsigned num_points)
Definition vtk_output.c:69
void yac_vtk_write_point_scalars_int(YAC_VTK_FILE *vtk_file, int *scalars, unsigned num_points, char *name)
Definition vtk_output.c:278
void yac_vtk_close(YAC_VTK_FILE *vtk_file)
Definition vtk_output.c:403
void yac_vtk_write_cell_data(YAC_VTK_FILE *vtk_file, unsigned *cell_corners, unsigned *num_points_per_cell, unsigned num_cells)
Definition vtk_output.c:88
YAC_VTK_FILE * yac_vtk_open(const char *filename, const char *title)
Definition vtk_output.c:45
void yac_cenddef(void)
Definition yac.c:4363
void yac_cset_global_index(int const *global_index, int location, int grid_id)
Definition yac.c:5012
void yac_cfree_ext_couple_config(int ext_couple_config_id)
Definition yac.c:1547
void yac_cdef_datetime(const char *start_datetime, const char *end_datetime)
Definition yac.c:738
int const YAC_LOCATION_CELL
Definition yac.c:31
int const YAC_AVG_ARITHMETIC
Definition yac.c:69
void yac_cinit(void)
Definition yac.c:488
void yac_cfinalize()
Finalises YAC.
Definition yac.c:717
void yac_cget_ext_couple_config(int *ext_couple_config_id)
Definition yac.c:1526
void yac_cset_ext_couple_config_weight_file(int ext_couple_config_id, char const *weight_file)
Definition yac.c:1562
int const YAC_LOCATION_CORNER
Definition yac.c:32
void yac_cdef_couple_custom(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)
Definition yac.c:1896
int const YAC_CONSERV_DESTAREA
Definition yac.c:82
void yac_cget(int const field_id, int collection_size, double **recv_field, int *info, int *ierr)
Definition yac.c:2729
int const YAC_REDUCTION_TIME_ACCUMULATE
Definition yac.c:50
int const YAC_TIME_UNIT_SECOND
Definition yac.c:56
void yac_cadd_interp_stack_config_conservative(int interp_stack_config_id, int order, int enforced_conserv, int partial_coverage, int normalisation)
Definition yac.c:5204
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)
Definition yac.c:4830
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)
Definition yac.c:1158
void yac_cput(int const field_id, int const collection_size, double ***const send_field, int *info, int *ierr)
Definition yac.c:3684
void yac_cdef_calendar(int calendar)
Definition yac.c:746
void yac_cset_core_mask(int const *is_core, int location, int grid_id)
Definition yac.c:5028
int const YAC_PROLEPTIC_GREGORIAN
Definition yac.c:65
void yac_cset_mask(int const *is_valid, int points_id)
Definition yac.c:1281
void yac_cadd_interp_stack_config_hcsbb(int interp_stack_config_id)
Definition yac.c:5741
void yac_cadd_interp_stack_config_fixed(int interp_stack_config_id, double value)
Definition yac.c:5785
int const YAC_CONSERV_FRACAREA
Definition yac.c:83
void yac_cfree_interp_stack_config(int interp_stack_config_id)
Definition yac.c:5114
int const YAC_NNN_AVG
Definition yac.c:76
void yac_cadd_interp_stack_config_nnn(int interp_stack_config_id, int type, size_t n, double max_search_distance, double scale)
Definition yac.c:5171
void yac_cget_interp_stack_config(int *interp_stack_config_id)
Definition yac.c:5100
void yac_cadd_interp_stack_config_average(int interp_stack_config_id, int reduction_type, int partial_coverage)
Definition yac.c:5134
void yac_cdef_comp(char const *comp_name, int *comp_id)
Definition yac.c:990
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)
Definition yac.c:1373
int const YAC_NNN_DIST
Definition yac.c:77
#define YAC_ASSERT_F(exp, format,...)
Definition yac_assert.h:19