random generation for nucleic acids
[unres4.git] / source / unres / minim.F90
index a096a62..73b6fd2 100644 (file)
 
 !     Don't do glycine or ends
       i=itype(res_pick,1)
-      if (i.eq.10 .or. i.eq.ntyp1) return
+      if (i.eq.10 .or. i.eq.ntyp1 .or. molnum(res_pick).eq.5) return
 
 !     Freeze everything (later will relax only selected side-chains)
       mask_r=.true.
       nres_moved=0
       do i=2,nres-1
 !     Don't do glycine (itype(j,1)==10)
-        if (itype(i,1).ne.10) then
+        if ((itype(i,1).ne.10).and.(itype(i,1).ne.ntyp1) &
+        .and.(molnum(i).ne.5)) then
           sc_dist=dist(nres+i,nres+res_pick)
         else
           sc_dist=sc_dist_cutoff
       n_try=0
       do while (n_try.lt.n_maxtry .and. orig_e-cur_e.lt.e_drop)
 !     Move the selected residue (don't worry if it fails)
-        call gen_side(iabs(itype(res_pick,1)),theta(res_pick+1),&
-             alph(res_pick),omeg(res_pick),fail)
+        call gen_side(iabs(itype(res_pick,molnum(res_pick))),theta(res_pick+1),&
+             alph(res_pick),omeg(res_pick),fail,molnum(res_pick))
 
 !     Minimize the side-chains starting from the new arrangement
         call geom_to_var(nvar,var)