4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/HF/density.f90

36 lines
629 B
Fortran
Raw Normal View History

2019-07-09 16:17:10 +02:00
subroutine density(nGrid,nBas,P,AO,rho)
2019-03-19 10:13:33 +01:00
2019-07-09 16:17:10 +02:00
! Calculate one-electron density
2019-03-19 10:13:33 +01:00
implicit none
2019-07-09 16:17:10 +02:00
include 'parameters.h'
2019-03-19 10:13:33 +01:00
! Input variables
2019-07-09 16:17:10 +02:00
integer,intent(in) :: nGrid
integer,intent(in) :: nBas
double precision,intent(in) :: P(nBas,nBas)
double precision,intent(in) :: AO(nBas,nGrid)
2019-03-19 10:13:33 +01:00
! Local variables
2019-07-09 16:17:10 +02:00
integer :: iG,mu,nu
2019-03-19 10:13:33 +01:00
! Output variables
2019-07-09 16:17:10 +02:00
double precision,intent(out) :: rho(nGrid)
2019-03-19 10:13:33 +01:00
2019-07-09 16:17:10 +02:00
rho(:) = 0d0
2019-07-09 23:09:32 +02:00
2019-07-09 16:17:10 +02:00
do iG=1,nGrid
do mu=1,nBas
do nu=1,nBas
2019-07-09 23:09:32 +02:00
2019-07-09 16:17:10 +02:00
rho(iG) = rho(iG) + AO(mu,iG)*P(mu,nu)*AO(nu,iG)
2019-07-09 23:09:32 +02:00
2019-03-19 10:13:33 +01:00
enddo
enddo
2019-07-09 16:17:10 +02:00
enddo
2019-03-19 10:13:33 +01:00
end subroutine density