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.
Warning
Inherits ASSOC_LEGENDRE_NORM_ALL's -dependent
stability limit (safe for unconditionally) --
see STABILITY_FINDINGS.md at the repo root.
by PLM_INDEX(l,m); 0 at the poles ().
ASSOC_LEGENDRE_NORM_ALL, same size/indexing.
PNORM).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | DPNORM((LMAX+1)*(LMAX+2)/2) | |||
| real(kind=dp), | intent(in) | :: | PNORM((LMAX+1)*(LMAX+2)/2) | |||
| integer(kind=i4), | intent(in) | :: | LMAX |
Maximum degree, (must match |
||
| real(kind=dp), | intent(in) | :: | X |
Argument, (must match the |
SUBROUTINE DDX_ASSOC_LEGENDRE_NORM_ALL_DP(DPNORM, PNORM, LMAX, X) IMPLICIT NONE INTEGER(KIND=i4), INTENT(IN) :: LMAX REAL(KIND=dp), INTENT(IN) :: X REAL(KIND=dp), INTENT(IN) :: PNORM((LMAX+1)*(LMAX+2)/2) REAL(KIND=dp), INTENT(OUT) :: DPNORM((LMAX+1)*(LMAX+2)/2) INTEGER(KIND=i4) :: L, M REAL(KIND=dp) :: DOM, COEFF DOM = 1.0_dp - X**2 DO M = 0, LMAX DO L = M, LMAX IF (ABS(X) .GE. 1.0_dp .OR. L .EQ. 0) THEN DPNORM(PLM_INDEX(L, M)) = 0.0_dp ELSE IF (L .EQ. M) THEN DPNORM(PLM_INDEX(L, M)) = & -L * X * PNORM(PLM_INDEX(L, M)) / DOM ELSE COEFF = DSQRT((2*L+1.d0)*(L**2-M**2)/(2*L-1.d0)) DPNORM(PLM_INDEX(L, M)) = & (COEFF * PNORM(PLM_INDEX(L-1, M)) - & L * X * PNORM(PLM_INDEX(L, M))) / DOM END IF END DO END DO END SUBROUTINE DDX_ASSOC_LEGENDRE_NORM_ALL_DP