YAC 3.7.1
Yet Another Coupler
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
toy_scrip.c File Reference
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <netcdf.h>
#include <string.h>
#include <stdbool.h>
#include "yac.h"
#include "yac_utils.h"
Include dependency graph for toy_scrip.c:

Go to the source code of this file.

Data Structures

struct  experiment_configuration
 

Macros

#define STR_USAGE   "Usage: %s -e experimentName\n"
 
#define YAC_ASSERT_ARGS(exp, msg)
 

Enumerations

enum  interp_stack_type {
  INTERP_STACK_CONSERV_DESTAREA , INTERP_STACK_CONSERV_FRACAREA , INTERP_STACK_CONS2ND_FRACAREA , INTERP_STACK_DISTWGT_4 ,
  INTERP_STACK_DISTWGT_1 , INTERP_STACK_HCSBB , INTERP_STACK_AVG_DIST , NUM_INTERP_STACK_TYPES
}
 
enum  experiment_type {
  GEN_MASK , NOICOH , NOGT_ICOH , ICOS_ICOH ,
  DUMMY , NUM_EXPERIMENT
}
 
enum  { NUM_TEST_FUNCTIONS = sizeof(test_functions)/sizeof(test_functions[0]) }
 

Functions

static void generate_interp_stacks (void)
 
static void free_interp_stacks (void)
 
static void LLtoXYZ (double lon, double lat, double p_out[])
 
static int * read_mask (char const *filename, char const *grid_name, int const valid_mask_value)
 
static void parse_arguments (int argc, char **argv, enum experiment_type *experiment)
 

Variables

struct experiment_configuration experiment_configs []
 
struct { 
 
   char const *   name 
 
   int   id 
 
interp_stacks [NUM_INTERP_STACK_TYPES
 
struct { 
 
   double(*   p )(double lon, double lat) 
 
   char const *   name 
 
test_functions [] 
 

Macro Definition Documentation

◆ STR_USAGE

#define STR_USAGE   "Usage: %s -e experimentName\n"

Definition at line 144 of file toy_scrip.c.

◆ YAC_ASSERT_ARGS

#define YAC_ASSERT_ARGS ( exp,
msg )
Value:
{ \
if(!((exp))) { \
fprintf(stderr, "ERROR: %s\n" STR_USAGE, msg, argv[0]); \
exit(EXIT_FAILURE); \
} \
}
#define STR_USAGE
Definition toy_scrip.c:144
Examples
dummy_atmosphere_c.c, dummy_io_c.c, and dummy_ocean_c.c.

Definition at line 145 of file toy_scrip.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NUM_TEST_FUNCTIONS 

Definition at line 136 of file toy_scrip.c.

◆ experiment_type

Enumerator
GEN_MASK 
NOICOH 
NOGT_ICOH 
ICOS_ICOH 
DUMMY 
NUM_EXPERIMENT 

Definition at line 29 of file toy_scrip.c.

◆ interp_stack_type

Enumerator
INTERP_STACK_CONSERV_DESTAREA 
INTERP_STACK_CONSERV_FRACAREA 
INTERP_STACK_CONS2ND_FRACAREA 
INTERP_STACK_DISTWGT_4 
INTERP_STACK_DISTWGT_1 
INTERP_STACK_HCSBB 
INTERP_STACK_AVG_DIST 
NUM_INTERP_STACK_TYPES 

Definition at line 18 of file toy_scrip.c.

Function Documentation

◆ free_interp_stacks()

static void free_interp_stacks ( void )
static

Definition at line 578 of file toy_scrip.c.

Here is the call graph for this function:

◆ generate_interp_stacks()

static void generate_interp_stacks ( void )
static

Definition at line 512 of file toy_scrip.c.

Here is the call graph for this function:

◆ LLtoXYZ()

static void LLtoXYZ ( double lon,
double lat,
double p_out[] )
static

Definition at line 587 of file toy_scrip.c.

Here is the caller graph for this function:

◆ parse_arguments()

static void parse_arguments ( int argc,
char ** argv,
enum experiment_type * experiment )
static
Examples
dummy_atmosphere_c.c, dummy_io_c.c, and dummy_ocean_c.c.

Definition at line 490 of file toy_scrip.c.

Here is the caller graph for this function:

◆ read_mask()

static int * read_mask ( char const * filename,
char const * grid_name,
int const valid_mask_value )
static

Definition at line 441 of file toy_scrip.c.

Here is the call graph for this function:

Variable Documentation

◆ experiment_configs

struct experiment_configuration experiment_configs[]

◆ id

int id

Definition at line 115 of file toy_scrip.c.

◆ [struct]

struct { ... } interp_stacks[NUM_INTERP_STACK_TYPES]

◆ name

char const* name

Definition at line 114 of file toy_scrip.c.

◆ p

double(* p) (double lon, double lat) ( double lon,
double lat )

Definition at line 119 of file toy_scrip.c.

◆ [struct]

struct { ... } test_functions[]
Initial value:
=
{{.p = yac_test_func,
.name = "yac"},
.name = "fcos"},
.name = "fcossin"},
{.p = yac_test_one,
.name = "one"},
.name = "gulfstream"},
.name = "harmonic"},
.name = "vortex"}}
double yac_test_one(double lon, double lat)
double yac_test_ana_fcos(double lon, double lat)
double yac_test_harmonic(double lon, double lat)
double yac_test_vortex(double lon, double lat)
double yac_test_func(double lon, double lat)
double yac_test_ana_fcossin(double lon, double lat)
double yac_test_gulfstream(double lon, double lat)