10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-08-25 05:51:46 +02:00

Tests for integration

This commit is contained in:
Anthony Scemama 2014-04-07 20:01:30 +02:00
parent 48c8616c29
commit c70e4591a9
12 changed files with 2091 additions and 1000 deletions

View File

@ -25,6 +25,8 @@ def run_test(test_name,inp):
template = """
class $test(unittest.TestCase):
default_precision = 1.e-10
execfile('$test.ref')
def setUp(self):
@ -38,9 +40,13 @@ class $test(unittest.TestCase):
continue
l,r = buffer
l,r = l.strip(), eval(r)
if 'precision' in self.__dict__:
precision = self.precision[l]
else:
precision = self.default_precision
if type(r) == float:
self.assertAlmostEqual(self.data[inp][l], r,
places=abs(int(log10(self.precision[l]*max(abs(self.data[inp][l]),1.e-12)))), msg=None)
places=abs(int(log10(precision*max(abs(self.data[inp][l]),1.e-12)))), msg=None)
else:
self.assertEqual(self.data[inp][l], r, msg=None)

View File

@ -35,6 +35,7 @@ then
exit 1
fi
VERSION=$( cut -d '=' -f 2 < ${QPACKAGE_ROOT}/EZFIO/version)
for i in ${!key[@]}
do
MD5=${key[$i]}
@ -42,6 +43,7 @@ do
if [[ ! -d $file ]]
then
mkdir -p $(dirname $file)
echo ${VERSION} > $(dirname $file)/.version
fi
if [[ ! -f ${QPACKAGE_ROOT}/data/cache/${MD5} ]]
then
@ -49,3 +51,4 @@ do
fi
cp ${QPACKAGE_ROOT}/data/cache/${MD5} ${file}
done
echo ${VERSION} > ${EZFIO_FILE}.ezfio/.version

View File

@ -21,7 +21,7 @@ BEGIN_PROVIDER [ character*(128), ezfio_filename ]
! Check that file exists
logical :: exists
inquire(file=trim(ezfio_filename)//'/ezfio/.version',exist=exists)
inquire(file=trim(ezfio_filename)//'/ezfio/creation',exist=exists)
if (.not.exists) then
print *, 'Error: file '//trim(ezfio_filename)//' does not exist'
stop 1

View File

@ -1,7 +1,8 @@
subroutine ortho_lowdin(overlap,lda,n,C,ldc,m)
implicit none
BEGIN_DOC
! Compute U.S^-1/2 canonical orthogonalization
END_DOC
integer, intent(in) :: lda, ldc, n, m
double precision, intent(in) :: overlap(lda,n)
@ -70,8 +71,10 @@ end
subroutine get_pseudo_inverse(A,m,n,C,LDA)
! Find C = A^-1
implicit none
BEGIN_DOC
! Find C = A^-1
END_DOC
integer, intent(in) :: m,n, LDA
double precision, intent(in) :: A(LDA,n)
double precision, intent(out) :: C(n,m)
@ -97,7 +100,7 @@ subroutine get_pseudo_inverse(A,m,n,C,LDA)
call dgesvd('S','A', m, n, A_tmp, m,D,U,m,Vt,n,work,lwork,info)
if (info /= 0) then
print *, info, ': SVD failed'
stop
stop 1
endif
do i=1,n
@ -122,8 +125,10 @@ subroutine get_pseudo_inverse(A,m,n,C,LDA)
end
subroutine find_rotation(A,LDA,B,m,C,n)
! Find A.C = B
implicit none
BEGIN_DOC
! Find A.C = B
END_DOC
integer, intent(in) :: m,n, LDA
double precision, intent(in) :: A(LDA,n), B(LDA,n)
double precision, intent(out) :: C(n,n)
@ -138,10 +143,11 @@ subroutine find_rotation(A,LDA,B,m,C,n)
end
subroutine apply_rotation(A,LDA,R,LDR,B,LDB,m,n)
implicit none
BEGIN_DOC
! Apply the rotation found by find_rotation
END_DOC
double precision, intent(in) :: R(LDR,n)
double precision, intent(in) :: A(LDA,n)
double precision, intent(out) :: B(LDB,n)
@ -149,8 +155,11 @@ subroutine apply_rotation(A,LDA,R,LDR,B,LDB,m,n)
call dgemm('N','N',m,n,n,1.d0,A,LDA,R,LDR,0.d0,B,LDB)
end
subroutine jacobi_lapack(eigvalues,eigvectors,H,nmax,n)
subroutine lapack_diag(eigvalues,eigvectors,H,nmax,n)
implicit none
BEGIN_DOC
! Diagonalize matrix H
END_DOC
integer, intent(in) :: n,nmax
double precision, intent(out) :: eigvectors(nmax,n)
double precision, intent(out) :: eigvalues(n)
@ -159,31 +168,19 @@ subroutine jacobi_lapack(eigvalues,eigvectors,H,nmax,n)
double precision,allocatable :: work(:)
double precision,allocatable :: A(:,:)
!eigvectors(i,j) = <d_i|psi_j> where d_i is the basis function and psi_j is the j th eigenvector
print*,nmax,n
allocate(A(nmax,n),eigenvalues(nmax),work(4*nmax))
integer :: LWORK, info, i,j,l,k
double precision :: cpu_2, cpu_1
A=H
call cpu_time (cpu_1)
LWORK = 4*nmax
call dsyev( 'V', &
'U', &
n, &
A, &
nmax, &
eigenvalues, &
work, &
LWORK, &
info )
call dsyev( 'V', 'U', n, A, nmax, eigenvalues, work, LWORK, info )
if (info < 0) then
print *, irp_here, ': the ',-info,'-th argument had an illegal value'
stop
stop 1
else if (info > 0) then
print *, irp_here, ': the algorithm failed to converge; ',info,' off-diagonal'
print *, 'elements of an intermediate tridiagonal form did not converge to zero.'
stop
stop 1
endif
call cpu_time (cpu_2)
eigvectors = 0.d0
eigvalues = 0.d0
do j = 1, n

View File

@ -2,18 +2,386 @@
Utils Module
============
Assumptions
-----------
.. include:: ./ASSUMPTIONS.rst
Needed Modules
--------------
.. include:: ./NEEDED_MODULES
Contains general purpose utilities.

View File

@ -1,9 +1,12 @@
subroutine give_explicit_poly_and_gaussian_x(P_new,P_center,p,fact_k,iorder,alpha,beta,a,b,A_center,B_center,dim)
! subroutine that transform the product of
BEGIN_DOC
! Transform the product of
! (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta)
! into
! fact_k (x-x_P)^iorder(1) (y-y_P)^iorder(2) (z-z_P)^iorder(3) exp(-p(r-P)^2)
END_DOC
implicit none
include 'constants.F'
integer, intent(in) :: dim
integer, intent(in) :: a,b ! powers : (x-xa)**a_x = (x-A(1))**a(1)
double precision, intent(in) :: alpha, beta ! exponents
@ -12,28 +15,28 @@
double precision, intent(out) :: P_center ! new center
double precision, intent(out) :: p ! new exponent
double precision, intent(out) :: fact_k ! constant factor
include 'constants.F'
double precision, intent(out) :: P_new(0:max_dim) ! polynom
integer, intent(out) :: iorder ! order of the polynoms
double precision, intent(out) :: P_new(0:max_dim) ! polynomial
integer, intent(out) :: iorder ! order of the polynomials
double precision :: P_a(0:max_dim), P_b(0:max_dim)
integer :: n_new,i,j
double precision :: p_inv,ab,d_AB
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: P_a, P_b
integer :: n_new,i,j
! Do the gaussian product to get the new center and the new exponent
P_new = 0.d0
! you do the gaussiant product to get the new center and the new exponent
double precision :: p_inv,ab,d_AB
p = alpha+beta
p_inv = 1.d0/p
ab = alpha * beta
d_AB = (A_center - B_center) * (A_center - B_center)
P_center = (alpha * A_center + beta * B_center) * p_inv
fact_k = exp(-ab*p_inv * d_AB)
! you recenter the polynomw P_a and P_b on x
!call recentered_poly(P_a(0),A_center,P_center,a,dim)
!call recentered_poly(P_b(0),B_center,P_center,b,dim)
! Recenter the polynomials P_a and P_b on x
!DIR$ FORCEINLINE
call recentered_poly2(P_a(0),A_center,P_center,a,P_b(0),B_center,P_center,b)
n_new = 0
!DEC$ FORCEINLINE
call multiply_poly(P_a(0),a,P_b(0),b,P_new(0),n_new)
iorder = a + b
@ -41,12 +44,14 @@
subroutine give_explicit_poly_and_gaussian(P_new,P_center,p,fact_k,iorder,alpha,beta,a,b,A_center,B_center,dim)
! subroutine that transform the product of
BEGIN_DOC
! Transforms the product of
! (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta)
! into
! fact_k * [ sum (l_x = 0,i_order(1)) P_new(l_x,1) * (x-P_center(1))^l_x ] exp (- p (x-P_center(1))^2 )
! * [ sum (l_y = 0,i_order(2)) P_new(l_y,2) * (y-P_center(2))^l_y ] exp (- p (y-P_center(2))^2 )
! * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 )
END_DOC
implicit none
include 'constants.F'
integer, intent(in) :: dim
@ -57,11 +62,12 @@
double precision, intent(out) :: P_center(3) ! new center
double precision, intent(out) :: p ! new exponent
double precision, intent(out) :: fact_k ! constant factor
double precision, intent(out) :: P_new(0:max_dim,3) ! polynom
integer, intent(out) :: iorder(3) ! i_order(i) = order of the polynoms
double precision, intent(out) :: P_new(0:max_dim,3)! polynomial
integer, intent(out) :: iorder(3) ! i_order(i) = order of the polynomials
double precision :: P_a(0:max_dim,3), P_b(0:max_dim,3)
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: P_a, P_b
integer :: n_new,i,j
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: P_a, P_b
iorder(1) = 0
iorder(2) = 0
@ -112,11 +118,12 @@
end
subroutine gaussian_product(a,xa,b,xb,k,p,xp)
implicit none
BEGIN_DOC
! Gaussian product in 1D.
! e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2}
END_DOC
double precision, intent(in) :: a,b ! Exponents
double precision, intent(in) :: xa(3),xb(3) ! Centers
@ -155,7 +162,10 @@ end subroutine
subroutine gaussian_product_x(a,xa,b,xb,k,p,xp)
implicit none
BEGIN_DOC
! Gaussian product in 1D.
! e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2}
END_DOC
double precision , intent(in) :: a,b ! Exponents
double precision , intent(in) :: xa,xb ! Centers
@ -190,11 +200,10 @@ end subroutine
subroutine multiply_poly(b,nb,c,nc,d,nd)
implicit none
BEGIN_DOC
! Multiply two polynomials
! D(t) += B(t)*C(t)
! 4251722 + 3928617
! 4481076
! 185461
! 418740
END_DOC
integer, intent(in) :: nb, nc
integer, intent(out) :: nd
@ -233,7 +242,10 @@ end
subroutine add_poly(b,nb,c,nc,d,nd)
implicit none
BEGIN_DOC
! Add two polynomials
! D(t) += B(t)+C(t)
END_DOC
integer, intent(inout) :: nb, nc
integer, intent(out) :: nd
double precision, intent(in) :: b(0:nb), c(0:nc)
@ -258,7 +270,10 @@ end
subroutine add_poly_multiply(b,nb,cst,d,nd)
implicit none
BEGIN_DOC
! Add a polynomial multiplied by a constant
! D(t) += cst * B(t)
END_DOC
integer, intent(in) :: nb
integer, intent(inout) :: nd
double precision, intent(in) :: b(0:nb),cst
@ -283,9 +298,10 @@ end
subroutine recentered_poly2(P_new,x_A,x_P,a,P_new2,x_B,x_Q,b)
! you enter with (x-x_A)^a
! you leave with sum_i=0,a c_i * (x-x_P)^i ==== P_new(i) * (x-x_P)^i
implicit none
BEGIN_DOC
! Recenter two polynomials
END_DOC
integer, intent(in) :: a,b
double precision, intent(in) :: x_A,x_P,x_B,x_Q
double precision, intent(out) :: P_new(0:a),P_new2(0:b)
@ -327,8 +343,10 @@ end
double precision function F_integral(n,p)
BEGIN_DOC
! function that calculates the following integral
! sum (x) between [-infty;+infty] of x^n exp(-p*x^2)
! \int_{\-infty}^{+\infty} x^n \exp(-p x^2) dx
END_DOC
implicit none
integer :: n
double precision :: p
@ -354,24 +372,24 @@ end
double precision function rint(n,rho)
implicit none
BEGIN_DOC
!.. math::
!
! \int_0^1 dx \exp(-p x^2) x^n
!
END_DOC
include 'include/constants.F'
double precision :: rho,u,rint1,v,val0,rint_large_n,u_inv
integer :: n,k
double precision, parameter :: pi=3.14159265359d0
double precision, parameter :: dsqpi=1.77245385091d0
double precision :: two_rho_inv
! double precision :: rint_brut
! rint = rint_brut(n,rho,10000)
! return
if(n.eq.0)then
if(rho == 0.d0)then
rint=1.d0
else
u_inv=1.d0/dsqrt(rho)
u=rho*u_inv
rint=0.5d0*u_inv*dsqpi*erf(u)
rint=0.5d0*u_inv*sqpi*erf(u)
endif
return
endif
@ -383,7 +401,7 @@ end
v=dexp(-rho)
u=rho*u_inv
two_rho_inv = 0.5d0*u_inv*u_inv
val0=0.5d0*u_inv*dsqpi*erf(u)
val0=0.5d0*u_inv*sqpi*erf(u)
rint=(val0-v)*two_rho_inv
do k=2,n
rint=(rint*dfloat(k+k-1)-v)*two_rho_inv
@ -398,12 +416,14 @@ end
double precision function rint_sum(n_pt_out,rho,d1)
implicit none
BEGIN_DOC
! Needed for the calculation of two-electron integrals.
END_DOC
include 'include/constants.F'
integer, intent(in) :: n_pt_out
double precision, intent(in) :: rho,d1(0:n_pt_out)
double precision :: u,rint1,v,val0,rint_large_n,u_inv
integer :: n,k,i
double precision, parameter :: pi=3.14159265359d0
double precision, parameter :: dsqpi=1.77245385091d0
double precision :: two_rho_inv, rint_tmp, di
@ -414,7 +434,7 @@ end
else
u_inv=1.d0/dsqrt(rho)
u=rho*u_inv
rint_sum=0.5d0*u_inv*dsqpi*erf(u) *d1(0)
rint_sum=0.5d0*u_inv*sqpi*erf(u) *d1(0)
endif
do i=2,n_pt_out,2
@ -428,7 +448,7 @@ end
u_inv=1.d0/dsqrt(rho)
u=rho*u_inv
two_rho_inv = 0.5d0*u_inv*u_inv
val0=0.5d0*u_inv*dsqpi*erf(u)
val0=0.5d0*u_inv*sqpi*erf(u)
rint_sum=val0*d1(0)
rint_tmp=(val0-v)*two_rho_inv
di = 3.d0
@ -447,6 +467,9 @@ end
double precision function hermite(n,x)
implicit none
BEGIN_DOC
! Hermite polynomial
END_DOC
integer :: n,k
double precision :: h0,x,h1,h2
h0=1.d0
@ -469,6 +492,9 @@ end
double precision function rint_large_n(n,rho)
implicit none
BEGIN_DOC
! Version of rint for large values of n
END_DOC
integer :: n,k,l
double precision :: rho,u,accu,eps,t1,t2,fact,alpha_k,rajout,hermite
u=dsqrt(rho)
@ -495,69 +521,11 @@ end
end
double precision function rint_brut(n,rho,npts)
implicit double precision(a-h,o-z)
double precision :: fi(4), t2(4), accu(4), dt(4), rho4(4), four(4)
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: fi, t2, accu, dt, rho4, four
accu(1:4)=0.d0
dt(1)=1.d0/dfloat(npts)
dt(2)=dt(1)
dt(3)=dt(1)
dt(4)=dt(1)
rho4(1:4) = (/ rho, rho, rho, rho /)
fi(1:4)= (/ 0.5d0, 1.5d0, 2.5d0, 3.5d0 /)
four(1:4) = (/ 4.d0, 4.d0, 4.d0, 4.d0 /)
select case(n)
case (1)
do i=1,npts,4
!DIR$ VECTOR ALIGNED
t2(1:4)=fi(1:4)*dt(1:4)
!DIR$ VECTOR ALIGNED
t2(1:4) = t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
accu(1:4)=accu(1:4)+dexp(-rho4(1:4)*t2(1:4))*t2(1:4)
!DIR$ VECTOR ALIGNED
fi(1:4) = fi(1:4)+four(1:4)
enddo
case (2)
do i=1,npts,4
!DIR$ VECTOR ALIGNED
t2(1:4)=fi(1:4)*dt(1:4)
!DIR$ VECTOR ALIGNED
t2(1:4) = t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
accu(1:4)=accu(1:4)+dexp(-rho4(1:4)*t2(1:4))*t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
fi(1:4) = fi(1:4)+four(1:4)
enddo
case (3)
do i=1,npts,4
!DIR$ VECTOR ALIGNED
t2(1:4)=fi(1:4)*dt(1:4)
!DIR$ VECTOR ALIGNED
t2(1:4) = t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
accu(1:4)=accu(1:4)+dexp(-rho4(1:4)*t2(1:4))*t2(1:4)*t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
fi(1:4) = fi(1:4)+four(1:4)
enddo
case default
do i=1,npts,4
!DIR$ VECTOR ALIGNED
t2(1:4)=fi(1:4)*dt(1:4)
!DIR$ VECTOR ALIGNED
t2(1:4) = t2(1:4)*t2(1:4)
!DIR$ VECTOR ALIGNED
accu(1:4)=accu(1:4)+dexp(-rho4(1:4)*t2(1:4))*(t2(1:4)**(n))
!DIR$ VECTOR ALIGNED
fi(1:4) = fi(1:4)+four(1:4)
enddo
end select
rint_brut=sum(accu)*dt(1)
end
double precision function rint1(n,rho)
implicit none
BEGIN_DOC
! Standard version of rint
END_DOC
integer, intent(in) :: n
double precision, intent(in) :: rho
double precision, parameter :: eps=1.d-15
@ -575,5 +543,5 @@ end
return
enddo
write(*,*)'pb in rint1 k too large!'
stop
stop 1
end

View File

@ -1,14 +1,19 @@
double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_A,power_B,dim)
implicit none
! calculates the following overlap :
! sum (x) between [-infty;+infty] of (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2)
BEGIN_DOC
!.. math::
!
! \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx
!
END_DOC
include 'include/constants.F'
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynoms
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
double precision,intent(in) :: A_center,B_center ! center of the x1 functions
integer,intent(in) :: power_A, power_B ! power of the x1 functions
double precision :: P_new(0:max_dim),P_center,fact_p,p,alpha,beta
integer :: iorder_p
call give_explicit_poly_and_gaussian_x(P_new,P_center,p,fact_p,iorder_p,alpha,beta,power_A,power_B,A_center,B_center,dim)
call give_explicit_poly_and_gaussian_x(P_new,P_center,p,fact_p,iorder_p,alpha,&
beta,power_A,power_B,A_center,B_center,dim)
if(fact_p.lt.0.000001d0)then
overlap_gaussian_x = 0.d0
@ -29,16 +34,18 @@
subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim)
subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,&
power_B,overlap_x,overlap_y,overlap_z,overlap,dim)
implicit none
BEGIN_DOC
!.. math::
!
! S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\
! S = S_x S_y S_z
!
!
END_DOC
include 'include/constants.F'
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynoms
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
double precision,intent(in) :: A_center(3),B_center(3) ! center of the x1 functions
double precision, intent(in) :: alpha,beta
integer,intent(in) :: power_A(3), power_B(3) ! power of the x1 functions
@ -91,8 +98,12 @@ end
subroutine overlap_x_abs(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx)
implicit none
! compute the following integral :
! int [-infty ; +infty] of [(x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) ]
BEGIN_DOC
! .. math ::
!
! \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx
!
END_DOC
integer :: i,j,k,l
integer,intent(in) :: power_A,power_B
double precision, intent(in) :: lower_exp_val
@ -127,9 +138,8 @@ end
overlap_x += abs((x-A_center)**power_A * (x-B_center)**power_B) * dexp(-p * (x-P_center)*(x-P_center))
enddo
overlap_x *= factor * dx
overlap_x = factor * dx * overlap_x
end

View File

@ -1,6 +1,11 @@
BEGIN_TEMPLATE
subroutine insertion_$Xsort (x,iorder,isize)
implicit none
BEGIN_DOC
! Sort array x(isize) using the insertion sort algorithm.
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
END_DOC
$type,intent(inout) :: x(isize)
integer,intent(inout) :: iorder(isize)
integer,intent(in) :: isize
@ -22,11 +27,15 @@ BEGIN_TEMPLATE
x(j+1) = xtmp
iorder(j+1) = i0
enddo
end subroutine insertion_$Xsort
subroutine heap_$Xsort(x,iorder,isize)
implicit none
BEGIN_DOC
! Sort array x(isize) using the heap sort algorithm.
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
END_DOC
$type,intent(inout) :: x(isize)
integer,intent(inout) :: iorder(isize)
integer,intent(in) :: isize
@ -85,6 +94,13 @@ BEGIN_TEMPLATE
subroutine heap_$Xsort_big(x,iorder,isize)
implicit none
BEGIN_DOC
! Sort array x(isize) using the heap sort algorithm.
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
! This is a version for very large arrays where the indices need
! to be in integer*8 format
END_DOC
$type,intent(inout) :: x(isize)
integer*8,intent(inout) :: iorder(isize)
integer*8,intent(in) :: isize
@ -144,6 +160,11 @@ BEGIN_TEMPLATE
subroutine $Xsort(x,iorder,isize)
implicit none
BEGIN_DOC
! Sort array x(isize).
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
END_DOC
$type,intent(inout) :: x(isize)
integer,intent(inout) :: iorder(isize)
integer,intent(in) :: isize
@ -165,6 +186,10 @@ END_TEMPLATE
BEGIN_TEMPLATE
subroutine $Xset_order(x,iorder,isize)
implicit none
BEGIN_DOC
! array A has already been sorted, and iorder has contains the new order of
! elements of A. This subroutine changes the order of x to match the new order of A.
END_DOC
integer :: isize
$type :: x(*)
$type,allocatable :: xtmp(:)
@ -194,6 +219,13 @@ END_TEMPLATE
BEGIN_TEMPLATE
subroutine insertion_$Xsort_big (x,iorder,isize)
implicit none
BEGIN_DOC
! Sort array x(isize) using the insertion sort algorithm.
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
! This is a version for very large arrays where the indices need
! to be in integer*8 format
END_DOC
$type,intent(inout) :: x(isize)
integer*8,intent(inout) :: iorder(isize)
integer*8,intent(in) :: isize
@ -220,6 +252,12 @@ BEGIN_TEMPLATE
subroutine $Xset_order_big(x,iorder,isize)
implicit none
BEGIN_DOC
! array A has already been sorted, and iorder has contains the new order of
! elements of A. This subroutine changes the order of x to match the new order of A.
! This is a version for very large arrays where the indices need
! to be in integer*8 format
END_DOC
integer*8 :: isize
$type :: x(*)
$type, allocatable :: xtmp(:)
@ -248,6 +286,12 @@ BEGIN_TEMPLATE
recursive subroutine $Xradix_sort$big(x,iorder,isize,iradix)
implicit none
BEGIN_DOC
! Sort integer array x(isize) using the radix sort algorithm.
! iorder in input should be (1,2,3,...,isize), and in output
! contains the new order of the elements.
! iradix should be -1 in input.
END_DOC
$int_type, intent(in) :: isize
$int_type, intent(inout) :: iorder(isize)
$type, intent(inout) :: x(isize)
@ -394,7 +438,6 @@ BEGIN_TEMPLATE
call $Xradix_sort$big(x,iorder,i0,iradix-1)
endif
end
SUBST [ X, type, octets, is_big, big, int_type, zero ]

33
src/Utils/tests/Makefile Normal file
View File

@ -0,0 +1,33 @@
OPENMP =1
PROFILE =0
DEBUG = 0
IRPF90+= -I tests
REF_FILES=$(subst %.irp.f, %.ref, $(wildcard *.irp.f))
.PHONY: clean executables serial_tests parallel_tests
all: clean executables serial_tests parallel_tests
parallel_tests: $(REF_FILES)
@echo ; echo " ---- Running parallel tests ----" ; echo
@OMP_NUM_THREADS=10 ${QPACKAGE_ROOT}/scripts/run_tests.py
serial_tests: $(REF_FILES)
@echo ; echo " ---- Running serial tests ----" ; echo
@OMP_NUM_THREADS=1 ${QPACKAGE_ROOT}/scripts/run_tests.py
executables: $(wildcard *.irp.f) veryclean
$(MAKE) -C ..
%.ref: $(wildcard $(QPACKAGE_ROOT)/data/inputs/*.md5) executables
$(QPACKAGE_ROOT)/scripts/create_test_ref.sh $*
clean:
$(MAKE) -C .. clean
veryclean:
$(MAKE) -C .. veryclean

View File

@ -0,0 +1,130 @@
program test_integration
implicit none
character*(128) :: arg
integer :: iargc
integer :: i
if (iargc() < 1) then
print *, iargc()
print *, 'usage : test_integration <test_name>'
stop 1
endif
call getarg(1,arg)
i = len(arg)
do while (arg(i:i) == ' ')
i -= 1
if (i == 0) then
stop 1
endif
enddo
i -= 1
do while (arg(i:i) /= '/')
i -= 1
if (i == 0) then
stop 1
endif
enddo
i += 1
arg = arg(i:)
BEGIN_SHELL [ /bin/bash ]
for i in $(grep subroutine tests/test_integration.irp.f | cut -d ' ' -f 2 | sed 's/test_//' )
do
echo "if (trim(arg) == '"$i"') then"
echo ' call test_'$i
echo 'endif'
done
END_SHELL
end
subroutine test_rint1
implicit none
integer :: i,j
double precision :: rho(10)
double precision :: rint1
do i=1,size(rho)
rho(i) = 2.d0**(1-i)
enddo
do j=1,size(rho)
do i=0,8
print '(I2,A,F12.8,A3,E15.8)', i, ',', rho(j), ' : ', rint1(i,rho(j))
enddo
enddo
end
subroutine test_rint_large_n
implicit none
integer :: i,j
double precision :: rho(10)
double precision :: rint_large_n
do i=1,size(rho)
rho(i) = 2.d0**(2-i)
enddo
do j=1,size(rho)
do i=4,20
print '(I2,A,F12.8,A3,E15.8)', i, ',', rho(j), ' : ', rint_large_n(i,rho(j))
enddo
enddo
end
subroutine test_hermite
implicit none
integer :: i,j
double precision :: x(10)
double precision :: hermite
do i=1,size(x)
x(i) = (-1.d0)**i * 2.d0**(5-i)
enddo
do j=1,size(x)
do i=0,10
print '(I2,A,F12.8,A3,E15.8)', i, ',', x(j), ' : ', hermite(i,x(j))
enddo
enddo
end
subroutine test_rint_sum
implicit none
integer :: i,j
double precision :: d1(0:50), rho(10)
double precision :: rint_sum
do i=0,size(d1)-1
d1(i) = (-1.d0)**i * 2.d0**(5-i)
enddo
do i=1,size(rho)
rho(i) = abs(1.d0/d1(i))
enddo
do j=1,size(rho)
do i=0,5
print '(I2,A,F12.8,A3,E15.8)', 4*i+1, ',', rho(j), ' : ', rint_sum(4*i+1,rho(j),d1)
enddo
enddo
end
subroutine test_rint
implicit none
integer :: i,j
double precision :: rho(10)
double precision :: rint
do i=1,size(rho)
rho(i) = 2.d0**(2-i)
enddo
do j=1,size(rho)
do i=0,20,3
print '(I2,A,F12.8,A3,E15.8)', i, ',', rho(j), ' : ', rint(i,rho(j))
enddo
enddo
end
subroutine test_F_integral
implicit none
integer :: i,j
double precision :: rho(10)
double precision :: F_integral
do i=1,size(rho)
rho(i) = 2.d0**(2-i)
enddo
do j=1,size(rho)
do i=0,20,3
print '(I2,A,F12.8,A3,E15.8)', i, ',', rho(j), ' : ', F_integral(i,rho(j))
enddo
enddo
end

View File

@ -0,0 +1,514 @@
data = {
'rint1' : {
'0, 1.00000000' : 0.74682413E+00,
'1, 1.00000000' : 0.18947235E+00,
'2, 1.00000000' : 0.10026880E+00,
'3, 1.00000000' : 0.66732275E-01,
'4, 1.00000000' : 0.49623241E-01,
'5, 1.00000000' : 0.39364865E-01,
'6, 1.00000000' : 0.32567034E-01,
'7, 1.00000000' : 0.27746002E-01,
'8, 1.00000000' : 0.24155294E-01,
'0, 0.50000000' : 0.85562439E+00,
'1, 0.50000000' : 0.24909373E+00,
'2, 0.50000000' : 0.14075054E+00,
'3, 0.50000000' : 0.97222024E-01,
'4, 0.50000000' : 0.74023511E-01,
'5, 0.50000000' : 0.59680941E-01,
'6, 0.50000000' : 0.49959693E-01,
'7, 0.50000000' : 0.42945347E-01,
'8, 0.50000000' : 0.37649547E-01,
'0, 0.25000000' : 0.92256201E+00,
'1, 0.25000000' : 0.28752246E+00,
'2, 0.25000000' : 0.16753319E+00,
'3, 0.25000000' : 0.11773034E+00,
'4, 0.25000000' : 0.90623235E-01,
'5, 0.25000000' : 0.73616662E-01,
'6, 0.25000000' : 0.61964994E-01,
'7, 0.25000000' : 0.53488276E-01,
'8, 0.25000000' : 0.47046726E-01,
'0, 0.12500000' : 0.95985044E+00,
'1, 0.12500000' : 0.30941414E+00,
'2, 0.12500000' : 0.18298209E+00,
'3, 0.12500000' : 0.12965410E+00,
'4, 0.12500000' : 0.10032732E+00,
'5, 0.12500000' : 0.81795915E-01,
'6, 0.12500000' : 0.69032643E-01,
'7, 0.12500000' : 0.59709841E-01,
'8, 0.12500000' : 0.52602850E-01,
'0, 0.06250000' : 0.97955155E+00,
'1, 0.06250000' : 0.32110789E+00,
'2, 0.06250000' : 0.19128479E+00,
'3, 0.06250000' : 0.13608717E+00,
'4, 0.06250000' : 0.10557686E+00,
'5, 0.06250000' : 0.86229246E-01,
'6, 0.06250000' : 0.72869188E-01,
'7, 0.06250000' : 0.63091082E-01,
'8, 0.06250000' : 0.55625318E-01,
'0, 0.03125000' : 0.98968027E+00,
'1, 0.03125000' : 0.32715253E+00,
'2, 0.03125000' : 0.19558951E+00,
'3, 0.03125000' : 0.13942892E+00,
'4, 0.03125000' : 0.10830743E+00,
'5, 0.03125000' : 0.88537500E-01,
'6, 0.03125000' : 0.74868200E-01,
'7, 0.03125000' : 0.64853890E-01,
'8, 0.03125000' : 0.57201824E-01,
'0, 0.01562500' : 0.99481599E+00,
'1, 0.01562500' : 0.33022570E+00,
'2, 0.01562500' : 0.19778136E+00,
'3, 0.01562500' : 0.14113208E+00,
'4, 0.01562500' : 0.10970000E+00,
'5, 0.01562500' : 0.89715269E-01,
'6, 0.01562500' : 0.75888558E-01,
'7, 0.01562500' : 0.65753944E-01,
'8, 0.01562500' : 0.58006946E-01,
'0, 0.00781250' : 0.99740193E+00,
'1, 0.00781250' : 0.33177518E+00,
'2, 0.00781250' : 0.19888731E+00,
'3, 0.00781250' : 0.14199186E+00,
'4, 0.00781250' : 0.11040323E+00,
'5, 0.00781250' : 0.90310159E-01,
'6, 0.00781250' : 0.76404035E-01,
'7, 0.00781250' : 0.66208710E-01,
'8, 0.00781250' : 0.58413795E-01,
'0, 0.00390625' : 0.99869944E+00,
'1, 0.00390625' : 0.33255317E+00,
'2, 0.00390625' : 0.19944281E+00,
'3, 0.00390625' : 0.14242381E+00,
'4, 0.00390625' : 0.11075658E+00,
'5, 0.00390625' : 0.90609118E-01,
'6, 0.00390625' : 0.76663109E-01,
'7, 0.00390625' : 0.66437288E-01,
'8, 0.00390625' : 0.58618300E-01,
'0, 0.00195312' : 0.99934934E+00,
'1, 0.00195312' : 0.33294298E+00,
'2, 0.00195312' : 0.19972119E+00,
'3, 0.00195312' : 0.14264030E+00,
'4, 0.00195312' : 0.11093370E+00,
'5, 0.00195312' : 0.90758978E-01,
'6, 0.00195312' : 0.76792981E-01,
'7, 0.00195312' : 0.66551877E-01,
'8, 0.00195312' : 0.58720824E-01,
},
'rint_large_n' : {
'4, 2.00000000' : 0.22769400E-01,
'5, 2.00000000' : 0.17397330E-01,
'6, 2.00000000' : 0.14008836E-01,
'7, 2.00000000' : 0.11694896E-01,
'8, 2.00000000' : 0.10022038E-01,
'9, 2.00000000' : 0.87598405E-02,
'10, 2.00000000' : 0.77754214E-02,
'11, 2.00000000' : 0.69871414E-02,
'12, 2.00000000' : 0.63422421E-02,
'13, 2.00000000' : 0.58051924E-02,
'14, 2.00000000' : 0.53512279E-02,
'15, 2.00000000' : 0.49625818E-02,
'16, 2.00000000' : 0.46261880E-02,
'17, 2.00000000' : 0.43322304E-02,
'18, 2.00000000' : 0.40731954E-02,
'19, 2.00000000' : 0.38432370E-02,
'20, 2.00000000' : 0.36377399E-02,
'4, 1.00000000' : 0.49623241E-01,
'5, 1.00000000' : 0.39364865E-01,
'6, 1.00000000' : 0.32567034E-01,
'7, 1.00000000' : 0.27746002E-01,
'8, 1.00000000' : 0.24155294E-01,
'9, 1.00000000' : 0.21380280E-01,
'10, 1.00000000' : 0.19172936E-01,
'11, 1.00000000' : 0.17376108E-01,
'12, 1.00000000' : 0.15885526E-01,
'13, 1.00000000' : 0.14629351E-01,
'14, 1.00000000' : 0.13556514E-01,
'15, 1.00000000' : 0.12629735E-01,
'16, 1.00000000' : 0.11821172E-01,
'17, 1.00000000' : 0.11109621E-01,
'18, 1.00000000' : 0.10478652E-01,
'19, 1.00000000' : 0.99153382E-02,
'20, 1.00000000' : 0.94093737E-02,
'4, 0.50000000' : 0.74131525E-01,
'5, 0.50000000' : 0.59734080E-01,
'6, 0.50000000' : 0.49988791E-01,
'7, 0.50000000' : 0.42962588E-01,
'8, 0.50000000' : 0.37660400E-01,
'9, 0.50000000' : 0.33518800E-01,
'10, 0.50000000' : 0.30195249E-01,
'11, 0.50000000' : 0.27469686E-01,
'12, 0.50000000' : 0.25194350E-01,
'13, 0.50000000' : 0.23266388E-01,
'14, 0.50000000' : 0.21612012E-01,
'15, 0.50000000' : 0.20176927E-01,
'16, 0.50000000' : 0.18920297E-01,
'17, 0.50000000' : 0.17810821E-01,
'18, 0.50000000' : 0.16824108E-01,
'19, 0.50000000' : 0.15940870E-01,
'20, 0.50000000' : 0.15145655E-01,
'4, 0.25000000' : 0.90623235E-01,
'5, 0.25000000' : 0.73616662E-01,
'6, 0.25000000' : 0.61964994E-01,
'7, 0.25000000' : 0.53488276E-01,
'8, 0.25000000' : 0.47046726E-01,
'9, 0.25000000' : 0.41987104E-01,
'10, 0.25000000' : 0.37908392E-01,
'11, 0.25000000' : 0.34550883E-01,
'12, 0.25000000' : 0.31739030E-01,
'13, 0.25000000' : 0.29349937E-01,
'14, 0.25000000' : 0.27295006E-01,
'15, 0.25000000' : 0.25508764E-01,
'16, 0.25000000' : 0.23941782E-01,
'17, 0.25000000' : 0.22556049E-01,
'18, 0.25000000' : 0.21321854E-01,
'19, 0.25000000' : 0.20215642E-01,
'20, 0.25000000' : 0.19218495E-01,
'4, 0.12500000' : 0.10032732E+00,
'5, 0.12500000' : 0.81795915E-01,
'6, 0.12500000' : 0.69032643E-01,
'7, 0.12500000' : 0.59709841E-01,
'8, 0.12500000' : 0.52602850E-01,
'9, 0.12500000' : 0.47006219E-01,
'10, 0.12500000' : 0.42485051E-01,
'11, 0.12500000' : 0.38756708E-01,
'12, 0.12500000' : 0.35629567E-01,
'13, 0.12500000' : 0.32969128E-01,
'14, 0.12500000' : 0.30678211E-01,
'15, 0.12500000' : 0.28684857E-01,
'16, 0.12500000' : 0.26934646E-01,
'17, 0.12500000' : 0.25385662E-01,
'18, 0.12500000' : 0.24005098E-01,
'19, 0.12500000' : 0.22766909E-01,
'20, 0.12500000' : 0.21650155E-01,
'4, 0.06250000' : 0.10557686E+00,
'5, 0.06250000' : 0.86229246E-01,
'6, 0.06250000' : 0.72869188E-01,
'7, 0.06250000' : 0.63091082E-01,
'8, 0.06250000' : 0.55625318E-01,
'9, 0.06250000' : 0.49738703E-01,
'10, 0.06250000' : 0.44978296E-01,
'11, 0.06250000' : 0.41049216E-01,
'12, 0.06250000' : 0.37751241E-01,
'13, 0.06250000' : 0.34943654E-01,
'14, 0.06250000' : 0.32524670E-01,
'15, 0.06250000' : 0.30418845E-01,
'16, 0.06250000' : 0.28569075E-01,
'17, 0.06250000' : 0.26931342E-01,
'18, 0.06250000' : 0.25471168E-01,
'19, 0.06250000' : 0.24161166E-01,
'20, 0.06250000' : 0.22979305E-01,
'4, 0.03125000' : 0.10830743E+00,
'5, 0.03125000' : 0.88537500E-01,
'6, 0.03125000' : 0.74868200E-01,
'7, 0.03125000' : 0.64853890E-01,
'8, 0.03125000' : 0.57201824E-01,
'9, 0.03125000' : 0.51164511E-01,
'10, 0.03125000' : 0.46279696E-01,
'11, 0.03125000' : 0.42246171E-01,
'12, 0.03125000' : 0.38859267E-01,
'13, 0.03125000' : 0.35975049E-01,
'14, 0.03125000' : 0.33489346E-01,
'15, 0.03125000' : 0.31324909E-01,
'16, 0.03125000' : 0.29423240E-01,
'17, 0.03125000' : 0.27739231E-01,
'18, 0.03125000' : 0.26237537E-01,
'19, 0.03125000' : 0.24890074E-01,
'20, 0.03125000' : 0.23674243E-01,
'4, 0.01562500' : 0.10970000E+00,
'5, 0.01562500' : 0.89715269E-01,
'6, 0.01562500' : 0.75888558E-01,
'7, 0.01562500' : 0.65753944E-01,
'8, 0.01562500' : 0.58006946E-01,
'9, 0.01562500' : 0.51892813E-01,
'10, 0.01562500' : 0.46944559E-01,
'11, 0.01562500' : 0.42857760E-01,
'12, 0.01562500' : 0.39425485E-01,
'13, 0.01562500' : 0.36502162E-01,
'14, 0.01562500' : 0.33982407E-01,
'15, 0.01562500' : 0.31788050E-01,
'16, 0.01562500' : 0.29859885E-01,
'17, 0.01562500' : 0.28152246E-01,
'18, 0.01562500' : 0.26629349E-01,
'19, 0.01562500' : 0.25262753E-01,
'20, 0.01562500' : 0.24029571E-01,
'4, 0.00781250' : 0.11040323E+00,
'5, 0.00781250' : 0.90310159E-01,
'6, 0.00781250' : 0.76404035E-01,
'7, 0.00781250' : 0.66208710E-01,
'8, 0.00781250' : 0.58413795E-01,
'9, 0.00781250' : 0.52260879E-01,
'10, 0.00781250' : 0.47280591E-01,
'11, 0.00781250' : 0.43166888E-01,
'12, 0.00781250' : 0.39711698E-01,
'13, 0.00781250' : 0.36768623E-01,
'14, 0.00781250' : 0.34231665E-01,
'15, 0.00781250' : 0.32022192E-01,
'16, 0.00781250' : 0.30080639E-01,
'17, 0.00781250' : 0.28361060E-01,
'18, 0.00781250' : 0.26827449E-01,
'19, 0.00781250' : 0.25451185E-01,
'20, 0.00781250' : 0.24209234E-01,
'4, 0.00390625' : 0.11075658E+00,
'5, 0.00390625' : 0.90609118E-01,
'6, 0.00390625' : 0.76663109E-01,
'7, 0.00390625' : 0.66437288E-01,
'8, 0.00390625' : 0.58618300E-01,
'9, 0.00390625' : 0.52445898E-01,
'10, 0.00390625' : 0.47449515E-01,
'11, 0.00390625' : 0.43322293E-01,
'12, 0.00390625' : 0.39855587E-01,
'13, 0.00390625' : 0.36902585E-01,
'14, 0.00390625' : 0.34356981E-01,
'15, 0.00390625' : 0.32139911E-01,
'16, 0.00390625' : 0.30191629E-01,
'17, 0.00390625' : 0.28466050E-01,
'18, 0.00390625' : 0.26927053E-01,
'19, 0.00390625' : 0.25545928E-01,
'20, 0.00390625' : 0.24299570E-01,
},
'hermite': {
'0,-16.00000000' : 0.10000000E+01,
'1,-16.00000000' : -0.32000000E+02,
'2,-16.00000000' : 0.10220000E+04,
'3,-16.00000000' : -0.32576000E+05,
'4,-16.00000000' : 0.10363000E+07,
'5,-16.00000000' : -0.32900992E+08,
'6,-16.00000000' : 0.10424687E+10,
'7,-16.00000000' : -0.32964188E+11,
'8,-16.00000000' : 0.10402595E+13,
'9,-16.00000000' : -0.32760875E+14,
'10,-16.00000000' : 0.10296233E+16,
'0, 8.00000000' : 0.10000000E+01,
'1, 8.00000000' : 0.16000000E+02,
'2, 8.00000000' : 0.25400000E+03,
'3, 8.00000000' : 0.40000000E+04,
'4, 8.00000000' : 0.62476000E+05,
'5, 8.00000000' : 0.96761600E+06,
'6, 8.00000000' : 0.14857096E+08,
'7, 8.00000000' : 0.22610214E+09,
'8, 8.00000000' : 0.34096350E+10,
'9, 8.00000000' : 0.50936525E+11,
'10, 8.00000000' : 0.75361097E+12,
'0, -4.00000000' : 0.10000000E+01,
'1, -4.00000000' : -0.80000000E+01,
'2, -4.00000000' : 0.62000000E+02,
'3, -4.00000000' : -0.46400000E+03,
'4, -4.00000000' : 0.33400000E+04,
'5, -4.00000000' : -0.23008000E+05,
'6, -4.00000000' : 0.15066400E+06,
'7, -4.00000000' : -0.92921600E+06,
'8, -4.00000000' : 0.53244320E+07,
'9, -4.00000000' : -0.27728000E+08,
'10, -4.00000000' : 0.12598422E+09,
'0, 2.00000000' : 0.10000000E+01,
'1, 2.00000000' : 0.40000000E+01,
'2, 2.00000000' : 0.14000000E+02,
'3, 2.00000000' : 0.40000000E+02,
'4, 2.00000000' : 0.76000000E+02,
'5, 2.00000000' : -0.16000000E+02,
'6, 2.00000000' : -0.82400000E+03,
'7, 2.00000000' : -0.31040000E+04,
'8, 2.00000000' : -0.88000000E+03,
'9, 2.00000000' : 0.46144000E+05,
'10, 2.00000000' : 0.20041600E+06,
'0, -1.00000000' : 0.10000000E+01,
'1, -1.00000000' : -0.20000000E+01,
'2, -1.00000000' : 0.20000000E+01,
'3, -1.00000000' : 0.40000000E+01,
'4, -1.00000000' : -0.20000000E+02,
'5, -1.00000000' : 0.80000000E+01,
'6, -1.00000000' : 0.18400000E+03,
'7, -1.00000000' : -0.46400000E+03,
'8, -1.00000000' : -0.16480000E+04,
'9, -1.00000000' : 0.10720000E+05,
'10, -1.00000000' : 0.82240000E+04,
'0, 0.50000000' : 0.10000000E+01,
'1, 0.50000000' : 0.10000000E+01,
'2, 0.50000000' : -0.10000000E+01,
'3, 0.50000000' : -0.50000000E+01,
'4, 0.50000000' : 0.10000000E+01,
'5, 0.50000000' : 0.41000000E+02,
'6, 0.50000000' : 0.31000000E+02,
'7, 0.50000000' : -0.46100000E+03,
'8, 0.50000000' : -0.89500000E+03,
'9, 0.50000000' : 0.64810000E+04,
'10, 0.50000000' : 0.22591000E+05,
'0, -0.25000000' : 0.10000000E+01,
'1, -0.25000000' : -0.50000000E+00,
'2, -0.25000000' : -0.17500000E+01,
'3, -0.25000000' : 0.28750000E+01,
'4, -0.25000000' : 0.90625000E+01,
'5, -0.25000000' : -0.27531250E+02,
'6, -0.25000000' : -0.76859375E+02,
'7, -0.25000000' : 0.36880469E+03,
'8, -0.25000000' : 0.89162891E+03,
'9, -0.25000000' : -0.63466895E+04,
'10, -0.25000000' : -0.12875976E+05,
'0, 0.12500000' : 0.10000000E+01,
'1, 0.12500000' : 0.25000000E+00,
'2, 0.12500000' : -0.19375000E+01,
'3, 0.12500000' : -0.14843750E+01,
'4, 0.12500000' : 0.11253906E+02,
'5, 0.12500000' : 0.14688477E+02,
'6, 0.12500000' : -0.10886694E+03,
'7, 0.12500000' : -0.20347845E+03,
'8, 0.12500000' : 0.14732676E+04,
'9, 0.12500000' : 0.36239722E+04,
'10, 0.12500000' : -0.25612824E+05,
'0, -0.06250000' : 0.10000000E+01,
'1, -0.06250000' : -0.12500000E+00,
'2, -0.06250000' : -0.19843750E+01,
'3, -0.06250000' : 0.74804688E+00,
'4, -0.06250000' : 0.11812744E+02,
'5, -0.06250000' : -0.74609680E+01,
'6, -0.06250000' : -0.11719482E+03,
'7, -0.06250000' : 0.10418097E+03,
'8, -0.06250000' : 0.16277049E+04,
'9, -0.06250000' : -0.18703586E+04,
'10, -0.06250000' : -0.29064893E+05,
'0, 0.03125000' : 0.10000000E+01,
'1, 0.03125000' : 0.62500000E-01,
'2, 0.03125000' : -0.19960938E+01,
'3, 0.03125000' : -0.37475586E+00,
'4, 0.03125000' : 0.11953140E+02,
'5, 0.03125000' : 0.37451181E+01,
'6, 0.03125000' : -0.11929733E+03,
'7, 0.03125000' : -0.52397501E+02,
'8, 0.03125000' : 0.16668878E+04,
'9, 0.03125000' : 0.94254050E+03,
'10, 0.03125000' : -0.29945072E+05,
},
'rint_sum' : {
'1, 0.06250000' : 0.31345650E+02,
'5, 0.06250000' : 0.34297082E+02,
'9, 0.06250000' : 0.34378323E+02,
'13, 0.06250000' : 0.34381587E+02,
'17, 0.06250000' : 0.34381737E+02,
'21, 0.06250000' : 0.34381745E+02,
'1, 0.12500000' : 0.30715214E+02,
'5, 0.12500000' : 0.33556491E+02,
'9, 0.12500000' : 0.33633859E+02,
'13, 0.12500000' : 0.33636955E+02,
'17, 0.12500000' : 0.33637097E+02,
'21, 0.12500000' : 0.33637104E+02,
'1, 0.25000000' : 0.29521984E+02,
'5, 0.25000000' : 0.32157230E+02,
'9, 0.25000000' : 0.32227424E+02,
'13, 0.25000000' : 0.32230208E+02,
'17, 0.25000000' : 0.32230336E+02,
'21, 0.25000000' : 0.32230342E+02,
'1, 0.50000000' : 0.27379981E+02,
'5, 0.50000000' : 0.29654231E+02,
'9, 0.50000000' : 0.29712095E+02,
'13, 0.50000000' : 0.29714351E+02,
'17, 0.50000000' : 0.29714453E+02,
'21, 0.50000000' : 0.29714458E+02,
'1, 1.00000000' : 0.23898372E+02,
'5, 1.00000000' : 0.25614689E+02,
'9, 1.00000000' : 0.25654258E+02,
'13, 1.00000000' : 0.25655742E+02,
'17, 1.00000000' : 0.25655808E+02,
'21, 1.00000000' : 0.25655811E+02,
'1, 2.00000000' : 0.19140608E+02,
'5, 2.00000000' : 0.20172111E+02,
'9, 2.00000000' : 0.20191130E+02,
'13, 2.00000000' : 0.20191783E+02,
'17, 2.00000000' : 0.20191811E+02,
'21, 2.00000000' : 0.20191812E+02,
'1, 4.00000000' : 0.14113302E+02,
'5, 4.00000000' : 0.14571079E+02,
'9, 4.00000000' : 0.14576072E+02,
'13, 4.00000000' : 0.14576208E+02,
'17, 4.00000000' : 0.14576213E+02,
'21, 4.00000000' : 0.14576214E+02,
'1, 8.00000000' : 0.10025878E+02,
'5, 8.00000000' : 0.10189658E+02,
'9, 8.00000000' : 0.10190276E+02,
'13, 8.00000000' : 0.10190285E+02,
'17, 8.00000000' : 0.10190285E+02,
'21, 8.00000000' : 0.10190285E+02,
'1, 16.00000000' : 0.70898153E+01,
'5, 16.00000000' : 0.71465026E+01,
'9, 16.00000000' : 0.71465561E+01,
'13, 16.00000000' : 0.71465563E+01,
'17, 16.00000000' : 0.71465563E+01,
'21, 16.00000000' : 0.71465563E+01,
'1, 32.00000000' : 0.50132565E+01,
'5, 32.00000000' : 0.50330691E+01,
'9, 32.00000000' : 0.50330737E+01,
'13, 32.00000000' : 0.50330737E+01,
'17, 32.00000000' : 0.50330737E+01,
'21, 32.00000000' : 0.50330737E+01,
},
'rint' : {
'0, 2.00000000' : 0.59814401E+00,
'3, 2.00000000' : 0.32344698E-01,
'6, 2.00000000' : 0.14008836E-01,
'9, 2.00000000' : 0.87598405E-02,
'12, 2.00000000' : 0.63422421E-02,
'15, 2.00000000' : 0.49625795E-02,
'18, 2.00000000' : 0.40719014E-02,
'0, 1.00000000' : 0.74682413E+00,
'3, 1.00000000' : 0.66732275E-01,
'6, 1.00000000' : 0.32567034E-01,
'9, 1.00000000' : 0.21380280E-01,
'12, 1.00000000' : 0.15885521E-01,
'15, 1.00000000' : 0.12617897E-01,
'18, 1.00000000' : -0.42503468E-01,
'0, 0.50000000' : 0.85562439E+00,
'3, 0.50000000' : 0.97222024E-01,
'6, 0.50000000' : 0.49959693E-01,
'9, 0.50000000' : 0.33511631E-01,
'12, 0.50000000' : 0.25191806E-01,
'15, 0.50000000' : 0.20175809E-01,
'18, 0.50000000' : 0.16823542E-01,
'0, 0.25000000' : 0.92256201E+00,
'3, 0.25000000' : 0.11773034E+00,
'6, 0.25000000' : 0.61964994E-01,
'9, 0.25000000' : 0.41987104E-01,
'12, 0.25000000' : 0.31739030E-01,
'15, 0.25000000' : 0.25508764E-01,
'18, 0.25000000' : 0.21321854E-01,
'0, 0.12500000' : 0.95985044E+00,
'3, 0.12500000' : 0.12965410E+00,
'6, 0.12500000' : 0.69032643E-01,
'9, 0.12500000' : 0.47006219E-01,
'12, 0.12500000' : 0.35629567E-01,
'15, 0.12500000' : 0.28684857E-01,
'18, 0.12500000' : 0.24005098E-01,
'0, 0.06250000' : 0.97955155E+00,
'3, 0.06250000' : 0.13608717E+00,
'6, 0.06250000' : 0.72869188E-01,
'9, 0.06250000' : 0.49738703E-01,
'12, 0.06250000' : 0.37751241E-01,
'15, 0.06250000' : 0.30418845E-01,
'18, 0.06250000' : 0.25471168E-01,
'0, 0.03125000' : 0.98968027E+00,
'3, 0.03125000' : 0.13942892E+00,
'6, 0.03125000' : 0.74868200E-01,
'9, 0.03125000' : 0.51164511E-01,
'12, 0.03125000' : 0.38859267E-01,
'15, 0.03125000' : 0.31324909E-01,
'18, 0.03125000' : 0.26237537E-01,
'0, 0.01562500' : 0.99481599E+00,
'3, 0.01562500' : 0.14113208E+00,
'6, 0.01562500' : 0.75888558E-01,
'9, 0.01562500' : 0.51892813E-01,
'12, 0.01562500' : 0.39425485E-01,
'15, 0.01562500' : 0.31788050E-01,
'18, 0.01562500' : 0.26629349E-01,
'0, 0.00781250' : 0.99740193E+00,
'3, 0.00781250' : 0.14199186E+00,
'6, 0.00781250' : 0.76404035E-01,
'9, 0.00781250' : 0.52260879E-01,
'12, 0.00781250' : 0.39711698E-01,
'15, 0.00781250' : 0.32022192E-01,
'18, 0.00781250' : 0.26827449E-01,
'0, 0.00390625' : 0.99869944E+00,
'3, 0.00390625' : 0.14242381E+00,
'6, 0.00390625' : 0.76663109E-01,
'9, 0.00390625' : 0.52445898E-01,
'12, 0.00390625' : 0.39855587E-01,
'15, 0.00390625' : 0.32139911E-01,
'18, 0.00390625' : 0.26927053E-01,
},
'F_integral' : {
}
}

View File

@ -1,5 +1,11 @@
double precision function binom_func(i,j)
implicit none
BEGIN_DOC
!.. math ::
!
! \frac{i!}{j!(i-j)!}
!
END_DOC
integer,intent(in) :: i,j
double precision :: fact, f
integer, save :: ifirst
@ -23,8 +29,6 @@ double precision function binom_func(i,j)
end
BEGIN_PROVIDER [ double precision, binom, (0:20,0:20) ]
&BEGIN_PROVIDER [ double precision, binom_transp, (0:20,0:20) ]
implicit none
@ -45,6 +49,9 @@ END_PROVIDER
integer function align_double(n)
implicit none
BEGIN_DOC
! Compute 1st dimension such that it is aligned for vectorization.
END_DOC
integer :: n
include 'include/constants.F'
if (mod(n,SIMD_vector/4) /= 0) then
@ -57,6 +64,9 @@ end
double precision function fact(n)
implicit none
BEGIN_DOC
! n!
END_DOC
integer :: n
double precision, save :: memo(1:100)
integer, save :: memomax = 1
@ -87,7 +97,7 @@ end function
BEGIN_PROVIDER [ double precision, fact_inv, (128) ]
implicit none
BEGIN_DOC
! 1.d0/fact(k)
! 1/n!
END_DOC
integer :: i
double precision :: fact
@ -98,6 +108,9 @@ END_PROVIDER
double precision function dble_fact(n) result(fact2)
implicit none
BEGIN_DOC
! n!!
END_DOC
integer :: n
double precision, save :: memo(1:100)
integer, save :: memomax = 1
@ -128,11 +141,14 @@ end function
subroutine write_git_log(iunit)
implicit none
BEGIN_DOC
! Write the last git commit in file iunit.
END_DOC
integer, intent(in) :: iunit
write(iunit,*) '----------------'
write(iunit,*) 'Last git commit:'
BEGIN_SHELL [ /bin/bash ]
git log -1 | sed "s/'//g"| sed "s/^/ write(iunit,*) '/g" | sed "s/$/'/g"
git log -1 2>/dev/null | sed "s/'//g"| sed "s/^/ write(iunit,*) '/g" | sed "s/$/'/g" || echo "Unknown"
END_SHELL
write(iunit,*) '----------------'
end
@ -151,6 +167,9 @@ END_PROVIDER
subroutine wall_time(t)
implicit none
BEGIN_DOC
! The equivalent of cpu_time, but for the wall time.
END_DOC
double precision, intent(out) :: t
integer :: c
integer, save :: rate = 0
@ -164,7 +183,7 @@ end
BEGIN_PROVIDER [ integer, nproc ]
implicit none
BEGIN_DOC
! Number of current openmp threads
! Number of current OpenMP threads
END_DOC
integer :: omp_get_num_threads