correction in new ions and clusterfix
[unres4.git] / source / unres / io.F90
index ffce3d7..61270e5 100644 (file)
                fail=.true.
                ii=0
                do while (fail .and. ii .le. maxsi)
-                 call gen_side(itype(i,1),theta(i+1),alph(i),omeg(i),fail)
+                 call gen_side(itype(i,1),theta(i+1),alph(i),omeg(i),fail,molnum(i))
                  ii = ii+1
                enddo
              endif
       call reada(weightcard,'WBOND_NUCL',wbond_nucl,0.0D0)
       call reada(weightcard,'WCATCAT',wcatcat,0.0d0)
       call reada(weightcard,'WCATPROT',wcatprot,0.0d0)
+      call reada(weightcard,'WCATNUCL',wcatnucl,0.0d0)
       call reada(weightcard,'WPEPBASE',wpepbase,1.0d0)
       call reada(weightcard,'WSCPHO',wscpho,0.0d0)
       call reada(weightcard,'WPEPPHO',wpeppho,0.0d0)
           weights(47)=wpepbase
           weights(48)=wscpho
           weights(49)=wpeppho
+          weights(50)=wcatnucl
 
       if(me.eq.king.or..not.out1file) &
        write (iout,10) wsc,wscp,welec,wvdwpp,wbond,wang,wscloc,wtor,&
             nsi=0
             fail=.true.
             do while (fail.and.nsi.le.maxsi)
-              call gen_side(iti,theta(i+1),alph(i),omeg(i),fail)
+              call gen_side(iti,theta(i+1),alph(i),omeg(i),fail,molnum(i))
               nsi=nsi+1
             enddo
             if(fail) write(iout,*)'Adding sidechain failed for res ',&
         do i=1,nres_molec(molec)
           itmp=itmp+1
           istype(itmp)=sugarcode(sequence(i,molec)(1:1),i)
-          itype(itmp,molec)=rescode(i,sequence(i,molec)(1:2),iscode,molec)
+          sequence(i,molec)=sequence(i,molec)(1:2)
+          itype(itmp,molec)=rescode(i,sequence(i,molec),iscode,molec)
         enddo
        endif
 
         enddo 
       else if (ndih_constr.lt.0) then
         raw_psipred=.true.
+        allocate(idih_constr(nres))
         allocate(secprob(3,nres))
         allocate(vpsipred(3,nres))
         allocate(sdihed(2,nres))