PVSH_TOR_ALL_DP Subroutine

private subroutine PVSH_TOR_ALL_DP(OUT, LMAX, THETA, PHI)

All toroidal polar VSH members PVSH_TOR for , from one VSH_CORE pass. Zero for .

Warning

Inherits ASSOC_LEGENDRE_NORM_ALL's -dependent stability limit (safe for unconditionally) -- see STABILITY_FINDINGS.md at the repo root.

1= (always 0), 2=, 3=; mode axis indexed by YLM_INDEX(l,m).

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(out) :: OUT(3,(LMAX+1)**2)
integer(kind=i4), intent(in) :: LMAX

Maximum degree, .

real(kind=dp), intent(in) :: THETA

Colatitude in radians, .

real(kind=dp), intent(in) :: PHI

Longitude in radians, .


Calls

proc~~pvsh_tor_all_dp~~CallsGraph proc~pvsh_tor_all_dp PVSH_TOR_ALL_DP interface~vsh_core VSH_CORE proc~pvsh_tor_all_dp->interface~vsh_core proc~ylm_index YLM_INDEX proc~pvsh_tor_all_dp->proc~ylm_index 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_tor_all_dp~~CalledByGraph proc~pvsh_tor_all_dp PVSH_TOR_ALL_DP interface~pvsh_tor_all PVSH_TOR_ALL interface~pvsh_tor_all->proc~pvsh_tor_all_dp proc~batch_pvsh_tor_cons BATCH_PVSH_TOR_CONS proc~batch_pvsh_tor_cons->interface~pvsh_tor_all proc~decompose DECOMPOSE proc~decompose->interface~pvsh_tor_all proc~decompose~2 DECOMPOSE proc~decompose~2->interface~pvsh_tor_all proc~pvsh_pol_tor_ortho PVSH_POL_TOR_ORTHO proc~pvsh_pol_tor_ortho->interface~pvsh_tor_all proc~reconstruct RECONSTRUCT proc~reconstruct->interface~pvsh_tor_all proc~reconstruct~2 RECONSTRUCT proc~reconstruct~2->interface~pvsh_tor_all proc~vsh_tor_all_dp VSH_TOR_ALL_DP proc~vsh_tor_all_dp->interface~pvsh_tor_all interface~vsh_tor_all VSH_TOR_ALL interface~vsh_tor_all->proc~vsh_tor_all_dp proc~run_part_a RUN_PART_A proc~run_part_a->proc~decompose proc~run_part_a~2 RUN_PART_A proc~run_part_a~2->proc~decompose~2 proc~run_part_b RUN_PART_B proc~run_part_b->proc~decompose proc~run_part_b->proc~reconstruct proc~run_part_b~2 RUN_PART_B proc~run_part_b~2->proc~decompose~2 proc~run_part_b~2->proc~reconstruct~2 program~main MAIN program~main->proc~batch_pvsh_tor_cons program~main->proc~pvsh_pol_tor_ortho proc~batch_vsh_tor_cons BATCH_VSH_TOR_CONS program~main->proc~batch_vsh_tor_cons proc~batch_vsh_tor_cons->interface~vsh_tor_all proc~bench_vsh_tor BENCH_VSH_TOR proc~bench_vsh_tor->interface~vsh_tor_all program~convergence_main CONVERGENCE_MAIN program~convergence_main->interface~vsh_tor_all program~convergence_main->proc~batch_vsh_tor_cons program~vsh_decomposition VSH_DECOMPOSITION program~vsh_decomposition->proc~run_part_a program~vsh_decomposition->proc~run_part_b program~vsh_decomposition_tor VSH_DECOMPOSITION_TOR program~vsh_decomposition_tor->proc~run_part_a~2 program~vsh_decomposition_tor->proc~run_part_b~2 program~bench_main BENCH_MAIN program~bench_main->proc~bench_vsh_tor

Source Code

  SUBROUTINE PVSH_TOR_ALL_DP(OUT, LMAX, THETA, PHI)
  IMPLICIT NONE
  INTEGER(KIND=i4), INTENT(IN)  :: LMAX
  REAL(KIND=dp),    INTENT(IN)  :: THETA
  REAL(KIND=dp),    INTENT(IN)  :: PHI
  COMPLEX(KIND=dp), INTENT(OUT) :: OUT(3,(LMAX+1)**2)
  INTEGER(KIND=i4) :: L, M, NYLM, IDX
  REAL(KIND=dp)    :: SCALE
  COMPLEX(KIND=dp), ALLOCATABLE :: YLM(:), GTH(:), GPH(:)
  NYLM = (LMAX+1)**2
  ALLOCATE(YLM(NYLM), GTH(NYLM), GPH(NYLM))
  CALL VSH_CORE(YLM, GTH, GPH, LMAX, THETA, PHI)
  OUT = DCMPLX(0.d0, 0.d0)
  DO L = 1, LMAX
    SCALE = 1.d0/DSQRT(L*(L+1.d0))
    DO M = -L, L
      IDX = YLM_INDEX(L, M)
      OUT(2,IDX) =  j*GPH(IDX)*SCALE
      OUT(3,IDX) = -j*GTH(IDX)*SCALE
    END DO
  END DO
  DEALLOCATE(YLM, GTH, GPH)
  END SUBROUTINE PVSH_TOR_ALL_DP