mirror of
https://github.com/pfloos/quack
synced 2024-08-26 06:01:45 +02:00
major modification for makefiles
This commit is contained in:
parent
2ea01fd77e
commit
2a498658b3
@ -1,9 +0,0 @@
|
||||
1 3
|
||||
S 3
|
||||
1 13.0100000 0.0196850
|
||||
2 1.9620000 0.1379770
|
||||
3 0.4446000 0.4781480
|
||||
S 1
|
||||
1 0.1220000 1.0000000
|
||||
P 1
|
||||
1 0.7270000 1.0000000
|
@ -1,5 +0,0 @@
|
||||
# nAt nEla nElb nCore nRyd
|
||||
2 4 3 0 0
|
||||
# Znuc x y z
|
||||
C 0. 0. -0.16245872
|
||||
H 0. 0. 1.93436816
|
@ -1,4 +0,0 @@
|
||||
2
|
||||
|
||||
C 0.0000000000 0.0000000000 -0.0859694585
|
||||
H 0.0000000000 0.0000000000 1.0236236215
|
@ -13,6 +13,6 @@
|
||||
# ACFDT: AC Kx XBS
|
||||
F F T
|
||||
# BSE: BSE dBSE dTDA evDyn
|
||||
T F T F
|
||||
T T T F
|
||||
# MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift
|
||||
1000000 100000 10 0.3 10000 1234 T
|
||||
|
19
input/weight
19
input/weight
@ -1,18 +1,9 @@
|
||||
1 3
|
||||
S 3
|
||||
1 13.0100000 0.0196850
|
||||
2 1.9620000 0.1379770
|
||||
3 0.4446000 0.4781480
|
||||
1 38.3600000 0.0238090
|
||||
2 5.7700000 0.1548910
|
||||
3 1.2400000 0.4699870
|
||||
S 1
|
||||
1 0.1220000 1.0000000
|
||||
1 0.2976000 1.0000000
|
||||
P 1
|
||||
1 0.7270000 1.0000000
|
||||
2 3
|
||||
S 3
|
||||
1 13.0100000 0.0196850
|
||||
2 1.9620000 0.1379770
|
||||
3 0.4446000 0.4781480
|
||||
S 1
|
||||
1 0.1220000 1.0000000
|
||||
P 1
|
||||
1 0.7270000 1.0000000
|
||||
1 1.2750000 1.0000000
|
||||
|
2
src/.gitignore
vendored
Normal file
2
src/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.
|
||||
*/Makefile
|
2
src/ADC/Makefile
Normal file
2
src/ADC/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=ADC.a
|
||||
include ../Makefile.include
|
2
src/AOtoMO/Makefile
Normal file
2
src/AOtoMO/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=AOtoMO.a
|
||||
include ../Makefile.include
|
2
src/BasCor/Makefile
Normal file
2
src/BasCor/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=BasCor.a
|
||||
include ../Makefile.include
|
2
src/CC/Makefile
Normal file
2
src/CC/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=CC.a
|
||||
include ../Makefile.include
|
2
src/CI/Makefile
Normal file
2
src/CI/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=CI.a
|
||||
include ../Makefile.include
|
2
src/HF/Makefile
Normal file
2
src/HF/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TARGET=HF.a
|
||||
include ../Makefile.include
|
0
src/HF/obj/.gitignore
vendored
Normal file
0
src/HF/obj/.gitignore
vendored
Normal file
@ -1,47 +0,0 @@
|
||||
!module c_functions
|
||||
! use iso_c_binding
|
||||
! interface
|
||||
! function gsl_sf_gamma_inc_P(a,t) bind(C, name="gsl_sf_gamma_inc_P")
|
||||
! use iso_c_binding, only: c_double
|
||||
! real(kind=c_double), value :: a,t
|
||||
! real(kind=c_double) :: gsl_sf_gamma_inc_P
|
||||
! end function gsl_sf_gamma_inc_P
|
||||
! end interface
|
||||
!end module
|
||||
|
||||
subroutine CalcBoysF(maxm,t,Fm)
|
||||
! use c_functions
|
||||
! Comute the generalized Boys function Fm(t) using Slatec library
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
double precision,intent(in) :: t
|
||||
integer,intent(in) :: maxm
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: dm
|
||||
double precision :: dgami
|
||||
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Fm(0:maxm)
|
||||
|
||||
if(t == 0d0) then
|
||||
do m=0,maxm
|
||||
dm = dble(m)
|
||||
Fm(m) = 1d0/(2d0*dm+1d0)
|
||||
end do
|
||||
else
|
||||
do m=0,maxm
|
||||
dm = dble(m)
|
||||
! Fm(m) = gamma(dm+0.5d0)*gsl_sf_gamma_inc_P(dm+0.5d0,t)/(2d0*t**(dm+0.5d0))
|
||||
Fm(m) = dgami(dm+0.5d0,t)/(2d0*t**(dm+0.5d0))
|
||||
end do
|
||||
end if
|
||||
|
||||
end subroutine CalcBoysF
|
@ -1,40 +0,0 @@
|
||||
subroutine CalcOm(maxm,ExpPQi,NormPQSq,Om)
|
||||
|
||||
! Comute the 0^m: (00|00)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: ExpPQi,NormPQSq
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: pi,dm,t
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om (0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = NormPQSq/ExpPQi
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (00|00)^m
|
||||
|
||||
do m=0,maxm
|
||||
dm =dble(m)
|
||||
Om(m) = (2d0/sqrt(pi))*(-1d0)**dm*(1d0/ExpPQi)**(dm+0.5d0)*Fm(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOm
|
@ -1,44 +0,0 @@
|
||||
subroutine CalcOm3e(maxm,delta0,delta1,Y1,Y0,Om)
|
||||
|
||||
! Compute the 0^m for ERIs: (00|00)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: delta0,delta1,Y0,Y1
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: pi,t,OG
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om (0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Calculate OG
|
||||
|
||||
OG = (pi**4/delta0)**(3d0/2d0)*exp(-Y0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = delta1/(delta1-delta0)*(Y1-Y0)
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (000|000)^m
|
||||
|
||||
do m=0,maxm
|
||||
Om(m) = (2d0/sqrt(pi))*OG*sqrt(delta0/(delta1-delta0))*(delta1/(delta1-delta0))**m
|
||||
Om(m) = Om(m)*Fm(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOm3e
|
@ -1,39 +0,0 @@
|
||||
subroutine CalcOmERI(maxm,ExpY,NormYSq,Om)
|
||||
|
||||
! Compute the 0^m for ERIs: (00|00)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: ExpY,NormYSq
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: pi,t
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om (0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = ExpY*NormYSq
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (00|00)^m
|
||||
|
||||
do m=0,maxm
|
||||
Om(m) = (2d0/sqrt(pi))*sqrt(ExpY)*Fm(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOmERI
|
@ -1,39 +0,0 @@
|
||||
subroutine CalcOmErf(maxm,ExpY,fG,NormYSq,Om)
|
||||
|
||||
! Compute the 0^m for the long-range Coulomb operator: (00|erf(mu r)/r|00)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: ExpY,fG,NormYSq
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: pi,t
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om (0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = fG*NormYSq
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (00|00)^m
|
||||
|
||||
do m=0,maxm
|
||||
Om(m) = (2d0/sqrt(pi))*sqrt(fG)*(fG/ExpY)**m*Fm(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOmErf
|
@ -1,40 +0,0 @@
|
||||
subroutine CalcOmNuc(maxm,ExpPQi,NormPQSq,Om)
|
||||
|
||||
! Compute (0|V|0)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: ExpPQi,NormPQSq
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m
|
||||
double precision :: pi,dm,t
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om (0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = NormPQSq/ExpPQi
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (00|00)^m
|
||||
|
||||
do m=0,maxm
|
||||
dm =dble(m)
|
||||
Om(m) = (2d0/sqrt(pi))*(1d0/ExpPQi)**(dm+0.5d0)*Fm(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOmNuc
|
@ -1,43 +0,0 @@
|
||||
subroutine CalcOmYuk(maxm,ExpG,ExpY,fG,NormYSq,Om)
|
||||
|
||||
! Compute the 0^m for the screened Coulomb operator: (00|f12/r12|00)^m
|
||||
|
||||
implicit none
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: maxm
|
||||
double precision,intent(in) :: ExpG,ExpY,fG,NormYSq
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: m,k
|
||||
double precision :: pi,t,dbinom
|
||||
double precision,allocatable :: Fm(:)
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(inout):: Om(0:maxm)
|
||||
|
||||
allocate(Fm(0:maxm))
|
||||
|
||||
pi = 4d0*atan(1d0)
|
||||
|
||||
! Campute generalized Boys functions
|
||||
|
||||
t = (ExpY - fG)*NormYSq
|
||||
call CalcBoysF(maxm,t,Fm)
|
||||
|
||||
! Compute (00|00)^m
|
||||
|
||||
do m=0,maxm
|
||||
Om(m) = 0d0
|
||||
do k=0,m
|
||||
Om(m) = Om(m) + dbinom(m,k)*(ExpY/ExpG)**k*Fm(k)
|
||||
end do
|
||||
Om(m) = (2d0/sqrt(pi))*sqrt(ExpY)*(fG/ExpG)*exp(-fG*NormYSq)*Om(m)
|
||||
end do
|
||||
|
||||
deallocate(Fm)
|
||||
|
||||
end subroutine CalcOmYuk
|
@ -1,308 +0,0 @@
|
||||
subroutine Compute2eInt(debug,chemist_notation,iType,nShell, &
|
||||
ExpS,KG,DG,ExpG, &
|
||||
CenterShell,TotAngMomShell,KShell,DShell,ExpShell, &
|
||||
np2eInt,nSigp2eInt,nc2eInt,nSigc2eInt)
|
||||
|
||||
|
||||
! Compute various two-electron integrals
|
||||
|
||||
implicit none
|
||||
include 'parameters.h'
|
||||
|
||||
! Input variables
|
||||
|
||||
logical,intent(in) :: debug
|
||||
logical,intent(in) :: chemist_notation
|
||||
integer,intent(in) :: iType,nShell
|
||||
double precision,intent(in) :: ExpS
|
||||
integer,intent(in) :: KG
|
||||
double precision,intent(in) :: DG(KG),ExpG(KG)
|
||||
double precision,intent(in) :: CenterShell(maxShell,3)
|
||||
integer,intent(in) :: TotAngMomShell(maxShell),KShell(maxShell)
|
||||
double precision,intent(in) :: DShell(maxShell,maxK),ExpShell(maxShell,maxK)
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: KBra(2),KKet(2)
|
||||
double precision :: CenterBra(2,3),CenterKet(2,3)
|
||||
integer :: TotAngMomBra(2),TotAngMomKet(2)
|
||||
integer :: AngMomBra(2,3),AngMomKet(2,3)
|
||||
integer :: nShellFunctionBra(2),nShellFunctionKet(2)
|
||||
integer,allocatable :: ShellFunctionA1(:,:),ShellFunctionA2(:,:)
|
||||
integer,allocatable :: ShellFunctionB1(:,:),ShellFunctionB2(:,:)
|
||||
double precision :: ExpBra(2),ExpKet(2)
|
||||
double precision :: DBra(2),DKet(2)
|
||||
double precision :: norm_coeff
|
||||
|
||||
integer :: iBasA1,iBasA2,iBasB1,iBasB2
|
||||
integer :: iShA1,iShA2,iShB1,iShB2
|
||||
integer :: iShFA1,iShFA2,iShFB1,iShFB2
|
||||
integer :: iKA1,iKA2,iKB1,iKB2
|
||||
integer :: iFile
|
||||
|
||||
double precision :: p2eInt,c2eInt
|
||||
double precision :: start_c2eInt,end_c2eInt,t_c2eInt
|
||||
|
||||
! Output variables
|
||||
|
||||
integer,intent(out) :: np2eInt,nSigp2eInt,nc2eInt,nSigc2eInt
|
||||
|
||||
np2eInt = 0
|
||||
nSigp2eInt = 0
|
||||
|
||||
nc2eInt = 0
|
||||
nSigc2eInt = 0
|
||||
|
||||
iBasA1 = 0
|
||||
iBasA2 = 0
|
||||
iBasB1 = 0
|
||||
iBasB2 = 0
|
||||
|
||||
! Open file to write down integrals
|
||||
|
||||
iFile = 0
|
||||
|
||||
if(iType == 1) then
|
||||
|
||||
! Compute two-electron integrals over the Coulomb operator
|
||||
|
||||
write(*,*) '******************************************'
|
||||
write(*,*) ' Compute two-electron repulsion integrals '
|
||||
write(*,*) '******************************************'
|
||||
write(*,*)
|
||||
|
||||
iFile = 21
|
||||
open(unit=iFile,file='int/ERI.dat')
|
||||
|
||||
elseif(iType == 2) then
|
||||
|
||||
! Compute two-electron integrals over Slater geminals
|
||||
|
||||
write(*,*) '****************************************'
|
||||
write(*,*) ' Compute two-electron geminal integrals '
|
||||
write(*,*) '****************************************'
|
||||
write(*,*)
|
||||
|
||||
iFile = 22
|
||||
open(unit=iFile,file='int/F12.dat')
|
||||
|
||||
elseif(iType == 3) then
|
||||
|
||||
! Compute two-electron integrals over the Yukawa operator
|
||||
|
||||
write(*,*) '***************************************'
|
||||
write(*,*) ' Compute two-electron Yukawa integrals '
|
||||
write(*,*) '***************************************'
|
||||
write(*,*)
|
||||
|
||||
iFile = 23
|
||||
open(unit=iFile,file='int/Yuk.dat')
|
||||
|
||||
elseif(iType == 4) then
|
||||
|
||||
! Compute two-electron integrals over the long-range Coulomb operator
|
||||
|
||||
write(*,*) '**************************************'
|
||||
write(*,*) ' Compute long-range Coulomb integrals '
|
||||
write(*,*) '**************************************'
|
||||
write(*,*)
|
||||
|
||||
iFile = 24
|
||||
open(unit=iFile,file='int/Erf.dat')
|
||||
|
||||
end if
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A1
|
||||
!------------------------------------------------------------------------
|
||||
do iShA1=1,nShell
|
||||
|
||||
CenterBra(1,1) = CenterShell(iShA1,1)
|
||||
CenterBra(1,2) = CenterShell(iShA1,2)
|
||||
CenterBra(1,3) = CenterShell(iShA1,3)
|
||||
|
||||
TotAngMomBra(1) = TotAngMomShell(iShA1)
|
||||
nShellFunctionBra(1) = (TotAngMomBra(1)*TotAngMomBra(1) + 3*TotAngMomBra(1) + 2)/2
|
||||
allocate(ShellFunctionA1(1:nShellFunctionBra(1),1:3))
|
||||
call GenerateShell(TotAngMomBra(1),nShellFunctionBra(1),ShellFunctionA1)
|
||||
|
||||
KBra(1) = KShell(iShA1)
|
||||
|
||||
do iShFA1=1,nShellFunctionBra(1)
|
||||
|
||||
iBasA1 = iBasA1 + 1
|
||||
AngMomBra(1,1) = ShellFunctionA1(iShFA1,1)
|
||||
AngMomBra(1,2) = ShellFunctionA1(iShFA1,2)
|
||||
AngMomBra(1,3) = ShellFunctionA1(iShFA1,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B1
|
||||
!------------------------------------------------------------------------
|
||||
do iShB1=1,iShA1
|
||||
|
||||
CenterKet(1,1) = CenterShell(iShB1,1)
|
||||
CenterKet(1,2) = CenterShell(iShB1,2)
|
||||
CenterKet(1,3) = CenterShell(iShB1,3)
|
||||
|
||||
TotAngMomKet(1) = TotAngMomShell(iShB1)
|
||||
nShellFunctionKet(1) = (TotAngMomKet(1)*TotAngMomKet(1) + 3*TotAngMomKet(1) + 2)/2
|
||||
allocate(ShellFunctionB1(1:nShellFunctionKet(1),1:3))
|
||||
call GenerateShell(TotAngMomKet(1),nShellFunctionKet(1),ShellFunctionB1)
|
||||
|
||||
KKet(1) = KShell(iShB1)
|
||||
|
||||
do iShFB1=1,nShellFunctionKet(1)
|
||||
|
||||
iBasB1 = iBasB1 + 1
|
||||
AngMomKet(1,1) = ShellFunctionB1(iShFB1,1)
|
||||
AngMomKet(1,2) = ShellFunctionB1(iShFB1,2)
|
||||
AngMomKet(1,3) = ShellFunctionB1(iShFB1,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A2
|
||||
!------------------------------------------------------------------------
|
||||
do iShA2=1,iShA1
|
||||
|
||||
CenterBra(2,1) = CenterShell(iShA2,1)
|
||||
CenterBra(2,2) = CenterShell(iShA2,2)
|
||||
CenterBra(2,3) = CenterShell(iShA2,3)
|
||||
|
||||
TotAngMomBra(2) = TotAngMomShell(iShA2)
|
||||
nShellFunctionBra(2) = (TotAngMomBra(2)*TotAngMomBra(2) + 3*TotAngMomBra(2) + 2)/2
|
||||
allocate(ShellFunctionA2(1:nShellFunctionBra(2),1:3))
|
||||
call GenerateShell(TotAngMomBra(2),nShellFunctionBra(2),ShellFunctionA2)
|
||||
|
||||
KBra(2) = KShell(iShA2)
|
||||
|
||||
do iShFA2=1,nShellFunctionBra(2)
|
||||
|
||||
iBasA2 = iBasA2 + 1
|
||||
AngMomBra(2,1) = ShellFunctionA2(iShFA2,1)
|
||||
AngMomBra(2,2) = ShellFunctionA2(iShFA2,2)
|
||||
AngMomBra(2,3) = ShellFunctionA2(iShFA2,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B2
|
||||
!------------------------------------------------------------------------
|
||||
do iShB2=1,iShA2
|
||||
|
||||
CenterKet(2,1) = CenterShell(iShB2,1)
|
||||
CenterKet(2,2) = CenterShell(iShB2,2)
|
||||
CenterKet(2,3) = CenterShell(iShB2,3)
|
||||
|
||||
TotAngMomKet(2) = TotAngMomShell(iShB2)
|
||||
nShellFunctionKet(2) = (TotAngMomKet(2)*TotAngMomKet(2) + 3*TotAngMomKet(2) + 2)/2
|
||||
allocate(ShellFunctionB2(1:nShellFunctionKet(2),1:3))
|
||||
call GenerateShell(TotAngMomKet(2),nShellFunctionKet(2),ShellFunctionB2)
|
||||
|
||||
KKet(2) = KShell(iShB2)
|
||||
|
||||
do iShFB2=1,nShellFunctionKet(2)
|
||||
|
||||
iBasB2 = iBasB2 + 1
|
||||
AngMomKet(2,1) = ShellFunctionB2(iShFB2,1)
|
||||
AngMomKet(2,2) = ShellFunctionB2(iShFB2,2)
|
||||
AngMomKet(2,3) = ShellFunctionB2(iShFB2,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over contraction degrees
|
||||
!-------------------------------------------------------------------------
|
||||
call cpu_time(start_c2eInt)
|
||||
|
||||
c2eInt = 0d0
|
||||
|
||||
do iKA1=1,KBra(1)
|
||||
ExpBra(1) = ExpShell(iShA1,iKA1)
|
||||
DBra(1) = DShell(iShA1,iKA1)*norm_coeff(ExpBra(1),AngMomBra(1,1:3))
|
||||
do iKA2=1,KBra(2)
|
||||
ExpBra(2) = ExpShell(iShA2,iKA2)
|
||||
DBra(2) = DShell(iShA2,iKA2)*norm_coeff(ExpBra(2),AngMomBra(2,1:3))
|
||||
do iKB1=1,KKet(1)
|
||||
ExpKet(1) = ExpShell(iShB1,iKB1)
|
||||
DKet(1) = DShell(iShB1,iKB1)*norm_coeff(ExpKet(1),AngMomKet(1,1:3))
|
||||
do iKB2=1,KKet(2)
|
||||
ExpKet(2) = ExpShell(iShB2,iKB2)
|
||||
DKet(2) = DShell(iShB2,iKB2)*norm_coeff(ExpKet(2),AngMomKet(2,1:3))
|
||||
|
||||
call S2eInt(debug,iType,np2eInt,nSigp2eInt, &
|
||||
ExpS,KG,DG,ExpG, &
|
||||
ExpBra,CenterBra,AngMomBra, &
|
||||
ExpKet,CenterKet,AngMomKet, &
|
||||
p2eInt)
|
||||
|
||||
c2eInt = c2eInt + DBra(1)*DBra(2)*DKet(1)*DKet(2)*p2eInt
|
||||
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
call cpu_time(end_c2eInt)
|
||||
|
||||
nc2eInt = nc2eInt + 1
|
||||
|
||||
if(abs(c2eInt) > 1d-15) then
|
||||
|
||||
nSigc2eInt = nSigc2eInt + 1
|
||||
t_c2eInt = end_c2eInt - start_c2eInt
|
||||
|
||||
if(chemist_notation) then
|
||||
|
||||
write(iFile,'(I6,I6,I6,I6,F20.15)') iBasA1,iBasB1,iBasA2,iBasB2,c2eInt
|
||||
! write(iFile,'(F20.15,I6,I6,I6,I6)') c2eInt,iBasA1,iBasB1,iBasA2,iBasB2
|
||||
|
||||
if(debug) then
|
||||
write(*,'(A10,1X,F16.10,1X,I6,1X,I6,1X,I6,1X,I6)') &
|
||||
'(a1b1|a2b2) = ',c2eInt,iBasA1,iBasB1,iBasA2,iBasB2
|
||||
end if
|
||||
|
||||
else
|
||||
|
||||
write(iFile,'(I6,I6,I6,I6,F20.15)') iBasA1,iBasA2,iBasB1,iBasB2,c2eInt
|
||||
! write(iFile,'(F20.15,I6,I6,I6,I6)') c2eInt,iBasA1,iBasA2,iBasB1,iBasB2
|
||||
|
||||
if(debug) then
|
||||
write(*,'(A10,1X,F16.10,1X,I6,1X,I6,1X,I6,1X,I6)') &
|
||||
'<a1a2|b1b2> = ',c2eInt,iBasA1,iBasA2,iBasB1,iBasB2
|
||||
end if
|
||||
|
||||
end if
|
||||
end if
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over contraction degrees
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB2)
|
||||
end do
|
||||
iBasB2 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B2
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA2)
|
||||
end do
|
||||
iBasA2 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A2
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB1)
|
||||
end do
|
||||
iBasB1 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B1
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA1)
|
||||
end do
|
||||
iBasA1 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A1
|
||||
!------------------------------------------------------------------------
|
||||
write(*,*)
|
||||
|
||||
! Close files to write down integrals
|
||||
|
||||
close(unit=iFile)
|
||||
|
||||
end subroutine Compute2eInt
|
@ -1,328 +0,0 @@
|
||||
subroutine Compute3eInt(debug,iType,nShell, &
|
||||
ExpS,KG,DG,ExpG, &
|
||||
CenterShell,TotAngMomShell,KShell,DShell,ExpShell, &
|
||||
np3eInt,nSigp3eInt,nc3eInt,nSigc3eInt)
|
||||
|
||||
|
||||
! Compute long-range Coulomb integrals
|
||||
|
||||
implicit none
|
||||
include 'parameters.h'
|
||||
|
||||
|
||||
! Input variables
|
||||
|
||||
logical,intent(in) :: debug
|
||||
integer,intent(in) :: iType,nShell
|
||||
double precision,intent(in) :: ExpS
|
||||
integer,intent(in) :: KG
|
||||
double precision,intent(in) :: DG(KG),ExpG(KG)
|
||||
double precision,intent(in) :: CenterShell(maxShell,3)
|
||||
integer,intent(in) :: TotAngMomShell(maxShell),KShell(maxShell)
|
||||
double precision,intent(in) :: DShell(maxShell,maxK),ExpShell(maxShell,maxK)
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: KBra(3),KKet(3)
|
||||
double precision :: CenterBra(3,3),CenterKet(3,3)
|
||||
integer :: TotAngMomBra(3),TotAngMomKet(3)
|
||||
integer :: AngMomBra(3,3),AngMomKet(3,3)
|
||||
integer :: nShellFunctionBra(3),nShellFunctionKet(3)
|
||||
integer,allocatable :: ShellFunctionA1(:,:),ShellFunctionA2(:,:),ShellFunctionA3(:,:)
|
||||
integer,allocatable :: ShellFunctionB1(:,:),ShellFunctionB2(:,:),ShellFunctionB3(:,:)
|
||||
double precision :: ExpBra(3),ExpKet(3)
|
||||
double precision :: DBra(3),DKet(3)
|
||||
double precision :: norm_coeff
|
||||
|
||||
integer :: iBasA1,iBasA2,iBasA3,iBasB1,iBasB2,iBasB3
|
||||
integer :: iShA1,iShA2,iShA3,iShB1,iShB2,iShB3
|
||||
integer :: iShFA1,iShFA2,iShFA3,iShFB1,iShFB2,iShFB3
|
||||
integer :: iKA1,iKA2,iKA3,iKB1,iKB2,iKB3
|
||||
integer :: iFile
|
||||
|
||||
double precision :: p3eInt,c3eInt
|
||||
double precision :: start_c3eInt,end_c3eInt,t_c3eInt
|
||||
|
||||
! Output variables
|
||||
|
||||
integer,intent(out) :: np3eInt,nSigp3eInt,nc3eInt,nSigc3eInt
|
||||
|
||||
! Compute three-electron integrals
|
||||
|
||||
write(*,*) '**********************************'
|
||||
write(*,*) ' Compute three-electron integrals '
|
||||
write(*,*) '**********************************'
|
||||
write(*,*)
|
||||
|
||||
np3eInt = 0
|
||||
nSigp3eInt = 0
|
||||
|
||||
nc3eInt = 0
|
||||
nSigc3eInt = 0
|
||||
|
||||
iBasA1 = 0
|
||||
iBasA2 = 0
|
||||
iBasA3 = 0
|
||||
iBasB1 = 0
|
||||
iBasB2 = 0
|
||||
iBasB3 = 0
|
||||
|
||||
! Open file to write down integrals
|
||||
|
||||
iFile = 0
|
||||
|
||||
if(iType == 1) then
|
||||
iFile = 31
|
||||
open(unit=iFile,file='int/3eInt_Type1.dat')
|
||||
elseif(iType == 2) then
|
||||
iFile = 32
|
||||
open(unit=iFile,file='int/3eInt_Type2.dat')
|
||||
elseif(iType == 3) then
|
||||
iFile = 33
|
||||
open(unit=iFile,file='int/3eInt_Type3.dat')
|
||||
end if
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A1
|
||||
!------------------------------------------------------------------------
|
||||
do iShA1=1,nShell
|
||||
|
||||
CenterBra(1,1) = CenterShell(iShA1,1)
|
||||
CenterBra(1,2) = CenterShell(iShA1,2)
|
||||
CenterBra(1,3) = CenterShell(iShA1,3)
|
||||
|
||||
TotAngMomBra(1) = TotAngMomShell(iShA1)
|
||||
nShellFunctionBra(1) = (TotAngMomBra(1)*TotAngMomBra(1) + 3*TotAngMomBra(1) + 2)/2
|
||||
allocate(ShellFunctionA1(1:nShellFunctionBra(1),1:3))
|
||||
call GenerateShell(TotAngMomBra(1),nShellFunctionBra(1),ShellFunctionA1)
|
||||
|
||||
KBra(1) = KShell(iShA1)
|
||||
|
||||
do iShFA1=1,nShellFunctionBra(1)
|
||||
|
||||
iBasA1 = iBasA1 + 1
|
||||
AngMomBra(1,1) = ShellFunctionA1(iShFA1,1)
|
||||
AngMomBra(1,2) = ShellFunctionA1(iShFA1,2)
|
||||
AngMomBra(1,3) = ShellFunctionA1(iShFA1,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A2
|
||||
!------------------------------------------------------------------------
|
||||
do iShA2=1,nShell
|
||||
|
||||
CenterBra(2,1) = CenterShell(iShA2,1)
|
||||
CenterBra(2,2) = CenterShell(iShA2,2)
|
||||
CenterBra(2,3) = CenterShell(iShA2,3)
|
||||
|
||||
TotAngMomBra(2) = TotAngMomShell(iShA2)
|
||||
nShellFunctionBra(2) = (TotAngMomBra(2)*TotAngMomBra(2) + 3*TotAngMomBra(2) + 2)/2
|
||||
allocate(ShellFunctionA2(1:nShellFunctionBra(2),1:3))
|
||||
call GenerateShell(TotAngMomBra(2),nShellFunctionBra(2),ShellFunctionA2)
|
||||
|
||||
KBra(2) = KShell(iShA2)
|
||||
|
||||
do iShFA2=1,nShellFunctionBra(2)
|
||||
|
||||
iBasA2 = iBasA2 + 1
|
||||
AngMomBra(2,1) = ShellFunctionA2(iShFA2,1)
|
||||
AngMomBra(2,2) = ShellFunctionA2(iShFA2,2)
|
||||
AngMomBra(2,3) = ShellFunctionA2(iShFA2,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A3
|
||||
!------------------------------------------------------------------------
|
||||
do iShA3=1,nShell
|
||||
|
||||
CenterBra(3,1) = CenterShell(iShA3,1)
|
||||
CenterBra(3,2) = CenterShell(iShA3,2)
|
||||
CenterBra(3,3) = CenterShell(iShA3,3)
|
||||
|
||||
TotAngMomBra(3) = TotAngMomShell(iShA3)
|
||||
nShellFunctionBra(3) = (TotAngMomBra(3)*TotAngMomBra(3) + 3*TotAngMomBra(3) + 2)/2
|
||||
allocate(ShellFunctionA3(1:nShellFunctionBra(3),1:3))
|
||||
call GenerateShell(TotAngMomBra(3),nShellFunctionBra(3),ShellFunctionA3)
|
||||
|
||||
KBra(3) = KShell(iShA3)
|
||||
|
||||
do iShFA3=1,nShellFunctionBra(3)
|
||||
|
||||
iBasA3 = iBasA3 + 1
|
||||
AngMomBra(3,1) = ShellFunctionA3(iShFA3,1)
|
||||
AngMomBra(3,2) = ShellFunctionA3(iShFA3,2)
|
||||
AngMomBra(3,3) = ShellFunctionA3(iShFA3,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B1
|
||||
!------------------------------------------------------------------------
|
||||
do iShB1=1,nShell
|
||||
|
||||
CenterKet(1,1) = CenterShell(iShB1,1)
|
||||
CenterKet(1,2) = CenterShell(iShB1,2)
|
||||
CenterKet(1,3) = CenterShell(iShB1,3)
|
||||
|
||||
TotAngMomKet(1) = TotAngMomShell(iShB1)
|
||||
nShellFunctionKet(1) = (TotAngMomKet(1)*TotAngMomKet(1) + 3*TotAngMomKet(1) + 2)/2
|
||||
allocate(ShellFunctionB1(1:nShellFunctionKet(1),1:3))
|
||||
call GenerateShell(TotAngMomKet(1),nShellFunctionKet(1),ShellFunctionB1)
|
||||
|
||||
KKet(1) = KShell(iShB1)
|
||||
|
||||
do iShFB1=1,nShellFunctionKet(1)
|
||||
|
||||
iBasB1 = iBasB1 + 1
|
||||
AngMomKet(1,1) = ShellFunctionB1(iShFB1,1)
|
||||
AngMomKet(1,2) = ShellFunctionB1(iShFB1,2)
|
||||
AngMomKet(1,3) = ShellFunctionB1(iShFB1,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B2
|
||||
!------------------------------------------------------------------------
|
||||
do iShB2=1,nShell
|
||||
|
||||
CenterKet(2,1) = CenterShell(iShB2,1)
|
||||
CenterKet(2,2) = CenterShell(iShB2,2)
|
||||
CenterKet(2,3) = CenterShell(iShB2,3)
|
||||
|
||||
TotAngMomKet(2) = TotAngMomShell(iShB2)
|
||||
nShellFunctionKet(2) = (TotAngMomKet(2)*TotAngMomKet(2) + 3*TotAngMomKet(2) + 2)/2
|
||||
allocate(ShellFunctionB2(1:nShellFunctionKet(2),1:3))
|
||||
call GenerateShell(TotAngMomKet(2),nShellFunctionKet(2),ShellFunctionB2)
|
||||
|
||||
KKet(2) = KShell(iShB2)
|
||||
|
||||
do iShFB2=1,nShellFunctionKet(2)
|
||||
|
||||
iBasB2 = iBasB2 + 1
|
||||
AngMomKet(2,1) = ShellFunctionB2(iShFB2,1)
|
||||
AngMomKet(2,2) = ShellFunctionB2(iShFB2,2)
|
||||
AngMomKet(2,3) = ShellFunctionB2(iShFB2,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B3
|
||||
!------------------------------------------------------------------------
|
||||
do iShB3=1,nShell
|
||||
|
||||
CenterKet(3,1) = CenterShell(iShB3,1)
|
||||
CenterKet(3,2) = CenterShell(iShB3,2)
|
||||
CenterKet(3,3) = CenterShell(iShB3,3)
|
||||
|
||||
TotAngMomKet(3) = TotAngMomShell(iShB3)
|
||||
nShellFunctionKet(3) = (TotAngMomKet(3)*TotAngMomKet(3) + 3*TotAngMomKet(3) + 2)/2
|
||||
allocate(ShellFunctionB3(1:nShellFunctionKet(3),1:3))
|
||||
call GenerateShell(TotAngMomKet(3),nShellFunctionKet(3),ShellFunctionB3)
|
||||
|
||||
KKet(3) = KShell(iShB3)
|
||||
|
||||
do iShFB3=1,nShellFunctionKet(3)
|
||||
|
||||
iBasB3 = iBasB3 + 1
|
||||
AngMomKet(3,1) = ShellFunctionB3(iShFB3,1)
|
||||
AngMomKet(3,2) = ShellFunctionB3(iShFB3,2)
|
||||
AngMomKet(3,3) = ShellFunctionB3(iShFB3,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over contraction degrees
|
||||
!-------------------------------------------------------------------------
|
||||
call cpu_time(start_c3eInt)
|
||||
|
||||
c3eInt = 0d0
|
||||
|
||||
do iKA1=1,KBra(1)
|
||||
ExpBra(1) = ExpShell(iShA1,iKA1)
|
||||
DBra(1) = DShell(iShA1,iKA1)*norm_coeff(ExpBra(1),AngMomBra(1,1:3))
|
||||
do iKA2=1,KBra(2)
|
||||
ExpBra(2) = ExpShell(iShA2,iKA2)
|
||||
DBra(2) = DShell(iShA2,iKA2)*norm_coeff(ExpBra(2),AngMomBra(2,1:3))
|
||||
do iKA3=1,KBra(3)
|
||||
ExpBra(3) = ExpShell(iShA3,iKA3)
|
||||
DBra(3) = DShell(iShA3,iKA3)*norm_coeff(ExpBra(3),AngMomBra(3,1:3))
|
||||
do iKB1=1,KKet(1)
|
||||
ExpKet(1) = ExpShell(iShB1,iKB1)
|
||||
DKet(1) = DShell(iShB1,iKB1)*norm_coeff(ExpKet(1),AngMomKet(1,1:3))
|
||||
do iKB2=1,KKet(2)
|
||||
ExpKet(2) = ExpShell(iShB2,iKB2)
|
||||
DKet(2) = DShell(iShB2,iKB2)*norm_coeff(ExpKet(2),AngMomKet(2,1:3))
|
||||
do iKB3=1,KKet(3)
|
||||
ExpKet(3) = ExpShell(iShB3,iKB3)
|
||||
DKet(3) = DShell(iShB3,iKB3)*norm_coeff(ExpKet(3),AngMomKet(3,1:3))
|
||||
|
||||
call S3eInt(debug,iType,np3eInt,nSigp3eInt, &
|
||||
ExpS,KG,DG,ExpG, &
|
||||
ExpBra,CenterBra,AngMomBra, &
|
||||
ExpKet,CenterKet,AngMomKet, &
|
||||
p3eInt)
|
||||
|
||||
c3eInt = c3eInt + DBra(1)*DBra(2)*DBra(3)*DKet(1)*DKet(2)*DKet(3)*p3eInt
|
||||
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
call cpu_time(end_c3eInt)
|
||||
|
||||
nc3eInt = nc3eInt + 1
|
||||
if(abs(c3eInt) > 1d-15) then
|
||||
nSigc3eInt = nSigc3eInt + 1
|
||||
t_c3eInt = end_c3eInt - start_c3eInt
|
||||
write(iFile,'(I9,I9,I9,I9,I9,I9,F25.15)') &
|
||||
iBasA1,iBasA2,iBasA3,iBasB1,iBasB2,iBasB3,c3eInt
|
||||
if(.true.) then
|
||||
write(*,'(A15,1X,I6,1X,I6,1X,I6,1X,I6,1X,I6,1X,I6,1X,F16.10)') &
|
||||
'(a1a2a3|b1b2b3) = ',iBasA1,iBasA2,iBasA3,iBasB1,iBasB2,iBasB3,c3eInt
|
||||
end if
|
||||
end if
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over contraction degrees
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB3)
|
||||
end do
|
||||
iBasB3 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B3
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB2)
|
||||
end do
|
||||
iBasB2 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B2
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB1)
|
||||
end do
|
||||
iBasB1 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B1
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA3)
|
||||
end do
|
||||
iBasA3 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A3
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA2)
|
||||
end do
|
||||
iBasA2 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A2
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA1)
|
||||
end do
|
||||
iBasA1 = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A1
|
||||
!------------------------------------------------------------------------
|
||||
write(*,*)
|
||||
|
||||
! Close files to write down integrals
|
||||
|
||||
close(unit=iFile)
|
||||
|
||||
end subroutine Compute3eInt
|
@ -1,246 +0,0 @@
|
||||
subroutine Compute4eInt(debug,nEl,iType,nShell,ExpS, &
|
||||
CenterShell,TotAngMomShell,KShell,DShell,ExpShell, &
|
||||
npErf,nSigpErf,ncErf,nSigcErf)
|
||||
|
||||
|
||||
! Compute long-range Coulomb integrals
|
||||
|
||||
implicit none
|
||||
include 'parameters.h'
|
||||
|
||||
! Input variables
|
||||
|
||||
logical,intent(in) :: debug
|
||||
integer,intent(in) :: nEl,iType,nShell
|
||||
double precision :: ExpS
|
||||
double precision,intent(in) :: CenterShell(maxShell,3)
|
||||
integer,intent(in) :: TotAngMomShell(maxShell),KShell(maxShell)
|
||||
double precision,intent(in) :: DShell(maxShell,maxK),ExpShell(maxShell,maxK)
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: KA,KB,KC,KD
|
||||
double precision :: CenterA(3),CenterB(3),CenterC(3),CenterD(3)
|
||||
integer :: TotAngMomA,TotAngMomB,TotAngMomC,TotAngMomD
|
||||
integer :: AngMomA(3),AngMomB(3),AngMomC(3),AngMomD(3)
|
||||
integer :: nShellFunctionA,nShellFunctionB, &
|
||||
nShellFunctionC,nShellFunctionD
|
||||
integer,allocatable :: ShellFunctionA(:,:),ShellFunctionB(:,:), &
|
||||
ShellFunctionC(:,:),ShellFunctionD(:,:)
|
||||
double precision :: ExpA,ExpB,ExpC,ExpD
|
||||
double precision,allocatable :: DA,DB,DC,DD
|
||||
double precision :: norm_coeff
|
||||
|
||||
integer :: iBasA,iBasB,iBasC,iBasD
|
||||
integer :: iShA,iShB,iShC,iShD
|
||||
integer :: iShFA,iShFB,iShFC,iShFD
|
||||
integer :: iKA,iKB,iKC,iKD
|
||||
|
||||
double precision :: pErf,cErf
|
||||
double precision :: start_cErf,end_cErf,t_cErf
|
||||
|
||||
! Output variables
|
||||
|
||||
integer,intent(out) :: npErf,nSigpErf,ncErf,nSigcErf
|
||||
|
||||
! Compute two-electron integrals over long-range Coulomb operator
|
||||
|
||||
write(*,*) '**********************************'
|
||||
write(*,*) ' Compute three-electron integrals '
|
||||
write(*,*) '**********************************'
|
||||
write(*,*)
|
||||
|
||||
npErf = 0
|
||||
nSigpErf = 0
|
||||
|
||||
ncErf = 0
|
||||
nSigcErf = 0
|
||||
|
||||
iBasA = 0
|
||||
iBasB = 0
|
||||
iBasC = 0
|
||||
iBasD = 0
|
||||
|
||||
! Open file to write down integrals
|
||||
|
||||
open(unit=41,file='int/4eInt_Type1.dat')
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A
|
||||
!------------------------------------------------------------------------
|
||||
do iShA=1,nShell
|
||||
|
||||
CenterA(1) = CenterShell(iShA,1)
|
||||
CenterA(2) = CenterShell(iShA,2)
|
||||
CenterA(3) = CenterShell(iShA,3)
|
||||
|
||||
TotAngMomA = TotAngMomShell(iShA)
|
||||
nShellFunctionA = (TotAngMomA*TotAngMomA + 3*TotAngMomA + 2)/2
|
||||
allocate(ShellFunctionA(1:nShellFunctionA,1:3))
|
||||
call GenerateShell(TotAngMomA,nShellFunctionA,ShellFunctionA)
|
||||
|
||||
KA = KShell(iShA)
|
||||
|
||||
do iShFA=1,nShellFunctionA
|
||||
|
||||
iBasA = iBasA + 1
|
||||
AngMomA(1) = ShellFunctionA(iShFA,1)
|
||||
AngMomA(2) = ShellFunctionA(iShFA,2)
|
||||
AngMomA(3) = ShellFunctionA(iShFA,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B
|
||||
!------------------------------------------------------------------------
|
||||
do iShB=1,iShA
|
||||
|
||||
CenterB(1) = CenterShell(iShB,1)
|
||||
CenterB(2) = CenterShell(iShB,2)
|
||||
CenterB(3) = CenterShell(iShB,3)
|
||||
|
||||
TotAngMomB = TotAngMomShell(iShB)
|
||||
nShellFunctionB = (TotAngMomB*TotAngMomB + 3*TotAngMomB + 2)/2
|
||||
allocate(ShellFunctionB(1:nShellFunctionB,1:3))
|
||||
call GenerateShell(TotAngMomB,nShellFunctionB,ShellFunctionB)
|
||||
|
||||
KB = KShell(iShB)
|
||||
|
||||
do iShFB=1,nShellFunctionB
|
||||
|
||||
iBasB = iBasB + 1
|
||||
AngMomB(1) = ShellFunctionB(iShFB,1)
|
||||
AngMomB(2) = ShellFunctionB(iShFB,2)
|
||||
AngMomB(3) = ShellFunctionB(iShFB,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell C
|
||||
!------------------------------------------------------------------------
|
||||
do iShC=1,iShA
|
||||
|
||||
CenterC(1) = CenterShell(iShC,1)
|
||||
CenterC(2) = CenterShell(iShC,2)
|
||||
CenterC(3) = CenterShell(iShC,3)
|
||||
|
||||
TotAngMomC = TotAngMomShell(iShC)
|
||||
nShellFunctionC = (TotAngMomC*TotAngMomC + 3*TotAngMomC + 2)/2
|
||||
allocate(ShellFunctionC(1:nShellFunctionC,1:3))
|
||||
call GenerateShell(TotAngMomC,nShellFunctionC,ShellFunctionC)
|
||||
|
||||
KC = KShell(iShC)
|
||||
|
||||
do iShFC=1,nShellFunctionC
|
||||
|
||||
iBasC = iBasC + 1
|
||||
AngMomC(1) = ShellFunctionC(iShFC,1)
|
||||
AngMomC(2) = ShellFunctionC(iShFC,2)
|
||||
AngMomC(3) = ShellFunctionC(iShFC,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell D
|
||||
!------------------------------------------------------------------------
|
||||
do iShD=1,iShC
|
||||
|
||||
CenterD(1) = CenterShell(iShD,1)
|
||||
CenterD(2) = CenterShell(iShD,2)
|
||||
CenterD(3) = CenterShell(iShD,3)
|
||||
|
||||
TotAngMomD = TotAngMomShell(iShD)
|
||||
nShellFunctionD = (TotAngMomD*TotAngMomD + 3*TotAngMomD + 2)/2
|
||||
allocate(ShellFunctionD(1:nShellFunctionD,1:3))
|
||||
call GenerateShell(TotAngMomD,nShellFunctionD,ShellFunctionD)
|
||||
|
||||
KD = KShell(iShD)
|
||||
|
||||
do iShFD=1,nShellFunctionD
|
||||
|
||||
iBasD = iBasD + 1
|
||||
AngMomD(1) = ShellFunctionD(iShFD,1)
|
||||
AngMomD(2) = ShellFunctionD(iShFD,2)
|
||||
AngMomD(3) = ShellFunctionD(iShFD,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over contraction degrees
|
||||
!-------------------------------------------------------------------------
|
||||
call cpu_time(start_cErf)
|
||||
|
||||
cErf = 0d0
|
||||
|
||||
do iKA=1,KA
|
||||
ExpA = ExpShell(iShA,iKA)
|
||||
DA = DShell(iShA,iKA)*norm_coeff(ExpA,AngMomA)
|
||||
do iKB=1,KB
|
||||
ExpB = ExpShell(iShB,iKB)
|
||||
DB = DShell(iShB,iKB)*norm_coeff(ExpB,AngMomB)
|
||||
do iKC=1,KC
|
||||
ExpC = ExpShell(iShC,iKC)
|
||||
DC = DShell(iShC,iKC)*norm_coeff(ExpC,AngMomC)
|
||||
do iKD=1,KD
|
||||
ExpD = ExpShell(iShD,iKD)
|
||||
DD = DShell(iShD,iKD)*norm_coeff(ExpD,AngMomD)
|
||||
|
||||
! Erf module
|
||||
! call ErfInt(debug,npErf,nSigpErf, &
|
||||
! ExpS, &
|
||||
! ExpA,CenterA,AngMomA, &
|
||||
! ExpB,CenterB,AngMomB, &
|
||||
! ExpC,CenterC,AngMomC, &
|
||||
! ExpD,CenterD,AngMomD, &
|
||||
! pErf)
|
||||
|
||||
! cErf = cErf + DA*DB*DC*DD*pErf
|
||||
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
call cpu_time(end_cErf)
|
||||
|
||||
ncErf = ncErf + 1
|
||||
if(abs(cErf) > 1d-15) then
|
||||
nSigcErf = nSigcErf + 1
|
||||
t_cErf = end_cErf - start_cErf
|
||||
write(41,'(F20.15,I6,I6,I6,I6)') &
|
||||
cErf,iBasA,iBasB,iBasC,iBasD
|
||||
if(debug) then
|
||||
write(*,'(A10,1X,F16.10,1X,I6,1X,I6,1X,I6,1X,I6)') &
|
||||
'(ab|erf(r)/r|cd) = ',cErf,iBasA,iBasB,iBasC,iBasD
|
||||
end if
|
||||
end if
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over contraction degrees
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionD)
|
||||
end do
|
||||
iBasD = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell D
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionC)
|
||||
end do
|
||||
iBasC = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell C
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB)
|
||||
end do
|
||||
iBasB = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA)
|
||||
end do
|
||||
iBasA = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A
|
||||
!------------------------------------------------------------------------
|
||||
write(*,*)
|
||||
|
||||
! Close files to write down integrals
|
||||
|
||||
close(unit=41)
|
||||
|
||||
end subroutine Compute4eInt
|
@ -1,167 +0,0 @@
|
||||
subroutine ComputeKin(debug,nShell, &
|
||||
CenterShell,TotAngMomShell,KShell,DShell,ExpShell, &
|
||||
npKin,nSigpKin,ncKin,nSigcKin)
|
||||
|
||||
|
||||
! Compute one-electron kinetic integrals
|
||||
|
||||
implicit none
|
||||
include 'parameters.h'
|
||||
|
||||
! Input variables
|
||||
|
||||
logical,intent(in) :: debug
|
||||
integer,intent(in) :: nShell
|
||||
double precision,intent(in) :: CenterShell(maxShell,3)
|
||||
integer,intent(in) :: TotAngMomShell(maxShell),KShell(maxShell)
|
||||
double precision,intent(in) :: DShell(maxShell,maxK),ExpShell(maxShell,maxK)
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: KA,KB
|
||||
double precision :: CenterA(3),CenterB(3)
|
||||
integer :: TotAngMomA,TotAngMomB
|
||||
integer :: AngMomA(3),AngMomB(3)
|
||||
integer :: nShellFunctionA,nShellFunctionB
|
||||
integer,allocatable :: ShellFunctionA(:,:),ShellFunctionB(:,:)
|
||||
double precision :: ExpA,ExpB
|
||||
double precision,allocatable :: DA,DB
|
||||
double precision :: norm_coeff
|
||||
|
||||
integer :: iBasA,iBasB
|
||||
integer :: iShA,iShB
|
||||
integer :: iShFA,iShFB
|
||||
integer :: iKA,iKB
|
||||
|
||||
double precision :: pKin,cKin
|
||||
double precision :: start_cKin,end_cKin,t_cKin
|
||||
|
||||
! Output variables
|
||||
|
||||
integer,intent(out) :: npKin,nSigpKin,ncKin,nSigcKin
|
||||
|
||||
! Compute one-electron integrals
|
||||
|
||||
write(*,*) '****************************************'
|
||||
write(*,*) ' Compute one-electron kinetic integrals '
|
||||
write(*,*) '****************************************'
|
||||
write(*,*)
|
||||
|
||||
npKin = 0
|
||||
nSigpKin = 0
|
||||
|
||||
ncKin = 0
|
||||
nSigcKin = 0
|
||||
|
||||
iBasA = 0
|
||||
iBasB = 0
|
||||
|
||||
! Open file to write down integrals
|
||||
|
||||
open(unit=9,file='int/Kin.dat')
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell A
|
||||
!------------------------------------------------------------------------
|
||||
do iShA=1,nShell
|
||||
|
||||
CenterA(1) = CenterShell(iShA,1)
|
||||
CenterA(2) = CenterShell(iShA,2)
|
||||
CenterA(3) = CenterShell(iShA,3)
|
||||
|
||||
TotAngMomA = TotAngMomShell(iShA)
|
||||
nShellFunctionA = (TotAngMomA*TotAngMomA + 3*TotAngMomA + 2)/2
|
||||
allocate(ShellFunctionA(1:nShellFunctionA,1:3))
|
||||
call GenerateShell(TotAngMomA,nShellFunctionA,ShellFunctionA)
|
||||
|
||||
KA = KShell(iShA)
|
||||
|
||||
do iShFA=1,nShellFunctionA
|
||||
|
||||
iBasA = iBasA + 1
|
||||
AngMomA(1) = ShellFunctionA(iShFA,1)
|
||||
AngMomA(2) = ShellFunctionA(iShFA,2)
|
||||
AngMomA(3) = ShellFunctionA(iShFA,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over shell B
|
||||
!------------------------------------------------------------------------
|
||||
do iShB=1,nShell
|
||||
|
||||
CenterB(1) = CenterShell(iShB,1)
|
||||
CenterB(2) = CenterShell(iShB,2)
|
||||
CenterB(3) = CenterShell(iShB,3)
|
||||
|
||||
TotAngMomB = TotAngMomShell(iShB)
|
||||
nShellFunctionB = (TotAngMomB*TotAngMomB + 3*TotAngMomB + 2)/2
|
||||
allocate(ShellFunctionB(1:nShellFunctionB,1:3))
|
||||
call GenerateShell(TotAngMomB,nShellFunctionB,ShellFunctionB)
|
||||
|
||||
KB = KShell(iShB)
|
||||
|
||||
do iShFB=1,nShellFunctionB
|
||||
|
||||
iBasB = iBasB + 1
|
||||
AngMomB(1) = ShellFunctionB(iShFB,1)
|
||||
AngMomB(2) = ShellFunctionB(iShFB,2)
|
||||
AngMomB(3) = ShellFunctionB(iShFB,3)
|
||||
|
||||
!------------------------------------------------------------------------
|
||||
! Loops over contraction degrees
|
||||
!-------------------------------------------------------------------------
|
||||
call cpu_time(start_cKin)
|
||||
|
||||
cKin = 0d0
|
||||
|
||||
do iKA=1,KA
|
||||
ExpA = ExpShell(iShA,iKA)
|
||||
DA = DShell(iShA,iKA)*norm_coeff(ExpA,AngMomA)
|
||||
do iKB=1,KB
|
||||
ExpB = ExpShell(iShB,iKB)
|
||||
DB = DShell(iShB,iKB)*norm_coeff(ExpB,AngMomB)
|
||||
|
||||
call KinInt(npKin,nSigpKin, &
|
||||
ExpA,CenterA,AngMomA, &
|
||||
ExpB,CenterB,AngMomB, &
|
||||
pKin)
|
||||
|
||||
cKin = cKin + DA*DB*pKin
|
||||
|
||||
end do
|
||||
end do
|
||||
call cpu_time(end_cKin)
|
||||
|
||||
ncKin = ncKin + 1
|
||||
if(abs(cKin) > 1d-15) then
|
||||
nSigcKin = nSigcKin + 1
|
||||
t_cKin = end_cKin - start_cKin
|
||||
write(9,'(I6,I6,F20.15)') iBasA,iBasB,cKin
|
||||
! write(9,'(F20.15,I6,I6)') cKin,iBasA,iBasB
|
||||
if(debug) then
|
||||
write(*,'(A10,1X,F16.10,1X,I6,1X,I6)') '(a|T|b) = ',cKin,iBasA,iBasB
|
||||
end if
|
||||
end if
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over contraction degrees
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionB)
|
||||
end do
|
||||
iBasB = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell B
|
||||
!------------------------------------------------------------------------
|
||||
end do
|
||||
deallocate(ShellFunctionA)
|
||||
end do
|
||||
iBasA = 0
|
||||
!------------------------------------------------------------------------
|
||||
! End loops over shell A
|
||||
!------------------------------------------------------------------------
|
||||
write(*,*)
|
||||
|
||||
! Close files to write down integrals
|
||||
|
||||
close(unit=9)
|
||||
|
||||
end subroutine ComputeKin
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user