Merge branch 'UCGM' of mmka.chem.univ.gda.pl:unres4 into UCGM
[unres4.git] / source / unres / minim.F90
index 4d3115c..c060c01 100644 (file)
           cur_omeg(i)=omeg(i)
         endif
       enddo
-      write(iout,*) 'Warning calling chainbuild'
+!      write(iout,*) 'Warning calling chainbuild'
       call chainbuild
+!      write(iout,*) "before egb1"
       call egb1(evdw)
       call esc(escloc)
 !elwrite(iout,*) "in sinle etot/ e_sc",e_sc
       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)
 !     if (icall.eq.0) lprn=.true.
       ind=0
       do i=iatsc_s,iatsc_e
-
+        if ((itype(i,1).eq.ntyp1).or.(molnum(i).gt.1)) cycle
         itypi=iabs(itype(i,1))
         itypi1=iabs(itype(i+1,1))
+!         print *,"ebg1",i,itypi,itypi1
         xi=c(1,nres+i)
         yi=c(2,nres+i)
         zi=c(3,nres+i)
           IF (mask_side(j).eq.1.or.mask_side(i).eq.1) THEN
             ind=ind+1
             itypj=iabs(itype(j,1))
+            if ((itype(j,1).eq.ntyp1).or.(molnum(j).gt.1)) cycle
+!            print *,"ebg1",j,itypj
+
             dscj_inv=dsc_inv(itypj)
             sig0ij=sigma(itypi,itypj)
             chi1=chi(itypi,itypj)