Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metadynamics switchon #803

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/dynamic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,8 @@ subroutine md(env,mol,chk,calc, &

type(metadyn_setvar) :: metasetlocal
real(wp) :: emtd
real(wp) :: metatime
metatime = 0.0_wp


integer :: imetatime
imetatime = 0

call delete_file('xtbmdok')

Expand Down Expand Up @@ -337,9 +335,7 @@ subroutine md(env,mol,chk,calc, &
write(env%unit,'(" kpush :",f9.3)') metasetlocal%global_factor
write(env%unit,'(" alpha :",f9.3)') metasetlocal%global_width
write(env%unit,'(" update :",i8)') metasetlocal%maxsave
if((metasetlocal%ramp - 0.03_wp) .ne. 0.0_wp)then
write(env%unit,'(" ramp :",f9.3)') metasetlocal%ramp
endif
if (metasetlocal%nstruc.eq.0) then
do i = 1, mol%n
do j = 1, 3
Expand Down Expand Up @@ -427,13 +423,13 @@ subroutine md(env,mol,chk,calc, &
& egap,et,maxiter,0,.true.,.true.,accu,epot,grd,sigma,res)

if (metasetlocal%maxsave.ne.0) then
metatime = metatime + 1.0_wp
imetatime = imetatime + 1
metasetlocal%factor(1:metasetlocal%nstruc) = metasetlocal%global_factor
metasetlocal%factor(metasetlocal%nstruc) = metasetlocal%factor(metasetlocal%nstruc) &
& * (2.0_wp/(1.0_wp+exp(-metasetlocal%ramp*metatime))-1.0_wp)
& * (2.0_wp/(1.0_wp+exp(-metasetlocal%ramp*imetatime*tstep))-1.0_wp)
if (cdump.gt.cdump0) then
if (metasetlocal%nstruc.lt.metasetlocal%maxsave) then
metatime = 0.0
imetatime = 0
metasetlocal%nstruc = metasetlocal%nstruc + 1
metasetlocal%xyz(:,:,metasetlocal%nstruc) = mol%xyz
else
Expand Down
2 changes: 1 addition & 1 deletion src/type/setvar.f90
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ module xtb_type_setvar
real(wp),allocatable :: factor(:)
real(wp) :: global_width = 1.0_wp
real(wp),allocatable :: width(:)
real(wp) :: ramp = 0.03_wp
real(wp) :: ramp = 0.0075_wp
integer :: nat = 0
logical :: static = .true.
integer, allocatable :: atoms(:)
Expand Down