correction of gen_rand_conf and preminim
[unres4.git] / source / unres / geometry.F90
index f41bd30..70b6218 100644 (file)
 !       write(iout,*)'phi(4)=',rad2deg*phi(4)
         if (nstart.lt.3) theta(3)=gen_theta(iabs(itype(2,1)),pi,phi(4))
 !       write(iout,*)'theta(3)=',rad2deg*theta(3) 
-        if (it1.ne.10) then
+        if ((it1.ne.10).and.(it.ne.ntyp1)) then
           nsi=0
           fail=.true.
           do while (fail.and.nsi.le.maxsi)
           phi(i)=gen_phi(i+1,it2,it1)
 !         print *,'phi(',i,')=',phi(i)
          theta(i-1)=gen_theta(it2,phi(i-1),phi(i))
-         if (it2.ne.10) then
+         if ((it2.ne.10).and.(it2.ne.ntyp1)) then
             nsi=0
             fail=.true.
             do while (fail.and.nsi.le.maxsi)
          call locate_next_res(i-1)
        endif
        theta(i)=gen_theta(it1,phi(i),phi(i+1))
-        if (it1.ne.10) then 
+        if ((it1.ne.10).and.(it1.ne.ntyp1)) then 
         nsi=0
         fail=.true.
         do while (fail.and.nsi.le.maxsi)
         do ires=1,ioverlap_last 
           i=ioverlap(ires)
           iti=iabs(itype(i,1))
-          if (iti.ne.10) then
+          if ((iti.ne.10).and.(molnum(i).ne.5).and.(iti.ne.ntyp1)) then
             nsi=0
             fail=.true.
             do while (fail.and.nsi.le.maxsi)
       ind=0
       do i=iatsc_s,iatsc_e
         if (itype(i,molnum(i)).eq.ntyp1_molec(molnum(i))) cycle
+        if (molnum(i).eq.5) print *,"WTF",i,iatsc_s,iatsc_e
+        if (molnum(i).eq.5) cycle
         itypi=iabs(itype(i,molnum(i)))
         itypi1=iabs(itype(i+1,1))
         xi=c(1,nres+i)