GSRLEYYP5OTLYQIPXXIZ2WGKXMO7OKTDN3TAO6FBCO5OEXXTJ76QC Cactus Code Thorn SHTOOLSAuthor(s) : Erik SchnetterMaintainer(s): Cactus teamLicence : ?--------------------------------------------------------------------------1. PurposeConfigure the SHTOOLS library; see<https://shtools.github.io/SHTOOLS/>From the web site:SHTOOLS - Spherical Harmonic ToolsSHTOOLS/pyshtools is an archive of Fortran 95 and Python software thatcan be used to perform spherical harmonic transforms, multitaperspectral analyses on the sphere, expansions of functions into Slepianbases, and standard operations on global gravitational and magneticfield data.Mark A. Wieczorek and Matthias Meschede (2018). SHTools -- Tools forworking with spherical harmonics, Geochemistry, Geophysics,Geosystems, 19, 2574-2592, doi:10.1029/2018GC007529.
# Configuration definitions for thorn SHTOOLSREQUIRES BLAS FFTW3 LAPACKPROVIDES SHTOOLS{SCRIPT configure.shLANG bashOPTIONS SHTOOLS_DIR}REQUIRES SHTOOLS
#! /bin/bash################################################################################# Prepare################################################################################# Set up shellif [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; thenset -x # Output commandsfiset -e # Abort on errors################################################################################# Configure Cactus################################################################################if [ -z "${SHTOOLS_DIR}" ]; thenecho "BEGIN ERROR"echo "Configuration variable SHTOOLS_DIR is not set"echo "END ERROR"exit 1fi# Set options: ${SHTOOLS_INC_DIRS="${SHTOOLS_DIR}/include"}: ${SHTOOLS_LIB_DIRS="${SHTOOLS_DIR}/lib"}: ${SHTOOLS_LIBS="SHTOOLS-mp"}SHTOOLS_INC_DIRS="$(${CCTK_HOME}/lib/sbin/strip-incdirs.sh ${SHTOOLS_INC_DIRS})"SHTOOLS_LIB_DIRS="$(${CCTK_HOME}/lib/sbin/strip-libdirs.sh ${SHTOOLS_LIB_DIRS})"# Pass options to Cactusecho "BEGIN MAKE_DEFINITION"echo "SHTOOLS_DIR = ${SHTOOLS_DIR}"echo "SHTOOLS_INC_DIRS = ${SHTOOLS_INC_DIRS}"echo "SHTOOLS_LIB_DIRS = ${SHTOOLS_LIB_DIRS}"echo "SHTOOLS_LIBS = ${SHTOOLS_LIBS}"echo "END MAKE_DEFINITION"echo 'INCLUDE_DIRECTORY $(SHTOOLS_INC_DIRS)'echo 'LIBRARY_DIRECTORY $(SHTOOLS_LIB_DIRS)'echo 'LIBRARY $(SHTOOLS_LIBS)'
# Interface definition for thorn SHTOOLSIMPLEMENTS: SHTOOLSINCLUDES HEADER: shtools.h IN shtools.h
# Parameter definitions for thorn SHTOOLS
# Schedule definitions for thorn SHTOOLS
# Main make.code.defn file for thorn SHTOOLS# Source files in this directorySRCS = shtools.f90# Subdirectories containing source filesSUBDIRS =
subroutine C_SHExpandDH ( &grid, n, cilm, lmax, norm, sampling, csphase, &lmax_calc, exitstatus)use shtoolsimplicit noneinteger, parameter :: dp = selected_real_kind(p=15)integer :: ninteger :: norm, sampling, csphase, lmax_calcreal(dp) :: grid(n, sampling*n)real(dp) :: cilm(2, lmax_calc+1, lmax_calc+1)integer :: lmaxinteger :: exitstatuscall SHExpandDH( &grid, n, cilm, lmax, norm, sampling, csphase, &lmax_calc, exitstatus)end subroutine C_SHExpandDHsubroutine C_MakeGridDH( &griddh, n, cilm, lmax, norm, sampling, csphase, &lmax_calc, exitstatus)use shtoolsimplicit noneinteger, parameter :: dp = selected_real_kind(p=15)integer :: lmaxinteger :: norm, sampling, csphase, lmax_calcreal(dp) :: cilm(2, lmax_calc+1, lmax_calc+1)real(dp) :: griddh(2*(lmax+1), sampling*(2*(lmax+1)))integer :: ninteger :: exitstatuscall MakeGridDH( &griddh, n, cilm, lmax, norm, sampling, csphase, &lmax_calc, exitstatus)end subroutine C_MakeGridDH
#ifndef SHTOOLS_H#define SHTOOLS_H#include <cctk.h>#ifdef __cplusplusextern "C" {#endif#define C_SHExpandDH c_shexpanddh_void C_SHExpandDH(const double *griddh, const int *n, double *cilm, int *lmax,const int *norm, const int *sampling, const int *csphase,const int *lmax_calc, int *exitstatus);#define C_MakeGridDH c_makegriddh_void C_MakeGridDH(double *griddh, int *n, const double *cilm, const int *lmax,const int *norm, const int *sampling, const int *csphase,const int *lmax_calc, int *exitstatus);#ifdef __cplusplus}#endif#endif // #ifndef SHTOOLS_H