YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_interp_weights_parallel.c File Reference
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <mpi.h>
#include <yaxt.h>
#include <netcdf.h>
#include <string.h>
#include "tests.h"
#include "test_common.h"
#include "geometry.h"
#include "read_icon_grid.h"
#include "interpolation/methods/interp_method_internal.h"
#include "interpolation/methods/interp_method_file.h"
#include "interpolation/interp_weights_internal.h"
#include "yac_mpi.h"
#include "dist_grid_utils.h"
#include "io_utils.h"
#include "interpolation/interpolation_exchange.h"
#include "interpolation/interpolation_gen_config.h"
Include dependency graph for test_interp_weights_parallel.c:

Go to the source code of this file.

Macros

#define FALLBACK_VALUE   (-1.0)
 
#define FIXED_VALUE   (999.0)
 
#define TOL   (1e-6)
 
#define N   (20)
 
#define FRAC_MASK_TOL   (1e-12)
 

Enumerations

enum  weight_type {
  NONE = 0 , DIRECT = 1 , SUM = 2 , WSUM = 3 ,
  FIXED = 4
}
 

Functions

static void on_existing_abort_handler (MPI_Comm comm, char const *msg, char const *source, int line)
 
static double ** allocate_src_data_raw (size_t collection_size, struct yac_interp_weights_data interp_weights_data)
 
static void deallocate_src_data_raw (size_t collection_size, struct yac_interp_weights_data interp_weights_data, double **src_data_raw)
 
static void apply_interp_weights_data (size_t collection_size, struct yac_interp_weights_data interp_weights_data, double **src_data_raw, double **tgt_field)
 
static void interpolation_put_frac_raw (struct yac_interpolation_exchange *interpolation_exchange, struct yac_interp_weights_data interp_weights_data, size_t collection_size, double ***src_fields, double ***src_frac_masks)
 
static void interpolation_put_raw (struct yac_interpolation_exchange *interpolation_exchange, struct yac_interp_weights_data interp_weights_data, size_t collection_size, double ***src_fields)
 
static void interpolation_get_raw (struct yac_interpolation_exchange *interpolation_exchange, struct yac_interp_weights_data interp_weights_data, size_t collection_size, double **tgt_field)
 
int get_logical_attribute (int ncid, char const *attribute_name)
 

Variables

static char const * weight_file_name_on_existing
 
static char const * grid_names [2] = {"grid_a", "grid_b"}
 

Detailed Description

Test
This contains some examples on how to use interp_weights.

Definition in file test_interp_weights_parallel.c.

Macro Definition Documentation

◆ FALLBACK_VALUE

#define FALLBACK_VALUE   (-1.0)

Definition at line 39 of file test_interp_weights_parallel.c.

◆ FIXED_VALUE

#define FIXED_VALUE   (999.0)

Definition at line 40 of file test_interp_weights_parallel.c.

◆ FRAC_MASK_TOL

#define FRAC_MASK_TOL   (1e-12)

◆ N

#define N   (20)

◆ TOL

#define TOL   (1e-6)

Definition at line 41 of file test_interp_weights_parallel.c.

Enumeration Type Documentation

◆ weight_type

Enumerator
NONE 
DIRECT 
SUM 
WSUM 
FIXED 

Definition at line 31 of file test_interp_weights_parallel.c.

Function Documentation

◆ allocate_src_data_raw()

static double ** allocate_src_data_raw ( size_t collection_size,
struct yac_interp_weights_data interp_weights_data )
static

Definition at line 3250 of file test_interp_weights_parallel.c.

Here is the caller graph for this function:

◆ apply_interp_weights_data()

static void apply_interp_weights_data ( size_t collection_size,
struct yac_interp_weights_data interp_weights_data,
double ** src_data_raw,
double ** tgt_field )
static

Definition at line 3310 of file test_interp_weights_parallel.c.

Here is the caller graph for this function:

◆ deallocate_src_data_raw()

static void deallocate_src_data_raw ( size_t collection_size,
struct yac_interp_weights_data interp_weights_data,
double ** src_data_raw )
static

Definition at line 3287 of file test_interp_weights_parallel.c.

Here is the caller graph for this function:

◆ get_logical_attribute()

int get_logical_attribute ( int ncid,
char const * attribute_name )

Definition at line 4033 of file test_interp_weights_parallel.c.

◆ interpolation_get_raw()

static void interpolation_get_raw ( struct yac_interpolation_exchange * interpolation_exchange,
struct yac_interp_weights_data interp_weights_data,
size_t collection_size,
double ** tgt_field )
static

Definition at line 3488 of file test_interp_weights_parallel.c.

Here is the call graph for this function:

◆ interpolation_put_frac_raw()

static void interpolation_put_frac_raw ( struct yac_interpolation_exchange * interpolation_exchange,
struct yac_interp_weights_data interp_weights_data,
size_t collection_size,
double *** src_fields,
double *** src_frac_masks )
static

Definition at line 3451 of file test_interp_weights_parallel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolation_put_raw()

static void interpolation_put_raw ( struct yac_interpolation_exchange * interpolation_exchange,
struct yac_interp_weights_data interp_weights_data,
size_t collection_size,
double *** src_fields )
static

Definition at line 3478 of file test_interp_weights_parallel.c.

Here is the call graph for this function:

◆ on_existing_abort_handler()

static void on_existing_abort_handler ( MPI_Comm comm,
char const * msg,
char const * source,
int line )
static

Definition at line 4075 of file test_interp_weights_parallel.c.

Variable Documentation

◆ grid_names

char const* grid_names[2] = {"grid_a", "grid_b"}
static

Definition at line 83 of file test_interp_weights_parallel.c.

◆ weight_file_name_on_existing

char const* weight_file_name_on_existing
static
Initial value:
=
"test_interp_weights_parallel_on_existing.nc"

Definition at line 65 of file test_interp_weights_parallel.c.