10
0
mirror of https://gitlab.com/scemama/eplf synced 2024-12-22 12:23:50 +01:00

Added types.h

This commit is contained in:
Anthony Scemama 2009-06-10 00:41:32 +02:00
parent a7867c90d9
commit dc47a48108
7 changed files with 144 additions and 19 deletions

27
LICENSE Normal file
View File

@ -0,0 +1,27 @@
All IRPF90 requestors MUST agree to the following license agreement which
covers all versions of IRPF90 (source code and binaries).
With regard to the IRP Fortran90 preprocessor IRPF90, together with its
associated utility programs, with which you have supplied me a
copy, I agree to the following conditions:
1. I will not supply a copy of the code to anyone outside my institution or
corporation for any reason whatsoever. Instead, I will refer any requests for
copies of the program to Anthony Scemama at CNRS. This in no way limits my making of
copies of the code for backup purposes, or for running on more than one
computer system at my institution or home.
2. I understand that copyright or ownership rights to IRPF90 are retained by
Anthony Scemama and CNRS to the IRPF90 package. I will not incorporate any part
of IRPF90 into any other program system, either for sale or for non-profit
distribution, without written permission from Anthony Scemama and CNRS,
3. I understand that no large program such as IRPF90 can be considered to be
bug free, and accordingly Anthony Scemama and the CNRS supplies the IRPF90 software on an "as is"
basis, with no additional responsibility or liability,
4. This license is considered a "Research Group" license. Thus anyone
directly associated with your research group is covered by the license and may
share your copy of IRPF90 on all of your group's computer resources.

View File

@ -8,9 +8,9 @@ FCFLAGS= -O3 -g
#FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib #FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib
# Mono # Mono
IRPF90 = irpf90 #IRPF90 = irpf90
FC = ifort -static-intel -static-libgcc #FC = ifort -static-intel -static-libgcc
FCFLAGS= -O3 -axP #FCFLAGS= -O3 -axP
SRC= SRC=
OBJ= OBJ=

0
README Normal file
View File

98
Util.irp.f Normal file
View File

@ -0,0 +1,98 @@
double precision function Boys(x,n)
implicit none
include 'constants.F'
real, intent(in) :: x
integer, intent(in) :: n
integer :: k
real, parameter :: thr = 6.
integer ,parameter :: Nmax = 20
double precision :: fact,fact2
if (n == 0) then
if (x > thr) then
Boys = 0.5d0*sqrt(pi/x)
else
Boys = 1.d0/dble(2*n+1)
do k=1,Nmax
Boys = Boys + (-x)**k/dble(fact(k)*(2*n+2*k+1))
enddo
endif
else
if (x > thr) then
Boys = fact2(2*n-1)*0.5d0**(n+1)*sqrt(pi/x**(2*n+1))
else
Boys = 1.d0/dble(2*n+1)
do k=1,Nmax
Boys = Boys + (-x)**k/dble(fact(k)*(2*n+2*k+1))
enddo
endif
endif
end function
double precision function fact2(n)
implicit none
integer :: n
double precision, save :: memo(1:100)
integer, save :: memomax = 1
ASSERT (mod(n,2) /= 0)
if (n<=memomax) then
if (n<3) then
fact2 = 1.d0
else
fact2 = memo(n)
endif
return
endif
integer :: i
memo(1) = 1.d0
do i=memomax+2,min(n,99),2
memo(i) = memo(i-2)* float(i)
enddo
memomax = min(n,99)
fact2 = memo(memomax)
do i=101,n,2
fact2 = fact2*float(i)
enddo
end function
double precision function fact(n)
implicit none
integer :: n
double precision, save :: memo(1:100)
integer, save :: memomax = 1
if (n<=memomax) then
if (n<2) then
fact = 1.d0
else
fact = memo(n)
endif
return
endif
integer :: i
memo(1) = 1.d0
do i=memomax+1,min(n,100)
memo(i) = memo(i-1)*float(i)
enddo
memomax = min(n,100)
fact = memo(memomax)
do i=101,n
fact = fact*float(i)
enddo
end function

View File

@ -134,20 +134,6 @@ END_PROVIDER
END_PROVIDER END_PROVIDER
double precision function ddfact2(n)
implicit none
integer :: n
ASSERT (mod(n,2) /= 0)
integer :: i
ddfact2 = 1.
do i=1,n,2
ddfact2 = ddfact2 * float(i)
enddo
end function
double precision function rintgauss(n) double precision function rintgauss(n)
implicit none implicit none
@ -163,9 +149,9 @@ double precision function rintgauss(n)
else if ( mod(n,2) == 1) then else if ( mod(n,2) == 1) then
rintgauss = 0. rintgauss = 0.
else else
double precision :: ddfact2 double precision :: fact2
rintgauss = rintgauss/(2.**(n/2)) rintgauss = rintgauss/(2.**(n/2))
rintgauss = rintgauss * ddfact2(n-1) rintgauss = rintgauss * fact2(n-1)
endif endif
end function end function

14
types.F Normal file
View File

@ -0,0 +1,14 @@
integer, parameter :: t_Gaussian = 1
integer, parameter :: t_Slater = 2
integer, parameter :: t_Brownian = 3
integer, parameter :: t_Langevin = 4
integer, parameter :: t_VMC = 5
integer, parameter :: t_DMC = 6
integer, parameter :: t_CI = 7
character*(32) :: types(t_CI) = &
(/ "Gaussian", "Slater", "Brownian", "Langevin", &
"VMC", "DMC", "CI" /)