|
YAC 3.20.0
Yet Another Coupler
|
#include <stdio.h>#include <string.h>#include <mpi.h>#include <yaxt.h>#include "grids/basic_grid.h"#include "grids/grid_cell.h"#include "field_data_set.h"#include "io_utils.h"#include "yac_mpi_internal.h"#include "time.h"#include "yac_config.h"#include "geometry.h"#include <netcdf.h>
Go to the source code of this file.
Data Structures | |
| struct | yac_basic_grid |
Functions | |
| struct yac_basic_grid * | yac_basic_grid_new (char const *name, struct yac_basic_grid_data grid_data) |
| struct yac_basic_grid * | yac_basic_grid_empty_new (char const *name) |
| void | yac_basic_grid_delete (struct yac_basic_grid *grid) |
| yac_const_coordinate_pointer | yac_basic_grid_get_field_coordinates (struct yac_basic_grid *grid, struct yac_interp_field field) |
| int const * | yac_basic_grid_get_core_mask (struct yac_basic_grid *grid, enum yac_location location) |
| int const * | yac_basic_grid_get_field_mask (struct yac_basic_grid *grid, struct yac_interp_field field) |
| char const * | yac_basic_grid_get_name (struct yac_basic_grid *grid) |
| struct yac_basic_grid_data * | yac_basic_grid_get_data (struct yac_basic_grid *grid) |
| size_t | yac_basic_grid_get_data_size (struct yac_basic_grid *grid, enum yac_location location) |
| size_t | yac_basic_grid_get_data_size_f2c (struct yac_basic_grid *grid, int location) |
| size_t | yac_basic_grid_get_named_mask_idx (struct yac_basic_grid *grid, enum yac_location location, char const *mask_name) |
| size_t | yac_basic_grid_add_coordinates_nocpy (struct yac_basic_grid *grid, enum yac_location location, yac_coordinate_pointer coordinates) |
| size_t | yac_basic_grid_add_coordinates_nocpy_f2c (struct yac_basic_grid *grid, int location, double *coordinates) |
| size_t | yac_basic_grid_add_coordinates (struct yac_basic_grid *grid, enum yac_location location, yac_coordinate_pointer coordinates, size_t count) |
| size_t | yac_basic_grid_add_coordinates_f2c (struct yac_basic_grid *grid, int location, double *coordinates, size_t count) |
| size_t | yac_basic_grid_add_mask_nocpy (struct yac_basic_grid *grid, enum yac_location location, int const *mask, char const *mask_name) |
| size_t | yac_basic_grid_add_mask_nocpy_f2c (struct yac_basic_grid *grid, int location, int const *mask, char const *mask_name) |
| size_t | yac_basic_grid_add_mask (struct yac_basic_grid *grid, enum yac_location location, int const *mask, size_t count, char const *mask_name) |
| size_t | yac_basic_grid_add_mask_f2c (struct yac_basic_grid *grid, int location, int const *mask, size_t count, char const *mask_name) |
| struct yac_field_data * | yac_basic_grid_get_field_data (struct yac_basic_grid *grid, enum yac_location location) |
| struct yac_basic_grid * | yac_basic_grid_reg_2d_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices) |
| struct yac_basic_grid * | yac_basic_grid_reg_2d_deg_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices) |
| struct yac_basic_grid * | yac_basic_grid_curve_2d_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices) |
| struct yac_basic_grid * | yac_basic_grid_curve_2d_deg_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_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) |
| 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) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_ll_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) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_ll_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) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_edge_new (char const *name, size_t nbr_vertices, size_t nbr_cells, size_t nbr_edges, int *num_edges_per_cell, double *x_vertices, double *y_vertices, int *cell_to_edge, int *edge_to_vertex) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_edge_deg_new (char const *name, size_t nbr_vertices, size_t nbr_cells, size_t nbr_edges, int *num_edges_per_cell, double *x_vertices, double *y_vertices, int *cell_to_edge, int *edge_to_vertex) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_edge_ll_new (char const *name, size_t nbr_vertices, size_t nbr_cells, size_t nbr_edges, int *num_edges_per_cell, double *x_vertices, double *y_vertices, int *cell_to_edge, int *edge_to_vertex) |
| struct yac_basic_grid * | yac_basic_grid_unstruct_edge_ll_deg_new (char const *name, size_t nbr_vertices, size_t nbr_cells, size_t nbr_edges, int *num_edges_per_cell, double *x_vertices, double *y_vertices, int *cell_to_edge, int *edge_to_vertex) |
| struct yac_basic_grid * | yac_basic_grid_cloud_new (char const *name, size_t nbr_points, double *x_points, double *y_points) |
| struct yac_basic_grid * | yac_basic_grid_cloud_deg_new (char const *name, size_t nbr_points, double *x_points, double *y_points) |
| struct yac_basic_grid * | yac_basic_grid_reg_2d_rot_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices, double north_pole_lon, double north_pole_lat) |
| struct yac_basic_grid * | yac_basic_grid_reg_2d_rot_deg_new (char const *name, size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices, double north_pole_lon, double north_pole_lat) |
| static int | def_dim (char const *filename, int ncid, char const *name, size_t dim_len, int file_is_new) |
| static void | def_var (char const *filename, int ncid, char const *name, nc_type type, int ndims, const int *dimids, char const *att_name, char const *att_value, int file_is_new) |
| static void | create_grid_file (char const *filename, char const *grid_name, size_t num_cells, int num_vertices_per_cell, int cell_center_coords_avaiable, int cell_global_ids_available, int core_cell_mask_available, int vertex_global_ids_available, int core_vertex_mask_available, int edge_global_ids_available, int core_edge_mask_available) |
| static void | put_vara (int ncid, char const *grid_name, char const *var_ext, size_t *start, size_t *count, void const *buffer) |
| void | yac_basic_grid_to_file_parallel (struct yac_basic_grid *grid, char const *filename, MPI_Comm comm) |
| void | yac_basic_grid_compute_cell_areas (struct yac_basic_grid *grid, double *cell_areas) |
| static void | report_mismatch (const char *grid_name, enum yac_location location, double const *coord, int is_fatal) |
| static void | get_grid_cell (struct yac_basic_grid_data const *grid_data, size_t cell_idx, struct yac_grid_cell *buffer_cell) |
| static int | check_cell_coords (yac_const_coordinate_pointer coords, struct yac_basic_grid *grid, int is_fatal) |
| static int | check_corner_coords (yac_const_coordinate_pointer coords, struct yac_basic_grid *grid, int is_fatal) |
| static int | check_edge_coords (yac_const_coordinate_pointer coords, struct yac_basic_grid *grid, int is_fatal) |
| int | yac_basic_grid_check_coordinates (struct yac_basic_grid *grid, int fatal) |
Variables | |
| static struct yac_basic_grid_data | yac_basic_grid_data_empty |
|
static |
Check CELL point coordinates. Each point coordinate should lie inside the bounding circle of the corresponding cell (the cell bounding circle already includes SIN_COS_TOL slack, added internally by yac_get_cell_bounding_circle).
Definition at line 1340 of file basic_grid.c.


