76#ifndef ectrans_transi_h
77#define ectrans_transi_h
87#include "ectrans/version.h"
92#define TRANS_SUCCESS 0
169int trans_set_read(
struct Trans_t*,
const char* filepath);
170int trans_set_write(
struct Trans_t*,
const char* filepath);
171int trans_set_cache(
struct Trans_t*,
const void*,
size_t);
Arguments structure for trans_dirtrans()
Definition transi.h:858
double * rspdiv
[output] spectral divergence
Definition transi.h:870
int ngpblks
[input,default=1] Blocking factor for distributed gridpoint array
Definition transi.h:875
int nproma
[input,default=ngptot] Blocking factor for distributed gridpoint array
Definition transi.h:872
int nvordiv
[input,default=0] Number of vorticity/divergence fields in RGP
Definition transi.h:874
int lglobal
[input,default=0] rgp is a global input field --> nproma==1,ngpblks==ngptotg
Definition transi.h:876
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:877
int nscalar
[input,default=0] Number of scalar fields present in RGP
Definition transi.h:873
const double * rgp
[input] gridpoint fields
Definition transi.h:859
int count
Internal storage for calls to trans_dirtrans()
Definition transi.h:878
double * rspvor
[output] spectral vorticity
Definition transi.h:868
double * rspscalar
[output] spectral scalar valued fields
Definition transi.h:866
Arguments structure for trans_dirtrans_adj()
Definition transi.h:894
double * rspscalar
[output] spectral scalar valued fields
Definition transi.h:902
int nscalar
[input,default=0] Number of scalar fields present in RGP
Definition transi.h:909
int lglobal
[input,default=0] rgp is a global input field --> nproma==1,ngpblks==ngptotg
Definition transi.h:912
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:913
double * rspvor
[output] spectral vorticity
Definition transi.h:904
int ngpblks
[input,default=1] Blocking factor for distributed gridpoint array
Definition transi.h:911
const double * rgp
[input] gridpoint fields
Definition transi.h:895
int nvordiv
[input,default=0] Number of vorticity/divergence fields in RGP
Definition transi.h:910
int count
Internal storage for calls to trans_dirtrans()
Definition transi.h:914
int nproma
[input,default=ngptot] Blocking factor for distributed gridpoint array
Definition transi.h:908
double * rspdiv
[output] spectral divergence
Definition transi.h:906
Arguments structure for trans_distgrid()
Definition transi.h:1018
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:1032
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1031
const double * rgpg
Global gridpoint array Fortran DIMENSIONS(1:NGPTOTG,1:NFLDG) C/C++ DIMENSIONS[NFLDG][NGPTOTG].
Definition transi.h:1019
int nfld
Number of distributed fields.
Definition transi.h:1029
double * rgp
Distributed gridpoint array Fortran DIMENSIONS(1:NPROMA,1:NFLD,1:NGPBLKS) C/C++ DIMENSIONS[NGPBLKS][N...
Definition transi.h:1022
int nproma
Blocking factor for distributed gridpoint array.
Definition transi.h:1028
int ngpblks
Blocking factor for distributed gridpoint array.
Definition transi.h:1030
const int * nfrom
Processors responsible for distributing each field DIMENSIONS(1:NFLD)
Definition transi.h:1026
Arguments structure for trans_distspec()
Definition transi.h:1077
const double * rspecg
Global spectral array Fortran DIMENSIONS(1:NFLDG,1:NSPEC2G) C/C++ DIMENSIONS[NSPEC2G][NFLDG].
Definition transi.h:1078
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:1088
const int * nfrom
Processors responsible for distributing each field Fortran DIMENSIONS(1:NFLD)
Definition transi.h:1084
int nfld
Number of distributed fields.
Definition transi.h:1086
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1087
double * rspec
Local spectral array Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NFLD].
Definition transi.h:1081
Arguments structure for trans_gathgrid()
Definition transi.h:1047
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:1062
int nfld
Number of distributed fields.
Definition transi.h:1059
int ngpblks
Blocking factor for distributed gridpoint array.
Definition transi.h:1060
const int * nto
Processors responsible for gathering each field Fortran DIMENSIONS(1:NFLD)
Definition transi.h:1056
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1061
double * rgpg
Global gridpoint array Fortran DIMENSIONS(1:NGPTOTG,1:NFLDG) C/C++ DIMENSIONS[NFLDG][NGPTOTG] DIMENSI...
Definition transi.h:1048
int nproma
Blocking factor for distributed gridpoint array.
Definition transi.h:1058
const double * rgp
Distributed gridpoint array Fortran DIMENSIONS(1:NPROMA,1:NFLD,1:NGPBLKS) C/C++ DIMENSIONS[NGPBLKS][N...
Definition transi.h:1052
Arguments structure for trans_gathspec()
Definition transi.h:1103
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1113
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:1114
double * rspecg
Global spectral array Fortran DIMENSIONS(1:NFLDG,1:NSPEC2G) C/C++ DIMENSIONS[NSPEC2G][NFLDG].
Definition transi.h:1104
const int * nto
Processors responsible for gathering each field DIMENSIONS(1:NFLD)
Definition transi.h:1110
const double * rspec
Local spectral array Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NFLD].
Definition transi.h:1107
int nfld
Number of distributed fields.
Definition transi.h:1112
Arguments structure for trans_invtrans()
Definition transi.h:930
int nproma
[input,default=ngptot] Blocking factor for distributed gridpoint array
Definition transi.h:950
const double * rspvor
[input] spectral vorticity
Definition transi.h:933
int lscalarders
[input,default=0] Indicate if derivatives of scalars are requested
Definition transi.h:953
int lglobal
[input,default=0] rgp is a global output field --> nproma==1,ngpblks==ngptotg
Definition transi.h:957
int nvordiv
[input,default=0] Number of vorticity/divergence fields in RGP
Definition transi.h:952
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:959
double * rgp
[output] gridpoint fields
Definition transi.h:937
int ngpblks
[input,default=1] Blocking factor for distributed gridpoint array
Definition transi.h:956
const double * rspscalar
[input,default=NULL] spectral scalar valued fields
Definition transi.h:931
const double * rspdiv
[input] spectral divergence
Definition transi.h:935
int luvder_EW
[input,default=0] Indicate if East-West derivative of u and v is requested
Definition transi.h:954
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:958
int lvordivgp
[input,default=0] Indicate if grid-point vorticity and divergence is requested
Definition transi.h:955
int nscalar
[input,default=0] Number of scalar fields present in RGP
Definition transi.h:951
Adjoint of spectral inverse.
Definition transi.h:972
int luvder_EW
[input,default=0] Indicate if East-West derivative of u and v is requested
Definition transi.h:996
const double * rgp
[input] gridpoint fields
Definition transi.h:979
int lvordivgp
[input,default=0] Indicate if grid-point vorticity and divergence is requested
Definition transi.h:997
int count
Internal storage for calls to trans_invtrans_adj()
Definition transi.h:1001
int nscalar
[input,default=0] Number of scalar fields present in RGP
Definition transi.h:993
int lscalarders
[input,default=0] Indicate if derivatives of scalars are requested
Definition transi.h:995
double * rspvor
[output] spectral vorticity
Definition transi.h:975
int lglobal
[input,default=0] rgp is a global output field --> nproma==1,ngpblks==ngptotg
Definition transi.h:999
int nvordiv
[input,default=0] Number of vorticity/divergence fields in RGP
Definition transi.h:994
int ngpblks
[input,default=1] Blocking factor for distributed gridpoint array
Definition transi.h:998
int nproma
[input,default=ngptot] Blocking factor for distributed gridpoint array
Definition transi.h:992
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1000
double * rspscalar
[output,default=NULL] spectral scalar valued fields
Definition transi.h:973
double * rspdiv
[output] spectral divergence
Definition transi.h:977
int nmaster
Processor to receive norms (value 1 means MPI_RANK 0)
Definition transi.h:1160
int count
Internal storage for calls to trans_invtrans()
Definition transi.h:1167
int nfld
Number of fields.
Definition transi.h:1165
const double * rspec
Spectral array to compute norm of Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NFLD].
Definition transi.h:1157
struct Trans_t * trans
Internal storage of trans object.
Definition transi.h:1166
const double * rmet
metric, OPTIONAL DIMENSIONS(0:NSMAX)
Definition transi.h:1161
double * rnorm
Norms (output for processor nmaster) DIMENSIONS(1:NFLD)
Definition transi.h:1163
Struct that holds information to do transforms for one particular grid resolution.
Definition transi.h:678
int * nptrls
Pointer to first global latitude of each a-set for which it performs the Fourier calculations DIMEN...
Definition transi.h:790
int * ndim0g
Defines partitioning of global spectral fields among PEs DIMENSIONS(0:NSMAX)
Definition transi.h:737
int nspec2
Number of complex spectral coefficients on this PE times 2 (real and imag)
Definition transi.h:714
int nspec2g
global KSPEC2
Definition transi.h:715
int * nloen
Number of longitude points for each latitude DIMENSIONS(1:NDGL)
Definition transi.h:682
int n_regions_EW
Number of regions in East-West direction.
Definition transi.h:745
int * nmyms
This PEs spectral zonal wavenumbers DIMENSIONS(1:NUMP)
Definition transi.h:723
int * npossp
Defines partitioning of global spectral fields among PEs DIMENSIONS(1:NPRTRW+1)
Definition transi.h:730
int nlei3
First dimension of Legendre polynomials.
Definition transi.h:805
int ngptotg
Total number of grid columns on the Globe.
Definition transi.h:719
int nspec2mx
Maximun KSPEC2 among all PEs.
Definition transi.h:716
int * ngptotl
Number of grid columns on each PE DIMENSIONS(1:N_REGIONS_NS,1:N_REGIONS_EW)
Definition transi.h:721
double * rgw
Gaussian weights DIMENSIONS(1:NDGL)
Definition transi.h:801
int * nptrms
Pointer to the first wave number of a given a-set DIMENSIONS(1:NPRTRW)
Definition transi.h:732
int handle
Resolution tag for which info is required ,default is the first defined resulution (input)
Definition transi.h:707
int nprtrw
Number of processors in A-direction (input)
Definition transi.h:727
int ndgl
Number of lattitudes.
Definition transi.h:681
int n_regions_NS
Number of regions in North-South direction.
Definition transi.h:744
int * nasm0
Address in a spectral array of (m, n=m) DIMENSIONS(0:NSMAX)
Definition transi.h:725
int fft
FFT library to use underneith FFT992 = 1 ; FFTW = 2.
Definition transi.h:692
int * ndglu
Number of active points in an hemisphere for a given wavenumber "m" DIMENSIONS(0:NSMAX)
Definition transi.h:811
int * nlstlat
Last latitude of each a-set in grid-point space DIMENSIONS(1:N_REGIONS_NS)
Definition transi.h:752
int * nvalue
n value for each KSPEC2 spectral coeffient DIMENSIONS(1:NSPEC2)
Definition transi.h:739
int myproc
Current MPI task (numbering starting at 1)
Definition transi.h:702
int * nultpp
Number of latitudes for which each a-set is calculating the FFT's. DIMENSIONS(1:NPRTRNS)
Definition transi.h:787
int * nfrstlat
First latitude of each a-set in grid-point space DIMENSIONS(1:N_REGIONS_NS)
Definition transi.h:750
int my_region_NS
My region in North-South direction.
Definition transi.h:746
int nlon
Number of longitude points for all latitudes .
Definition transi.h:684
int * numpp
No. of wave numbers each wave set is responsible for. DIMENSIONS(1:NPRTRW)
Definition transi.h:728
int nfrstloff
Offset for first lat of own a-set in grid-point space.
Definition transi.h:754
double * rlapin
Eigen-values of the inverse Laplace operator DIMENSIONS(-1:NSMAX+2)
Definition transi.h:809
int nsmax
Spectral truncation wave number.
Definition transi.h:685
_bool ldlam
True if the corresponding resolution is LAM, false if it is global.
Definition transi.h:709
int * nonl
Number of grid columns for the latitudes on a processor. Similar to nsta() in data structure....
Definition transi.h:776
double * rpnm
Legendre polynomials DIMENSIONS(1:NLEI3,1:NSPOLEGL)
Definition transi.h:803
int ngptot
Total number of grid columns on this PE.
Definition transi.h:718
_bool lsplit
If false, the distribution does not allow latitudes to be split.
Definition transi.h:687
int nproc
Number of parallel MPI tasks.
Definition transi.h:703
int nprtrns
No. of sets in N-S direction (Fourier space) (always equal to NPRTRW)
Definition transi.h:785
_bool * ldsplitlat
True if latitude is split in grid point space over two a-sets. DIMENSIONS(1:NDGL)
Definition transi.h:779
int * nptrlstlat
Pointer to the last latitude of each a-set in NSTA and NONL arrays DIMENSIONS(1:N_REGIONS_NS)
Definition transi.h:760
int llatlon
If true, the transforms compute extra coefficients for latlon transforms.
Definition transi.h:688
double * rmu
sin(Gaussian latitudes) DIMENSIONS(1:NDGL)
Definition transi.h:799
int * nptrlat
Pointer to the start of each latitude DIMENSIONS(1:NDGL)
Definition transi.h:755
int nptrfloff
Offset for pointer to the first latitude of own a-set NSTA and NONL arrays, i.e. nptrfrstlat(myseta)-...
Definition transi.h:763
int nspolegl
Second dimension of Legendre polynomials.
Definition transi.h:806
int * npms
Adress for legendre polynomial for given M (NSMAX) DIMENSIONS(0:NSMAX)
Definition transi.h:807
int * nnmeng
associated (with NLOENG) cut-off zonal wavenumber DIMENSIONS(1:NDGL)
Definition transi.h:793
int * nsta
Position of first grid column for the latitudes on a processor. DIMENSIONS(1:NDGL+N_REGIONS_NS-1,...
Definition transi.h:765
int * n_regions
Number of East-West Regions per band of North-South Regions.
Definition transi.h:748
int ngptotmx
Maximum number of grid columns on any of the PEs.
Definition transi.h:720
int my_region_EW
My region in East-West direction.
Definition transi.h:747
int flt
If true, the Fast-Legendre-Transform method is used which is faster for higher resolutions (N1024)
Definition transi.h:690
int * nallms
Wave numbers for all wave-set concatenated together to give all wave numbers in wave-set order DIME...
Definition transi.h:734
int nspec
Number of complex spectral coefficients on this PE.
Definition transi.h:713
int nump
Number of spectral waves handled by this PE.
Definition transi.h:717
int * nptrfrstlat
Pointer to the first latitude of each a-set in NSTA and NONL arrays DIMENSIONS(1:N_REGIONS_NS)
Definition transi.h:757
Arguments structure for trans_vordiv_to_UV()
Definition transi.h:1129
double * rspu
Local spectral array for U*cos(theta) Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NF...
Definition transi.h:1136
int count
Internal storage for calls to trans_vordiv_toUV()
Definition transi.h:1146
double * rspv
Local spectral array for V*cos(theta) Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NF...
Definition transi.h:1139
const double * rspvor
Local spectral array for vorticity Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NFLD]...
Definition transi.h:1130
const double * rspdiv
Local spectral array for divergence Fortran DIMENSIONS(1:NFLD,1:NSPEC2) C/C++ DIMENSIONS[NSPEC2][NFLD...
Definition transi.h:1133
int ncoeff
number of spectral coefficients (equivalent to nspec2 for distributed or nspec2g for global)
Definition transi.h:1144
int nfld
Number of distributed fields.
Definition transi.h:1142
int nsmax
Spectral resolution (T)
Definition transi.h:1143
int trans_specnorm(struct SpecNorm_t *specnorm)
Compute global spectral norms.
struct DirTransAdj_t new_dirtrans_adj(struct Trans_t *trans)
Constructor for DirTransAdj_t, resetting default values.
Definition transi.c:152
struct SpecNorm_t new_specnorm(struct Trans_t *trans)
Constructor for SpecNorm_t, resetting default values.
Definition transi.c:274
const char * trans_error_msg(int errcode)
Get error message relating to error code.
Definition transi.c:38
struct DirTrans_t new_dirtrans(struct Trans_t *trans)
Constructor for DirTrans_t, resetting default values.
Definition transi.c:135
int trans_inquire(struct Trans_t *trans, const char *varlist)
Inquire the trans library for array values.
int trans_distgrid(struct DistGrid_t *distgrid)
Distribute global gridpoint array among processors.
int trans_dirtrans(struct DirTrans_t *dirtrans)
Direct spectral transform (from grid-point to spectral)
int trans_invtrans_adj(struct InvTransAdj_t *invtrans_adj)
Adjoint of the Inverse spectral transform (from grid-point spectral)
int trans_new(struct Trans_t *)
Constructor for Trans_t, setting default values.
Definition transi.c:59
struct InvTrans_t new_invtrans(struct Trans_t *trans)
Constructor for InvTrans_t, resetting default values.
Definition transi.c:169
struct GathSpec_t new_gathspec(struct Trans_t *trans)
Constructor for GathSpec_t, resetting default values.
Definition transi.c:249
int trans_set_resol_lonlat(struct Trans_t *trans, int nlon, int nlat)
Set gridpoint resolution for trans for longitude-latitude grids.
Definition transi.c:86
int trans_set_radius(double radius)
Set radius of planet used in trans.
int trans_delete(struct Trans_t *trans)
Remove footprint of specific resolution.
int trans_gathspec(struct GathSpec_t *gathspec)
Gather global spectral array from processors.
int trans_setup(struct Trans_t *trans)
Setup a new resolution to be used in the trans library.
int trans_invtrans(struct InvTrans_t *invtrans)
Inverse spectral transform (from spectral grid-point)
struct VorDivToUV_t new_vordiv_to_UV(void)
Constructor for VorDivToUV_t, resetting default values.
Definition transi.c:260
int trans_set_nprtrv(int nprtrv)
Set nprtrv for parallel distribution of fields in spectral space.
struct DistSpec_t new_distspec(struct Trans_t *trans)
Constructor for DistSpec_t, resetting default values.
Definition transi.c:238
int trans_set_trunc(struct Trans_t *trans, int nsmax)
Set spectral truncation wave number for trans.
Definition transi.c:108
int trans_set_handles_limit(int limit)
Set limit on maximum simultaneously allocated transforms.
int trans_set_resol(struct Trans_t *trans, int ndgl, const int *nloen)
Set gridpoint resolution for trans.
Definition transi.c:76
int trans_use_mpi(_bool)
Use MPI in trans library.
int trans_gathgrid(struct GathGrid_t *gathgrid)
Gather global gridpoint 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)
struct DistGrid_t new_distgrid(struct Trans_t *trans)
Constructor for DistGrid_t, resetting default values.
Definition transi.c:210
int trans_finalize(void)
Finalize trans library.
Definition transi_module.F90:1289
int trans_dirtrans_adj(struct DirTransAdj_t *dirtransadj)
Adjoint of the Direct spectral transform (from spectral to grid-point)
struct GathGrid_t new_gathgrid(struct Trans_t *trans)
Constructor for GathGrid_t, resetting default values.
Definition transi.c:224
int trans_distspec(struct DistSpec_t *distspec)
Distribute global spectral array among processors.
int trans_init(void)
Initialize trans library.
Definition transi_module.F90:539
struct InvTransAdj_t new_invtrans_adj(struct Trans_t *trans)
Constructor for InvTransAdj_t, resetting default values.
Definition transi.c:189