diff --git a/Makefile b/Makefile index fc05e7d..dfce639 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ # MPI-ifort -#IRPF90 = irpf90 -DMPI #-a -d -#FC = mpif90 -static-intel -static-libgcc -xT -ip -finline -#FCFLAGS= -O3 +IRPF90 = irpf90 -DMPI #-a -d +FC = mpif90 -xT -ip -finline +FCFLAGS= -O3 # Gfortran -IRPF90 = irpf90 #-DMPI #-a -d -FC = gfortran -ffree-line-length-none -static-libgcc -FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib +#IRPF90 = irpf90 #-DMPI #-a -d +#FC = gfortran -ffree-line-length-none -static-libgcc +#FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib # Mono #IRPF90 = irpf90 diff --git a/Util.irp.f b/Util.irp.f index dd06a5f..eae7655 100644 --- a/Util.irp.f +++ b/Util.irp.f @@ -1,19 +1,19 @@ -recursive double precision function Boys(x,n) result(res) - implicit none - include 'constants.F' - - real, intent(in) :: x - integer, intent(in) :: n - - ASSERT (x > 0.) - if (n == 0) then - res = sqrt(pi/(4.*x))*erf(sqrt(x)) - else - res = (dble(2*n-1) * Boys(x,(n-1)) - exp(-x) )/(2.*x) - endif - -end function +!recursive double precision function Boys(x,n) result(res) +! implicit none +! include 'constants.F' +! +! real, intent(in) :: x +! integer, intent(in) :: n +! +! ASSERT (x > 0.) +! if (n == 0) then +! res = sqrt(pi/(4.*x))*erf(sqrt(x)) +! else +! res = (dble(2*n-1) * Boys(x,(n-1)) - exp(-x) )/(2.*x) +! endif +! +!end function double precision function fact2(n) implicit none diff --git a/ao.irp.f b/ao.irp.f index 3c57c65..4846ba1 100644 --- a/ao.irp.f +++ b/ao.irp.f @@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, ao_num ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_num_contr(ao_num) !$OMP END CRITICAL (qcio_critical) assert (ao_num > 0) @@ -20,6 +21,7 @@ BEGIN_PROVIDER [ integer, ao_prim_num, (ao_num) ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_num_prim(ao_prim_num) !$OMP END CRITICAL (qcio_critical) @@ -33,6 +35,7 @@ BEGIN_PROVIDER [ integer, ao_nucl, (ao_num) ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_atom(ao_nucl) !$OMP END CRITICAL (qcio_critical) @@ -48,6 +51,7 @@ BEGIN_PROVIDER [ integer, ao_power, (ao_num,3) ] integer :: i,j !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_power(buffer) !$OMP END CRITICAL (qcio_critical) @@ -110,6 +114,7 @@ END_PROVIDER integer :: i,j !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_exponent(buffer) !$OMP END CRITICAL (qcio_critical) do i=1,ao_num @@ -119,6 +124,7 @@ END_PROVIDER enddo !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_basis_coefficient(buffer) !$OMP END CRITICAL (qcio_critical) diff --git a/density.irp.f b/density.irp.f new file mode 100644 index 0000000..b5dcfd7 --- /dev/null +++ b/density.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [ real, density_p ] + + BEGIN_DOC +! Value of the density at the current point + END_DOC + + density_p = 0. + integer :: i + do i=1,elec_beta_num + density_p = density_p + mo_value_p(i)**2 + enddo + + do i=1,elec_alpha_num + density_p = density_p + mo_value_p(i)**2 + enddo + +END_PROVIDER + + diff --git a/electrons.irp.f b/electrons.irp.f index 651831e..d6cda6d 100644 --- a/electrons.irp.f +++ b/electrons.irp.f @@ -7,6 +7,7 @@ BEGIN_PROVIDER [ integer, elec_alpha_num ] implicit none elec_alpha_num = -1 !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_system_num_alpha(elec_alpha_num) !$OMP END CRITICAL (qcio_critical) ASSERT (elec_alpha_num > 0) @@ -22,6 +23,7 @@ BEGIN_PROVIDER [ integer, elec_beta_num ] implicit none elec_beta_num = -1 !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_system_num_beta(elec_beta_num) !$OMP END CRITICAL (qcio_critical) ASSERT (elec_beta_num >= 0) diff --git a/eplf.irp.f b/eplf.irp.f index e60bbfa..630361b 100644 --- a/eplf.irp.f +++ b/eplf.irp.f @@ -3,7 +3,9 @@ BEGIN_PROVIDER [ real, eplf_gamma ] BEGIN_DOC ! Value of the gaussian for the EPLF END_DOC - eplf_gamma = 10000. + real :: eps + eps = -real(dlog(tiny(1.d0))) + eplf_gamma = density_p**(2./3.) * 100.*eps END_PROVIDER BEGIN_PROVIDER [ double precision, ao_eplf_integral_matrix, (ao_num,ao_num) ] @@ -114,19 +116,21 @@ BEGIN_PROVIDER [ real, eplf_value ] ! Value of the EPLF at the current point. END_DOC double precision :: aa, ab + double precision, parameter :: eps = tiny(1.d0) aa = eplf_up_up ab = eplf_up_dn - aa = min(1.d0,aa) - ab = min(1.d0,ab) - aa = max(tiny(1.d0),aa) - ab = max(tiny(1.d0),ab) - aa = -(dlog(aa)/eplf_gamma)+tiny(1.d0) - ab = -(dlog(ab)/eplf_gamma)+tiny(1.d0) - aa = dsqrt(aa) - ab = dsqrt(ab) - - eplf_value = (aa-ab)/(aa+ab) + if ( (aa > 0.d0).and.(ab > 0.d0) ) then + aa = min(1.d0,aa) + ab = min(1.d0,ab) + aa = -(dlog(aa)/eplf_gamma) + ab = -(dlog(ab)/eplf_gamma) + aa = dsqrt(aa) + ab = dsqrt(ab) + eplf_value = (aa-ab)/(aa+ab+eps) + else + eplf_value = 0.d0 + endif END_PROVIDER diff --git a/eplf_hf.irp.f b/eplf_hf.irp.f index eb7b012..a12f568 100644 --- a/eplf_hf.irp.f +++ b/eplf_hf.irp.f @@ -1,11 +1,7 @@ program eplf_hf - PROVIDE ao_prim_num_max call write_grid_eplf() - IRP_IF MPI - integer :: ierr - call MPI_FINALIZE(ierr) - IRP_ENDIF + call finish() end diff --git a/info.irp.f b/info.irp.f new file mode 100644 index 0000000..a786e51 --- /dev/null +++ b/info.irp.f @@ -0,0 +1,37 @@ +BEGIN_SHELL [ /usr/bin/python ] + +for i in [('r' ,'real'), \ + ('d','double precision'), \ + ('l','logical'), \ + ('i','integer'), \ + ('c','character*(*)'), \ + ]: + print "subroutine "+i[0]+"info (here,token,value)" + print " implicit none" + print " character*(*) :: here" + print " character*(*) :: token" + print " "+i[1]+" :: value" + print " if (mpi_master) then" + print " print *, trim(here)//':'" + if i[0] == 'l': + print " if (value) then" + print " print *, ' -> ', trim(token), '= True' " + print " else" + print " print *, ' -> ', trim(token), '= False' " + print " endif" + else: + print " print *, ' -> ', trim(token), '=', value" + print " endif" + print "end" + +END_SHELL + +subroutine info(here,message) + implicit none + character*(*) :: here, message + if (mpi_master) then + print *, trim(here)//':' + print *, ' -> ', trim(message) + endif +end + diff --git a/mo.irp.f b/mo.irp.f index f00c858..07639b8 100644 --- a/mo.irp.f +++ b/mo.irp.f @@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, mo_closed_num ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_num_closed(mo_closed_num) !$OMP END CRITICAL (qcio_critical) ASSERT (mo_closed_num >= 0) @@ -22,6 +23,7 @@ BEGIN_PROVIDER [ integer, mo_active_num ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_num_active(mo_active_num) !$OMP END CRITICAL (qcio_critical) ASSERT (mo_active_num >= 0) @@ -38,6 +40,7 @@ BEGIN_PROVIDER [ real, mo_occ, (mo_num) ] double precision, allocatable :: buffer(:) allocate ( buffer(mo_tot_num) ) !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_occupation(buffer) !$OMP END CRITICAL (qcio_critical) integer :: i @@ -72,6 +75,7 @@ BEGIN_PROVIDER [ real, mo_coef, (ao_num,mo_num) ] allocate (buffer(ao_num,mo_tot_num)) !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_matrix(buffer) !$OMP END CRITICAL (qcio_critical) do j=1,mo_num @@ -129,6 +133,7 @@ BEGIN_PROVIDER [ logical, mo_is_closed, (mo_num) ] character, allocatable :: buffer(:) allocate (buffer(mo_num)) !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_classif(buffer) !$OMP END CRITICAL @@ -154,6 +159,7 @@ BEGIN_PROVIDER [ integer, mo_tot_num ] ! Total number of MOs in the QCIO file END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_mo_num_orb_tot(mo_tot_num) !$OMP END CRITICAL (qcio_critical) ASSERT (mo_tot_num > 0) diff --git a/mpi.irp.f b/mpi.irp.f index 0f243cc..2ce2edf 100644 --- a/mpi.irp.f +++ b/mpi.irp.f @@ -1,35 +1,77 @@ - BEGIN_PROVIDER [ integer, mpi_rank ] -&BEGIN_PROVIDER [ integer, mpi_size ] -&BEGIN_PROVIDER [ logical, mpi_master ] +subroutine start_mpi implicit none + integer :: ierr + integer, save :: started = 0 IRP_IF MPI - include 'mpif.h' + include 'mpif.h' + if (started == 0) then + call MPI_INIT(ierr) + if (ierr /= MPI_SUCCESS) then + call abrt(irp_here,"Unable to initialize MPI") + endif + endif + started = 1 IRP_ENDIF +end + +BEGIN_PROVIDER [ integer, mpi_rank ] + implicit none BEGIN_DOC -! mpi_rank : ID of the current processor -! -! mpi_size : Total number of processors -! -! mpi_master : True if the current processor is the master +! Number of the processor END_DOC - mpi_size = 1 - mpi_rank = 0 + IRP_IF MPI + include 'mpif.h' + integer :: ierr + call start_mpi + call MPI_COMM_RANK(MPI_COMM_WORLD, mpi_rank, ierr) + if (ierr /= MPI_SUCCESS) then + call abrt(irp_here,"Unable to get MPI") + endif - IRP_IF MPI + IRP_ELSE - integer :: ierr - call MPI_INIT(ierr) - call MPI_COMM_RANK(MPI_COMM_WORLD, mpi_rank, ierr) - call MPI_COMM_SIZE(MPI_COMM_WORLD, mpi_size, ierr) + mpi_rank = 0 IRP_ENDIF - mpi_master = (mpi_rank == 0) +END_PROVIDER + +BEGIN_PROVIDER [ integer, mpi_size ] + implicit none + BEGIN_DOC +! Number of processors + END_DOC + + IRP_IF MPI + include 'mpif.h' + + integer :: ierr + call start_mpi + call MPI_COMM_SIZE(MPI_COMM_WORLD, mpi_size, ierr) + if (ierr /= MPI_SUCCESS) then + call abrt(irp_here,"Unable to get MPI size") + endif + + IRP_ELSE + + mpi_size = 1 + + IRP_ENDIF + + call iinfo(irp_here,'mpi_size',mpi_size) END_PROVIDER +BEGIN_PROVIDER [ logical, mpi_master ] + implicit none + BEGIN_DOC +! mpi_master : True if the current processor is the master + END_DOC + mpi_master = (mpi_rank == 0) +END_PROVIDER + diff --git a/nuclei.irp.f b/nuclei.irp.f index b272800..b47050e 100644 --- a/nuclei.irp.f +++ b/nuclei.irp.f @@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, nucl_num ] END_DOC !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_geometry_num_atom(nucl_num) !$OMP END CRITICAL (qcio_critical) assert (nucl_num > 0) @@ -22,6 +23,7 @@ BEGIN_PROVIDER [ real, nucl_charge, (nucl_num) ] double precision,allocatable :: buffer(:) allocate(buffer(nucl_num)) !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_geometry_charge(buffer) !$OMP END CRITICAL (qcio_critical) @@ -42,6 +44,7 @@ BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ] allocate (buffer(3,nucl_num)) !$OMP CRITICAL (qcio_critical) + PROVIDE qcio_filename call qcio_get_geometry_coord(buffer) !$OMP END CRITICAL (qcio_critical) diff --git a/test/QCIO_File/.exists b/test/QCIO_File/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/ao/.exists b/test/QCIO_File/ao/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/ao/num_orb_sym.gz b/test/QCIO_File/ao/num_orb_sym.gz index b69f7e1..21163f4 100644 Binary files a/test/QCIO_File/ao/num_orb_sym.gz and b/test/QCIO_File/ao/num_orb_sym.gz differ diff --git a/test/QCIO_File/ao/transformation.gz b/test/QCIO_File/ao/transformation.gz index 5587faf..1239a3f 100644 Binary files a/test/QCIO_File/ao/transformation.gz and b/test/QCIO_File/ao/transformation.gz differ diff --git a/test/QCIO_File/basis/.exists b/test/QCIO_File/basis/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/basis/atom.gz b/test/QCIO_File/basis/atom.gz index c4bc79b..6949435 100644 Binary files a/test/QCIO_File/basis/atom.gz and b/test/QCIO_File/basis/atom.gz differ diff --git a/test/QCIO_File/basis/coefficient.gz b/test/QCIO_File/basis/coefficient.gz index d313af5..f09196f 100644 Binary files a/test/QCIO_File/basis/coefficient.gz and b/test/QCIO_File/basis/coefficient.gz differ diff --git a/test/QCIO_File/basis/exponent.gz b/test/QCIO_File/basis/exponent.gz index dfa775b..16704e7 100644 Binary files a/test/QCIO_File/basis/exponent.gz and b/test/QCIO_File/basis/exponent.gz differ diff --git a/test/QCIO_File/basis/num_prim.gz b/test/QCIO_File/basis/num_prim.gz index 9c0971b..4921c03 100644 Binary files a/test/QCIO_File/basis/num_prim.gz and b/test/QCIO_File/basis/num_prim.gz differ diff --git a/test/QCIO_File/basis/power.gz b/test/QCIO_File/basis/power.gz index 48ccbb1..d381e39 100644 Binary files a/test/QCIO_File/basis/power.gz and b/test/QCIO_File/basis/power.gz differ diff --git a/test/QCIO_File/geometry/.exists b/test/QCIO_File/geometry/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/geometry/atomic_number.gz b/test/QCIO_File/geometry/atomic_number.gz index 0257a43..45b44e2 100644 Binary files a/test/QCIO_File/geometry/atomic_number.gz and b/test/QCIO_File/geometry/atomic_number.gz differ diff --git a/test/QCIO_File/geometry/charge.gz b/test/QCIO_File/geometry/charge.gz index ae7084d..9540560 100644 Binary files a/test/QCIO_File/geometry/charge.gz and b/test/QCIO_File/geometry/charge.gz differ diff --git a/test/QCIO_File/geometry/coord.gz b/test/QCIO_File/geometry/coord.gz index 964c9c0..425864f 100644 Binary files a/test/QCIO_File/geometry/coord.gz and b/test/QCIO_File/geometry/coord.gz differ diff --git a/test/QCIO_File/geometry/label.gz b/test/QCIO_File/geometry/label.gz index 19fb67b..41a7d46 100644 Binary files a/test/QCIO_File/geometry/label.gz and b/test/QCIO_File/geometry/label.gz differ diff --git a/test/QCIO_File/mo/.exists b/test/QCIO_File/mo/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/mo/classif.gz b/test/QCIO_File/mo/classif.gz index dc0d235..380695b 100644 Binary files a/test/QCIO_File/mo/classif.gz and b/test/QCIO_File/mo/classif.gz differ diff --git a/test/QCIO_File/mo/eigenvalue.gz b/test/QCIO_File/mo/eigenvalue.gz index 506e33e..1a3f4fa 100644 Binary files a/test/QCIO_File/mo/eigenvalue.gz and b/test/QCIO_File/mo/eigenvalue.gz differ diff --git a/test/QCIO_File/mo/fitcusp b/test/QCIO_File/mo/fitcusp deleted file mode 100644 index cf84443..0000000 --- a/test/QCIO_File/mo/fitcusp +++ /dev/null @@ -1 +0,0 @@ -F diff --git a/test/QCIO_File/mo/label.gz b/test/QCIO_File/mo/label.gz index 7019a7c..aef2cb6 100644 Binary files a/test/QCIO_File/mo/label.gz and b/test/QCIO_File/mo/label.gz differ diff --git a/test/QCIO_File/mo/matrix.gz b/test/QCIO_File/mo/matrix.gz index 91aaed4..5c7d316 100644 Binary files a/test/QCIO_File/mo/matrix.gz and b/test/QCIO_File/mo/matrix.gz differ diff --git a/test/QCIO_File/mo/num_orb_sym.gz b/test/QCIO_File/mo/num_orb_sym.gz index 0f642ab..c7d6bcf 100644 Binary files a/test/QCIO_File/mo/num_orb_sym.gz and b/test/QCIO_File/mo/num_orb_sym.gz differ diff --git a/test/QCIO_File/mo/symmetry.gz b/test/QCIO_File/mo/symmetry.gz index f577f8d..fa8f58a 100644 Binary files a/test/QCIO_File/mo/symmetry.gz and b/test/QCIO_File/mo/symmetry.gz differ diff --git a/test/QCIO_File/random/.exists b/test/QCIO_File/random/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/random/number b/test/QCIO_File/random/number deleted file mode 100644 index 851112b..0000000 --- a/test/QCIO_File/random/number +++ /dev/null @@ -1 +0,0 @@ - 0.549308735950000E+11 diff --git a/test/QCIO_File/random/seed.gz b/test/QCIO_File/random/seed.gz deleted file mode 100644 index be82c27..0000000 Binary files a/test/QCIO_File/random/seed.gz and /dev/null differ diff --git a/test/QCIO_File/simulation/.exists b/test/QCIO_File/simulation/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/simulation/method b/test/QCIO_File/simulation/method deleted file mode 100644 index 5988c50..0000000 --- a/test/QCIO_File/simulation/method +++ /dev/null @@ -1 +0,0 @@ -VMC diff --git a/test/QCIO_File/simulation/num_step b/test/QCIO_File/simulation/num_step deleted file mode 100644 index c744cba..0000000 --- a/test/QCIO_File/simulation/num_step +++ /dev/null @@ -1 +0,0 @@ - 500 diff --git a/test/QCIO_File/simulation/sampling b/test/QCIO_File/simulation/sampling deleted file mode 100644 index f0f292f..0000000 --- a/test/QCIO_File/simulation/sampling +++ /dev/null @@ -1 +0,0 @@ -Langevin diff --git a/test/QCIO_File/simulation/time_step b/test/QCIO_File/simulation/time_step deleted file mode 100644 index 73773ba..0000000 --- a/test/QCIO_File/simulation/time_step +++ /dev/null @@ -1 +0,0 @@ - 2.000000000000000E-01 diff --git a/test/QCIO_File/symmetry/.exists b/test/QCIO_File/symmetry/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/system/.exists b/test/QCIO_File/system/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/walker/.exists b/test/QCIO_File/walker/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/walker/coord.gz b/test/QCIO_File/walker/coord.gz deleted file mode 100644 index 0d08e82..0000000 Binary files a/test/QCIO_File/walker/coord.gz and /dev/null differ diff --git a/test/QCIO_File/walker/num_walk b/test/QCIO_File/walker/num_walk deleted file mode 100644 index cca84bf..0000000 --- a/test/QCIO_File/walker/num_walk +++ /dev/null @@ -1 +0,0 @@ - 10 diff --git a/test/QCIO_File/wf/.exists b/test/QCIO_File/wf/.exists deleted file mode 100644 index e69de29..0000000 diff --git a/test/QCIO_File/wf/determinant.gz b/test/QCIO_File/wf/determinant.gz index 437c063..6478f3e 100644 Binary files a/test/QCIO_File/wf/determinant.gz and b/test/QCIO_File/wf/determinant.gz differ