10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-26 07:02:14 +02:00

Compiles with gfortran. Closes #33

This commit is contained in:
Anthony Scemama 2015-03-24 09:39:13 +01:00
parent 6d1881d8f7
commit 85d611c1ba
8 changed files with 126 additions and 40 deletions

View File

@ -92,3 +92,7 @@ ocaml/Qptypes.ml:
@sleep 1
QPACKAGE_ROOT=$$PWD ./scripts/install_ocaml.sh | tee install_ocaml.log
veryclean:
rm -f EZFIO
$(MAKE) EZFIO
$(MAKE) -C src veryclean

View File

@ -214,13 +214,13 @@ logical function is_a_two_holes_two_particles(key_in)
integer :: i,i_diff
i_diff = 0
if(N_int == 1)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
+ popcnt( iand( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ), virt_bitmask(1,2)) )
else if(N_int == 2)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -231,7 +231,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ), virt_bitmask(2,2)) )
else if(N_int == 3)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -245,7 +245,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1))), virt_bitmask(3,1) ), virt_bitmask(3,1)) ) &
+ popcnt( iand( iand( xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1))), virt_bitmask(3,2) ), virt_bitmask(3,2)) )
else if(N_int == 4)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -263,7 +263,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(4,1),iand(key_in(4,1),cas_bitmask(4,1,1))), virt_bitmask(4,1) ), virt_bitmask(4,1)) ) &
+ popcnt( iand( iand( xor(key_in(4,2),iand(key_in(4,2),cas_bitmask(4,2,1))), virt_bitmask(4,2) ), virt_bitmask(4,2)) )
else if(N_int == 5)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -285,7 +285,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(5,1),iand(key_in(5,1),cas_bitmask(5,1,1))), virt_bitmask(5,1) ), virt_bitmask(5,1)) ) &
+ popcnt( iand( iand( xor(key_in(5,2),iand(key_in(5,2),cas_bitmask(5,2,1))), virt_bitmask(5,2) ), virt_bitmask(5,2)) )
else if(N_int == 6)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -311,7 +311,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(6,1),iand(key_in(6,1),cas_bitmask(6,1,1))), virt_bitmask(6,1) ), virt_bitmask(6,1)) ) &
+ popcnt( iand( iand( xor(key_in(6,2),iand(key_in(6,2),cas_bitmask(6,2,1))), virt_bitmask(6,2) ), virt_bitmask(6,2)) )
else if(N_int == 7)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -341,7 +341,7 @@ logical function is_a_two_holes_two_particles(key_in)
+ popcnt( iand( iand( xor(key_in(7,1),iand(key_in(7,1),cas_bitmask(7,1,1))), virt_bitmask(7,1) ), virt_bitmask(7,1)) ) &
+ popcnt( iand( iand( xor(key_in(7,2),iand(key_in(7,2),cas_bitmask(7,2,1))), virt_bitmask(7,2) ), virt_bitmask(7,2)) )
else if(N_int == 8)then
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), inact_bitmask(1,1)) ) &
+ popcnt( xor( iand(inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), inact_bitmask(1,2)) ) &
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
@ -378,7 +378,7 @@ logical function is_a_two_holes_two_particles(key_in)
else
do i = 1, N_int
i_diff = i_diff + &
i_diff = i_diff &
+ popcnt( xor( iand(inact_bitmask(i,1), xor(key_in(i,1),iand(key_in(i,1),cas_bitmask(i,1,1)))), inact_bitmask(i,1)) ) &
+ popcnt( xor( iand(inact_bitmask(i,2), xor(key_in(i,2),iand(key_in(i,2),cas_bitmask(i,2,1)))), inact_bitmask(i,2)) ) &
+ popcnt( iand( iand( xor(key_in(i,1),iand(key_in(i,1),cas_bitmask(i,1,1))), virt_bitmask(i,1) ), virt_bitmask(i,1)) ) &

View File

