Dr. Xiao-Le Deng

SHA_SHS: spherical harmonic analysis and synthesis

1. Introduction

These routines are designed for accurate and fast FFT-based ultra-high-degree (tens of thousands) surface spherical harmonic analysis (SHA) and synthesis (SHS). As their key features, Legendre's functions are evaluated after [Fukushima (2012)](https://link.springer.com/article/10.1007/s00190-011-0519-2) and both point and mean values are supported.

The C and Fortran versions of the package are generally faster than the MATLAB-based one. For instance, using a single CPU with both MATLAB (run via the command: "taskset --cpu-list 1 matlab & disown") and Fortran, harmonic analysis up to degree 4320 took about 20.2 min in MATLAB, while it was only 5.6 min in Fortran. When parallelizing the Fortran code via OpenMP (4 CPUs, the "!$OMP PARALLEL DO" directive), the computation time reduced down to 2.1 min (harmonic degree still 4320). On the top of that, the C code may be up to about 40 % faster than the Fortran code. This was achieved by appropriately designing two array structures to store spherical harmonic coefficients which, in turn, reduced cache misses. In the Fortran code, the cache misses can certainly be reduced, too. However, using the same approach as in C does not appear to be straightforward. As a general conclusion, if the computational time needs to be minimized, it is strongly recommended to use either the C or Fortran routines. In addition, the C and Fortran versions of the package also support working with mean values (block-means, not yet supported in MATLAB).

Download:

2. Reference

Bucha, B., Hirt, C., Kuhn, M., 2019. Cap integration in spectral gravity forward modelling up to the full gravity tensor. Journal of Geodesy. https://doi.org/10.1007/s00190-019-01277-3