|
static |
Check CORNER point coordinates. Each coordinate should be identical to the corresponding vertex coordinate within yac_sq_angle_tol.
Definition at line 1388 of file basic_grid.c.


|
static |
Check EDGE point coordinates. Each coordinate should lie inside the bounding circle whose centre is the normalised midpoint of the edge and whose angular radius equals half the edge length plus SIN_COS_TOL.
Definition at line 1426 of file basic_grid.c.


|
static |
Definition at line 598 of file basic_grid.c.


|
static |
|
static |
|
static |
|
static |
Definition at line 724 of file basic_grid.c.


|
static |
Emit mismatch message. If is_fatal is non-zero the function aborts via YAC_ASSERT_F, otherwise it writes a warning to stderr and returns.
Definition at line 1277 of file basic_grid.c.


| size_t yac_basic_grid_add_coordinates | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location, | ||
| yac_coordinate_pointer | coordinates, | ||
| size_t | count ) |
Definition at line 222 of file basic_grid.c.


| size_t yac_basic_grid_add_coordinates_f2c | ( | struct yac_basic_grid * | grid, |
| int | location, | ||
| double * | coordinates, | ||
| size_t | count ) |
| size_t yac_basic_grid_add_coordinates_nocpy | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location, | ||
| yac_coordinate_pointer | coordinates ) |
Definition at line 202 of file basic_grid.c.


| size_t yac_basic_grid_add_coordinates_nocpy_f2c | ( | struct yac_basic_grid * | grid, |
| int | location, | ||
| double * | coordinates ) |
| size_t yac_basic_grid_add_mask | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location, | ||
| int const * | mask, | ||
| size_t | count, | ||
| char const * | mask_name ) |
Definition at line 266 of file basic_grid.c.


| size_t yac_basic_grid_add_mask_f2c | ( | struct yac_basic_grid * | grid, |
| int | location, | ||
| int const * | mask, | ||
| size_t | count, | ||
| char const * | mask_name ) |
| size_t yac_basic_grid_add_mask_nocpy | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location, | ||
| int const * | mask, | ||
| char const * | mask_name ) |
Definition at line 244 of file basic_grid.c.