@ -4,6 +4,7 @@ subroutine save_casino
character*(128) :: message
integer :: getUnitAndOpen, iunit
integer, allocatable :: itmp(:)
integer :: n_ao_new
real, allocatable :: rtmp(:)
PROVIDE ezfio_filename
@ -75,7 +76,8 @@ subroutine save_casino
icount += 2*ao_l(i)+1
endif
enddo
write(iunit,*) icount
n_ao_new = icount
write(iunit,*) n_ao_new
write(iunit,'(A)') 'Number of Gaussian primitives per primitive cell'
allocate(itmp(ao_num))
integer :: l
@ -175,6 +177,89 @@ subroutine save_casino
write(iunit,'(A)')
write(iunit,'(A)') 'MULTIDETERMINANT INFORMATION'
write(iunit,'(A)') '----------------------------'
write(iunit,'(A)') 'GS'
write(iunit,'(A)') 'ORBITAL COEFFICIENTS'
write(iunit,'(A)') '------------------------'
! Transformation cartesian -> spherical
double precision :: tf2(6,5), tf3(10,7), tf4(15,9)
integer :: check2(3,6), check3(3,10), check4(3,15)
check2(:,1) = (/ 2, 0, 0 /)
check2(:,2) = (/ 1, 1, 0 /)
check2(:,3) = (/ 1, 0, 1 /)
check2(:,4) = (/ 0, 2, 0 /)
check2(:,5) = (/ 0, 1, 1 /)
check2(:,6) = (/ 0, 0, 2 /)
check3(:,1) = (/ 3, 0, 0 /)
check3(:,2) = (/ 2, 1, 0 /)
check3(:,3) = (/ 2, 0, 1 /)
check3(:,4) = (/ 1, 2, 0 /)
check3(:,5) = (/ 1, 1, 1 /)
check3(:,6) = (/ 1, 0, 2 /)
check3(:,7) = (/ 0, 3, 0 /)
check3(:,8) = (/ 0, 2, 1 /)
check3(:,9) = (/ 0, 1, 2 /)
check3(:,10) = (/ 0, 0, 3 /)
check4(:,1) = (/ 4, 0, 0 /)
check4(:,2) = (/ 3, 1, 0 /)
check4(:,3) = (/ 3, 0, 1 /)
check4(:,4) = (/ 2, 2, 0 /)
check4(:,5) = (/ 2, 1, 1 /)
check4(:,6) = (/ 2, 0, 2 /)
check4(:,7) = (/ 1, 3, 0 /)
check4(:,8) = (/ 1, 2, 1 /)
check4(:,9) = (/ 1, 1, 2 /)
check4(:,10) = (/ 1, 0, 3 /)
check4(:,11) = (/ 0, 4, 0 /)
check4(:,12) = (/ 0, 3, 1 /)
check4(:,13) = (/ 0, 2, 2 /)
check4(:,14) = (/ 0, 1, 3 /)
check4(:,15) = (/ 0, 0, 4 /)
! tf2 = (/
! -0.5, 0, 0, -0.5, 0, 1.0, &
! 0, 0, 1.0, 0, 0, 0, &
! 0, 0, 0, 0, 1.0, 0, &
! 0.86602540378443864676, 0, 0, -0.86602540378443864676, 0, 0, &
! 0, 1.0, 0, 0, 0, 0, &
! /)
! tf3 = (/
! 0, 0, -0.67082039324993690892, 0, 0, 0, 0, -0.67082039324993690892, 0, 1.0, &
! -0.61237243569579452455, 0, 0, -0.27386127875258305673, 0, 1.0954451150103322269, 0, 0, 0, 0, &
! 0, -0.27386127875258305673, 0, 0, 0, 0, -0.61237243569579452455, 0, 1.0954451150103322269, 0, &
! 0, 0, 0.86602540378443864676, 0, 0, 0, 0, -0.86602540378443864676, 0, 0, &
! 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 0, &
! 0.790569415042094833, 0, 0, -1.0606601717798212866, 0, 0, 0, 0, 0, 0, &
! 0, 1.0606601717798212866, 0, 0, 0, 0, -0.790569415042094833, 0, 0, 0, &
! /)
! tf4 = (/
! 0.375, 0, 0, 0.21957751641341996535, 0, -0.87831006565367986142, 0, 0, 0, 0, 0.375, 0, -0.87831006565367986142, 0, 1.0, &
! 0, 0, -0.89642145700079522998, 0, 0, 0, 0, -0.40089186286863657703, 0, 1.19522860933439364, 0, 0, 0, 0, 0, &
! 0, 0, 0, 0, -0.40089186286863657703, 0, 0, 0, 0, 0, 0, -0.89642145700079522998, 0, 1.19522860933439364, 0, &
! -0.5590169943749474241, 0, 0, 0, 0, 0.9819805060619657157, 0, 0, 0, 0, 0.5590169943749474241, 0, -0.9819805060619657157, 0, 0, &
! 0, -0.42257712736425828875, 0, 0, 0, 0, -0.42257712736425828875, 0, 1.1338934190276816816, 0, 0, 0, 0, 0, 0, &
! 0, 0, 0.790569415042094833, 0, 0, 0, 0, -1.0606601717798212866, 0, 0, 0, 0, 0, 0, 0, &
! 0, 0, 0, 0, 1.0606601717798212866, 0, 0, 0, 0, 0, 0, -0.790569415042094833, 0, 0, 0, &
! 0.73950997288745200532, 0, 0, -1.2990381056766579701, 0, 0, 0, 0, 0, 0, 0.73950997288745200532, 0, 0, 0, 0, &
! 0, 1.1180339887498948482, 0, 0, 0, 0, -1.1180339887498948482, 0, 0, 0, 0, 0, 0, 0, 0, &
! /)
!
allocate(rtmp(ao_num*mo_tot_num))
l=0
do i=1,mo_tot_num
do j=1,ao_num
l += 1
rtmp(l) = mo_coef(j,i)
enddo
enddo
write(iunit,'(4(1PE20.13))') rtmp(1:l)
deallocate(rtmp)
close(iunit)
end

