mirror of
https://gitlab.com/scemama/eplf
synced 2024-12-22 12:23:50 +01:00
qcio file as an argument
This commit is contained in:
parent
70c3eba68c
commit
576063dab3
12
Makefile
12
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
|
||||
|
30
Util.irp.f
30
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
|
||||
|
6
ao.irp.f
6
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)
|
||||
|
||||
|
19
density.irp.f
Normal file
19
density.irp.f
Normal file
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
26
eplf.irp.f
26
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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
37
info.irp.f
Normal file
37
info.irp.f
Normal file
@ -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
|
||||
|
6
mo.irp.f
6
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)
|
||||
|
76
mpi.irp.f
76
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
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
F
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
0.549308735950000E+11
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
VMC
|
@ -1 +0,0 @@
|
||||
500
|
@ -1 +0,0 @@
|
||||
Langevin
|
@ -1 +0,0 @@
|
||||
2.000000000000000E-01
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
10
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user