mirror of
https://code.it4i.cz/sccs/easyconfigs-it4i.git
synced 2025-04-17 20:20:49 +01:00
95 lines
2.6 KiB
Fortran
95 lines
2.6 KiB
Fortran
! Set some necessary variables for the integral calculations
|
|
ccontr=nicontr*njcontr*nkcontr
|
|
nckl=nc12*nkcontr
|
|
nclkj=nckl*njcontr
|
|
ncklp=nckl*njprim
|
|
nc12p=nc12*nkprim
|
|
nckl1=nckl-1
|
|
nclkj1=nclkj-1
|
|
nc121=nc12-1
|
|
niprim2=niprim**2
|
|
njprim2=njprim**2
|
|
! Allocate memory
|
|
it2=imem
|
|
imem=imem+nc12*nkprim
|
|
kbuff=imem
|
|
imem=imem+nc12
|
|
kbuff1=imem-1
|
|
it3=imem
|
|
imem=imem+nc12*nkcontr*njprim
|
|
jbuff=imem
|
|
imem=imem+nc12*nkcontr
|
|
jbuff1=imem-1
|
|
it4=imem
|
|
imem=imem+nc12*nkcontr*njcontr*niprim
|
|
ibuff=imem
|
|
imem=imem+nc12*nkcontr*njcontr
|
|
ibuff1=imem-1
|
|
if(max(imem,imem+nc12)-imem1.gt.maxcor) then
|
|
write(iout,*)
|
|
write(iout,*) 'Insufficient memory for integral calculation! '
|
|
write(iout,*) 'Increase the memory available to the program '
|
|
write(iout,*) 'or run integral-direct calculations! '
|
|
call mrccend(1)
|
|
endif
|
|
! Loop over primitives
|
|
ptol=itol/dfloat(max(1,niprim*njprim*nkprim))
|
|
ptol2=ptol*ptol
|
|
cf0=cf(0)
|
|
cf02=cf0*cf0
|
|
nzip=0
|
|
minc=gexpk(nkprim)
|
|
minc2=minc*minc
|
|
jlength=it4-nclkj
|
|
do iprim=1,niprim
|
|
ptol2i=ptol2
|
|
icc=1.d0
|
|
if(ip(iprim).ne.0) then
|
|
icc=gci(iprim,ip(iprim))
|
|
c ptol2i=ptol2*niprim2
|
|
endif
|
|
a=gexpi(iprim)
|
|
nzjp=0
|
|
jlength=jlength+nclkj
|
|
do jprim=1,njprim
|
|
b=gexpj(jprim)
|
|
p=a+b
|
|
ab2=-2.d0*p
|
|
rp=1.d0/p
|
|
ap=a*rp
|
|
bp=b*rp
|
|
xpq=ap*ax+bp*bx-cx
|
|
ypq=ap*ay+bp*by-cy
|
|
zpq=ap*az+bp*bz-cz
|
|
b2=2.d0*b
|
|
norm2=34.98683665524972569252564335974310d0*dexp(-ap*b*sb2)*rp
|
|
rp=0.5d0*rp
|
|
jcc=icc*rp
|
|
ncklj=it3+(jprim-1)*nckl
|
|
ptol2j=ptol2i
|
|
if(jp(jprim).ne.0) then
|
|
jcc=jcc*gcj(jprim,jp(jprim))
|
|
ncklj=jlength+(jp(jprim)-1)*nckl
|
|
c ptol2j=ptol2i*njprim2
|
|
endif
|
|
argij=p*(xpq*xpq+ypq*ypq+zpq*zpq)
|
|
psq=1.d0/(p+minc)
|
|
alp=minc*psq
|
|
norms=norm2*norm2*psq/minc2
|
|
arg=alp*argij
|
|
if(norms*cf02/arg.gt.ptol2j) then
|
|
! ij=ncklj-nc12
|
|
do kprim=1,nkprim
|
|
! ij=ij+nc12
|
|
kcc=jcc
|
|
ij=it2+(kprim-1)*nc12
|
|
if(kp(kprim).ne.0) then
|
|
kcc=kcc*gck(kprim,kp(kprim))
|
|
ij=ncklj+(kp(kprim)-1)*nc12
|
|
endif
|
|
c=gexpk(kprim)
|
|
psq=1.d0/(p+c)
|
|
alp=c*psq
|
|
arg=alp*argij
|
|
norm=norm2*dsqrt(psq)/c*kcc*ck(kprim)
|