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 xtb/docking test #1173

Merged
merged 6 commits into from
Feb 12, 2025
Merged
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
3 changes: 2 additions & 1 deletion src/docking/search_nci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ END SUBROUTINE Quicksort
call generateFileName(fin_name, 'best', '', comb%ftype)
call open_file(ifinal, fin_name, 'w')
call writeMolecule(comb, ifinal, energy=final_e(1))
call close_file(ifinal)
!If not xyz then best.xyz is written to not have api break
if(comb%ftype /= 1)then
call open_file(ifinal, 'best.xyz', 'w')
Expand All @@ -975,8 +976,8 @@ END SUBROUTINE Quicksort
write (ifinal, '(a4,2x,3f20.14)') comb%sym(j), xyz_opt(1, j, 1)*autoang, &
& xyz_opt(2, j, 1)*autoang, xyz_opt(3, j, 1)*autoang
end do
call close_file(ifinal)
end if
call close_file(ifinal)


call delete_file(set%opt_logfile)
Expand Down
12 changes: 6 additions & 6 deletions src/iff/iff_energy.f90
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,16 @@ subroutine iff_e(env, n, n1, n2, at1, at2, neigh, A1, c02, q01, q02, c6ab,&
r2 = (AL1(1, i) - AL2(1, j))**2&
&+ (AL1(2, i) - AL2(2, j))**2&
&+ (AL1(3, i) - AL2(3, j))**2
r = dble(sqrt(real(r2)))
esl = esl + AL1(4, i)*AL2(4, j)/(r + r0tmp(jat, iat)/r)
r = sqrt(r2)
esl = esl + AL1(4, i)*AL2(4, j)*r/(r2 + r0tmp(jat, iat))
end do
! LP atom corrections
do j = 1, n2
r2 = (A2(1, j) - AL1(1, i))**2&
&+ (A2(2, j) - AL1(2, i))**2&
&+ (A2(3, j) - AL1(3, i))**2
r = dble(sqrt(real(r2)))
esl = esl + AL1(4, i)*q2(j)/(r + r0tmp(j, iat)/r)
r = sqrt(r2)
esl = esl + AL1(4, i)*q2(j)*r/(r2 + r0tmp(j, iat))
end do
end do
! LP atom corrections
Expand All @@ -294,8 +294,8 @@ subroutine iff_e(env, n, n1, n2, at1, at2, neigh, A1, c02, q01, q02, c6ab,&
r2 = (A1(1, j) - AL2(1, i))**2&
&+ (A1(2, j) - AL2(2, i))**2&
&+ (A1(3, j) - AL2(3, i))**2
r = dble(sqrt(real(r2)))
esl = esl + AL2(4, i)*q1(j)/(r + r0tmp(iat, j)/r)
r = sqrt(r2)
esl = esl + AL2(4, i)*q1(j)*r/(r2 + r0tmp(iat, j))
end do
end do

Expand Down
6 changes: 4 additions & 2 deletions src/iff/iff_ini.f90
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,12 @@ subroutine init_iff(env,n1,n2,at1,at2,neigh,xyz1,xyz2,q1,q2,c6ab,z1,z2,&
&(xyz1(3, j) - xyz1(3, i))**2
r0 = sqrt(rr)
gab1(j, i) = 1.0d0/(r0 + 1./sqrt(gam(at1(i))*gam(at1(j))))
if (j .eq. i) cycle
ai = alp0(i)**(1./3)
aj = alp0(j)**(1./3)
rrr = 1.13*2.6*(ai + aj)*0.5/r0
tmp = 1.0d0/(1.d0 + 6.d0*rrr**14)
if (j .ne. i .and. tmp .gt. 0.90 .and. r0 .lt. thr) then
if (tmp .gt. 0.90 .and. r0 .lt. thr) then
k = k + 1
neigh(k, i) = j
end if
Expand All @@ -239,11 +240,12 @@ subroutine init_iff(env,n1,n2,at1,at2,neigh,xyz1,xyz2,q1,q2,c6ab,z1,z2,&
&(xyz2(3, j) - xyz2(3, i))**2
r0 = sqrt(rr)
gab2(j, i) = 1.0d0/(r0 + 1./sqrt(gam(at2(i))*gam(at2(j))))
if (j .eq. i) cycle
ai = alp0(i + n1)**(1./3)
aj = alp0(j + n1)**(1./3)
rrr = 1.13*2.6*(ai + aj)*0.5/r0
tmp = 1.0d0/(1.d0 + 6.d0*rrr**14)
if (j .ne. i .and. tmp .gt. 0.90 .and. r0 .lt. thr) then
if (tmp .gt. 0.90 .and. r0 .lt. thr) then
k = k + 1
neigh(k, i + n1) = j
end if
Expand Down