YetAnotherCoupler 3.1.1
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <netcdf.h>
#include "basic_grid.h"
#include "utils_common.h"
#include "io_utils.h"
#include "read_grid.h"
#include "read_icon_grid.h"
#include "geometry.h"
Go to the source code of this file.
Functions | |
static int * | get_icon_cell_mask (int ncid, size_t nbr_cells) |
static int * | get_icon_connect (int ncid, size_t nbr_cells) |
void | yac_read_part_icon_grid_information (const char *filename, int *nbr_vertices, int *nbr_cells, int **num_vertices_per_cell, int **cell_to_vertex, double **x_vertices, double **y_vertices, double **x_cells, double **y_cells, int **global_cell_id, int **cell_mask, int **cell_core_mask, int **global_corner_id, int **corner_core_mask, int rank, int size) |
void | yac_read_icon_grid_information (const char *filename, int *nbr_vertices, int *nbr_cells, int **num_vertices_per_cell, int **cell_to_vertex, double **x_vertices, double **y_vertices, double **x_cells, double **y_cells, int **cell_mask) |
static int | partition_idx_from_element_idx (unsigned element_idx, unsigned num_elements, int num_partitions) |
static void | convert_to_rad (int ncid, int varid, double *array, size_t count) |
void | yac_read_icon_grid_information_parallel (const char *filename, MPI_Comm comm, int *nbr_vertices, int *nbr_cells, int **num_vertices_per_cell, int **cell_to_vertex, int **global_cell_ids, int **cell_owner, int **global_vertex_ids, int **vertex_owner, double **x_vertices, double **y_vertices, double **x_cells, double **y_cells, int **cell_msk) |
void | yac_read_icon_grid_information_parallel_f2c (const char *filename, MPI_Fint comm, int *nbr_vertices, int *nbr_cells, int **num_vertices_per_cell, int **cell_to_vertex, int **global_cell_ids, int **cell_owner, int **global_vertex_ids, int **vertex_owner, double **x_vertices, double **y_vertices, double **x_cells, double **y_cells, int **cell_msk) |
static int * | generate_simple_core_mask (size_t N) |
static size_t * | generate_offsets (size_t N, int *counts) |
struct yac_basic_grid_data | yac_read_icon_basic_grid_data_parallel (const char *filename, MPI_Comm comm) |
struct yac_basic_grid * | yac_read_icon_basic_grid_parallel (char const *filename, char const *gridname, MPI_Comm comm) |
struct yac_basic_grid * | yac_read_icon_basic_grid_parallel_f2c (char const *filename, char const *gridname, MPI_Fint comm) |
struct yac_basic_grid_data | yac_read_icon_basic_grid_data (char const *filename) |
struct yac_basic_grid * | yac_read_icon_basic_grid (char const *filename, char const *gridname) |
void | yac_delete_icon_grid_data (int **cell_mask, int **global_cell_id, int **global_cell_id_rank, int **num_vertices_per_cell, int **global_corner_id, int **global_corner_id_rank, int **cell_to_vertex, double **x_cells, double **y_cells, double **x_vertices, double **y_vertices) |
|
static |
Definition at line 237 of file read_icon_grid.c.
|
static |
|
static |
|
static |
Definition at line 1497 of file read_icon_grid.c.
|
static |
Definition at line 1535 of file read_icon_grid.c.
|
inlinestatic |
void yac_delete_icon_grid_data | ( | int ** | cell_mask, |
int ** | global_cell_id, | ||
int ** | cell_core_mask, | ||
int ** | num_vertices_per_cell, | ||
int ** | global_corner_id, | ||
int ** | corner_core_mask, | ||
int ** | cell_to_vertex, | ||
double ** | x_cells, | ||
double ** | y_cells, | ||
double ** | x_vertices, | ||
double ** | y_vertices | ||
) |
destroys remaining icon grid data
[out] | cell_mask | mask for cells |
[out] | global_cell_id | global cell IDs |
[out] | cell_core_mask | cell core mask |
[out] | num_vertices_per_cell | number of vertices per cell |
[out] | global_corner_id | global corner IDs |
[out] | corner_core_mask | corner core mask |
[out] | cell_to_vertex | vertex indices for each cell |
[out] | x_cells | longitudes of cell center |
[out] | y_cells | latitudes of cell center |
[out] | x_vertices | longitudes of vertices |
[out] | y_vertices | latitudes of vertices |
Definition at line 1572 of file read_icon_grid.c.
struct yac_basic_grid * yac_read_icon_basic_grid | ( | char const * | filename, |
char const * | gridname | ||
) |
reads in an icon grid netcdf file and generates a struct basic_grid from it
[in] | filename | name of the icon grid netcdf file |
[in] | gridname | name of the grid |
Definition at line 1487 of file read_icon_grid.c.
struct yac_basic_grid_data yac_read_icon_basic_grid_data | ( | char const * | filename | ) |
reads in an icon grid netcdf file and generates a struct yac_basic_grid_data from it
[in] | filename | name of the icon grid netcdf file |
Definition at line 1451 of file read_icon_grid.c.
struct yac_basic_grid_data yac_read_icon_basic_grid_data_parallel | ( | const char * | filename, |
MPI_Comm | comm | ||
) |
Definition at line 886 of file read_icon_grid.c.
struct yac_basic_grid * yac_read_icon_basic_grid_parallel | ( | char const * | filename, |
char const * | gridname, | ||
MPI_Comm | comm | ||
) |
Definition at line 1434 of file read_icon_grid.c.
struct yac_basic_grid * yac_read_icon_basic_grid_parallel_f2c | ( | char const * | filename, |
char const * | gridname, | ||
MPI_Fint | comm | ||
) |
void yac_read_icon_grid_information | ( | const char * | filename, |
int * | num_vertices, | ||
int * | num_cells, | ||
int ** | num_vertices_per_cell, | ||
int ** | cell_to_vertex, | ||
double ** | x_vertices, | ||
double ** | y_vertices, | ||
double ** | x_cells, | ||
double ** | y_cells, | ||
int ** | cell_mask | ||
) |
reads in an icon grid netcdf file and return the grid information in a format that is supported by the YAC user interface.
[in] | filename | name of the icon grid netcdf file |
[out] | num_vertices | number of vertices in the grid |
[out] | num_cells | number of cells in the grid |
[out] | num_vertices_per_cell | number of vertices per cell |
[out] | cell_to_vertex | vertex indices for each cell |
[out] | x_vertices | longitudes of vertices |
[out] | y_vertices | latitudes of vertices |
[out] | x_cells | longitudes of cell center |
[out] | y_cells | latitudes of cell center |
[out] | cell_mask | mask for cells |
Definition at line 176 of file read_icon_grid.c.
void yac_read_icon_grid_information_parallel | ( | const char * | filename, |
MPI_Comm | comm, | ||
int * | num_vertices, | ||
int * | num_cells, | ||
int ** | num_vertices_per_cell, | ||
int ** | cell_to_vertex, | ||
int ** | global_cell_ids, | ||
int ** | cell_owner, | ||
int ** | global_vertex_ids, | ||
int ** | vertex_owner, | ||
double ** | x_vertices, | ||
double ** | y_vertices, | ||
double ** | x_cells, | ||
double ** | y_cells, | ||
int ** | cell_mask | ||
) |
reads in an icon grid netcdf file and return the grid information in a format that is supported by the YAC user interface. The reading is done in parallel and a basic domain decomposition is applied.
[in] | filename | name of the icon grid netcdf file |
[in] | comm | MPI communicator containing all proceses that will get a part of the grid |
[out] | num_vertices | number of vertices in the local part of the grid |
[out] | num_cells | number of cells in the local part of the grid |
[out] | num_vertices_per_cell | number of vertices per cell |
[out] | cell_to_vertex | vertex indices for each cell |
[out] | global_cell_ids | global ids of local cells (core and halo cells) |
[out] | cell_owner | owner of each cell (locally owned cells are marked with -1) |
[out] | global_vertex_ids | global ids of local vertices (core and halo vertices) |
[out] | vertex_owner | owner of each vertex (locally owned vertices are marked with -1) |
[out] | x_vertices | longitudes of vertices |
[out] | y_vertices | latitudes of vertices |
[out] | x_cells | longitudes of cell center |
[out] | y_cells | latitudes of cell center |
[out] | cell_mask | mask for cells |
Definition at line 243 of file read_icon_grid.c.
void yac_read_icon_grid_information_parallel_f2c | ( | const char * | filename, |
MPI_Fint | comm, | ||
int * | nbr_vertices, | ||
int * | nbr_cells, | ||
int ** | num_vertices_per_cell, | ||
int ** | cell_to_vertex, | ||
int ** | global_cell_ids, | ||
int ** | cell_owner, | ||
int ** | global_vertex_ids, | ||
int ** | vertex_owner, | ||
double ** | x_vertices, | ||
double ** | y_vertices, | ||
double ** | x_cells, | ||
double ** | y_cells, | ||
int ** | cell_msk | ||
) |
void yac_read_part_icon_grid_information | ( | const char * | filename, |
int * | num_vertices, | ||
int * | num_cells, | ||
int ** | num_vertices_per_cell, | ||
int ** | cell_to_vertex, | ||
double ** | x_vertices, | ||
double ** | y_vertices, | ||
double ** | x_cells, | ||
double ** | y_cells, | ||
int ** | global_cell_id, | ||
int ** | cell_mask, | ||
int ** | cell_core_mask, | ||
int ** | global_corner_id, | ||
int ** | corner_core_mask, | ||
int | rank, | ||
int | size | ||
) |
reads in an icon grid netcdf file and return the grid information in a format that is supported by the YAC user interface.
[in] | filename | name of the icon grid netcdf file |
[out] | num_vertices | number of vertices in the grid |
[out] | num_cells | number of cells in the grid |
[out] | num_vertices_per_cell | number of vertices per cell |
[out] | cell_to_vertex | vertex indices for each cell |
[out] | x_vertices | longitudes of vertices |
[out] | y_vertices | latitudes of vertices |
[out] | x_cells | longitudes of cell center |
[out] | y_cells | latitudes of cell center |
[out] | global_cell_id | global cell IDs |
[out] | cell_mask | mask for cells |
[out] | cell_core_mask | cell core mask |
[out] | global_corner_id | global corner IDs |
[out] | corner_core_mask | corner core mask |
[out] | rank | local MPI rank |
[out] | size | number of MPI ranks |
Definition at line 23 of file read_icon_grid.c.