| size_t yac_basic_grid_add_mask_nocpy_f2c | ( | struct yac_basic_grid * | grid, |
| int | location, | ||
| int const * | mask, | ||
| char const * | mask_name ) |
| int yac_basic_grid_check_coordinates | ( | struct yac_basic_grid * | grid, |
| int | fatal ) |
Definition at line 1480 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_cloud_deg_new | ( | char const * | name, |
| size_t | nbr_points, | ||
| double * | x_points, | ||
| double * | y_points ) |
| struct yac_basic_grid * yac_basic_grid_cloud_new | ( | char const * | name, |
| size_t | nbr_points, | ||
| double * | x_points, | ||
| double * | y_points ) |
| void yac_basic_grid_compute_cell_areas | ( | struct yac_basic_grid * | grid, |
| double * | cell_areas ) |
Definition at line 1264 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_curve_2d_deg_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices ) |
| struct yac_basic_grid * yac_basic_grid_curve_2d_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices ) |
| void yac_basic_grid_delete | ( | struct yac_basic_grid * | grid | ) |
Definition at line 77 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_empty_new | ( | char const * | name | ) |
Definition at line 70 of file basic_grid.c.


| int const * yac_basic_grid_get_core_mask | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location ) |
| struct yac_basic_grid_data * yac_basic_grid_get_data | ( | struct yac_basic_grid * | grid | ) |
| size_t yac_basic_grid_get_data_size | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location ) |
| size_t yac_basic_grid_get_data_size_f2c | ( | struct yac_basic_grid * | grid, |
| int | location ) |
| yac_const_coordinate_pointer yac_basic_grid_get_field_coordinates | ( | struct yac_basic_grid * | grid, |
| struct yac_interp_field | field ) |
| struct yac_field_data * yac_basic_grid_get_field_data | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location ) |
Definition at line 287 of file basic_grid.c.


| int const * yac_basic_grid_get_field_mask | ( | struct yac_basic_grid * | grid, |
| struct yac_interp_field | field ) |
Definition at line 120 of file basic_grid.c.


| char const * yac_basic_grid_get_name | ( | struct yac_basic_grid * | grid | ) |
| size_t yac_basic_grid_get_named_mask_idx | ( | struct yac_basic_grid * | grid, |
| enum yac_location | location, | ||
| char const * | mask_name ) |
Definition at line 172 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_new | ( | char const * | name, |
| struct yac_basic_grid_data | grid_data ) |
Definition at line 57 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_reg_2d_deg_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices ) |
Definition at line 311 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_reg_2d_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices ) |
Definition at line 300 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_reg_2d_rot_deg_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices, | ||
| double | north_pole_lon, | ||
| double | north_pole_lat ) |
Definition at line 479 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_reg_2d_rot_new | ( | char const * | name, |
| size_t | nbr_vertices[2], | ||
| int | cyclic[2], | ||
| double * | lon_vertices, | ||
| double * | lat_vertices, | ||
| double | north_pole_lon, | ||
| double | north_pole_lat ) |
| void yac_basic_grid_to_file_parallel | ( | struct yac_basic_grid * | grid, |
| char const * | filename, | ||
| MPI_Comm | comm ) |
Definition at line 747 of file basic_grid.c.


| 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 ) |
| struct yac_basic_grid * yac_basic_grid_unstruct_edge_deg_new | ( | char const * | name, |
| size_t | nbr_vertices, | ||
| size_t | nbr_cells, | ||
| size_t | nbr_edges, | ||
| int * | num_edges_per_cell, | ||
| double * | x_vertices, | ||
| double * | y_vertices, | ||
| int * | cell_to_edge, | ||
| int * | edge_to_vertex ) |
| struct yac_basic_grid * yac_basic_grid_unstruct_edge_ll_deg_new | ( | char const * | name, |
| size_t | nbr_vertices, | ||
| size_t | nbr_cells, | ||
| size_t | nbr_edges, | ||
| int * | num_edges_per_cell, | ||
| double * | x_vertices, | ||
| double * | y_vertices, | ||
| int * | cell_to_edge, | ||
| int * | edge_to_vertex ) |
| struct yac_basic_grid * yac_basic_grid_unstruct_edge_ll_new | ( | char const * | name, |
| size_t | nbr_vertices, | ||
| size_t | nbr_cells, | ||
| size_t | nbr_edges, | ||
| int * | num_edges_per_cell, | ||
| double * | x_vertices, | ||
| double * | y_vertices, | ||
| int * | cell_to_edge, | ||
| int * | edge_to_vertex ) |
Definition at line 422 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_unstruct_edge_new | ( | char const * | name, |
| size_t | nbr_vertices, | ||
| size_t | nbr_cells, | ||
| size_t | nbr_edges, | ||
| int * | num_edges_per_cell, | ||
| double * | x_vertices, | ||
| double * | y_vertices, | ||
| int * | cell_to_edge, | ||
| int * | edge_to_vertex ) |
Definition at line 396 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_unstruct_ll_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 ) |
| struct yac_basic_grid * yac_basic_grid_unstruct_ll_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 at line 370 of file basic_grid.c.


| struct yac_basic_grid * yac_basic_grid_unstruct_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 at line 344 of file basic_grid.c.


|
static |
Definition at line 31 of file basic_grid.c.