SUBROUTINE FREEZESYMLABELS(NHG, NBASIS, GG, FRZ)
IMPLICIT NONE
INTEGER NHG, NBASIS, GG(NHG)
INTEGER I
INTEGER NSL(NBASIS)
LOGICAL FRZ
character(*), parameter :: this_routine = 'FreezeSymLabels'
! SYMLABELS is used to classify all states which transform with the same symmetry
! for the excitation generation routines
! Each state's symmetry falls into a class SymClasses(ISTATE).
! The symmetry bit string, decomposing the sym label into its component irreps is in
! SymLabels(ISYMLABEL)
! The characters of this class are stored in SYMLABELCHARS(1:NROT, SymClasses(ISTATE))
! The total number of symmetry labels is NSYMLABELS
!.. SYMREPS(1,IBASISFN) contains the numnber of the representation
!.. of which IBASISFN is a part.
IF (.NOT. FRZ) THEN
DO I = 1, NHG, 2
IF (GG(I) /= 0) THEN
NSL((GG(I) + 1) / 2) = SymClasses((I + 1) / 2)
end if
end do
DO I = 1, NBASIS / 2
SymClasses(I) = NSL(I)
! write(stdout,*) "SL",I,SymClasses(I)
end do
DO i = 1, nhg
IF (GG(i) /= 0) NSL(GG(i)) = Symreps(1, i)
end do
DO i = 1, nbasis
Symreps(1, i) = NSL(i)
end do
ELSE
IF (associated(SYMCLASSES2)) call stop_all(this_routine, 'Problem in freezing')
allocate(SymClasses2(nBasis / 2))
call LogMemAlloc('SymClasses2', nBasis / 2, 4, this_routine, tagSymClasses2)
DO I = 1, NHG, 2
IF (GG(I) /= 0) THEN
NSL((GG(I) + 1) / 2) = SymClasses((I + 1) / 2)
end if
end do
DO I = 1, NBASIS / 2
SymClasses2(I) = NSL(I)
! write(stdout,*) "SL",I,SymClasses(I)
end do
DO i = 1, nhg
IF (GG(i) /= 0) NSL(GG(i)) = Symreps(1, i)
end do
DO i = 1, nbasis
Symreps(1, i) = NSL(i)
end do
end if
! write(stdout,*) "Sym Reps after Freezing"
! DO i=1,nbasis
! write(stdout,*) i,Symreps(1,i),Symreps(2,i)
! end do
END SUBROUTINE FREEZESYMLABELS