#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <netcdf.h>
#include "read_mpiom_grid.h"
#include "geometry.h"
#include "utils_common.h"
#include "io_utils.h"
Go to the source code of this file.
|
static void | get_mpiom_vertices (int ncid, double **vertex_lon, double **vertex_lat, size_t *nbr_vertices) |
|
static void | get_mpiom_cell_center (int ncid, double **cell_lon, double **cell_lat, size_t *nbr_cells) |
|
static void | get_mpiom_cell_mask (int ncid, int **cell_mask, size_t *nbr_cells) |
|
static void | remove_duplicated_coords (double *temp_coords_lon, double *temp_coords_lat, int *temp_coords_mask, size_t *temp_nbr_coords, int *old_to_new_id) |
|
void | yac_read_mpiom_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) |
|
void | yac_read_part_mpiom_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) |
|
struct yac_basic_grid_data | yac_read_mpiom_basic_grid_data (char const *filename) |
|
struct yac_basic_grid * | yac_read_mpiom_basic_grid (char const *filename, char const *gridname) |
|
static int | compare_point_with_index (const void *a, const void *b) |
|
◆ compare_point_with_index()
static int compare_point_with_index |
( |
const void * |
a, |
|
|
const void * |
b |
|
) |
| |
|
inlinestatic |
◆ get_mpiom_cell_center()
static void get_mpiom_cell_center |
( |
int |
ncid, |
|
|
double ** |
cell_lon, |
|
|
double ** |
cell_lat, |
|
|
size_t * |
nbr_cells |
|
) |
| |
|
static |
◆ get_mpiom_cell_mask()
static void get_mpiom_cell_mask |
( |
int |
ncid, |
|
|
int ** |
cell_mask, |
|
|
size_t * |
nbr_cells |
|
) |
| |
|
static |
◆ get_mpiom_vertices()
static void get_mpiom_vertices |
( |
int |
ncid, |
|
|
double ** |
vertex_lon, |
|
|
double ** |
vertex_lat, |
|
|
size_t * |
nbr_vertices |
|
) |
| |
|
static |
◆ remove_duplicated_coords()
static void remove_duplicated_coords |
( |
double * |
temp_coords_lon, |
|
|
double * |
temp_coords_lat, |
|
|
int * |
temp_coords_mask, |
|
|
size_t * |
temp_nbr_coords, |
|
|
int * |
old_to_new_id |
|
) |
| |
|
static |
◆ yac_read_mpiom_basic_grid()
struct yac_basic_grid * yac_read_mpiom_basic_grid |
( |
char const * |
filename, |
|
|
char const * |
gridname |
|
) |
| |
reads in an mpiom grid netcdf file and generates a struct yac_basic_grid_data from it
- Parameters
-
[in] | filename | name of the mpiom grid netcdf file |
[in] | gridname | name of the grid |
- Returns
- yac_basic_grid structure that contains the mpiom grid
Definition at line 344 of file read_mpiom_grid.c.
◆ yac_read_mpiom_basic_grid_data()
reads in an mpiom grid netcdf file and generates a struct yac_basic_grid_data from it
- Parameters
-
[in] | filename | name of the mpiom grid netcdf file |
- Returns
- yac_basic_grid_data structure that contains the mpiom grid
- Examples
- test_read_mpiom.c.
Definition at line 309 of file read_mpiom_grid.c.
◆ yac_read_mpiom_grid_information()
void yac_read_mpiom_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 ** |
cellmask |
|
) |
| |
reads in an mpiom grid netcdf file and return the grid information in a format that is supported by the YAC user interface.
- Parameters
-
[in] | filename | name of the mpiom 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] | cellmask | mask value for cells |
Definition at line 42 of file read_mpiom_grid.c.
◆ yac_read_part_mpiom_grid_information()
void yac_read_part_mpiom_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 partition mpiom grid netcdf file and return the grid information in a format that is supported by the YAC user interface.
- Parameters
-
[in] | filename | name of the mpiom 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 value 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 |
- Examples
- test_dummy_coupling3_c.c.
Definition at line 160 of file read_mpiom_grid.c.