BATCH_SSH_CONS Subroutine

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

Batch-consistency check: SSH_ALL vs. looped SSH calls, for , swept over NTH colatitude points at fixed . Fails (STATUS=1) if any exceeds .

theta phi re(batch) im(batch) re(single) im(single)`). ).

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


Calls

proc~~batch_ssh_cons~~CallsGraph proc~batch_ssh_cons BATCH_SSH_CONS dimag dimag proc~batch_ssh_cons->dimag interface~ssh SSH proc~batch_ssh_cons->interface~ssh interface~ssh_all SSH_ALL proc~batch_ssh_cons->interface~ssh_all proc~ylm_index YLM_INDEX proc~batch_ssh_cons->proc~ylm_index proc~ssh_dp SSH_DP interface~ssh->proc~ssh_dp proc~ssh_all_dp SSH_ALL_DP interface~ssh_all->proc~ssh_all_dp proc~ssh_all_dp->proc~ylm_index dcos dcos proc~ssh_all_dp->dcos interface~assoc_legendre_norm_all ASSOC_LEGENDRE_NORM_ALL proc~ssh_all_dp->interface~assoc_legendre_norm_all proc~plm_index PLM_INDEX proc~ssh_all_dp->proc~plm_index proc~ssh_dp->dcos interface~assoc_legendre ASSOC_LEGENDRE proc~ssh_dp->interface~assoc_legendre interface~log_fact LOG_FACT proc~ssh_dp->interface~log_fact proc~assoc_legendre_dp ASSOC_LEGENDRE_DP interface~assoc_legendre->proc~assoc_legendre_dp proc~assoc_legendre_norm_all_dp ASSOC_LEGENDRE_NORM_ALL_DP interface~assoc_legendre_norm_all->proc~assoc_legendre_norm_all_dp proc~log_fact_dp LOG_FACT_DP interface~log_fact->proc~log_fact_dp proc~assoc_legendre_dp->interface~log_fact proc~assoc_legendre_norm_all_dp->proc~plm_index

Called by

proc~~batch_ssh_cons~~CalledByGraph proc~batch_ssh_cons BATCH_SSH_CONS program~convergence_main CONVERGENCE_MAIN program~convergence_main->proc~batch_ssh_cons program~main MAIN program~main->proc~batch_ssh_cons

Source Code

  SUBROUTINE BATCH_SSH_CONS(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
  REAL(KIND=dp) :: THETA, PHI, DTH
  COMPLEX(KIND=dp) :: Y_SINGLE
  COMPLEX(KIND=dp), ALLOCATABLE :: YLM(:)

  NYLM = (LMAX+1)**2
  ALLOCATE(YLM(NYLM))
  STATUS = 0
  DTH = pi / (NTH + 1)
  PHI = pi / 4.d0

  WRITE(OUTUNIT, '(A)') &
      '# L  M  theta  phi  re(batch)  im(batch)'// &
      '  re(single)  im(single)'
  DO ITH = 1, NTH
    THETA = ITH * DTH
    CALL SSH_ALL(YLM, LMAX, THETA, PHI)
    DO L = 0, LMAX
      DO M = -L, L
        Y_SINGLE = SSH(L, M, THETA, PHI)
        WRITE(OUTUNIT, *) L, M, THETA, PHI, &
            DREAL(YLM(YLM_INDEX(L, M))), &
            DIMAG(YLM(YLM_INDEX(L, M))), &
            DREAL(Y_SINGLE), DIMAG(Y_SINGLE)
        IF (ABS(YLM(YLM_INDEX(L,M)) - Y_SINGLE) > 1.0E-13_dp) STATUS = 1
      END DO
    END DO
  END DO

  DEALLOCATE(YLM)
  END SUBROUTINE BATCH_SSH_CONS