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).
Warning
Built on the unnormalized ASSOC_LEGENDRE_AND_DERIV --
inherits its stability limit (safe for at any
), not PVSH_TOR_ALL's . See
STABILITY_FINDINGS.md at the repo root, Part 2.
Returns: , complex 3-vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i4), | intent(in) | :: | L |
Degree, . |
||
| integer(kind=i4), | intent(in) | :: | K |
Order, . |
||
| real(kind=dp), | intent(in) | :: | THETA |
Colatitude in radians, . |
||
| real(kind=dp), | intent(in) | :: | PHI |
Longitude in radians, . |
FUNCTION PVSH_TOR_DP(L,K,THETA,PHI) RESULT(PVSH_TOR) IMPLICIT NONE INTEGER(KIND=i4), INTENT(IN) :: L INTEGER(KIND=i4), INTENT(IN) :: K REAL(KIND=dp), INTENT(IN) :: THETA REAL(KIND=dp), INTENT(IN) :: PHI REAL(KIND=dp) :: SINTH,NORM,PLK,DPLK,SCALE COMPLEX(KIND=dp) :: EPHIM,YLM,GTH,GPH COMPLEX(KIND=dp), DIMENSION(3) :: PVSH_TOR PVSH_TOR(1) = DCMPLX(0.d0, 0.d0) IF (L .GT. 0) THEN SINTH = DSIN(THETA) NORM = DSQRT((2.d0*L+1.d0)/(4.d0*pi))* & EXP(0.5_dp*(LOG_FACT(L-K)-LOG_FACT(L+K))) CALL ASSOC_LEGENDRE_AND_DERIV(L, K, DCOS(THETA), PLK, DPLK) EPHIM = EXP(j*K*PHI) YLM = NORM * PLK * EPHIM GTH = -SINTH * NORM * DPLK * EPHIM IF (SINTH .NE. 0.d0) THEN GPH = j*K*YLM/SINTH ELSE GPH = DCMPLX(0.d0, 0.d0) END IF SCALE = 1.d0/DSQRT(L*(L+1.d0)) PVSH_TOR(2) = j*GPH*SCALE PVSH_TOR(3) = -j*GTH*SCALE ELSE PVSH_TOR(2) = DCMPLX(0.d0, 0.d0) PVSH_TOR(3) = DCMPLX(0.d0, 0.d0) END IF RETURN END FUNCTION PVSH_TOR_DP