mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-02 18:08:23 +01:00
This commit is contained in:
parent
9b0c270662
commit
0242e9c376
66
config/ifort_2021_debug.cfg
Normal file
66
config/ifort_2021_debug.cfg
Normal file
@ -0,0 +1,66 @@
|
||||
# Common flags
|
||||
##############
|
||||
#
|
||||
# -mkl=[parallel|sequential] : Use the MKL library
|
||||
# --ninja : Allow the utilisation of ninja. It is mandatory !
|
||||
# --align=32 : Align all provided arrays on a 32-byte boundary
|
||||
#
|
||||
[COMMON]
|
||||
FC : ifort -fpic
|
||||
LAPACK_LIB : -mkl=parallel -lirc -lsvml -limf -lipps
|
||||
IRPF90 : irpf90
|
||||
IRPF90_FLAGS : --ninja --align=32 --assert -DINTEL
|
||||
|
||||
# Global options
|
||||
################
|
||||
#
|
||||
# 1 : Activate
|
||||
# 0 : Deactivate
|
||||
#
|
||||
[OPTION]
|
||||
MODE : DEBUG ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
|
||||
CACHE : 0 ; Enable cache_compile.py
|
||||
OPENMP : 1 ; Append OpenMP flags
|
||||
|
||||
# Optimization flags
|
||||
####################
|
||||
#
|
||||
# -xHost : Compile a binary optimized for the current architecture
|
||||
# -O2 : O3 not better than O2.
|
||||
# -ip : Inter-procedural optimizations
|
||||
# -ftz : Flushes denormal results to zero
|
||||
#
|
||||
[OPT]
|
||||
FC : -traceback
|
||||
FCFLAGS : -msse4.2 -O2 -ip -ftz -g
|
||||
|
||||
|
||||
# Profiling flags
|
||||
#################
|
||||
#
|
||||
[PROFILE]
|
||||
FC : -p -g
|
||||
FCFLAGS : -msse4.2 -O2 -ip -ftz
|
||||
|
||||
|
||||
# Debugging flags
|
||||
#################
|
||||
#
|
||||
# -traceback : Activate backtrace on runtime
|
||||
# -fpe0 : All floating point exaceptions
|
||||
# -C : Checks uninitialized variables, array subscripts, etc...
|
||||
# -g : Extra debugging information
|
||||
# -msse4.2 : Valgrind needs a very simple x86 executable
|
||||
#
|
||||
[DEBUG]
|
||||
FC : -g -traceback
|
||||
FCFLAGS : -msse4.2 -check all -debug all -fpe-all=0 -implicitnone
|
||||
|
||||
|
||||
# OpenMP flags
|
||||
#################
|
||||
#
|
||||
[OPENMP]
|
||||
FC : -qopenmp
|
||||
IRPF90_FLAGS : --openmp
|
||||
|
@ -1,47 +1,3 @@
|
||||
BEGIN_PROVIDER [ integer, mini_basis_size, (128) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Size of the minimal basis set per element
|
||||
END_DOC
|
||||
|
||||
mini_basis_size(1:2) = 1
|
||||
mini_basis_size(3:4) = 2
|
||||
mini_basis_size(5:10) = 5
|
||||
mini_basis_size(11:12) = 6
|
||||
mini_basis_size(13:18) = 9
|
||||
mini_basis_size(19:20) = 13
|
||||
mini_basis_size(21:36) = 18
|
||||
mini_basis_size(37:38) = 22
|
||||
mini_basis_size(39:54) = 27
|
||||
mini_basis_size(55:) = 36
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ integer, cholesky_ao_num_guess ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Number of Cholesky vectors in AO basis
|
||||
END_DOC
|
||||
|
||||
cholesky_ao_num_guess = ao_num*ao_num
|
||||
cholesky_ao_num_guess = 2* ao_num * sum(mini_basis_size(int(nucl_charge(:))))
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ integer, cholesky_ao_num ]
|
||||
&BEGIN_PROVIDER [ double precision, cholesky_ao, (ao_num, ao_num, cholesky_ao_num_guess) ]
|
||||
use mmap_module
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Cholesky vectors in AO basis: (ik|a):
|
||||
! <ij|kl> = (ik|jl) = sum_a (ik|a).(a|jl)
|
||||
END_DOC
|
||||
|
||||
cholesky_ao_num = cholesky_ao_num_guess
|
||||
|
||||
call direct_cholesky(cholesky_ao, ao_num*ao_num, cholesky_ao_num, ao_cholesky_threshold)
|
||||
print *, 'Rank : ', cholesky_ao_num, '(', 100.d0*dble(cholesky_ao_num)/dble(ao_num*ao_num), ' %)'
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ double precision, cholesky_ao_transp, (cholesky_ao_num, ao_num, ao_num) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
@ -58,36 +14,55 @@ BEGIN_PROVIDER [ double precision, cholesky_ao_transp, (cholesky_ao_num, ao_num,
|
||||
END_PROVIDER
|
||||
|
||||
|
||||
subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
BEGIN_PROVIDER [ integer, cholesky_ao_num ]
|
||||
&BEGIN_PROVIDER [ double precision, cholesky_ao, (ao_num, ao_num, 1) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Cholesky-decomposed AOs.
|
||||
!
|
||||
! https://www.diva-portal.org/smash/get/diva2:396223/FULLTEXT01.pdf :
|
||||
! Page 32, section 13.5
|
||||
! Cholesky vectors in AO basis: (ik|a):
|
||||
! <ij|kl> = (ik|jl) = sum_a (ik|a).(a|jl)
|
||||
!
|
||||
! Last dimension of cholesky_ao is cholesky_ao_num
|
||||
END_DOC
|
||||
integer :: ndim
|
||||
integer, intent(out) :: rank
|
||||
double precision, intent(out) :: L(ndim, ndim)
|
||||
double precision, intent(in) :: tau
|
||||
|
||||
integer :: rank, ndim
|
||||
double precision :: tau
|
||||
double precision, pointer :: L(:,:), L_old(:,:)
|
||||
|
||||
|
||||
double precision, parameter :: s = 1.d-2
|
||||
double precision, parameter :: dscale = 1.d0
|
||||
|
||||
double precision, allocatable :: D(:), Delta(:,:), Ltmp_p(:,:), Ltmp_q(:,:)
|
||||
integer*8, allocatable :: Lset(:), Dset(:), addr(:,:), LDmap(:), DLmap(:)
|
||||
integer*8, allocatable :: Lset_rev(:), Dset_rev(:)
|
||||
integer, allocatable :: Lset(:), Dset(:), addr(:,:), LDmap(:), DLmap(:)
|
||||
integer, allocatable :: Lset_rev(:), Dset_rev(:)
|
||||
|
||||
integer*8 :: i,j,k,m,p,q, qj, dj, p2, q2
|
||||
integer*8 :: N, np, nq
|
||||
integer :: i,j,k,m,p,q, qj, dj, p2, q2
|
||||
integer :: N, np, nq
|
||||
|
||||
double precision :: Dmax, Dmin, Qmax, f
|
||||
double precision, external :: get_ao_two_e_integral
|
||||
logical, external :: ao_two_e_integral_zero
|
||||
|
||||
integer :: block_size, iblock
|
||||
integer :: block_size, iblock, ierr
|
||||
|
||||
PROVIDE ao_two_e_integrals_in_map
|
||||
deallocate(cholesky_ao)
|
||||
|
||||
ndim = ao_num*ao_num
|
||||
tau = ao_cholesky_threshold
|
||||
|
||||
|
||||
allocate(L(ndim,1))
|
||||
|
||||
print *, ''
|
||||
print *, 'Cholesky decomposition of AO integrals'
|
||||
print *, '======================================'
|
||||
print *, ''
|
||||
print *, '============ ============='
|
||||
print *, ' Rank Threshold'
|
||||
print *, '============ ============='
|
||||
|
||||
|
||||
print *, 'Entering Cholesky'
|
||||
rank = 0
|
||||
|
||||
allocate( D(ndim), Lset(ndim), LDmap(ndim), DLmap(ndim), Dset(ndim) )
|
||||
@ -155,10 +130,40 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
enddo
|
||||
|
||||
! d., e.
|
||||
block_size = max(N,32)
|
||||
allocate(Delta(np,nq), &
|
||||
Ltmp_p(max(np,1),block_size), &
|
||||
Ltmp_q(max(nq,1),block_size) )
|
||||
block_size = max(N,24)
|
||||
|
||||
L_old => L
|
||||
allocate(L(ndim,rank+nq), stat=ierr)
|
||||
if (ierr /= 0) then
|
||||
print *, irp_here, ': allocation failed : (Delta(np,nq))'
|
||||
stop -1
|
||||
endif
|
||||
|
||||
!$OMP PARALLEL DO PRIVATE(k)
|
||||
do k=1,rank
|
||||
L(:,k) = L_old(:,k)
|
||||
enddo
|
||||
!$OMP END PARALLEL DO
|
||||
|
||||
deallocate(L_old)
|
||||
|
||||
allocate(Delta(np,nq), stat=ierr)
|
||||
if (ierr /= 0) then
|
||||
print *, irp_here, ': allocation failed : (Delta(np,nq))'
|
||||
stop -1
|
||||
endif
|
||||
|
||||
allocate(Ltmp_p(np,block_size), stat=ierr)
|
||||
if (ierr /= 0) then
|
||||
print *, irp_here, ': allocation failed : (Ltmp_p(np,block_size))'
|
||||
stop -1
|
||||
endif
|
||||
|
||||
allocate(Ltmp_q(nq,block_size), stat=ierr)
|
||||
if (ierr /= 0) then
|
||||
print *, irp_here, ': allocation failed : (Ltmp_q(nq,block_size))'
|
||||
stop -1
|
||||
endif
|
||||
|
||||
!$OMP PARALLEL DEFAULT(SHARED) PRIVATE(m,k,p,q)
|
||||
|
||||
@ -176,19 +181,18 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
!$OMP DO SCHEDULE(dynamic,8)
|
||||
do m=1,nq
|
||||
|
||||
Delta(:,m) = 0.d0
|
||||
do k=1, nq
|
||||
! Apply only to (k,m) pairs both in Dset
|
||||
p = DLmap(k)
|
||||
q = Lset_rev(addr(3,Dset(k)))
|
||||
if ((0 < q).and.(q < p)) cycle
|
||||
if (ao_two_e_integral_zero( addr(1,Dset(k)), addr(1,Dset(m)), &
|
||||
if (.not.ao_two_e_integral_zero( addr(1,Dset(k)), addr(1,Dset(m)), &
|
||||
addr(2,Dset(k)), addr(2,Dset(m)) ) ) then
|
||||
Delta(p,m) = 0.d0
|
||||
else
|
||||
Delta(p,m) = get_ao_two_e_integral( addr(1,Dset(k)), addr(1,Dset(m)), &
|
||||
addr(2,Dset(k)), addr(2,Dset(m)), ao_integrals_map)
|
||||
Delta(q,m) = Delta(p,m)
|
||||
endif
|
||||
Delta(q,m) = Delta(p,m)
|
||||
enddo
|
||||
|
||||
do k=1,np
|
||||
@ -196,22 +200,22 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
if (LDmap(k) /= 0) cycle
|
||||
q = Lset_rev(addr(3,Lset(k)))
|
||||
if ((0 < q).and.(q < k)) cycle
|
||||
if (ao_two_e_integral_zero( addr(1,Lset(k)), addr(1,Dset(m)), &
|
||||
if (.not.ao_two_e_integral_zero( addr(1,Lset(k)), addr(1,Dset(m)), &
|
||||
addr(2,Lset(k)), addr(2,Dset(m)) ) ) then
|
||||
Delta(k,m) = 0.d0
|
||||
else
|
||||
Delta(k,m) = get_ao_two_e_integral( addr(1,Lset(k)), addr(1,Dset(m)), &
|
||||
addr(2,Lset(k)), addr(2,Dset(m)), ao_integrals_map)
|
||||
Delta(q,m) = Delta(k,m)
|
||||
endif
|
||||
Delta(q,m) = Delta(k,m)
|
||||
enddo
|
||||
enddo
|
||||
!$OMP END DO
|
||||
|
||||
!$OMP END PARALLEL
|
||||
|
||||
call dgemm('N','T', int(np,4), int(nq,4), int(N,4), -1.d0, &
|
||||
Ltmp_p, int(np,4), Ltmp_q, int(nq,4), 1.d0, Delta, int(np,4))
|
||||
if (N>0) then
|
||||
call dgemm('N','T', np, nq, N, -1.d0, &
|
||||
Ltmp_p, np, Ltmp_q, nq, 1.d0, Delta, np)
|
||||
endif
|
||||
|
||||
! f.
|
||||
Qmax = D(Dset(1))
|
||||
@ -242,14 +246,18 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
endif
|
||||
enddo
|
||||
|
||||
L(:, rank) = 0.d0
|
||||
L(1:ndim, rank) = 0.d0
|
||||
|
||||
iblock = iblock+1
|
||||
do p=1,np
|
||||
Ltmp_p(p,iblock) = Delta(p,dj)
|
||||
enddo
|
||||
call dgemv('N', np, iblock-1, -1.d0, Ltmp_p, np, Ltmp_q(dj,1), nq, 1.d0, &
|
||||
|
||||
! iv.
|
||||
if (iblock > 1) then
|
||||
call dgemv('N', np, iblock-1, -1.d0, Ltmp_p, np, Ltmp_q(dj,1), nq, 1.d0, &
|
||||
Ltmp_p(1,iblock), 1)
|
||||
endif
|
||||
|
||||
! iii.
|
||||
f = 1.d0/dsqrt(Qmax)
|
||||
@ -269,27 +277,20 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
enddo
|
||||
!$OMP END DO
|
||||
|
||||
! iv.
|
||||
|
||||
! !$OMP DO SCHEDULE(static)
|
||||
! do m=1, nq
|
||||
! do k=1, np
|
||||
! Delta(k,m) = Delta(k,m) - Ltmp_p(k,iblock) * Ltmp_q(m,iblock)
|
||||
! enddo
|
||||
! enddo
|
||||
! !$OMP END DO
|
||||
|
||||
!$OMP END PARALLEL
|
||||
|
||||
Qmax = D(Dset(1))
|
||||
do q=1,np
|
||||
Qmax = max(Qmax, D(Lset(q)))
|
||||
do q=1,nq
|
||||
Qmax = max(Qmax, D(Dset(q)))
|
||||
enddo
|
||||
|
||||
enddo
|
||||
print *, Qmax
|
||||
|
||||
deallocate(Delta, Ltmp_p, Ltmp_q)
|
||||
print '(I10, 4X, ES12.3)', rank, Qmax
|
||||
|
||||
deallocate(Delta, stat=ierr)
|
||||
deallocate(Ltmp_p, stat=ierr)
|
||||
deallocate(Ltmp_q, stat=ierr)
|
||||
|
||||
! i.
|
||||
N = N+j
|
||||
@ -312,4 +313,15 @@ subroutine direct_cholesky(L, ndim, rank, tau)
|
||||
|
||||
enddo
|
||||
|
||||
end
|
||||
allocate(cholesky_ao(ao_num,ao_num,rank))
|
||||
call dcopy(ndim*rank, L, 1, cholesky_ao, 1)
|
||||
deallocate(L)
|
||||
cholesky_ao_num = rank
|
||||
|
||||
print *, '============ ============='
|
||||
print *, ''
|
||||
print *, 'Rank : ', cholesky_ao_num, '(', 100.d0*dble(cholesky_ao_num)/dble(ao_num*ao_num), ' %)'
|
||||
print *, ''
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
|
@ -112,7 +112,7 @@ subroutine run_ccsd_space_orb
|
||||
|
||||
! Energy
|
||||
call ccsd_energy_space(nO,nV,tau,t1,energy)
|
||||
write(*,'(A3,I6,A3,F18.12,A3,F16.12,A3,1pE10.2,A3,1pE10.2,A2)') ' | ',nb_iter,' | ', uncorr_energy+energy,' | ', energy,' | ', max_r1,' | ', max_r2,' |'
|
||||
write(*,'(A3,I6,A3,F18.12,A3,F16.12,A3,ES10.2,A3,ES10.2,A2)') ' | ',nb_iter,' | ', uncorr_energy+energy,' | ', energy,' | ', max_r1,' | ', max_r2,' |'
|
||||
|
||||
nb_iter = nb_iter + 1
|
||||
if (max_r < cc_thresh_conv .or. nb_iter > cc_max_iter) then
|
||||
@ -132,7 +132,7 @@ subroutine run_ccsd_space_orb
|
||||
print*,''
|
||||
write(*,'(A15,F18.12,A3)') ' E(CCSD) = ', uncorr_energy+energy, ' Ha'
|
||||
write(*,'(A15,F18.12,A3)') ' Correlation = ', energy, ' Ha'
|
||||
write(*,'(A15,1pE10.2,A3)')' Conv = ', max_r
|
||||
write(*,'(A15,ES10.2,A3)')' Conv = ', max_r
|
||||
print*,''
|
||||
|
||||
if (write_amplitudes) then
|
||||
|
@ -241,7 +241,7 @@ subroutine run_ccsd_spin_orb
|
||||
call ccsd_energy_spin(nO,nV,t1,t2,F_ov,v_oovv,energy)
|
||||
call wall_time(tfi)
|
||||
|
||||
write(*,'(A3,I6,A3,F18.12,A3,F16.12,A3,1pE10.2,A3,1pE10.2,A2)') ' | ',nb_iter,' | ', &
|
||||
write(*,'(A3,I6,A3,F18.12,A3,F16.12,A3,ES10.2,A3,ES10.2,A2)') ' | ',nb_iter,' | ', &
|
||||
uncorr_energy+energy,' | ', energy,' | ', max_r1,' | ', max_r2,' |'
|
||||
if (cc_dev) then
|
||||
print*,'Total:',tfi-tbi,'s'
|
||||
@ -266,7 +266,7 @@ subroutine run_ccsd_spin_orb
|
||||
print*,''
|
||||
write(*,'(A15,F18.12,A3)') ' E(CCSD) = ', uncorr_energy+energy, ' Ha'
|
||||
write(*,'(A15,F18.12,A3)') ' Correlation = ', energy, ' Ha'
|
||||
write(*,'(A15,1pE10.2,A3)')' Conv = ', max_r
|
||||
write(*,'(A15,ES10.2,A3)')' Conv = ', max_r
|
||||
print*,''
|
||||
|
||||
if (write_amplitudes) then
|
||||
|
@ -210,9 +210,9 @@ subroutine ccsd_par_t_space_stoch(nO,nV,t1,t2,f_o,f_v,v_vvvo,v_vvoo,v_vooo,energ
|
||||
Pabc(:) = 1.d0/Pabc(:)
|
||||
|
||||
print '(A)', ''
|
||||
print '(A)', ' +----------------------+--------------+----------+'
|
||||
print '(A)', ' | E(CCSD(T)) | Error | % |'
|
||||
print '(A)', ' +----------------------+--------------+----------+'
|
||||
print '(A)', ' ======================= ============== =========='
|
||||
print '(A)', ' E(CCSD(T)) Error % '
|
||||
print '(A)', ' ======================= ============== =========='
|
||||
|
||||
|
||||
call wall_time(t00)
|
||||
@ -257,7 +257,7 @@ subroutine ccsd_par_t_space_stoch(nO,nV,t1,t2,f_o,f_v,v_vvvo,v_vvoo,v_vooo,energ
|
||||
if (imin >= bounds(2,isample)) then
|
||||
cycle
|
||||
endif
|
||||
ieta = binary_search(waccu,(eta + dble(isample-1))/dble(nbuckets),Nabc)
|
||||
ieta = binary_search(waccu,(eta + dble(isample-1))/dble(nbuckets),Nabc)+1
|
||||
|
||||
if (sampled(ieta) == -1_8) then
|
||||
sampled(ieta) = 0_8
|
||||
@ -324,14 +324,14 @@ subroutine ccsd_par_t_space_stoch(nO,nV,t1,t2,f_o,f_v,v_vvvo,v_vvoo,v_vooo,energ
|
||||
|
||||
energy = energy_det + energy_stoch
|
||||
|
||||
print '('' | '',F20.8, '' | '', E12.4,'' | '', F8.2,'' |'')', eccsd+energy, dsqrt(variance/(norm-1.d0)), 100.*real(Ncomputed)/real(Nabc)
|
||||
print '('' '',F20.8, '' '', ES12.4,'' '', F8.2,'' '')', eccsd+energy, dsqrt(variance/(norm-1.d0)), 100.*real(Ncomputed)/real(Nabc)
|
||||
endif
|
||||
!$OMP END MASTER
|
||||
if (imin >= Nabc) exit
|
||||
enddo
|
||||
|
||||
!$OMP END PARALLEL
|
||||
print '(A)', ' +----------------------+--------------+----------+'
|
||||
print '(A)', ' ======================= ============== ========== '
|
||||
print '(A)', ''
|
||||
|
||||
deallocate(X_vovv)
|
||||
|
@ -591,7 +591,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2_data, pt2_data_
|
||||
time-time0
|
||||
|
||||
! Old print
|
||||
!print '(I10, X, F12.6, X, G10.3, X, F10.6, X, G10.3, X, F10.6, X, G10.3, X, F10.1,1pE16.6,1pE16.6)', c, &
|
||||
!print '(I10, X, F12.6, X, G10.3, X, F10.6, X, G10.3, X, F10.6, X, G10.3, X, F10.1,ES16.6,ES16.6)', c, &
|
||||
! pt2_data % pt2(pt2_stoch_istate) +E, &
|
||||
! pt2_data_err % pt2(pt2_stoch_istate), &
|
||||
! pt2_data % variance(pt2_stoch_istate), &
|
||||
|
@ -331,7 +331,7 @@ subroutine davidson_general_ext_rout_diag_dressed(u_in,H_jj,Dress_jj,energies,sz
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -405,7 +405,7 @@ subroutine dav_double_dressed(u_in,H_jj,Dress_jj,Dressing_vec,idx_dress,energies
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -398,7 +398,7 @@ subroutine davidson_general_ext_rout_dressed(u_in,H_jj,energies,sze,N_st,N_st_di
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -316,7 +316,7 @@ subroutine davidson_general_ext_rout(u_in,H_jj,energies,sze,N_st,N_st_diag_in,co
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -327,7 +327,7 @@ subroutine davidson_general(u_in,H_jj,energies,dim_in,sze,N_st,N_st_diag_in,conv
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -457,7 +457,7 @@ subroutine davidson_diag_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,N_st,N_st_dia
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -477,7 +477,7 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -611,7 +611,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,E11.3))') iter-1, to_print(1:3,1:N_st)
|
||||
write(*,'(1X,I3,1X,100(1X,F16.10,1X,F11.6,1X,ES11.3))') iter-1, to_print(1:3,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -436,7 +436,7 @@ subroutine davidson_diag_nonsym_hjj(dets_in, u_in, H_jj, energies, dim_in, sze,
|
||||
!don't print
|
||||
continue
|
||||
else
|
||||
write(*, '(1X, I3, 1X, 100(1X, F16.10, 1X, E11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
write(*, '(1X, I3, 1X, 100(1X, F16.10, 1X, ES11.3))') iter-1, to_print(1:2,1:N_st)
|
||||
endif
|
||||
|
||||
! Check convergence
|
||||
|
@ -66,9 +66,9 @@ END_PROVIDER
|
||||
write(*,'(i16)',advance='no') i
|
||||
end do
|
||||
write(*,*) ''
|
||||
write(*,'(A17,100(1pE16.8))') 'x_dipole_moment = ',x_dipole_moment
|
||||
write(*,'(A17,100(1pE16.8))') 'y_dipole_moment = ',y_dipole_moment
|
||||
write(*,'(A17,100(1pE16.8))') 'z_dipole_moment = ',z_dipole_moment
|
||||
write(*,'(A17,100(ES16.8))') 'x_dipole_moment = ',x_dipole_moment
|
||||
write(*,'(A17,100(ES16.8))') 'y_dipole_moment = ',y_dipole_moment
|
||||
write(*,'(A17,100(ES16.8))') 'z_dipole_moment = ',z_dipole_moment
|
||||
!print*, 'x_dipole_moment = ',x_dipole_moment
|
||||
!print*, 'y_dipole_moment = ',y_dipole_moment
|
||||
!print*, 'z_dipole_moment = ',z_dipole_moment
|
||||
|
@ -5,7 +5,7 @@ BEGIN_PROVIDER [ character*(1024), ezfio_filename ]
|
||||
! variable if it is set, or as the 1st argument of the command line.
|
||||
END_DOC
|
||||
|
||||
PROVIDE mpi_initialized
|
||||
PROVIDE mpi_initialized output_wall_time_0
|
||||
|
||||
integer :: i
|
||||
|
||||
|
@ -111,7 +111,7 @@ subroutine first_gradient_opt(n,v_grad)
|
||||
if (debug) then
|
||||
print*,'Matrix containing the gradient :'
|
||||
do i = 1, mo_num
|
||||
write(*,'(100(E12.5))') A(i,1:mo_num)
|
||||
write(*,'(100(ES12.5))') A(i,1:mo_num)
|
||||
enddo
|
||||
endif
|
||||
|
||||
|
@ -62,7 +62,7 @@ subroutine KMat_tilde_dump()
|
||||
do j = 1, mo_num
|
||||
do i = 1, mo_num
|
||||
! TCHint convention
|
||||
write(33, '(E15.7, 4X, 4(I4, 2X))') mo_bi_ortho_tc_two_e_chemist(j,i,l,k), i, j, k, l
|
||||
write(33, '(ES15.7, 4X, 4(I4, 2X))') mo_bi_ortho_tc_two_e_chemist(j,i,l,k), i, j, k, l
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
@ -71,7 +71,7 @@ subroutine KMat_tilde_dump()
|
||||
do j = 1, mo_num
|
||||
do i = 1, mo_num
|
||||
! TCHint convention
|
||||
write(33, '(E15.7, 4X, 4(I4, 2X))') mo_bi_ortho_tc_one_e(i,j), i, j, 0, 0
|
||||
write(33, '(ES15.7, 4X, 4(I4, 2X))') mo_bi_ortho_tc_one_e(i,j), i, j, 0, 0
|
||||
enddo
|
||||
enddo
|
||||
|
||||
@ -128,7 +128,7 @@ subroutine ERI_dump()
|
||||
do k = 1, mo_num
|
||||
do j = 1, mo_num
|
||||
do i = 1, mo_num
|
||||
write(33, '(4(I4, 2X), 4X, E15.7)') i, j, k, l, a1(i,j,k,l)
|
||||
write(33, '(4(I4, 2X), 4X, ES15.7)') i, j, k, l, a1(i,j,k,l)
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
@ -167,8 +167,8 @@ subroutine LMat_tilde_dump()
|
||||
!write(33, '(6(I4, 2X), 4X, E15.7)') i, j, k, l, m, n, integral
|
||||
! TCHint convention
|
||||
if(dabs(integral).gt.1d-10) then
|
||||
write(33, '(E15.7, 4X, 6(I4, 2X))') -integral/3.d0, i, j, k, l, m, n
|
||||
!write(33, '(E15.7, 4X, 6(I4, 2X))') -integral/3.d0, l, m, n, i, j, k
|
||||
write(33, '(ES15.7, 4X, 6(I4, 2X))') -integral/3.d0, i, j, k, l, m, n
|
||||
!write(33, '(ES15.7, 4X, 6(I4, 2X))') -integral/3.d0, l, m, n, i, j, k
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
@ -72,7 +72,7 @@ subroutine molden_lr
|
||||
write(i_unit_output,*) character_shell, ao_prim_num(i_ao), '1.00'
|
||||
do k = 1, ao_prim_num(i_ao)
|
||||
i_prim +=1
|
||||
write(i_unit_output,'(E20.10,2X,E20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
write(i_unit_output,'(ES20.10,2X,ES20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
enddo
|
||||
l = i_ao
|
||||
do while ( ao_l(l) == ao_l(i_ao) )
|
||||
@ -170,7 +170,7 @@ subroutine molden_lr
|
||||
write (i_unit_output,*) 'Spin= Alpha'
|
||||
write (i_unit_output,*) 'Occup=', mo_occ(i)
|
||||
do j=1,ao_num
|
||||
write(i_unit_output, '(I6,2X,E20.10)') j, mo_r_coef(iorder(j),i)
|
||||
write(i_unit_output, '(I6,2X,ES20.10)') j, mo_r_coef(iorder(j),i)
|
||||
enddo
|
||||
|
||||
write (i_unit_output,*) 'Sym= 1'
|
||||
@ -178,7 +178,7 @@ subroutine molden_lr
|
||||
write (i_unit_output,*) 'Spin= Alpha'
|
||||
write (i_unit_output,*) 'Occup=', mo_occ(i)
|
||||
do j=1,ao_num
|
||||
write(i_unit_output, '(I6,2X,E20.10)') j, mo_l_coef(iorder(j),i)
|
||||
write(i_unit_output, '(I6,2X,ES20.10)') j, mo_l_coef(iorder(j),i)
|
||||
enddo
|
||||
enddo
|
||||
close(i_unit_output)
|
||||
@ -235,7 +235,7 @@ subroutine molden_l()
|
||||
write(i_unit_output,*) character_shell, ao_prim_num(i_ao), '1.00'
|
||||
do k = 1, ao_prim_num(i_ao)
|
||||
i_prim +=1
|
||||
write(i_unit_output,'(E20.10,2X,E20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
write(i_unit_output,'(ES20.10,2X,ES20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
enddo
|
||||
l = i_ao
|
||||
do while ( ao_l(l) == ao_l(i_ao) )
|
||||
@ -333,7 +333,7 @@ subroutine molden_l()
|
||||
write (i_unit_output,*) 'Spin= Alpha'
|
||||
write (i_unit_output,*) 'Occup=', mo_occ(i)
|
||||
do j=1,ao_num
|
||||
write(i_unit_output, '(I6,2X,E20.10)') j, mo_l_coef(iorder(j),i)
|
||||
write(i_unit_output, '(I6,2X,ES20.10)') j, mo_l_coef(iorder(j),i)
|
||||
enddo
|
||||
enddo
|
||||
close(i_unit_output)
|
||||
@ -390,7 +390,7 @@ subroutine molden_r()
|
||||
write(i_unit_output,*) character_shell, ao_prim_num(i_ao), '1.00'
|
||||
do k = 1, ao_prim_num(i_ao)
|
||||
i_prim +=1
|
||||
write(i_unit_output,'(E20.10,2X,E20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
write(i_unit_output,'(ES20.10,2X,ES20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
enddo
|
||||
l = i_ao
|
||||
do while ( ao_l(l) == ao_l(i_ao) )
|
||||
@ -488,7 +488,7 @@ subroutine molden_r()
|
||||
write (i_unit_output,*) 'Spin= Alpha'
|
||||
write (i_unit_output,*) 'Occup=', mo_occ(i)
|
||||
do j=1,ao_num
|
||||
write(i_unit_output, '(I6,2X,E20.10)') j, mo_r_coef(iorder(j),i)
|
||||
write(i_unit_output, '(I6,2X,ES20.10)') j, mo_r_coef(iorder(j),i)
|
||||
enddo
|
||||
enddo
|
||||
close(i_unit_output)
|
||||
|
@ -44,7 +44,7 @@ program molden
|
||||
write(i_unit_output,*) character_shell, ao_prim_num(i_ao), '1.00'
|
||||
do k = 1, ao_prim_num(i_ao)
|
||||
i_prim +=1
|
||||
write(i_unit_output,'(E20.10,2X,E20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
write(i_unit_output,'(ES20.10,2X,ES20.10)') ao_expo(i_ao,k), ao_coef(i_ao,k)
|
||||
enddo
|
||||
l = i_ao
|
||||
do while ( ao_l(l) == ao_l(i_ao) )
|
||||
@ -142,7 +142,7 @@ program molden
|
||||
write (i_unit_output,*) 'Spin= Alpha'
|
||||
write (i_unit_output,*) 'Occup=', mo_occ(i)
|
||||
do j=1,ao_num
|
||||
write(i_unit_output, '(I6,2X,E20.10)') j, mo_coef(iorder(j),i)
|
||||
write(i_unit_output, '(I6,2X,ES20.10)') j, mo_coef(iorder(j),i)
|
||||
enddo
|
||||
enddo
|
||||
close(i_unit_output)
|
||||
|
@ -28,7 +28,7 @@ subroutine routine
|
||||
do i = 1, N_det
|
||||
print *, 'Determinant ', i
|
||||
call debug_det(psi_det(1,1,i),N_int)
|
||||
print '(4E20.12,X)', (psi_coef(i,k), k=1,N_states)
|
||||
print '(4ES20.12,X)', (psi_coef(i,k), k=1,N_states)
|
||||
print *, ''
|
||||
print *, ''
|
||||
enddo
|
||||
|
@ -39,7 +39,7 @@ subroutine format_w_error(value,error,size_nb,max_nb_digits,format_value,str_err
|
||||
write(str_size,'(I3)') size_nb
|
||||
|
||||
! Error
|
||||
write(str_exp,'(1pE20.0)') error
|
||||
write(str_exp,'(ES20.0)') error
|
||||
str_error = trim(adjustl(str_exp))
|
||||
|
||||
! Number of digit: Y (FX.Y) from the exponent
|
||||
|
@ -73,7 +73,7 @@ subroutine rotation_matrix_iterative(m,X,R)
|
||||
|
||||
!print*,'R'
|
||||
!do i = 1, m
|
||||
! write(*,'(10(E12.5))') R(i,:)
|
||||
! write(*,'(10(ES12.5))') R(i,:)
|
||||
!enddo
|
||||
|
||||
do i = 1, m
|
||||
@ -82,7 +82,7 @@ subroutine rotation_matrix_iterative(m,X,R)
|
||||
|
||||
!print*,'RRT'
|
||||
!do i = 1, m
|
||||
! write(*,'(10(E12.5))') RRT(i,:)
|
||||
! write(*,'(10(ES12.5))') RRT(i,:)
|
||||
!enddo
|
||||
|
||||
max_elem = 0d0
|
||||
|
@ -336,7 +336,7 @@ subroutine trust_region_optimal_lambda(n,e_val,tmp_wtg,delta,lambda)
|
||||
d_1 = d1_norm_inverse_trust_region_omp(n,e_val,tmp_wtg,lambda,delta) ! first derivative of (1/||x(lambda)||^2 - 1/delta^2)^2
|
||||
d_2 = d2_norm_inverse_trust_region_omp(n,e_val,tmp_wtg,lambda,delta) ! second derivative of (1/||x(lambda)||^2 - 1/delta^2)^2
|
||||
endif
|
||||
!write(*,'(a,E12.5,a,E12.5)') ' 1st and 2nd derivative: ', d_1,', ', d_2
|
||||
!write(*,'(a,ES12.5,a,ES12.5)') ' 1st and 2nd derivative: ', d_1,', ', d_2
|
||||
|
||||
! Newton's step
|
||||
y = -(1d0/DABS(d_2))*d_1
|
||||
@ -345,7 +345,7 @@ subroutine trust_region_optimal_lambda(n,e_val,tmp_wtg,delta,lambda)
|
||||
if (DABS(y) > alpha) then
|
||||
y = alpha * (y/DABS(y)) ! preservation of the sign of y
|
||||
endif
|
||||
!write(*,'(a,E12.5)') ' Step length: ', y
|
||||
!write(*,'(a,ES12.5)') ' Step length: ', y
|
||||
|
||||
! Predicted value of (||x(lambda)||^2 - delta^2)^2, Taylor series
|
||||
model = prev_f_R + d_1 * y + 0.5d0 * d_2 * y**2
|
||||
@ -414,7 +414,7 @@ subroutine trust_region_optimal_lambda(n,e_val,tmp_wtg,delta,lambda)
|
||||
else
|
||||
alpha = 0.25d0 * alpha
|
||||
endif
|
||||
!write(*,'(a,E12.5)') ' New trust length alpha: ', alpha
|
||||
!write(*,'(a,ES12.5)') ' New trust length alpha: ', alpha
|
||||
|
||||
! cancellaion of the step if rho < 0.1
|
||||
if (rho_2 < thresh_rho_2) then !0.1d0) then
|
||||
|
Loading…
Reference in New Issue
Block a user