zmaina w xdrf
[unres.git] / source / wham / src-M / readpdb.f
index 24bd600..a65709e 100644 (file)
@@ -163,7 +163,7 @@ C Splits to single chain if occurs
       lll=lll+1
 cc      write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
       if (i.gt.1) then 
-      if ((itype(i-1).eq.ntyp1).and.(i.gt.2)) then
+      if ((itype(i-1).eq.ntyp1).and.(i.gt.2).and.(i.ne.nres)) then
       chain_length=lll-1
       kkk=kkk+1
 c       write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
@@ -179,6 +179,8 @@ c       write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
           endif
          enddo
       enddo
+      if (chain_length.eq.0) chain_length=nres
+      write (iout,*) chain_length
       do j=1,3
       chain_rep(j,chain_length,symetr)=chain_rep(j,chain_length,1)
       chain_rep(j,chain_length+nres,symetr)