From dc47a481084ae984877a9cd2a8a984252e9fe600 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 10 Jun 2009 00:41:32 +0200 Subject: [PATCH] Added types.h --- LICENSE | 27 +++++++++ Makefile | 6 +- README | 0 Util.irp.f | 98 +++++++++++++++++++++++++++++++++ ao.irp.f | 18 +----- debug.irp.f => debug_eplf.irp.f | 0 types.F | 14 +++++ 7 files changed, 144 insertions(+), 19 deletions(-) create mode 100644 LICENSE create mode 100644 README create mode 100644 Util.irp.f rename debug.irp.f => debug_eplf.irp.f (100%) create mode 100644 types.F diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d753130 --- /dev/null +++ b/LICENSE @@ -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. + + diff --git a/Makefile b/Makefile index 8a3df60..a2e209d 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,9 @@ FCFLAGS= -O3 -g #FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib # Mono -IRPF90 = irpf90 -FC = ifort -static-intel -static-libgcc -FCFLAGS= -O3 -axP +#IRPF90 = irpf90 +#FC = ifort -static-intel -static-libgcc +#FCFLAGS= -O3 -axP SRC= OBJ= diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/Util.irp.f b/Util.irp.f new file mode 100644 index 0000000..44261a9 --- /dev/null +++ b/Util.irp.f @@ -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 + + diff --git a/ao.irp.f b/ao.irp.f index 252a082..1181f6c 100644 --- a/ao.irp.f +++ b/ao.irp.f @@ -134,20 +134,6 @@ 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) implicit none @@ -163,9 +149,9 @@ double precision function rintgauss(n) else if ( mod(n,2) == 1) then rintgauss = 0. else - double precision :: ddfact2 + double precision :: fact2 rintgauss = rintgauss/(2.**(n/2)) - rintgauss = rintgauss * ddfact2(n-1) + rintgauss = rintgauss * fact2(n-1) endif end function diff --git a/debug.irp.f b/debug_eplf.irp.f similarity index 100% rename from debug.irp.f rename to debug_eplf.irp.f diff --git a/types.F b/types.F new file mode 100644 index 0000000..891bda7 --- /dev/null +++ b/types.F @@ -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" /) +