dfa & cluster
[unres.git] / source / unres / src-HCD-5D / gen_rand_conf.F
index b5e5595..ea009b6 100644 (file)
@@ -144,6 +144,7 @@ C Check for SC-SC overlaps.
 cd    print *,'nnt=',nnt,' nct=',nct
       do j=nnt,i-1
         itj=iabs(itype(j))
+        if (itj.eq.ntyp1) cycle
         if (j.lt.i-1 .or. ipot.ne.4) then
           rcomp=sigmaii(iti,itj)
         else 
@@ -281,7 +282,7 @@ c-------------------------------------------------------------------------
       double precision eig_limit /1.0D-8/
       double precision Big /10.0D0/
       double precision vec(3,3)
-      logical lprint,fail,lcheck
+      logical lprint,fail,lcheck,lprn /.false./
       lcheck=.false.
       lprint=.false.
       fail=.false.
@@ -514,10 +515,12 @@ C
       endif
       if (box(1,2).lt.-MaxBoxLen .or. box(2,2).gt.MaxBoxLen) then
 #ifdef MPI
+        if (lprn) then
         write (iout,'(a,i4,a)') 'CG Processor:',me,': bad sampling box.'
         write (*,'(a,i4,a)') 'CG Processor:',me,': bad sampling box.'
+        endif
 #else
-c        write (iout,'(a)') 'Bad sampling box.'
+        if (lprn) write (iout,'(a)') 'Bad sampling box.'
 #endif
         fail=.true.
         return
@@ -796,13 +799,16 @@ c     overlapping residues left, or false otherwise (success)
             fail=.true.
             do while (fail.and.nsi.le.maxsi)
               call gen_side(iti,theta(i+1),alph(i),omeg(i),fail)
+              call sc_coord_rebuild(i)
               nsi=nsi+1
             enddo
             if(fail) goto 999
           endif
         enddo
 
-        call chainbuild_extconf
+c        write (iout,*) "before chaincuild overlap_sc_list: dc0",dc(:,0)
+c        call chainbuild_extconf
+c        write (iout,*) "after chaincuild overlap_sc_list: dc0",dc(:,0)
         call overlap_sc_list(ioverlap,ioverlap_last)
         write (iout,*) 'Overlaping residues ',ioverlap_last,
      &           (ioverlap(j),j=1,ioverlap_last)