View File

@ -11,27 +11,27 @@ s.set_perturbation("epstein_nesbet_2x2")
print s
s = H_apply("FCI_mono")
s.set_selection_pt2("epstein_nesbet_2x2")
s.unset_double_excitations()
print s
if False:
s = H_apply("FCI_mono")
s.set_selection_pt2("epstein_nesbet_2x2")
s.unset_double_excitations()
print s
s = H_apply("select_mono_delta_rho")
s.unset_double_excitations()
s.set_selection_pt2("delta_rho_one_point")
print s
s = H_apply("select_mono_delta_rho")
s.unset_double_excitations()
s.set_selection_pt2("delta_rho_one_point")
print s
s = H_apply("pt2_mono_delta_rho")
s.unset_double_excitations()
s.set_perturbation("delta_rho_one_point")
print s
s = H_apply("select_mono_di_delta_rho")
s.set_selection_pt2("delta_rho_one_point")
print s
s = H_apply("pt2_mono_delta_rho")
s.unset_double_excitations()
s.set_perturbation("delta_rho_one_point")
print s
s = H_apply("pt2_mono_di_delta_rho")
s.set_perturbation("delta_rho_one_point")
print s

View File

@ -3,10 +3,12 @@ PROFILE =0
DEBUG = 0
IRPF90_FLAGS=
FC = gfortran -ffree-line-length-none
FCFLAGS=
FCFLAGS+= -O2
MKL=-L /opt/intel/composerxe/mkl/lib/intel64/ -lmkl_gf_lp64 -lmkl_core -lmkl_gnu_thread -fopenmp
FC = gfortran -ffree-line-length-none -march=native
FCFLAGS= -ffast-math
FCFLAGS+= -Ofast
MKL=-lblas -llapack
# Uncomment to use gfortan with MKL
#MKL=-L /opt/intel/composerxe/mkl/lib/intel64/ -lmkl_gf_lp64 -lmkl_core -lmkl_gnu_thread -fopenmp
ifeq ($(PROFILE),1)
FC += -p -g

View File

@ -132,7 +132,7 @@
! <fortran>
double precision function gammp(a,x)
implicit double precision (a-h,o-z)
if(x.lt.0..or.a.le.0.)pause
if(x.lt.0..or.a.le.0.)stop 'error in gammp'
if(x.lt.a+1.)then
call gser(gammp,a,x,gln)
else
@ -169,7 +169,7 @@
parameter (itmax=100,eps=3.e-7)
gln=gammln(a)
if(x.le.0.)then
if(x.lt.0.)pause
if(x.lt.0.) stop 'error in gser'
gamser=0.
return
endif
@ -182,7 +182,7 @@
sum=sum+del
if(abs(del).lt.abs(sum)*eps)go to 1
11 continue
pause 'a too large, itmax too small'
stop 'a too large, itmax too small'
1 gamser=sum*exp(-x+a*log(x)-gln)
return
end
@ -233,7 +233,7 @@
gold=g
endif
11 continue
pause 'a too large, itmax too small'
stop 'a too large, itmax too small'
1 gammcf=exp(-x+a*log(x)-gln)*g
return
end

View File

@ -17,16 +17,13 @@ BEGIN_PROVIDER [ logical, abort_here ]
END_PROVIDER
subroutine trap_signals
use ifport
implicit none
BEGIN_DOC
! What to do when a signal is caught. Here, trap Ctrl-C and call the control_C subroutine.
END_DOC
integer, external :: catch_signal
integer :: err, flag
integer, parameter :: sigusr2 = 12
flag = -1
err = signal (sigusr2, catch_signal, flag)
call signal (sigusr2, catch_signal)
end subroutine trap_signals
integer function catch_signal(signum)

View File

@ -38,12 +38,11 @@ end
progress_title = ''
progress_active = .False.
progress_timeout = 1
open (unit=0, carriagecontrol='fortran')
! open (unit=0, carriagecontrol='fortran')
END_PROVIDER
recursive subroutine run_progress
use ifport
implicit none
BEGIN_DOC
! Display a progress bar with documentation of what is happening
@ -70,8 +69,7 @@ recursive subroutine run_progress
bar(49+k:49+k)="="
enddo
write(unit=0,fmt="(a1,a1,a75)") '+',char(13), bar
integer :: istat
istat = alarm(progress_timeout,run_progress)
call alarm(progress_timeout,run_progress)
endif
end