| Procedure | Location | Procedure Type | Description |
|---|---|---|---|
| ASSOC_LEGENDRE | VSH | Interface | |
| ASSOC_LEGENDRE_ALL | VSH | Interface | |
| ASSOC_LEGENDRE_ALL_DP | VSH | Subroutine | All unnormalized associated Legendre functions for , via the Bonnet recurrence, in one pass (amortizing shared recurrence terms across every at fixed -- far cheaper than independent ASSOC_LEGENDRE calls). Condon-Shortley phase; same recurrence and same stability limit as ASSOC_LEGENDRE (see ASSOC_LEGENDRE_NORM_ALL for the far-more-stable normalized alternative, itself safe to ). |
| ASSOC_LEGENDRE_AND_DERIV | VSH | Interface | |
| ASSOC_LEGENDRE_AND_DERIV_DP | VSH | Subroutine | Private helper: and together, from a single upward recurrence pass. Avoids the redundant separate ASSOC_LEGENDRE calls that DDX_ASSOC_LEGENDRE would otherwise need, and the repeated SSH + DDX_ASSOC_LEGENDRE evaluation that GRAD_SSH and L_SSH both build on. |
| ASSOC_LEGENDRE_DP | VSH | Function | Associated Legendre function , Condon-Shortley phase convention, computed by the classic Bonnet-type upward recurrence starting from . For negative order, . Unnormalized (unlike ASSOC_LEGENDRE_NORM_ALL); loses numerical stability well before the intermediate values literally overflow, since the later upward-in- recurrence involves a subtraction of two comparably huge terms (catastrophic cancellation). |
| ASSOC_LEGENDRE_NORM_ALL | VSH | Interface | |
| ASSOC_LEGENDRE_NORM_ALL_DP | VSH | Subroutine | All -normalized associated Legendre functions , (i.e. the real-valued radial part of SSH, for ), using the Holmes & Featherstone (2002) modified forward-column recurrence. The normalization is folded directly into the recurrence coefficients, keeping every intermediate value rather than letting itself grow/shrink combinatorially like the unnormalized ASSOC_LEGENDRE_ALL/Bonnet recurrence does. This is the recurrence SSH_ALL and every batch VSH routine build on. |
| BATCH_ALM_CONS | TESTS | Subroutine | Batch-consistency check: ASSOC_LEGENDRE_ALL vs. looped
ASSOC_LEGENDRE calls, for , swept over |
| BATCH_DALM_CONS | TESTS | Subroutine | Batch-consistency check: DDX_ASSOC_LEGENDRE_ALL vs. looped
DDX_ASSOC_LEGENDRE calls, for , swept over |
| BATCH_GRAD_SSH_CONS | TESTS | Subroutine | Batch-consistency check: GRAD_SSH_ALL vs. looped GRAD_SSH
calls, for , swept over
|
| BATCH_L_SSH_CONS | TESTS | Subroutine | Batch-consistency check: L_SSH_ALL vs. looped L_SSH calls, for
, swept over |
| BATCH_PVSH_POL_CONS | TESTS | Subroutine | Batch-consistency check: PVSH_POL_ALL vs. looped PVSH_POL
calls, for , swept over
|
| BATCH_PVSH_RAD_CONS | TESTS | Subroutine | Batch-consistency check: PVSH_RAD_ALL vs. looped PVSH_RAD
calls, for , swept over
|
| BATCH_PVSH_TOR_CONS | TESTS | Subroutine | Batch-consistency check: PVSH_TOR_ALL vs. looped PVSH_TOR
calls, for , swept over
|
| BATCH_SSH_CONS | TESTS | Subroutine | Batch-consistency check: SSH_ALL vs. looped SSH calls, for
, swept over |
| BATCH_VSH_POL_DN_CONS | TESTS | Subroutine | Batch-consistency check: VSH_POL_DN_ALL vs. looped VSH_POL_DN
calls, for , swept over
|
| BATCH_VSH_POL_UP_CONS | TESTS | Subroutine | Batch-consistency check: VSH_POL_UP_ALL vs. looped VSH_POL_UP
calls, for , swept over
|
| BATCH_VSH_TOR_CONS | TESTS | Subroutine | Batch-consistency check: VSH_TOR_ALL vs. looped VSH_TOR calls,
for (starts at
; VSH_TOR is identical to PVSH_TOR, already
covered at by BATCH_PVSH_TOR_CONS), swept over |
| BENCH_LEGENDRE | BENCHMARK | Subroutine | Benchmarks ASSOC_LEGENDRE_NORM_ALL (batch) against looped
ASSOC_LEGENDRE (single-mode) calls, for , swept over |
| BENCH_SSH | BENCHMARK | Subroutine | Benchmarks SSH_ALL (batch) against looped SSH (single-mode)
calls, for , swept over
|
| BENCH_VSH_POL_DN | BENCHMARK | Subroutine | Benchmarks VSH_POL_DN_ALL (batch) against looped VSH_POL_DN
(single-mode) calls, for , swept over |
| BENCH_VSH_POL_UP | BENCHMARK | Subroutine | Benchmarks VSH_POL_UP_ALL (batch) against looped VSH_POL_UP
(single-mode) calls, for , swept over |
| BENCH_VSH_TOR | BENCHMARK | Subroutine | Benchmarks VSH_TOR_ALL (batch) against looped VSH_TOR
(single-mode) calls, for , swept over |
| CGCOEFF | VSH | Interface | |
| CGCOEFF_DP | VSH | Function | Clebsch-Gordan coefficient for coupling two angular momenta to a total , via the closed-form Racah sum (evaluated in log-factorial form for numerical stability at large arguments -- see LOG_FACT): where . Adapted from David Simpson (NASA GSFC). Automatically returns 0 for any invalid combination -- violated triangle inequality , , or -- so it is always safe to call with an arbitrary sextuple of integers, e.g. when sweeping a parameter range. |
| DDX_ASSOC_LEGENDRE | VSH | Interface | |
| DDX_ASSOC_LEGENDRE_ALL | VSH | Interface | |
| DDX_ASSOC_LEGENDRE_ALL_DP | VSH | Subroutine | All derivatives for , reusing a precomputed ASSOC_LEGENDRE_ALL table rather than recomputing from scratch. |
| DDX_ASSOC_LEGENDRE_DP | VSH | Function | Derivative of the associated Legendre function, via ASSOC_LEGENDRE_AND_DERIV (thin wrapper that discards itself). |
| DDX_ASSOC_LEGENDRE_NORM_ALL | VSH | Interface | |
| DDX_ASSOC_LEGENDRE_NORM_ALL_DP | VSH | Subroutine | All derivatives of the normalized associated Legendre functions, for , reusing a precomputed ASSOC_LEGENDRE_NORM_ALL table: This is the recurrence VSH_CORE (and therefore every batch VSH routine) uses for the component. |
| DDX_LEGENDRE | VSH | Interface | |
| DDX_LEGENDRE_DP | VSH | Function | Derivative of the Legendre polynomial, via away from the poles, and the closed-form pole values at . |
| DECOMPOSE | VSH_DECOMPOSITION | Subroutine | Decomposes |
| DECOMPOSE | VSH_DECOMPOSITION_TOR | Subroutine | Decomposes |
| DOT | VSH | Interface | |
| DOT_DP | VSH | Function | Dot product of two 3-vectors (typically two VSH values evaluated at
the same ): . Note this is a plain component-wise
product, not a Hermitian inner product -- callers wanting
must conjugate |
| FACTORIAL | VSH | Interface | |
| FACTORIAL_DP | VSH | Function | Factorial for , computed by direct multiplication. |
| FIELD_GAUSSIAN | VSH_DECOMPOSITION | Function | Target field for Part B: a smooth angular Gaussian bump with slight modulation (carries and content, on top of effectively unbounded content from the Gaussian profile in ). Purely radial, for simplicity. |
| FIELD_KNOWN | VSH_DECOMPOSITION | Function | Target field for Part A: equal unit weight on all three basis families at each of the eight known modes; zero elsewhere. A genuine finite sum over eight independent modes, not a shortcut. |
| FIELD_KNOWN_TOR | VSH_DECOMPOSITION_TOR | Function | Target field for Part A: equal unit weight on PVSH_TOR alone at each of the eight known modes; zero elsewhere. Purely toroidal by construction (each term is a direct PVSH_TOR call). |
| FIELD_QUAD_BUMP | VSH_DECOMPOSITION_TOR | Function | Target field for Part B: an exact axisymmetric "quadrupole" toroidal background plus a broadband toroidal field built from applied to an equator-centered Gaussian bump generating function (see module docstring for the closed-form derivatives and why , not , is needed to force / to vanish exactly at both poles) -- purely toroidal by construction in both pieces. |
| GRAD_SSH | VSH | Interface | |
| GRAD_SSH_ALL | VSH | Interface | |
| GRAD_SSH_ALL_DP | VSH | Subroutine | All angular gradients (GRAD_SSH) for , from one VSH_CORE pass. |
| GRAD_SSH_DP | VSH | Function | Angular (surface) gradient of the scalar spherical harmonic, . Returned as a 3-vector with a zero radial component, since the gradient of a purely angular function is purely tangential. |
| GWI | VSH | Interface | |
| GWI_DP | VSH | Function | Geppert-Wiebicke axisymmetric coupling coefficient (Geppert & Wiebicke, 1991), a compact
shorthand for the generation/amplification amplitude of a two-mode
interaction in the Hall-MHD induction equation:
This is algebraically the standard Gaunt coefficient -- the closed
form for --
written in terms of two CGCOEFF evaluations. Built entirely from
CGCOEFF, which guards all selection rules, so |
| GWJ | VSH | Interface | |
| GWJ_DP | VSH | Function | Geppert-Wiebicke non-axisymmetric coupling coefficient (Geppert & Wiebicke, 1991), the
companion to GWI encoding the amplitude of a two-mode Hall-MHD
interaction that generates or amplifies a non-axisymmetric component:
Cross-validated against an independent VSH-dot-product expansion in
|
| L_SSH | VSH | Interface | |
| L_SSH_ALL | VSH | Interface | |
| L_SSH_ALL_DP | VSH | Subroutine | All angular-momentum-operator fields (L_SSH) for , from one VSH_CORE pass. |
| L_SSH_DP | VSH | Function | The angular-momentum-operator field (proportional to the quantum-mechanical orbital angular-momentum operator acting on the scalar harmonic). Simply GRAD_SSH rotated 90 degrees within the tangent plane: . |
| LEGENDRE | VSH | Interface | |
| LEGENDRE_DP | VSH | Function | Legendre polynomial , degree , via the standard three-term recurrence |
| LOG_FACT | VSH | Interface | |
| LOG_FACT_DP | VSH | Function |
, via (the intrinsic
|
| PLM_INDEX | VSH | Function | 1D packed-triangular index for into the output arrays of
ASSOC_LEGENDRE_ALL, DDX_ASSOC_LEGENDRE_ALL,
ASSOC_LEGENDRE_NORM_ALL, and DDX_ASSOC_LEGENDRE_NORM_ALL (all
of which only need , by conjugate/parity symmetry).
Matches the SHTOOLS |
| PVSH_POL | VSH | Interface | |
| PVSH_POL_ALL | VSH | Interface | |
| PVSH_POL_ALL_DP | VSH | Subroutine | All poloidal (horizontal) polar VSH members PVSH_POL for , from one VSH_CORE pass. Zero for . |
| PVSH_POL_DP | VSH | Function | Poloidal (horizontal) member of the polar vector spherical harmonic basis, -- purely horizontal (zero radial component), i.e. GRAD_SSH normalized by . Combined with a radial stream function , this is the horizontal-field piece of a poloidal field, . Zero for (a constant has no horizontal gradient). |
| PVSH_POL_TOR_ORTHO | TESTS | Subroutine | Verifies pointwise orthogonality of the poloidal and toroidal polar VSH members, for every -- an exact analytic identity (poloidal is a pure gradient, toroidal a pure gradient, and always), so any nonzero DOT value here is purely numerical error. |
| PVSH_RAD | VSH | Interface | |
| PVSH_RAD_ALL | VSH | Interface | |
| PVSH_RAD_ALL_DP | VSH | Subroutine | All radial polar VSH members PVSH_RAD for , from one VSH_CORE pass. |
| PVSH_RAD_DP | VSH | Function | Radial member of the polar vector spherical harmonic basis, . Purely radial by construction (zero horizontal components) -- combined with a radial stream function , this is the -generating piece of a poloidal magnetic (or any divergence-free) field, . |
| PVSH_TOR | VSH | Interface | |
| PVSH_TOR_ALL | VSH | Interface | |
| PVSH_TOR_ALL_DP | VSH | Subroutine | All toroidal polar VSH members PVSH_TOR for , from one VSH_CORE pass. Zero for . |
| PVSH_TOR_DP | VSH | Function | Toroidal member of the polar vector spherical harmonic basis, -- purely horizontal (zero radial component), identical in form to L_SSH but normalized by . This is the horizontal-field piece of a toroidal magnetic field, for a toroidal stream function . Zero for (no toroidal monopole). |
| RECONSTRUCT | VSH_DECOMPOSITION | Function | Reconstructs the field at from coefficients up to
|
| RECONSTRUCT | VSH_DECOMPOSITION_TOR | Function | Reconstructs the field at from coefficients up to
|
| RUN_GWI_SWEEP | GWI_GWJ_SWEEP | Subroutine | GWI vs. the brute-force Gaunt-coefficient integral (via SHGLQ
theta-quadrature times a uniform phi sum), swept over
|
| RUN_GWJ_SWEEP | GWI_GWJ_SWEEP | Subroutine | GWJ vs. the
pointwise identity, swept over
|
| RUN_PART_A | VSH_DECOMPOSITION | Subroutine | Part A: DECOMPOSE FIELD_KNOWN, confirm exact recovery of the
eight known unit coefficients and near-zero everywhere else. Writes
|
| RUN_PART_A | VSH_DECOMPOSITION_TOR | Subroutine | Part A: DECOMPOSE FIELD_KNOWN_TOR, confirm exact recovery of
the eight known unit |
| RUN_PART_B | VSH_DECOMPOSITION | Subroutine | Part B: DECOMPOSE+RECONSTRUCT FIELD_GAUSSIAN at increasing
(quadrature order scaled with each: |
| RUN_PART_B | VSH_DECOMPOSITION_TOR | Subroutine | Part B: DECOMPOSE+RECONSTRUCT FIELD_QUAD_BUMP at increasing
(quadrature order scaled with each: |
| SHGLQ | VSH | Interface | |
| SHGLQ_DP | VSH | Subroutine | Gauss-Legendre quadrature nodes and weights, exact for integrating any polynomial of degree using only points -- the natural quadrature for spherical harmonic transforms, since is a polynomial in times , and the transform integral separates exactly into this -quadrature times a uniform sum over (itself exact for finite Fourier content). Nodes are the zeros of , found by Newton iteration (converges to machine precision in under 10 steps); weights are . |
| SSH | VSH | Interface | |
| SSH_ALL | VSH | Interface | |
| SSH_ALL_DP | VSH | Subroutine | All scalar spherical harmonics for , in one call. Computes ASSOC_LEGENDRE_NORM_ALL once, then fills directly and via the conjugate symmetry rather than a second recurrence pass. |
| SSH_DP | VSH | Function | Scalar spherical harmonic , fully normalized with the Condon-Shortley phase: |
| SSH_ORTHO | TESTS | Subroutine | Verifies scalar spherical harmonic orthonormality,
, for every . The
integral is done analytically ( for matching
, by construction 0 otherwise, so only same- pairs are
checked); the integral (in ) uses a
plain |
| SYMBOL3J | VSH | Interface | |
| SYMBOL3J_DP | VSH | Function | Wigner 3-j symbol , via the standard conversion from CGCOEFF: Inherits CGCOEFF's selection-rule guards -- safe to call with any integer sextuple, returning 0 for invalid combinations. |
| TEST1_ANALYTIC | TESTS | Function | Hand-derived closed form for Test 1's target quantity (a specific product of VSH inner products), evaluated over a colatitude grid at for comparison against TEST1_VSH and TEST1_GW. |
| TEST1_GW | TESTS | Function | Test 1's target quantity computed via the GWI-coefficient expansion in scalar spherical harmonics, rather than direct VSH DOT products -- must agree with TEST1_ANALYTIC and TEST1_VSH to machine precision. This is the check that specifically exercises GWI (see also TEST2_GW for the GWJ counterpart). |
| TEST1_VSH | TESTS | Function | Test 1's target quantity computed directly from DOT products of VSH_TOR/VSH_POL_DN/VSH_POL_UP values -- must agree with TEST1_ANALYTIC to machine precision. |
| TEST2_ANALYTIC | TESTS | Function | Hand-derived closed form for Test 2's target quantity (a different product of VSH inner products than Test 1, with nonzero content), evaluated over a colatitude grid at a fixed for comparison against TEST2_VSH and TEST2_GW. |
| TEST2_GW | TESTS | Function | Test 2's target quantity computed via the GWJ-coefficient expansion (combined with a GWI term) in scalar spherical harmonics -- must agree with TEST2_ANALYTIC and TEST2_VSH to machine precision. This is the check that specifically exercises GWJ. |
| TEST2_VSH | TESTS | Function | Test 2's target quantity computed directly from DOT products of PVSH_POL/PVSH_TOR/PVSH_RAD values -- must agree with TEST2_ANALYTIC to machine precision. |
| VSH_CORE | VSH | Interface | |
| VSH_CORE_DP | VSH | Subroutine | Private helper shared by every batch VSH routine (GRAD_SSH_ALL, L_SSH_ALL, PVSH_RAD_ALL, PVSH_POL_ALL, PVSH_TOR_ALL, VSH_TOR_ALL, VSH_POL_UP_ALL, VSH_POL_DN_ALL): computes and its two angular gradient components (GRAD_SSH's parts) for every in one pass, so each caller only has to apply its own linear combination/normalization on top. |
| VSH_POL_DN | VSH | Interface | |
| VSH_POL_DN_ALL | VSH | Interface | |
| VSH_POL_DN_ALL_DP | VSH | Subroutine | All standard-VSH members VSH_POL_DN for , from one VSH_CORE pass: . Zero for -- see VSH_POL_DN for the dipole-ratio caveat at . |
| VSH_POL_DN_DP | VSH | Function | The member of the standard (total-angular-momentum coupled) vector spherical harmonic basis, built from the polar basis by i.e. PVSH_RAD and PVSH_POL rotated together by an -dependent angle (see VSH_POL_UP for the companion rotation). Zero for (no ). |
| VSH_POL_INVERSION | TESTS | Subroutine | Verifies the orthogonal-rotation identity linking the standard and polar VSH bases can be inverted exactly: i.e. rotating VSH_POL_UP/VSH_POL_DN back by the same angle used to build them from PVSH_POL/PVSH_RAD recovers the originals exactly. |
| VSH_POL_UP | VSH | Interface | |
| VSH_POL_UP_ALL | VSH | Interface | |
| VSH_POL_UP_ALL_DP | VSH | Subroutine | All standard-VSH members VSH_POL_UP for , from one VSH_CORE pass: . Well-defined (nonzero) at -- see VSH_POL_UP for the dipole-ratio note at . |
| VSH_POL_UP_DP | VSH | Function | The member of the standard (total-angular-momentum coupled) vector spherical harmonic basis, built from the polar basis by the companion rotation to VSH_POL_DN's . Unlike VSH_POL_DN this is well-defined (nonzero radial part) at , since still exists when . |
| VSH_TOR | VSH | Interface | |
| VSH_TOR_ALL | VSH | Interface | |
| VSH_TOR_ALL_DP | VSH | Subroutine | All toroidal standard-VSH members VSH_TOR for . Identical to PVSH_TOR_ALL (thin wrapper) -- the toroidal member is common to both bases. |
| VSH_TOR_DP | VSH | Function | Toroidal member of the "standard" (total-angular-momentum-coupled) vector spherical harmonic basis, . Identical to PVSH_TOR -- the toroidal member is common to both the polar and standard bases, since already carries total angular momentum with no admixture. |
| WALL_TIME | BENCHMARK | Function | Wall-clock seconds elapsed, via |
| YLM_INDEX | VSH | Function | 1D index for into the output arrays of every batch
|