My Project
|
C-interface to the IFS trans-library. More...
#include <stddef.h>
#include "ectrans/version.h"
Go to the source code of this file.
Classes | |
struct | Trans_t |
Struct that holds information to do transforms for one particular grid resolution. More... | |
struct | DirTrans_t |
Arguments structure for trans_dirtrans() More... | |
struct | DirTransAdj_t |
Arguments structure for trans_dirtrans_adj() More... | |
struct | InvTrans_t |
Arguments structure for trans_invtrans() More... | |
struct | InvTransAdj_t |
Adjoint of spectral inverse. More... | |
struct | DistGrid_t |
Arguments structure for trans_distgrid() More... | |
struct | GathGrid_t |
Arguments structure for trans_gathgrid() More... | |
struct | DistSpec_t |
Arguments structure for trans_distspec() More... | |
struct | GathSpec_t |
Arguments structure for trans_gathspec() More... | |
struct | VorDivToUV_t |
Arguments structure for trans_vordiv_to_UV() More... | |
struct | SpecNorm_t |
Macros | |
#define | TRANS_FFT992 1 |
#define | TRANS_FFTW 2 |
#define | TRANS_SUCCESS 0 |
Typedefs | |
typedef int | _bool |
Functions | |
const char * | trans_error_msg (int errcode) |
Get error message relating to error code. | |
int | trans_set_handles_limit (int limit) |
Set limit on maximum simultaneously allocated transforms. | |
int | trans_set_radius (double radius) |
Set radius of planet used in trans. | |
int | trans_set_nprtrv (int nprtrv) |
Set nprtrv for parallel distribution of fields in spectral space. | |
int | trans_use_mpi (_bool) |
Use MPI in trans library. | |
int | trans_init (void) |
Initialize trans library. | |
int | trans_set_read (struct Trans_t *, const char *filepath) |
int | trans_set_write (struct Trans_t *, const char *filepath) |
int | trans_set_cache (struct Trans_t *, const void *, size_t) |
int | trans_setup (struct Trans_t *trans) |
Setup a new resolution to be used in the trans library. | |
int | trans_inquire (struct Trans_t *trans, const char *varlist) |
Inquire the trans library for array values. | |
int | trans_dirtrans (struct DirTrans_t *dirtrans) |
Direct spectral transform (from grid-point to spectral) | |
int | trans_dirtrans_adj (struct DirTransAdj_t *dirtransadj) |
Adjoint of the Direct spectral transform (from spectral to grid-point) | |
int | trans_invtrans (struct InvTrans_t *invtrans) |
Inverse spectral transform (from spectral grid-point) | |
int | trans_invtrans_adj (struct InvTransAdj_t *invtrans_adj) |
Adjoint of the Inverse spectral transform (from grid-point spectral) | |
int | trans_distgrid (struct DistGrid_t *distgrid) |
Distribute global gridpoint array among processors. | |
int | trans_gathgrid (struct GathGrid_t *gathgrid) |
Gather global gridpoint array from processors. | |
int | trans_distspec (struct DistSpec_t *distspec) |
Distribute global spectral array among processors. | |
int | trans_gathspec (struct GathSpec_t *gathspec) |
Gather global spectral array from processors. | |
int | trans_vordiv_to_UV (struct VorDivToUV_t *vordiv_to_UV) |
Convert Spectral vorticity & divergence to Spectral u*cos(theta) & v*cos(theta) | |
int | trans_specnorm (struct SpecNorm_t *specnorm) |
Compute global spectral norms. | |
int | trans_delete (struct Trans_t *trans) |
Remove footprint of specific resolution. | |
int | trans_finalize (void) |
Finalize trans library. | |
int | trans_new (struct Trans_t *) |
Constructor for Trans_t, setting default values. | |
int | trans_set_resol (struct Trans_t *trans, int ndgl, const int *nloen) |
Set gridpoint resolution for trans. | |
int | trans_set_resol_lonlat (struct Trans_t *trans, int nlon, int nlat) |
Set gridpoint resolution for trans for longitude-latitude grids. | |
int | trans_set_trunc (struct Trans_t *trans, int nsmax) |
Set spectral truncation wave number for trans. | |
struct DirTrans_t | new_dirtrans (struct Trans_t *trans) |
Constructor for DirTrans_t, resetting default values. | |
struct DirTransAdj_t | new_dirtrans_adj (struct Trans_t *trans) |
Constructor for DirTransAdj_t, resetting default values. | |
struct InvTrans_t | new_invtrans (struct Trans_t *trans) |
Constructor for InvTrans_t, resetting default values. | |
struct InvTransAdj_t | new_invtrans_adj (struct Trans_t *trans) |
Constructor for InvTransAdj_t, resetting default values. | |
struct DistGrid_t | new_distgrid (struct Trans_t *trans) |
Constructor for DistGrid_t, resetting default values. | |
struct GathGrid_t | new_gathgrid (struct Trans_t *trans) |
Constructor for GathGrid_t, resetting default values. | |
struct DistSpec_t | new_distspec (struct Trans_t *trans) |
Constructor for DistSpec_t, resetting default values. | |
struct GathSpec_t | new_gathspec (struct Trans_t *trans) |
Constructor for GathSpec_t, resetting default values. | |
struct VorDivToUV_t | new_vordiv_to_UV (void) |
Constructor for VorDivToUV_t, resetting default values. | |
struct SpecNorm_t | new_specnorm (struct Trans_t *trans) |
Constructor for SpecNorm_t, resetting default values. | |
C-interface to the IFS trans-library.
This file declares the C-API to the IFS trans-library Definitions of routines are implemented in trans_module.F90, which redirects function calls to the IFS TRANS library
struct DirTrans_t new_dirtrans | ( | struct Trans_t * | trans | ) |
Constructor for DirTrans_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct DirTransAdj_t new_dirtrans_adj | ( | struct Trans_t * | trans | ) |
Constructor for DirTransAdj_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct DistGrid_t new_distgrid | ( | struct Trans_t * | trans | ) |
Constructor for DistGrid_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct DistSpec_t new_distspec | ( | struct Trans_t * | trans | ) |
Constructor for DistSpec_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct GathGrid_t new_gathgrid | ( | struct Trans_t * | trans | ) |
Constructor for GathGrid_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct GathSpec_t new_gathspec | ( | struct Trans_t * | trans | ) |
Constructor for GathSpec_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct InvTrans_t new_invtrans | ( | struct Trans_t * | trans | ) |
Constructor for InvTrans_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct InvTransAdj_t new_invtrans_adj | ( | struct Trans_t * | trans | ) |
Constructor for InvTransAdj_t, resetting default values.
trans | [in] Trans_t used to set defaults |
struct SpecNorm_t new_specnorm | ( | struct Trans_t * | trans | ) |
Constructor for SpecNorm_t, resetting default values.
struct VorDivToUV_t new_vordiv_to_UV | ( | void | ) |
Constructor for VorDivToUV_t, resetting default values.
int trans_delete | ( | struct Trans_t * | trans | ) |
Remove footprint of specific resolution.
trans | Trans_t struct describing specific resolution |
All arrays will be deallocated.
int trans_dirtrans | ( | struct DirTrans_t * | dirtrans | ) |
Direct spectral transform (from grid-point to spectral)
A DirTrans_t struct, initialised with new_dirtrans(), groups all arguments
dirtrans | DirTrans_t struct, containing all arguments. |
Usage:
int trans_dirtrans_adj | ( | struct DirTransAdj_t * | dirtransadj | ) |
Adjoint of the Direct spectral transform (from spectral to grid-point)
A DirTransAdj_t struct, initialised with new_dirtrans_adj(), groups all arguments
dirtrans_adj | DirTransAdj_t struct, containing all arguments. |
Usage:
int trans_distgrid | ( | struct DistGrid_t * | distgrid | ) |
Distribute global gridpoint array among processors.
Usage:
int trans_distspec | ( | struct DistSpec_t * | distspec | ) |
Distribute global spectral array among processors.
Usage:
int trans_finalize | ( | void | ) |
Finalize trans library.
This finalizes MPI communication, and deallocates resolution-independent storage. After this, no more calls to trans should be made
int trans_gathgrid | ( | struct GathGrid_t * | gathgrid | ) |
Gather global gridpoint array from processors.
Usage:
int trans_gathspec | ( | struct GathSpec_t * | gathspec | ) |
Gather global spectral array from processors.
Usage:
int trans_init | ( | void | ) |
Initialize trans library.
This initializes MPI communication, and allocates resolution-independent storage.
If this routine is not called, then it will be called internally upon the first call to trans_setup()
int trans_inquire | ( | struct Trans_t * | trans, |
const char * | varlist ) |
Inquire the trans library for array values.
trans | Trans_t struct which needs to have been setup using trans_setup() |
varlist | comma-separated string of values to inquire |
The inquired values will be allocated if needed, and filled in in the Trans_t struct
int trans_invtrans | ( | struct InvTrans_t * | invtrans | ) |
Inverse spectral transform (from spectral grid-point)
A InvTrans_t struct, initialised with new_invtrans(), groups all arguments
invtrans | InvTrans_t struct, containing all arguments. |
Usage:
int trans_invtrans_adj | ( | struct InvTransAdj_t * | invtrans_adj | ) |
Adjoint of the Inverse spectral transform (from grid-point spectral)
A InvTransAdj_t struct, initialised with new_invtrans_adj(), groups all arguments
invtrans_adj | InvTransAdj_t struct, containing all arguments. |
Usage:
int trans_new | ( | struct Trans_t * | trans | ) |
Constructor for Trans_t, setting default values.
int trans_set_handles_limit | ( | int | limit | ) |
Set limit on maximum simultaneously allocated transforms.
Default value is 10 This function needs to be called before trans_init() or trans_setup(), and ONLY if the default value needs to be changed.
int trans_set_nprtrv | ( | int | nprtrv | ) |
Set nprtrv for parallel distribution of fields in spectral space.
Default value of nprtrv is 1, meaning that there is no parallel distribution of the same wave number for different fields (or levels) This function needs to be called before trans_init() or trans_setup(), and ONLY if the default value needs to be changed.
int trans_set_radius | ( | double | radius | ) |
Set radius of planet used in trans.
Default value of radius is Earth's radius (6371.22e+03) This function needs to be called before trans_init() or trans_setup(), and ONLY if the default value needs to be changed.
int trans_set_resol | ( | struct Trans_t * | trans, |
int | ndgl, | ||
const int * | nloen ) |
Set gridpoint resolution for trans.
trans | [in] Trans_t used to setup |
ndgl | [in] Number of lattitudes |
nloen | [in] Number of longitude points for each latitude DIMENSIONS(1:NDGL) |
int trans_set_resol_lonlat | ( | struct Trans_t * | trans, |
int | nlon, | ||
int | nlat ) |
Set gridpoint resolution for trans for longitude-latitude grids.
trans | [in] Trans_t used to setup |
nlon | [in] Number of longitudes |
nlat | [in] Number of latitudes (pole to pole) |
int trans_set_trunc | ( | struct Trans_t * | trans, |
int | nsmax ) |
Set spectral truncation wave number for trans.
trans | [in] Trans_t used to setup |
nsmax | [in] Spectral truncation wave number |
int trans_setup | ( | struct Trans_t * | trans | ) |
Setup a new resolution to be used in the trans library.
trans | Trans_t struct, that needs to have following variables defined:
|
All scalar values in the struct will be filled in. Remaining array values will be deallocated and set to null. To define array values, make individual calls to trans_inquire()
Usage:
int trans_specnorm | ( | struct SpecNorm_t * | specnorm | ) |
Compute global spectral norms.
Usage:< >
int trans_use_mpi | ( | _bool | ) |
Use MPI in trans library.
By default, MPI is used if MPI was detected during compilation. To force not to use MPI, this function may be used.
int trans_vordiv_to_UV | ( | struct VorDivToUV_t * | vordiv_to_UV | ) |
Convert Spectral vorticity & divergence to Spectral u*cos(theta) & v*cos(theta)
Usage: