10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Compiles with gfortran

This commit is contained in:
Anthony Scemama 2017-04-12 15:05:48 +02:00
parent 06efe7ca16
commit d89cbacca5
4 changed files with 33 additions and 22 deletions

View File

@ -35,7 +35,7 @@ OPENMP : 1 ; Append OpenMP flags
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast
FCFLAGS : -Ofast -march=native
# Profiling flags
#################

View File

@ -12,7 +12,7 @@ BEGIN_PROVIDER [ double precision, pt2_E0_denominator, (N_states) ]
! E0 in the denominator of the PT2
END_DOC
if (initialize_pt2_E0_denominator) then
pt2_E0_denominator(1:N_states) = CI_electronic_energy(1:N_states)
pt2_E0_denominator(1:N_states) = psi_energy(1:N_states)
! pt2_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion
! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
call write_double(6,pt2_E0_denominator(1)+nuclear_repulsion, 'PT2 Energy denominator')

View File

@ -1,8 +1,7 @@
program pt2_stoch
implicit none
initialize_pt2_E0_denominator = .False.
read_wf = .True.
SOFT_TOUCH initialize_pt2_E0_denominator read_wf
SOFT_TOUCH read_wf
PROVIDE mo_bielec_integrals_in_map
call run
end
@ -19,17 +18,12 @@ subroutine run
double precision :: E_CI_before(N_states), relative_error
if (.true.) then
call ezfio_get_full_ci_zmq_energy(E_CI_before(1))
pt2_e0_denominator(:) = E_CI_before(1) - nuclear_repulsion
SOFT_TOUCH pt2_e0_denominator read_wf
endif
allocate (pt2(N_states))
pt2 = 0.d0
threshold_selectors = 1.d0
threshold_generators = 1d0
relative_error = 1.d-6
relative_error = 1.d-4
call ZMQ_pt2(pt2, relative_error)
print *, 'Final step'
print *, 'N_det = ', N_det

View File

@ -18,24 +18,33 @@ subroutine get_excitation_degree(key1,key2,degree,Nint)
select case (Nint)
case (1)
xorvec(1:2) = xor( key1(1:2), key2(1:2))
xorvec(1) = xor( key1(1), key2(1))
xorvec(2) = xor( key1(2), key2(2))
degree = sum(popcnt(xorvec(1:2)))
case (2)
xorvec(1:4) = xor( key1(1:4), key2(1:4))
xorvec(1) = xor( key1(1), key2(1))
xorvec(2) = xor( key1(2), key2(2))
xorvec(3) = xor( key1(3), key2(3))
xorvec(4) = xor( key1(4), key2(4))
degree = sum(popcnt(xorvec(1:4)))
case (3)
xorvec(1:6) = xor( key1(1:6), key2(1:6))
do l=1,6
xorvec(l) = xor( key1(l), key2(l))
enddo
degree = sum(popcnt(xorvec(1:6)))
case (4)
xorvec(1:8) = xor( key1(1:8), key2(1:8))
do l=1,8
xorvec(l) = xor( key1(l), key2(l))
enddo
degree = sum(popcnt(xorvec(1:8)))
case default
l = ishft(Nint,1)
xorvec(1:l) = xor( key1(1:l), key2(1:l))
do l=1,ishft(Nint,1)
xorvec(l) = xor( key1(l), key2(l))
enddo
degree = sum(popcnt(xorvec(1:l)))
end select
@ -2254,19 +2263,27 @@ subroutine get_excitation_degree_spin(key1,key2,degree,Nint)
degree = popcnt(xorvec(1))
case (2)
xorvec(1:2) = xor( key1(1:2), key2(1:2))
degree = sum(popcnt(xorvec(1:2)))
xorvec(1) = xor( key1(1), key2(1))
xorvec(2) = xor( key1(2), key2(2))
degree = popcnt(xorvec(1))+popcnt(xorvec(2))
case (3)
xorvec(1:3) = xor( key1(1:3), key2(1:3))
xorvec(1) = xor( key1(1), key2(1))
xorvec(2) = xor( key1(2), key2(2))
xorvec(3) = xor( key1(3), key2(3))
degree = sum(popcnt(xorvec(1:3)))
case (4)
xorvec(1:4) = xor( key1(1:4), key2(1:4))
xorvec(1) = xor( key1(1), key2(1))
xorvec(2) = xor( key1(2), key2(2))
xorvec(3) = xor( key1(3), key2(3))
xorvec(4) = xor( key1(4), key2(4))
degree = sum(popcnt(xorvec(1:4)))
case default
xorvec(1:Nint) = xor( key1(1:Nint), key2(1:Nint))
do l=1,N_int
xorvec(l) = xor( key1(l), key2(l))
enddo
degree = sum(popcnt(xorvec(1:Nint)))
end select