mirror of
https://github.com/pfloos/quack
synced 2025-03-14 12:46:42 +01:00
109 lines
3.7 KiB
Fortran
109 lines
3.7 KiB
Fortran
subroutine URPA(dophRPA,dophRPAx,docrRPA,doppRPA,TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip, &
|
|
nBas,nC,nO,nV,nR,nS,ENuc,EHF,ERI_aaaa,ERI_aabb,ERI_bbbb,dipole_int_aa,dipole_int_bb,epsHF,cHF,S)
|
|
|
|
! Random-phase approximation module
|
|
|
|
implicit none
|
|
include 'parameters.h'
|
|
|
|
! Input variables
|
|
|
|
logical :: dophRPA
|
|
logical :: dophRPAx
|
|
logical :: docrRPA
|
|
logical :: doppRPA
|
|
|
|
logical,intent(in) :: TDA
|
|
logical,intent(in) :: doACFDT
|
|
logical,intent(in) :: exchange_kernel
|
|
logical,intent(in) :: spin_conserved
|
|
logical,intent(in) :: spin_flip
|
|
integer,intent(in) :: nBas
|
|
integer,intent(in) :: nC(nspin)
|
|
integer,intent(in) :: nO(nspin)
|
|
integer,intent(in) :: nV(nspin)
|
|
integer,intent(in) :: nR(nspin)
|
|
integer,intent(in) :: nS(nspin)
|
|
double precision,intent(in) :: ENuc
|
|
double precision,intent(in) :: EHF
|
|
double precision,intent(in) :: epsHF(nBas,nspin)
|
|
double precision,intent(in) :: cHF(nBas,nBas,nspin)
|
|
double precision,intent(in) :: S(nBas,nBas)
|
|
double precision,intent(in) :: ERI_aaaa(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: ERI_aabb(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: ERI_bbbb(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: dipole_int_aa(nBas,nBas,ncart)
|
|
double precision,intent(in) :: dipole_int_bb(nBas,nBas,ncart)
|
|
|
|
! Local variables
|
|
|
|
double precision :: start_RPA ,end_RPA ,t_RPA
|
|
|
|
!------------------------------------------------------------------------
|
|
! Compute (direct) RPA excitations
|
|
!------------------------------------------------------------------------
|
|
|
|
if(dophRPA) then
|
|
|
|
call wall_time(start_RPA)
|
|
call phURPA(TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip,nBas,nC,nO,nV,nR,nS,ENuc,EHF, &
|
|
ERI_aaaa,ERI_aabb,ERI_bbbb,dipole_int_aa,dipole_int_bb,epsHF,cHF,S)
|
|
call wall_time(end_RPA)
|
|
|
|
t_RPA = end_RPA - start_RPA
|
|
write(*,'(A65,1X,F9.3,A8)') 'Total CPU time for RPA = ',t_RPA,' seconds'
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
!------------------------------------------------------------------------
|
|
! Compute RPAx (RPA with exchange) excitations
|
|
!------------------------------------------------------------------------
|
|
|
|
if(dophRPAx) then
|
|
|
|
call wall_time(start_RPA)
|
|
call phURPAx(TDA,doACFDT,exchange_kernel,spin_conserved,spin_flip,nBas,nC,nO,nV,nR,nS,ENuc,EHF, &
|
|
ERI_aaaa,ERI_aabb,ERI_bbbb,dipole_int_aa,dipole_int_bb,epsHF,cHF,S)
|
|
call wall_time(end_RPA)
|
|
|
|
t_RPA = end_RPA - start_RPA
|
|
write(*,'(A65,1X,F9.3,A8)') 'Total CPU time for RPAx = ',t_RPA,' seconds'
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
!------------------------------------------------------------------------
|
|
! Compute crRPA excitations
|
|
!------------------------------------------------------------------------
|
|
|
|
if(docrRPA) then
|
|
|
|
call wall_time(start_RPA)
|
|
write(*,*) 'Unrestricted version of crRPA not yet implemented! Sorry.'
|
|
call wall_time(end_RPA)
|
|
|
|
t_RPA = end_RPA - start_RPA
|
|
write(*,'(A65,1X,F9.3,A8)') 'Total CPU time for pp-RPA = ',t_RPA,' seconds'
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
!------------------------------------------------------------------------
|
|
! Compute ppRPA excitations
|
|
!------------------------------------------------------------------------
|
|
|
|
if(doppRPA) then
|
|
|
|
call wall_time(start_RPA)
|
|
call ppURPA(TDA,doACFDT,spin_conserved,spin_flip,nBas,nC,nO,nV,nR,ENuc,EHF,ERI_aaaa,ERI_aabb,ERI_bbbb,epsHF)
|
|
call wall_time(end_RPA)
|
|
|
|
t_RPA = end_RPA - start_RPA
|
|
write(*,'(A65,1X,F9.3,A8)') 'Total CPU time for pp-RPA = ',t_RPA,' seconds'
|
|
write(*,*)
|
|
|
|
end if
|
|
|
|
end subroutine
|