SHTns  3.4.6
High performance Spherical Harmonic Transform for numerical simulations.

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 latitude-major or longitude-major arrays.
  • various conventions (normalization and Condon-Shortley phase).
  • can be used from Fortran, c/c++, Python, and Java programs.
  • a highly efficient Gauss algorithm working with Gauss nodes (based on Gauss-Legendre quadrature).
  • support for regular grids (but they require twice the number of nodes than Gauss grid).
  • support for SSE2, SSE3 and AVX, AVX2, AVX-512 vectorization, as well as Xeon Phi (KNL) and AltiVec VSX.
  • parallel transforms with OpenMP.
  • Beta: automatic GPU off-loading with nvidia cuda (Kepler, Pascal & Volta).
  • synthesis (inverse transform) at any coordinate (not constrained to a grid) useful for rendering purposes.
  • on-the-fly 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).

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 pseudo-spectral 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.
SHTns is written by Nathanael Schaeffer (CNRS). Email: