10
0
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:
Anthony Scemama 2009-09-11 17:35:23 +02:00
parent 70c3eba68c
commit 576063dab3
49 changed files with 169 additions and 61 deletions

View File

@ -1,12 +1,12 @@
# MPI-ifort # MPI-ifort
#IRPF90 = irpf90 -DMPI #-a -d IRPF90 = irpf90 -DMPI #-a -d
#FC = mpif90 -static-intel -static-libgcc -xT -ip -finline FC = mpif90 -xT -ip -finline
#FCFLAGS= -O3 FCFLAGS= -O3
# Gfortran # Gfortran
IRPF90 = irpf90 #-DMPI #-a -d #IRPF90 = irpf90 #-DMPI #-a -d
FC = gfortran -ffree-line-length-none -static-libgcc #FC = gfortran -ffree-line-length-none -static-libgcc
FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib #FCFLAGS= -O3 -ffast-math -L ~/QCIO/lib
# Mono # Mono
#IRPF90 = irpf90 #IRPF90 = irpf90

View File

@ -1,19 +1,19 @@
recursive double precision function Boys(x,n) result(res) !recursive double precision function Boys(x,n) result(res)
implicit none ! implicit none
include 'constants.F' ! include 'constants.F'
!
real, intent(in) :: x ! real, intent(in) :: x
integer, intent(in) :: n ! integer, intent(in) :: n
!
ASSERT (x > 0.) ! ASSERT (x > 0.)
if (n == 0) then ! if (n == 0) then
res = sqrt(pi/(4.*x))*erf(sqrt(x)) ! res = sqrt(pi/(4.*x))*erf(sqrt(x))
else ! else
res = (dble(2*n-1) * Boys(x,(n-1)) - exp(-x) )/(2.*x) ! res = (dble(2*n-1) * Boys(x,(n-1)) - exp(-x) )/(2.*x)
endif ! endif
!
end function !end function
double precision function fact2(n) double precision function fact2(n)
implicit none implicit none

View File

