SHTns is a high performance library for Spherical Harmonic Transform written in C, aimed at numerical simulation (fluid flows, mhd, ...) in spherical geometries.
Main features :
 blazingly fast.
 distributed under the open source CeCILL License (GPL compatible).
 both scalar and vector transforms.
 backward and forward (synthesis and analysis) functions.
 flexible truncation (degree, order, azimuthal periodicity).
 spatial data can be stored in latitudemajor or longitudemajor arrays.
 various conventions (normalization and CondonShortley phase).
 can be used from Fortran, c/c++, Python, and Java programs.
 a highly efficient Gauss algorithm working with Gauss nodes (based on GaussLegendre quadrature).
 support for regular grids (but they require twice the number of nodes than Gauss grid).
 support for SSE2, SSE3 and AVX, AVX2, AVX512 vectorization, as well as Xeon Phi (KNL), Blue Gene/Q and AltiVec VSX.
 parallel transforms with OpenMP.
 Beta: automatic GPU offloading with nvidia cuda (Kepler & Pascal).
 synthesis (inverse transform) at any coordinate (not constrained to a grid) useful for rendering purposes.
 onthefly transforms : saving memory and bandwidth, they are even faster on modern architecture.
 accurate up to spherical harmonic degree l=16383 (at least).
 rotation functions to rotate spherical harmonics (beta).
 special spectral operator functions that do not require a transform (multiply by cos(theta)...) .
 scalar transforms and rotations for complex spatial fields.
 SHT at fixed m (without fft, aka Legendre transform  beta).
Using several optimizations, it is intended to be very fast.
It requires the FFTW library for Fast Fourier Transforms.
If you use SHTns for research work, please cite the paper: Efficient Spherical Harmonic Transforms aimed at pseudospectral numerical simulations, also available from arXiv.
If you accept the open source CeCILL License (GPL compatible french License), you can download SHTns.
Please report bugs and feature request on the issue tracker.
 See also
 shtns.h for the definitions of variables, macros and functions.

The example programs (in Fortran , C and Python ) to get started.

The organisation of data used by SHTns is described in Spatial data layouts and grids used by SHTns.

The description of Optimizations implemented in SHTns.
 Author
 SHTns is written by Nathanael Schaeffer (CNRS). Email: natha.nosp@m.nael.nosp@m..scha.nosp@m.effe.nosp@m.r@ujf.nosp@m.gre.nosp@m.noble.nosp@m..fr