mirror of https://gitlab.com/QEF/q-e.git
DFT-D3: clock print
This commit is contained in:
parent
98901cc0d6
commit
c67bcb5e52
|
@ -72,6 +72,11 @@ SUBROUTINE print_clock_pw()
|
||||||
CALL print_clock( 'vdW_ffts' )
|
CALL print_clock( 'vdW_ffts' )
|
||||||
CALL print_clock( 'vdW_v' )
|
CALL print_clock( 'vdW_v' )
|
||||||
CALL print_clock( 'vdW_kernel' )
|
CALL print_clock( 'vdW_kernel' )
|
||||||
|
CALL print_clock( 'dftd3' )
|
||||||
|
CALL print_clock( 'dftd3:edisp' )
|
||||||
|
CALL print_clock( 'dftd3:three' )
|
||||||
|
CALL print_clock( 'dftd3:ncoor' )
|
||||||
|
CALL print_clock( 'dftd3:gdisp' )
|
||||||
|
|
||||||
IF (lxdm) THEN
|
IF (lxdm) THEN
|
||||||
CALL print_clock('energy_xdm')
|
CALL print_clock('energy_xdm')
|
||||||
|
|
|
@ -242,6 +242,8 @@ contains
|
||||||
real(wp) :: rtmp3(3)
|
real(wp) :: rtmp3(3)
|
||||||
integer :: rep_cn(3), rep_vdw(3)
|
integer :: rep_cn(3), rep_vdw(3)
|
||||||
|
|
||||||
|
Call start_clock('dftd3')
|
||||||
|
|
||||||
if (present(grads) .neqv. present(stress)) then
|
if (present(grads) .neqv. present(stress)) then
|
||||||
write(*,*) "!!! Error in dftd3_pbc_dispersion"
|
write(*,*) "!!! Error in dftd3_pbc_dispersion"
|
||||||
write(*,*) "Either both grads and stress must be present or none of them"
|
write(*,*) "Either both grads and stress must be present or none of them"
|
||||||
|
@ -268,20 +270,22 @@ contains
|
||||||
& this%rthr, rep_vdw, this%cn_thr, rep_cn)
|
& this%rthr, rep_vdw, this%cn_thr, rep_cn)
|
||||||
disp = -e6 * this%s6 - e8 * this%s18 - e6abc
|
disp = -e6 * this%s6 - e8 * this%s18 - e6abc
|
||||||
|
|
||||||
if (.not. present(grads)) then
|
if (present(grads)) then
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
grads(:,:) = 0.0_wp
|
grads(:,:) = 0.0_wp
|
||||||
call pbcgdisp(max_elem, maxc, natom, coords, izp, this%c6ab, this%mxc, &
|
call pbcgdisp(max_elem, maxc, natom, coords, izp, this%c6ab, this%mxc, &
|
||||||
& r2r4, this%r0ab, rcov, s6, s18, rs6, rs8, rs10, alp6, alp8, alp10, &
|
& r2r4, this%r0ab, rcov, s6, s18, rs6, rs8, rs10, alp6, alp8, alp10, &
|
||||||
& this%noabc, this%numgrad, this%version, grads, disp2, gnorm, &
|
& this%noabc, this%numgrad, this%version, grads, disp2, gnorm, &
|
||||||
& stress, latvecs, rep_vdw, rep_cn, this%rthr, .false., this%cn_thr)
|
& stress, latvecs, rep_vdw, rep_cn, this%rthr, .false., this%cn_thr)
|
||||||
! Note, the stress variable in pbcgdisp contains the *lattice derivatives*
|
! Note, the stress variable in pbcgdisp contains the *lattice derivatives*
|
||||||
! on return, so it needs to be converted to obtain the stress tensor.
|
! on return, so it needs to be converted to obtain the stress tensor.
|
||||||
stress(:,:) = -matmul(stress, transpose(latvecs))&
|
stress(:,:) = -matmul(stress, transpose(latvecs))&
|
||||||
& / abs(determinant(latvecs))
|
& / abs(determinant(latvecs))
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
|
Call stop_clock('dftd3')
|
||||||
|
|
||||||
end subroutine dftd3_pbc_dispersion
|
end subroutine dftd3_pbc_dispersion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2455,6 +2455,8 @@ contains
|
||||||
real(wp) dx,dy,dz,r,damp,xn,rr,rco,tau(3)
|
real(wp) dx,dy,dz,r,damp,xn,rr,rco,tau(3)
|
||||||
real(wp), INTENT(IN) :: crit_cn
|
real(wp), INTENT(IN) :: crit_cn
|
||||||
|
|
||||||
|
call start_clock('dftd3:ncoor')
|
||||||
|
|
||||||
do i=1,natoms
|
do i=1,natoms
|
||||||
xn=0.0d0
|
xn=0.0d0
|
||||||
do iat=1,natoms
|
do iat=1,natoms
|
||||||
|
@ -2485,6 +2487,8 @@ contains
|
||||||
cn(i)=xn
|
cn(i)=xn
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
call stop_clock('dftd3:ncoor')
|
||||||
|
|
||||||
end subroutine pbcncoord
|
end subroutine pbcncoord
|
||||||
|
|
||||||
|
|
||||||
|
@ -2520,6 +2524,7 @@ contains
|
||||||
real(wp) bj_dmp6,bj_dmp8
|
real(wp) bj_dmp6,bj_dmp8
|
||||||
real(wp) tmp1,tmp2
|
real(wp) tmp1,tmp2
|
||||||
|
|
||||||
|
call start_clock('dftd3:edisp')
|
||||||
|
|
||||||
e6 =0
|
e6 =0
|
||||||
e8 =0
|
e8 =0
|
||||||
|
@ -2806,12 +2811,15 @@ contains
|
||||||
|
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if (.not.noabc) then
|
||||||
|
|
||||||
if (noabc)return
|
! compute non-additive third-order energy using averaged C6
|
||||||
|
call pbcthreebody(max_elem,xyz,lat,n,iz,rep_cn,crit_cn,&
|
||||||
|
& cc6ab,r0ab,e63)
|
||||||
|
|
||||||
! compute non-additive third-order energy using averaged C6
|
end if
|
||||||
call pbcthreebody(max_elem,xyz,lat,n,iz,rep_cn,crit_cn,&
|
|
||||||
& cc6ab,r0ab,e63)
|
call stop_clock('dftd3:edisp')
|
||||||
|
|
||||||
end subroutine pbcedisp
|
end subroutine pbcedisp
|
||||||
|
|
||||||
|
@ -2841,6 +2849,8 @@ contains
|
||||||
INTEGER, DIMENSION(3) :: repmin,repmax
|
INTEGER, DIMENSION(3) :: repmin,repmax
|
||||||
! REAL(WP) :: time1,time2
|
! REAL(WP) :: time1,time2
|
||||||
|
|
||||||
|
call start_clock('dftd3:three')
|
||||||
|
|
||||||
counter=0
|
counter=0
|
||||||
eabc=0.0d0
|
eabc=0.0d0
|
||||||
abcthr=cnthr
|
abcthr=cnthr
|
||||||
|
@ -3141,6 +3151,8 @@ contains
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
call stop_clock('dftd3:three')
|
||||||
|
|
||||||
end subroutine pbcthreebody
|
end subroutine pbcthreebody
|
||||||
|
|
||||||
|
|
||||||
|
@ -3211,6 +3223,8 @@ contains
|
||||||
real(wp) abcthr,time1,time2,geomean2,r0av,dc9,dfdmp,dang,ang
|
real(wp) abcthr,time1,time2,geomean2,r0av,dc9,dfdmp,dang,ang
|
||||||
integer,dimension(3) ::repv,repmin,repmax,repmin2,repmax2
|
integer,dimension(3) ::repv,repmin,repmax,repmin2,repmax2
|
||||||
|
|
||||||
|
call start_clock('dftd3:gdisp')
|
||||||
|
|
||||||
! R^2 cut-off
|
! R^2 cut-off
|
||||||
rthr=crit_vdw
|
rthr=crit_vdw
|
||||||
abcthr=crit_cn
|
abcthr=crit_cn
|
||||||
|
@ -4665,6 +4679,8 @@ contains
|
||||||
write(*,*)'|G(stress)|=',gnorm
|
write(*,*)'|G(stress)|=',gnorm
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
call stop_clock('dftd3:gdisp')
|
||||||
|
|
||||||
end subroutine pbcgdisp
|
end subroutine pbcgdisp
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue