GENSYMREPS Subroutine

public subroutine GENSYMREPS(G1, NBASIS, ARR, DEGENTOL)

Arguments

Type IntentOptional Attributes Name
type(BasisFN) :: G1(nBasis)
integer :: NBASIS
real(kind=dp) :: ARR(NBASIS,2)
real(kind=dp) :: DEGENTOL

Contents

Source Code


Source Code

    SUBROUTINE GENSYMREPS(G1, NBASIS, ARR, DEGENTOL)
        IMPLICIT NONE
        INTEGER I, J
        INTEGER NBASIS
        TYPE(BasisFN) G1(nBasis)
        real(dp) ARR(NBASIS, 2)
        real(dp) DEGENTOL
        logical lTmp
        character(*), parameter :: this_routine = 'GenSymReps'

!   now work out which reps are degenerate and label them
        allocate(SymReps(2, nBasis))
        call LogMemAlloc('SymReps', 2 * nBasis, 4, this_routine, tagSymReps)

        symreps(2,1) = 1
        symreps(1,1) = 1

        J = 1
        DO I = 2, NBASIS
            ltmp = .false.
            if (abs(arr(i, 2) - arr(i - 1, 2)) < degentol .and. &
                (tAbelian .or. symeq(G1(i)%sym, G1(i - 1)%sym))) then
                ! We have the same degenerate rep as the previous entry
                symreps(2, J) = symreps(2, J) + 1
                lTmp = .true.
            end if
            if (.not. lTmp) then
                ! We have a new rep
                J = J + 1
                symreps(2, J) = 1
            end if
            SYMREPS(1, I) = J
        end do
    END SUBROUTINE GENSYMREPS