mirror of
https://gitlab.com/scemama/eplf
synced 2024-09-06 11:44:46 +02:00
optimizations
This commit is contained in:
parent
1ddc502c46
commit
0e1c2f74a9
@ -237,8 +237,8 @@ BEGIN_PROVIDER [ real, eplf_value_p ]
|
|||||||
if ( (aa > 0.d0).and.(ab > 0.d0) ) then
|
if ( (aa > 0.d0).and.(ab > 0.d0) ) then
|
||||||
aa = min(1.d0,aa)
|
aa = min(1.d0,aa)
|
||||||
ab = min(1.d0,ab)
|
ab = min(1.d0,ab)
|
||||||
aa = -(dlog(aa)/eplf_gamma)
|
aa = -dlog(aa)/eplf_gamma
|
||||||
ab = -(dlog(ab)/eplf_gamma)
|
ab = -dlog(ab)/eplf_gamma
|
||||||
aa = dsqrt(aa)
|
aa = dsqrt(aa)
|
||||||
ab = dsqrt(ab)
|
ab = dsqrt(ab)
|
||||||
eplf_value_p = (aa-ab)/(aa+ab+eps)
|
eplf_value_p = (aa-ab)/(aa+ab+eps)
|
||||||
@ -330,6 +330,7 @@ double precision function ao_eplf_integral_numeric(i,j,gmma,center)
|
|||||||
|
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|
||||||
double precision function ao_eplf_integral_primitive_oneD(a,xa,i,b,xb,j,gmma,xr)
|
double precision function ao_eplf_integral_primitive_oneD(a,xa,i,b,xb,j,gmma,xr)
|
||||||
implicit none
|
implicit none
|
||||||
include 'constants.F'
|
include 'constants.F'
|
||||||
@ -363,10 +364,15 @@ double precision function ao_eplf_integral_primitive_oneD(a,xa,i,b,xb,j,gmma,xr)
|
|||||||
t(2) = (p1*xp1+gmma*xr)
|
t(2) = (p1*xp1+gmma*xr)
|
||||||
xab(2) = xp1-xr
|
xab(2) = xp1-xr
|
||||||
xp = t(2)*inv_p(2)
|
xp = t(2)*inv_p(2)
|
||||||
c = exp(- real(ab(1)*inv_p(1)*xab(1)**2 + &
|
c = real(ab(1)*inv_p(1)*xab(1)**2 + &
|
||||||
ab(2)*inv_p(2)*xab(2)**2) )
|
ab(2)*inv_p(2)*xab(2)**2)
|
||||||
|
if ( c > 32.d0 ) then
|
||||||
S(0,0) = dsqrt(pi*inv_p(2))*c
|
ao_eplf_integral_primitive_oneD = 0.d0
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
c = exp(-c)
|
||||||
|
!S(0,0) = dsqrt(pi*inv_p(2))*c
|
||||||
|
S(0,0) = 1.d0 ! Factor is applied at the end
|
||||||
|
|
||||||
! Obara-Saika recursion
|
! Obara-Saika recursion
|
||||||
|
|
||||||
@ -397,7 +403,7 @@ double precision function ao_eplf_integral_primitive_oneD(a,xa,i,b,xb,j,gmma,xr)
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
ao_eplf_integral_primitive_oneD = S(i,j)
|
ao_eplf_integral_primitive_oneD = dsqrt(pi*inv_p(2))*S(i,j)*c ! Application of the factor of S(0,0)
|
||||||
|
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@ -508,7 +514,9 @@ double precision function ao_eplf_integral(i,j,gmma,center)
|
|||||||
nucl_coord(ao_nucl(j),1), &
|
nucl_coord(ao_nucl(j),1), &
|
||||||
ao_power(j,1), &
|
ao_power(j,1), &
|
||||||
gmma, &
|
gmma, &
|
||||||
center(1)) * &
|
center(1))
|
||||||
|
if (integral /= 0.d0) then
|
||||||
|
integral *= &
|
||||||
ao_eplf_integral_primitive_oneD( &
|
ao_eplf_integral_primitive_oneD( &
|
||||||
ao_expo(i,p), &
|
ao_expo(i,p), &
|
||||||
nucl_coord(ao_nucl(i),2), &
|
nucl_coord(ao_nucl(i),2), &
|
||||||
@ -517,7 +525,9 @@ double precision function ao_eplf_integral(i,j,gmma,center)
|
|||||||
nucl_coord(ao_nucl(j),2), &
|
nucl_coord(ao_nucl(j),2), &
|
||||||
ao_power(j,2), &
|
ao_power(j,2), &
|
||||||
gmma, &
|
gmma, &
|
||||||
center(2)) * &
|
center(2))
|
||||||
|
if (integral /= 0.d0) then
|
||||||
|
integral *= &
|
||||||
ao_eplf_integral_primitive_oneD( &
|
ao_eplf_integral_primitive_oneD( &
|
||||||
ao_expo(i,p), &
|
ao_expo(i,p), &
|
||||||
nucl_coord(ao_nucl(i),3), &
|
nucl_coord(ao_nucl(i),3), &
|
||||||
@ -527,8 +537,9 @@ double precision function ao_eplf_integral(i,j,gmma,center)
|
|||||||
ao_power(j,3), &
|
ao_power(j,3), &
|
||||||
gmma, &
|
gmma, &
|
||||||
center(3))
|
center(3))
|
||||||
! ao_eplf_integral += integral*ao_coef(i,p)*ao_coef(j,q)
|
|
||||||
buffer(p) += integral*ao_coef(i,p)*ao_coef(j,q)
|
buffer(p) += integral*ao_coef(i,p)*ao_coef(j,q)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
do p=1,ao_prim_num_max
|
do p=1,ao_prim_num_max
|
||||||
@ -555,3 +566,10 @@ double precision function mo_eplf_integral(i,j)
|
|||||||
|
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user