Skip to content

Commit

Permalink
Possibility to skip geo opt with aISS (#1198)
Browse files Browse the repository at this point in the history
Signed-off-by: cplett <[email protected]>
  • Loading branch information
cplett authored Feb 20, 2025
1 parent 65e9c14 commit 76c1f5a
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions src/docking/search_nci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ END SUBROUTINE Quicksort
real(wp) :: dx_rg, dy_rg, dz_rg, xx1_rg, yy1_rg, zz1_rg
real(wp) :: r1, r2, r3, a1, a2, a3, av, sig, epq, tmpx(15), t0, t1, w0, w1
real(wp) :: dum3(3, 3), dum2(3), dum(3), pmass, rmin, mvec(3, 14)
real(wp) :: rmsd(n_opt*(n_opt + 1)/2)
real(wp) :: dx2, dy2, dz2
real*4 :: r4
integer :: i, j, k, nang, nr, ii, jj, ns, icycle, maxs, iseed(2)
integer :: kk = 0
integer :: m1, m2, m3, l, nn, ndim, ll, kkk, kkkk, mfrag, maxlow, nclust, ierr
integer :: mm1, mm2, mm3, maxpock, icssym
integer :: sig_count
integer, allocatable :: atfrag(:), molvec(:), iatnum(:)
real(wp), allocatable :: xyzfrag(:, :)
logical :: tooclose
Expand Down Expand Up @@ -797,13 +797,18 @@ END SUBROUTINE Quicksort
end if

!-------------------------------------------------------------- start genetic optimization
!Set how many structure to consider for convergence
if (n_opt == 0) then
sig_count = 15
else
sig_count = n_opt
end if

write (*, *) '------------------------------'
write (*, *) 'genetic optimization algorithm'
write (*, *) '------------------------------'
write (*, *) ' cycle Eint/kcal/mol average Eint'
do icycle = 1, maxgen

!$omp parallel do default(none) &
!$omp shared(env,found2,maxparent,found,n,n1,n2,at1,at2,neigh,&
!$omp xyz1,xyz2,q1,q2,c6ab,z1,z2,nl1,nl2,l1,l2,cl1,cl2,qdr1,qdr2,cn1,cn2,&
Expand All @@ -829,26 +834,40 @@ END SUBROUTINE Quicksort
!$omp end parallel do

ii = maxparent**2
call doubles(ii, ndim, 3.0d0, 0.10d0, found2) ! SETING
call doubles(ii, ndim, 3.0d0, 0.10d0, found2) ! SETTING
call sort6(ii, found2)

found = found2
if (debug) call wrc2('structures_after_gen.xyz', 0, n1, n2, at1, at2, xyz1,&
& xyz2, n_opt, found)
if (n_opt == 0) then
call wrc2('structures_after_gen.xyz', 0, n1, n2, at1, at2, xyz1,&
& xyz2, 15, found)
else if (debug) then
call wrc2('structures_after_gen.xyz', 0, n1, n2, at1, at2, xyz1,&
& xyz2, n_opt, found)
end if
call wrc3('best_after_gen.xyz', n1, n2, at1, at2, xyz1, xyz2, 1, found)

av = sum(found(7, 1:maxparent))/float(maxparent)
sig = 0
do i = 1, n_opt
do i = 1, sig_count
sig = sig + (found(7, i) - av)**2
end do
sig = sqrt(sig/float(n_opt - 1))
sig = sqrt(sig/float(sig_count - 1))
write(*,'(4x,i0,7x,F7.1,5x,F8.1,5x)')&
&icycle, found(7, 1), av
if (sig .lt. 0.3d0) exit
! LOOP END ------
end do
call stop_timing(4)

! Stop here, if no final optimizations should be done
if (n_opt == 0) then
write(env%unit, *)
write(env%unit, *) " Skipping geometry optimizations due to user request."
write(env%unit, *) " The best structure after screening can be found on best_after_gen.xyz."
write(env%unit, *) " More structures after screening can be found on structures_after_gen.xyz."
return
end if
!-------------------------------------------------------------- end genetic optimization

!> Check if ensemble runtype is requested
Expand Down

0 comments on commit 76c1f5a

Please sign in to comment.