YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
grid_file_common.c File Reference
#include <string.h>
#include <math.h>
#include <netcdf.h>
#include "tests.h"
#include "grid_file_common.h"
#include "io_utils.h"
#include "utils_common.h"
#include "geometry.h"
Include dependency graph for grid_file_common.c:

Go to the source code of this file.

Functions

static int compare_cell_coords (double *a, double *b, int count)
 
static int compare_ints (int *a, int *b, int count)
 
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)
 
void write_dummy_exodus_grid_file (char const *grid_filename, size_t num_lon, size_t num_lat, double lon_range[2], double lat_range[2])
 
void write_dummy_scrip_grid_file (char *grid_name, char *grid_filename, char *mask_filename, int with_corners, size_t num_lon, size_t num_lat, double lon_range[2], double lat_range[2])
 

Function Documentation

◆ check_grid_file()

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 )

checks whether data in a scrip formated grid file is identical to a reference data provided

Parameters
[in]filenamename of the grid file to be checked
[in]grid_namename of the grid
[in]ref_num_cellsreference number of cells
[in]ref_num_corners_per_cellreference number of corners per cell
[in]ref_clareference latitude coordinates in degree
[in]ref_cloreference longitude coordinates in degree
[in]ref_latreference latitude cell center coordinates in degree
[in]ref_lonreference longitude cell center coordinates in degree
[in]ref_cell_global_idsreference global cell ids
[in]ref_core_cell_maskreference core cell mask
[in]ref_vertex_global_idsreference global vertex ids
[in]ref_core_vertex_maskreference core vertex mask
[in]ref_edge_global_idsreference global edge ids
[in]ref_core_edge_maskreference core edge mask
Remarks
arguments ref_lat, ref_lon, ref_global_ids, ref_core_cell_mask can be NULL

Definition at line 55 of file grid_file_common.c.

Here is the call graph for this function:

◆ compare_cell_coords()

static int compare_cell_coords ( double * a,
double * b,
int count )
static

Definition at line 15 of file grid_file_common.c.

Here is the caller graph for this function:

◆ compare_ints()

static int compare_ints ( int * a,
int * b,
int count )
static

Definition at line 35 of file grid_file_common.c.

Here is the caller graph for this function:

◆ write_dummy_exodus_grid_file()

void write_dummy_exodus_grid_file ( char const * grid_filename,
size_t num_lon,
size_t num_lat,
double lon_range[2],
double lat_range[2] )

Definition at line 357 of file grid_file_common.c.

Here is the call graph for this function:

◆ write_dummy_scrip_grid_file()

void write_dummy_scrip_grid_file ( char * grid_name,
char * grid_filename,
char * mask_filename,
int with_corners,
size_t num_lon,
size_t num_lat,
double lon_range[2],
double lat_range[2] )

Definition at line 446 of file grid_file_common.c.

Here is the call graph for this function: