Scalar spherical harmonic , fully normalized with the Condon-Shortley phase:
Warning
Built on the unnormalized ASSOC_LEGENDRE -- inherits its
stability limit (safe for at any ),
not SSH_ALL's (that routine uses the
normalized recurrence instead). See STABILITY_FINDINGS.md at the
repo root, Part 2.
Returns: , complex.
| 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 SSH_DP(L,K,THETA,PHI) RESULT(SSH) 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) :: NORM COMPLEX(KIND=dp) :: SSH NORM = DSQRT((2.d0*L+1.d0)/(4.d0*pi))* & EXP(0.5_dp*(LOG_FACT(L-K)-LOG_FACT(L+K))) SSH = NORM*ASSOC_LEGENDRE(L,K,DCOS(THETA))*EXP(j*K*PHI) RETURN END FUNCTION SSH_DP