2023-10-25 21:38:20 +02:00
|
|
|
subroutine read_molecule(nNuc,nO,nC,nR)
|
2019-03-20 13:38:42 +01:00
|
|
|
|
|
|
|
! Read number of atoms and number of electrons
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
include 'parameters.h'
|
|
|
|
|
2023-10-25 21:38:20 +02:00
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: nCore
|
|
|
|
integer :: nRyd
|
|
|
|
|
|
|
|
! Output variables
|
2019-03-20 13:38:42 +01:00
|
|
|
|
|
|
|
integer,intent(out) :: nNuc
|
|
|
|
integer,intent(out) :: nO(nspin)
|
|
|
|
integer,intent(out) :: nC(nspin)
|
|
|
|
integer,intent(out) :: nR(nspin)
|
|
|
|
|
|
|
|
! Open file with geometry specification
|
|
|
|
|
|
|
|
open(unit=1,file='input/molecule')
|
|
|
|
|
|
|
|
! Read number of atoms and number of electrons
|
|
|
|
|
|
|
|
read(1,*)
|
2023-10-25 21:38:20 +02:00
|
|
|
read(1,*) nNuc,nO(1),nO(2),nCore,nRyd
|
2019-03-20 13:38:42 +01:00
|
|
|
|
|
|
|
if(mod(nCore,2) /= 0 .or. mod(nRyd,2) /= 0) then
|
|
|
|
|
|
|
|
print*, 'The number of core and Rydberg electrons must be even!'
|
|
|
|
stop
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
nC(:) = nCore/2
|
2023-10-25 21:38:20 +02:00
|
|
|
nR(:) = nRyd/2
|
2019-03-20 13:38:42 +01:00
|
|
|
|
|
|
|
! Print results
|
|
|
|
|
|
|
|
write(*,'(A28)') '----------------------'
|
|
|
|
write(*,'(A28,1X,I16)') 'Number of atoms',nNuc
|
|
|
|
write(*,'(A28)') '----------------------'
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A28)') '----------------------'
|
2023-10-25 21:38:20 +02:00
|
|
|
write(*,'(A28,1X,I16)') 'Number of spin-up electrons',nO(1)
|
|
|
|
write(*,'(A28,1X,I16)') 'Number of spin-down electrons',nO(2)
|
|
|
|
write(*,'(A28,1X,I16)') ' Total number of electrons',sum(nO(:))
|
2019-03-20 13:38:42 +01:00
|
|
|
write(*,'(A28)') '----------------------'
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A28)') '----------------------'
|
|
|
|
write(*,'(A28,1X,I16)') 'Number of core electrons',sum(nC(:))
|
|
|
|
write(*,'(A28,1X,I16)') 'Number of Rydberg electrons',sum(nR(:))
|
|
|
|
write(*,'(A28)') '----------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! Close file with geometry specification
|
|
|
|
|
|
|
|
close(unit=1)
|
|
|
|
|
2024-04-22 15:59:02 +02:00
|
|
|
end subroutine
|