PVSH_POL_TOR_ORTHO Subroutine

public subroutine PVSH_POL_TOR_ORTHO(LMAX, NTH, OUTUNIT, STATUS)

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)|`). )).

Arguments

Type IntentOptional 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}


Calls

proc~~pvsh_pol_tor_ortho~~CallsGraph proc~pvsh_pol_tor_ortho PVSH_POL_TOR_ORTHO interface~dot DOT proc~pvsh_pol_tor_ortho->interface~dot interface~pvsh_pol_all PVSH_POL_ALL proc~pvsh_pol_tor_ortho->interface~pvsh_pol_all interface~pvsh_tor_all PVSH_TOR_ALL proc~pvsh_pol_tor_ortho->interface~pvsh_tor_all proc~ylm_index YLM_INDEX proc~pvsh_pol_tor_ortho->proc~ylm_index proc~dot_dp DOT_DP interface~dot->proc~dot_dp proc~pvsh_pol_all_dp PVSH_POL_ALL_DP interface~pvsh_pol_all->proc~pvsh_pol_all_dp proc~pvsh_tor_all_dp PVSH_TOR_ALL_DP interface~pvsh_tor_all->proc~pvsh_tor_all_dp proc~pvsh_pol_all_dp->proc~ylm_index interface~vsh_core VSH_CORE proc~pvsh_pol_all_dp->interface~vsh_core proc~pvsh_tor_all_dp->proc~ylm_index proc~pvsh_tor_all_dp->interface~vsh_core proc~vsh_core_dp VSH_CORE_DP interface~vsh_core->proc~vsh_core_dp proc~vsh_core_dp->proc~ylm_index dcos dcos proc~vsh_core_dp->dcos dsin dsin proc~vsh_core_dp->dsin interface~assoc_legendre_norm_all ASSOC_LEGENDRE_NORM_ALL proc~vsh_core_dp->interface~assoc_legendre_norm_all interface~ddx_assoc_legendre_norm_all DDX_ASSOC_LEGENDRE_NORM_ALL proc~vsh_core_dp->interface~ddx_assoc_legendre_norm_all proc~plm_index PLM_INDEX proc~vsh_core_dp->proc~plm_index proc~assoc_legendre_norm_all_dp ASSOC_LEGENDRE_NORM_ALL_DP interface~assoc_legendre_norm_all->proc~assoc_legendre_norm_all_dp proc~ddx_assoc_legendre_norm_all_dp DDX_ASSOC_LEGENDRE_NORM_ALL_DP interface~ddx_assoc_legendre_norm_all->proc~ddx_assoc_legendre_norm_all_dp proc~assoc_legendre_norm_all_dp->proc~plm_index proc~ddx_assoc_legendre_norm_all_dp->proc~plm_index

Called by

proc~~pvsh_pol_tor_ortho~~CalledByGraph proc~pvsh_pol_tor_ortho PVSH_POL_TOR_ORTHO program~main MAIN program~main->proc~pvsh_pol_tor_ortho

Source Code

  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