subroutine lowdin(infos)
use precision, only: dp
use io_constants, only: iw
use basis_tools, only: basis_set
use messages, only: show_message, with_abort
use types, only: information
use strings, only: Cstring, fstring
implicit none
type(information), target, intent(inout) :: infos
type(basis_set), pointer :: basis
real(kind=dp), allocatable :: orbital_pop(:)
real(kind=dp), allocatable :: chg(:)
integer :: nat, ok
open (unit=IW, file=infos%log_filename, position="append")
! Load basis set
basis => infos%basis
basis%atoms => infos%atoms
nat = ubound(infos%atoms%zn,1)
allocate(orbital_pop(basis%nbf), &
chg(nat), &
source=0.0d0, stat=ok)
if (ok /= 0) call show_message('Cannot allocate memory', WITH_ABORT)
write(iw,'(2/)')
write(iw,'(4x,a)') '=========================='
write(iw,'(4x,a)') 'Lowdin population analysis'
write(iw,'(4x,a)') '=========================='
call flush(iw)
call run_population_analysis(infos, basis, orbital_pop, chg, POP_LOWDIN)
write(iw,'(/,2X,A)') 'Gross AO population (Lowdin)'
call print_ao_pop(infos, orbital_pop)
write(iw,'(/,2X,A)') 'Atomic partial charges (Lowdin)'
call print_charges(infos, chg)
close(iw)
end subroutine lowdin