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.
theta phi |DOT(PVSH_POL,PVSH_TOR)|`). )).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i4), | intent(in) | :: | LMAX |
Maximum degree tested, . |
||
| integer(kind=i4), | intent(in) | :: | NTH |
Number of colatitude points swept over . |
||
| integer(kind=i4), | intent(in) | :: | OUTUNIT |
Fortran unit number to write results to (columns: `L M |
||
| integer(kind=i4), | intent(out) | :: | STATUS |
Output: 0 = pass, 1 = fail (some ( |{\rm DOT}|>10^{-12} |
SUBROUTINE PVSH_POL_TOR_ORTHO(LMAX, NTH, OUTUNIT, STATUS) IMPLICIT NONE INTEGER(KIND=i4), INTENT(IN) :: LMAX INTEGER(KIND=i4), INTENT(IN) :: NTH INTEGER(KIND=i4), INTENT(IN) :: OUTUNIT INTEGER(KIND=i4), INTENT(OUT) :: STATUS INTEGER(KIND=i4) :: L, M, ITH, NYLM, IDX REAL(KIND=dp) :: THETA, PHI, DTH COMPLEX(KIND=dp) :: DOTVAL COMPLEX(KIND=dp), ALLOCATABLE :: POL(:,:), TOR(:,:) NYLM = (LMAX+1)**2 ALLOCATE(POL(3, NYLM), TOR(3, NYLM)) STATUS = 0 DTH = pi / (NTH + 1) PHI = pi / 4.d0 WRITE(OUTUNIT,'(A)') & '# L M theta phi |DOT(PVSH_POL,PVSH_TOR)|' DO ITH = 1, NTH THETA = ITH * DTH CALL PVSH_POL_ALL(POL, LMAX, THETA, PHI) CALL PVSH_TOR_ALL(TOR, LMAX, THETA, PHI) DO L = 1, LMAX DO M = -L, L IDX = YLM_INDEX(L, M) DOTVAL = DOT(POL(:,IDX), TOR(:,IDX)) WRITE(OUTUNIT, *) L, M, THETA, PHI, ABS(DOTVAL) IF (ABS(DOTVAL) > 1.0E-12_dp) STATUS = 1 END DO END DO END DO DEALLOCATE(POL, TOR) END SUBROUTINE PVSH_POL_TOR_ORTHO