26 return omp_get_wtime();
36 if (shtns->cpu_timer >= 0) shtns->cpu_timer = t;
43 if (shtns->cpu_timer >= 0) shtns->cpu_timer = t;
50 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SSY])(shtns, Qlm, Vr, shtns->
lmax);
54 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SAN])(shtns, Vr, Qlm, shtns->
lmax);
58 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VSY])(shtns, Slm, Tlm, Vt, Vp, shtns->
lmax);
62 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VAN])(shtns, Vt, Vp, Slm, Tlm, shtns->
lmax);
66 ((pf6l)shtns->ftable[SHT_STD][SHT_TYP_3SY])(shtns, Qlm, Slm, Tlm, Vr, Vt, Vp, shtns->
lmax);
70 ((pf6l)shtns->ftable[SHT_STD][SHT_TYP_3AN])(shtns, Vr, Vt, Vp, Qlm, Slm, Tlm, shtns->
lmax);
74 ((pf3l)shtns->ftable[SHT_STD][SHT_TYP_GTO])(shtns, Tlm, Vt, Vp, shtns->
lmax);
78 ((pf3l)shtns->ftable[SHT_STD][SHT_TYP_GSP])(shtns, Slm, Vt, Vp, shtns->
lmax);
84void SH_to_spat_l(
shtns_cfg shtns,
cplx *Qlm,
double *Vr,
int ltr) {
85 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SSY])(shtns, Qlm, Vr, ltr);
88void spat_to_SH_l(
shtns_cfg shtns,
double *Vr,
cplx *Qlm,
int ltr) {
89 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SAN])(shtns, Vr, Qlm, ltr);
92void SHsphtor_to_spat_l(
shtns_cfg shtns,
cplx *Slm,
cplx *Tlm,
double *Vt,
double *Vp,
int ltr) {
93 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VSY])(shtns, Slm, Tlm, Vt, Vp, ltr);
96void spat_to_SHsphtor_l(
shtns_cfg shtns,
double *Vt,
double *Vp,
cplx *Slm,
cplx *Tlm,
int ltr) {
97 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VAN])(shtns, Vt, Vp, Slm, Tlm, ltr);
100void SHqst_to_spat_l(
shtns_cfg shtns,
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
double *Vr,
double *Vt,
double *Vp,
int ltr) {
101 ((pf6l)shtns->ftable[SHT_STD][SHT_TYP_3SY])(shtns, Qlm, Slm, Tlm, Vr, Vt, Vp, ltr);
104void spat_to_SHqst_l(
shtns_cfg shtns,
double *Vr,
double *Vt,
double *Vp,
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
int ltr) {
105 ((pf6l)shtns->ftable[SHT_STD][SHT_TYP_3AN])(shtns, Vr, Vt, Vp, Qlm, Slm, Tlm, ltr);
108void SHtor_to_spat_l(
shtns_cfg shtns,
cplx *Tlm,
double *Vt,
double *Vp,
int ltr) {
109 ((pf3l)shtns->ftable[SHT_STD][SHT_TYP_GTO])(shtns, Tlm, Vt, Vp, ltr);
112void SHsph_to_spat_l(
shtns_cfg shtns,
cplx *Slm,
double *Vt,
double *Vp,
int ltr) {
113 ((pf3l)shtns->ftable[SHT_STD][SHT_TYP_GSP])(shtns, Slm, Vt, Vp, ltr);
120 ((pf2ml)shtns->ftable[SHT_M][SHT_TYP_SSY])(shtns, im, Qlm, Vr, ltr);
124 ((pf2ml)shtns->ftable[SHT_M][SHT_TYP_SAN])(shtns, im, Vr, Qlm, ltr);
128 ((pf4ml)shtns->ftable[SHT_M][SHT_TYP_VSY])(shtns, im, Slm, Tlm, Vt, Vp, ltr);
132 ((pf4ml)shtns->ftable[SHT_M][SHT_TYP_VAN])(shtns, im, Vt, Vp, Slm, Tlm, ltr);
136 ((pf6ml)shtns->ftable[SHT_M][SHT_TYP_3SY])(shtns, im, Qlm, Slm, Tlm, Vr, Vt, Vp, ltr);
140 ((pf6ml)shtns->ftable[SHT_M][SHT_TYP_3AN])(shtns, im, Vr, Vt, Vp, Qlm, Slm, Tlm, ltr);
144 ((pf3ml)shtns->ftable[SHT_M][SHT_TYP_GTO])(shtns, im, Tlm, Vt, Vp, ltr);
148 ((pf3ml)shtns->ftable[SHT_M][SHT_TYP_GSP])(shtns, im, Slm, Vt, Vp, ltr);
154void SHqst_to_spat_2l(
shtns_cfg shtns,
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
double *Vr,
double *Vt,
double *Vp,
int ltr) {
155 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SSY])(shtns, Qlm, Vr, ltr);
156 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VSY])(shtns, Slm, Tlm, Vt, Vp, ltr);
160void spat_to_SHqst_2l(
shtns_cfg shtns,
double *Vr,
double *Vt,
double *Vp,
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
int ltr) {
161 ((pf2l)shtns->ftable[SHT_STD][SHT_TYP_SAN])(shtns, Vr, Qlm, ltr);
162 ((pf4l)shtns->ftable[SHT_STD][SHT_TYP_VAN])(shtns, Vt, Vp, Slm, Tlm, ltr);
167 ((pf2ml)shtns->ftable[SHT_M][SHT_TYP_SSY])(shtns, im, Qlm, Vr, ltr);
168 ((pf4ml)shtns->ftable[SHT_M][SHT_TYP_VSY])(shtns, im, Slm, Tlm, Vt, Vp, ltr);
173 ((pf2ml)shtns->ftable[SHT_M][SHT_TYP_SAN])(shtns, im, Vr, Qlm, ltr);
174 ((pf4ml)shtns->ftable[SHT_M][SHT_TYP_VAN])(shtns, im, Vt, Vp, Slm, Tlm, ltr);
178#if defined(SHT_F77_API)
189void shtns_sh_to_spat_(
cplx *Qlm,
double *Vr) {
190 ((pf2l)sht_data->ftable[SHT_STD][SHT_TYP_SSY])(sht_data, Qlm, Vr, sht_data->
lmax);
194void shtns_spat_to_sh_(
double *Vr,
cplx *Qlm) {
195 ((pf2l)sht_data->ftable[SHT_STD][SHT_TYP_SAN])(sht_data, Vr, Qlm, sht_data->
lmax);
199void shtns_sh_to_spat_cplx_(
cplx *alm,
cplx *z) {
204void shtns_spat_cplx_to_sh_(
cplx *z,
cplx *alm) {
209void shtns_sphtor_to_spat_(
cplx *Slm,
cplx *Tlm,
double *Vt,
double *Vp) {
210 ((pf4l)sht_data->ftable[SHT_STD][SHT_TYP_VSY])(sht_data, Slm, Tlm, Vt, Vp, sht_data->
lmax);
214void shtns_spat_to_sphtor_(
double *Vt,
double *Vp,
cplx *Slm,
cplx *Tlm) {
215 ((pf4l)sht_data->ftable[SHT_STD][SHT_TYP_VAN])(sht_data, Vt, Vp, Slm, Tlm, sht_data->
lmax);
219void shtns_qst_to_spat_(
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
double *Vr,
double *Vt,
double *Vp) {
220 ((pf6l)sht_data->ftable[SHT_STD][SHT_TYP_3SY])(sht_data, Qlm, Slm, Tlm, Vr, Vt, Vp, sht_data->
lmax);
224void shtns_spat_to_qst_(
double *Vr,
double *Vt,
double *Vp,
cplx *Qlm,
cplx *Slm,
cplx *Tlm) {
225 ((pf6l)sht_data->ftable[SHT_STD][SHT_TYP_3AN])(sht_data, Vr, Vt, Vp, Qlm, Slm, Tlm, sht_data->
lmax);
229void shtns_sph_to_spat_(
cplx *Slm,
double *Vt,
double *Vp) {
230 ((pf3l)sht_data->ftable[SHT_STD][SHT_TYP_GSP])(sht_data, Slm, Vt, Vp, sht_data->
lmax);
234void shtns_tor_to_spat_(
cplx *Tlm,
double *Vt,
double *Vp) {
235 ((pf3l)sht_data->ftable[SHT_STD][SHT_TYP_GTO])(sht_data, Tlm, Vt, Vp, sht_data->
lmax);
241void shtns_sh_to_spat_l_(
cplx *Qlm,
double *Vr,
int* ltr) {
242 ((pf2l)sht_data->ftable[SHT_STD][SHT_TYP_SSY])(sht_data, Qlm, Vr, *ltr);
246void shtns_spat_to_sh_l_(
double *Vr,
cplx *Qlm,
int* ltr) {
247 ((pf2l)sht_data->ftable[SHT_STD][SHT_TYP_SAN])(sht_data, Vr, Qlm, *ltr);
251void shtns_sphtor_to_spat_l_(
cplx *Slm,
cplx *Tlm,
double *Vt,
double *Vp,
int* ltr) {
252 ((pf4l)sht_data->ftable[SHT_STD][SHT_TYP_VSY])(sht_data, Slm, Tlm, Vt, Vp, *ltr);
256void shtns_spat_to_sphtor_l_(
double *Vt,
double *Vp,
cplx *Slm,
cplx *Tlm,
int* ltr) {
257 ((pf4l)sht_data->ftable[SHT_STD][SHT_TYP_VAN])(sht_data, Vt, Vp, Slm, Tlm, *ltr);
261void shtns_qst_to_spat_l_(
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
double *Vr,
double *Vt,
double *Vp,
int* ltr) {
262 ((pf6l)sht_data->ftable[SHT_STD][SHT_TYP_3SY])(sht_data, Qlm, Slm, Tlm, Vr, Vt, Vp, *ltr);
266void shtns_spat_to_qst_l_(
double *Vr,
double *Vt,
double *Vp,
cplx *Qlm,
cplx *Slm,
cplx *Tlm,
int* ltr) {
267 ((pf6l)sht_data->ftable[SHT_STD][SHT_TYP_3AN])(sht_data, Vr, Vt, Vp, Qlm, Slm, Tlm, *ltr);
271void shtns_sph_to_spat_l_(
cplx *Slm,
double *Vt,
double *Vp,
int* ltr) {
272 ((pf3l)sht_data->ftable[SHT_STD][SHT_TYP_GSP])(sht_data, Slm, Vt, Vp, *ltr);
276void shtns_tor_to_spat_l_(
cplx *Tlm,
double *Vt,
double *Vp,
int* ltr) {
277 ((pf3l)sht_data->ftable[SHT_STD][SHT_TYP_GTO])(sht_data, Tlm, Vt, Vp, *ltr);
283void shtns_sh_to_spat_ml_(
int *im,
cplx *Qlm,
cplx *Vr,
int *ltr) {
284 ((pf2ml)sht_data->ftable[SHT_M][SHT_TYP_SSY])(sht_data, *im, Qlm, Vr, *ltr);
288void shtns_spat_to_sh_ml_(
int *im,
cplx *Vr,
cplx *Qlm,
int *ltr) {
289 ((pf2ml)sht_data->ftable[SHT_M][SHT_TYP_SAN])(sht_data, *im, Vr, Qlm, *ltr);
293void shtns_sphtor_to_spat_ml_(
int *im,
cplx *Slm,
cplx *Tlm,
cplx *Vt,
cplx *Vp,
int *ltr) {
294 ((pf4ml)sht_data->ftable[SHT_M][SHT_TYP_VSY])(sht_data, *im, Slm, Tlm, Vt, Vp, *ltr);
298void shtns_spat_to_sphtor_ml_(
int *im,
cplx *Vt,
cplx *Vp,
cplx *Slm,
cplx *Tlm,
int *ltr) {
299 ((pf4ml)sht_data->ftable[SHT_M][SHT_TYP_VAN])(sht_data, *im, Vt, Vp, Slm, Tlm, *ltr);
304 ((pf6ml)sht_data->ftable[SHT_M][SHT_TYP_3SY])(sht_data, *im, Qlm, Slm, Tlm, Vr, Vt, Vp, *ltr);
309 ((pf6ml)sht_data->ftable[SHT_M][SHT_TYP_3AN])(sht_data, *im, Vr, Vt, Vp, Qlm, Slm, Tlm, *ltr);
313void shtns_tor_to_spat_ml_(
int *im,
cplx *Tlm,
cplx *Vt,
cplx *Vp,
int *ltr) {
314 ((pf3ml)sht_data->ftable[SHT_M][SHT_TYP_GTO])(sht_data, *im, Tlm, Vt, Vp, *ltr);
318void shtns_sph_to_spat_ml_(
int *im,
cplx *Slm,
cplx *Vt,
cplx *Vp,
int *ltr) {
319 ((pf3ml)sht_data->ftable[SHT_M][SHT_TYP_GSP])(sht_data, *im, Slm, Vt, Vp, *ltr);
void SHqst_to_spat(shtns_cfg shtns, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp)
3D vector transform from radial-spheroidal-toroidal spectral components (see Radial - Spheroidal - To...
Definition sht_com.c:65
void SHtor_to_spat(shtns_cfg shtns, cplx *Tlm, double *Vt, double *Vp)
transform toroidal spherical harmonic coefficients Tlm to the spatial theta and phi components (Vt,...
Definition sht_com.c:73
void SHsph_to_spat(shtns_cfg shtns, cplx *Slm, double *Vt, double *Vp)
transform spheroidal spherical harmonic coefficients Slm to the spatial theta and phi components (Vt,...
Definition sht_com.c:77
void SHsphtor_to_spat(shtns_cfg shtns, cplx *Slm, cplx *Tlm, double *Vt, double *Vp)
transform spheroidal-toroidal spherical harmonic coefficients (Slm,Tlm) to the spatial theta and phi ...
Definition sht_com.c:57
void spat_to_SHqst(shtns_cfg shtns, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm)
3D vector transform from spherical coordinates to radial-spheroidal-toroidal spectral components (see...
Definition sht_com.c:69
void spat_to_SH(shtns_cfg shtns, double *Vr, cplx *Qlm)
transform the scalar field Vr into its spherical harmonic representation Qlm.
Definition sht_com.c:53
void SH_to_spat(shtns_cfg shtns, cplx *Qlm, double *Vr)
transform the spherical harmonic coefficients Qlm into its spatial representation Vr.
Definition sht_com.c:49
void SH_to_spat_cplx(shtns_cfg shtns, cplx *alm, cplx *z)
complex scalar synthesis.
Definition sht_func.c:1023
void spat_cplx_to_SH(shtns_cfg shtns, cplx *z, cplx *alm)
complex scalar analysis.
Definition sht_func.c:968
void spat_to_SHsphtor(shtns_cfg shtns, double *Vt, double *Vp, cplx *Slm, cplx *Tlm)
transform the theta and phi components (Vt,Vp) of a vector into its spheroidal-toroidal spherical har...
Definition sht_com.c:61
double shtns_wtime()
common sht functions and api calls
Definition sht_com.c:24
double spat_to_SH_time(shtns_cfg shtns, double *Vr, cplx *Qlm)
same as spat_to_SH() but with time recording; returns time in seconds
Definition sht_com.c:39
double SH_to_spat_time(shtns_cfg shtns, cplx *Qlm, double *Vr)
same as SH_to_spat() but with time recording; returns time in seconds
Definition sht_com.c:32
_Complex double cplx
double precision complex number data type
Definition shtns.h:28
const unsigned short lmax
maximum degree (lmax) of spherical harmonics.
Definition shtns.h:82