@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, ao_num ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_num_contr(ao_num) call qcio_get_basis_num_contr(ao_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
assert (ao_num > 0) assert (ao_num > 0)
@ -20,6 +21,7 @@ BEGIN_PROVIDER [ integer, ao_prim_num, (ao_num) ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_num_prim(ao_prim_num) call qcio_get_basis_num_prim(ao_prim_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
@ -33,6 +35,7 @@ BEGIN_PROVIDER [ integer, ao_nucl, (ao_num) ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_atom(ao_nucl) call qcio_get_basis_atom(ao_nucl)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
@ -48,6 +51,7 @@ BEGIN_PROVIDER [ integer, ao_power, (ao_num,3) ]
integer :: i,j integer :: i,j
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_power(buffer) call qcio_get_basis_power(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
@ -110,6 +114,7 @@ END_PROVIDER
integer :: i,j integer :: i,j
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_exponent(buffer) call qcio_get_basis_exponent(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
do i=1,ao_num do i=1,ao_num
@ -119,6 +124,7 @@ END_PROVIDER
enddo enddo
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_basis_coefficient(buffer) call qcio_get_basis_coefficient(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)

19
density.irp.f Normal file
View 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

View File

@ -7,6 +7,7 @@ BEGIN_PROVIDER [ integer, elec_alpha_num ]
implicit none implicit none
elec_alpha_num = -1 elec_alpha_num = -1
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_system_num_alpha(elec_alpha_num) call qcio_get_system_num_alpha(elec_alpha_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
ASSERT (elec_alpha_num > 0) ASSERT (elec_alpha_num > 0)
@ -22,6 +23,7 @@ BEGIN_PROVIDER [ integer, elec_beta_num ]
implicit none implicit none
elec_beta_num = -1 elec_beta_num = -1
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_system_num_beta(elec_beta_num) call qcio_get_system_num_beta(elec_beta_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
ASSERT (elec_beta_num >= 0) ASSERT (elec_beta_num >= 0)

View File

@ -3,7 +3,9 @@ BEGIN_PROVIDER [ real, eplf_gamma ]
BEGIN_DOC BEGIN_DOC
! Value of the gaussian for the EPLF ! Value of the gaussian for the EPLF
END_DOC END_DOC
eplf_gamma = 10000. real :: eps
eps = -real(dlog(tiny(1.d0)))
eplf_gamma = density_p**(2./3.) * 100.*eps
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_eplf_integral_matrix, (ao_num,ao_num) ] 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. ! Value of the EPLF at the current point.
END_DOC END_DOC
double precision :: aa, ab double precision :: aa, ab
double precision, parameter :: eps = tiny(1.d0)
aa = eplf_up_up aa = eplf_up_up
ab = eplf_up_dn ab = eplf_up_dn
aa = min(1.d0,aa) if ( (aa > 0.d0).and.(ab > 0.d0) ) then
ab = min(1.d0,ab) aa = min(1.d0,aa)
aa = max(tiny(1.d0),aa) ab = min(1.d0,ab)
ab = max(tiny(1.d0),ab) aa = -(dlog(aa)/eplf_gamma)
aa = -(dlog(aa)/eplf_gamma)+tiny(1.d0) ab = -(dlog(ab)/eplf_gamma)
ab = -(dlog(ab)/eplf_gamma)+tiny(1.d0) aa = dsqrt(aa)
aa = dsqrt(aa) ab = dsqrt(ab)
ab = dsqrt(ab) eplf_value = (aa-ab)/(aa+ab+eps)
else
eplf_value = (aa-ab)/(aa+ab) eplf_value = 0.d0
endif
END_PROVIDER END_PROVIDER

View File

@ -1,11 +1,7 @@
program eplf_hf program eplf_hf
PROVIDE ao_prim_num_max
call write_grid_eplf() call write_grid_eplf()
IRP_IF MPI call finish()
integer :: ierr
call MPI_FINALIZE(ierr)
IRP_ENDIF
end end

37
info.irp.f Normal file
View 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

View File

@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, mo_closed_num ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_num_closed(mo_closed_num) call qcio_get_mo_num_closed(mo_closed_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
ASSERT (mo_closed_num >= 0) ASSERT (mo_closed_num >= 0)
@ -22,6 +23,7 @@ BEGIN_PROVIDER [ integer, mo_active_num ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_num_active(mo_active_num) call qcio_get_mo_num_active(mo_active_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
ASSERT (mo_active_num >= 0) ASSERT (mo_active_num >= 0)
@ -38,6 +40,7 @@ BEGIN_PROVIDER [ real, mo_occ, (mo_num) ]
double precision, allocatable :: buffer(:) double precision, allocatable :: buffer(:)
allocate ( buffer(mo_tot_num) ) allocate ( buffer(mo_tot_num) )
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_occupation(buffer) call qcio_get_mo_occupation(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
integer :: i integer :: i
@ -72,6 +75,7 @@ BEGIN_PROVIDER [ real, mo_coef, (ao_num,mo_num) ]
allocate (buffer(ao_num,mo_tot_num)) allocate (buffer(ao_num,mo_tot_num))
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_matrix(buffer) call qcio_get_mo_matrix(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
do j=1,mo_num do j=1,mo_num
@ -129,6 +133,7 @@ BEGIN_PROVIDER [ logical, mo_is_closed, (mo_num) ]
character, allocatable :: buffer(:) character, allocatable :: buffer(:)
allocate (buffer(mo_num)) allocate (buffer(mo_num))
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_classif(buffer) call qcio_get_mo_classif(buffer)
!$OMP END CRITICAL !$OMP END CRITICAL
@ -154,6 +159,7 @@ BEGIN_PROVIDER [ integer, mo_tot_num ]
! Total number of MOs in the QCIO file ! Total number of MOs in the QCIO file
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_mo_num_orb_tot(mo_tot_num) call qcio_get_mo_num_orb_tot(mo_tot_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
ASSERT (mo_tot_num > 0) ASSERT (mo_tot_num > 0)

View File

@ -1,35 +1,77 @@
BEGIN_PROVIDER [ integer, mpi_rank ] subroutine start_mpi
&BEGIN_PROVIDER [ integer, mpi_size ]
&BEGIN_PROVIDER [ logical, mpi_master ]
implicit none implicit none
integer :: ierr
integer, save :: started = 0
IRP_IF MPI 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 IRP_ENDIF
end
BEGIN_PROVIDER [ integer, mpi_rank ]
implicit none
BEGIN_DOC BEGIN_DOC
! mpi_rank : ID of the current processor ! Number of the processor
!
! mpi_size : Total number of processors
!
! mpi_master : True if the current processor is the master
END_DOC END_DOC
mpi_size = 1 IRP_IF MPI
mpi_rank = 0 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 mpi_rank = 0
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, mpi_rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, mpi_size, ierr)
IRP_ENDIF 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 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

View File

@ -6,6 +6,7 @@ BEGIN_PROVIDER [ integer, nucl_num ]
END_DOC END_DOC
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_geometry_num_atom(nucl_num) call qcio_get_geometry_num_atom(nucl_num)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
assert (nucl_num > 0) assert (nucl_num > 0)
@ -22,6 +23,7 @@ BEGIN_PROVIDER [ real, nucl_charge, (nucl_num) ]
double precision,allocatable :: buffer(:) double precision,allocatable :: buffer(:)
allocate(buffer(nucl_num)) allocate(buffer(nucl_num))
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_geometry_charge(buffer) call qcio_get_geometry_charge(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)
@ -42,6 +44,7 @@ BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ]
allocate (buffer(3,nucl_num)) allocate (buffer(3,nucl_num))
!$OMP CRITICAL (qcio_critical) !$OMP CRITICAL (qcio_critical)
PROVIDE qcio_filename
call qcio_get_geometry_coord(buffer) call qcio_get_geometry_coord(buffer)
!$OMP END CRITICAL (qcio_critical) !$OMP END CRITICAL (qcio_critical)

View File

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.

View File

@ -1 +0,0 @@
F

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
0.549308735950000E+11

Binary file not shown.

View File

@ -1 +0,0 @@
VMC

View File

@ -1 +0,0 @@
500

View File

@ -1 +0,0 @@
Langevin

View File

@ -1 +0,0 @@
2.000000000000000E-01

Binary file not shown.

View File

@ -1 +0,0 @@
10

Binary file not shown.