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
 spatial data can be stored in latitudemajor or longitudemajor order arrays.
 various conventions (normalization and CondonShortley phase)
 can be used from Fortran, c/c++, and Python 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 vectorization with gcc.
 parallel transforms with OpenMP (for Gauss grid only).
 synthesis (inverse transform) at any coordinate (not constrained to a grid) useful for rendering purposes.
 ability to choose the optimal spatial sizes for a given spherical harmonic truncation.
 onthefly transforms : saving memory and bandwidth, and can even be faster depending on 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 for complex spatial fields.
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