dfa & cluster
[unres.git] / source / unres / src-HCD-5D / readrtns_CSA.F
index d76b29e..e5f0b41 100644 (file)
@@ -1228,11 +1228,16 @@ C initial geometry.
             read(inp,'(8f10.5)',end=36,err=36)
      &       ((c(l,k),l=1,3),k=1,nres),
      &       ((c(l,k+nres),l=1,3),k=nnt,nct)
+            if (nnt.gt.1) c(:,nres+1)=c(:,1)
+            if (nct.lt.nres) c(:,2*nres)=c(:,nres)
 c            write (iout,*) "Exit READ_CART"
 c            write (iout,'(8f10.5)') 
 c     &       ((c(l,k),l=1,3),k=1,nres),
 c     &       ((c(l,k+nres),l=1,3),k=nnt,nct)
             call cartprint
+            do j=1,3
+              dc(j,0)=c(j,1)
+            enddo
             do i=1,nres-1
               do j=1,3
                 dc(j,i)=c(j,i+1)-c(j,i)
@@ -1292,7 +1297,7 @@ c            return
           enddo
           call bond_regular
           call chainbuild_extconf
-        else
+        else if (.not. start_from_model) then
           if(me.eq.king.or..not.out1file)
      &     write (iout,'(a)') 'Random-generated initial geometry.'
           call bond_regular
@@ -3053,7 +3058,8 @@ c
       double precision, dimension (max_template,maxres) :: rescore2
       double precision, dimension (max_template,maxres) :: rescore3
       double precision distal
-      character*24 pdbfile,tpl_k_rescore
+      character*24 tpl_k_rescore
+      character*256 pdbfile
 c -----------------------------------------------------------------
 c Reading multiple PDB ref structures and calculation of retraints
 c not using pre-computed ones stored in files model_ki_{dist,angle}
@@ -3132,6 +3138,7 @@ c
       do k=1,constr_homology
 
         read(inp,'(a)') pdbfile
+        pdbfiles_chomo(k)=pdbfile
         if(me.eq.king .or. .not. out1file)
      &    write (iout,'(a,5x,a)') 'HOMOL: Opening PDB file',
      &  pdbfile(:ilen(pdbfile))
@@ -3636,7 +3643,8 @@ c
       double precision rescore_tmp,x12,y12,z12,rescore2_tmp
       double precision, dimension (max_template,maxres) :: rescore
       double precision, dimension (max_template,maxres) :: rescore2
-      character*24 pdbfile,tpl_k_rescore
+      character*24 tpl_k_rescore
+      character*256 pdbfile
 
 c
 c For new homol impl
@@ -3646,6 +3654,7 @@ c
       call getenv("FRAGFILE",fragfile) 
       open(ientin,file=fragfile,status="old",err=10)
       read(ientin,*) constr_homology,nclust
+      nmodel_start=constr_homology
       l_homo = .false.
       sigma_theta=0.0
       sigma_d=0.0
@@ -3655,6 +3664,7 @@ c Read pdb files
         read(ientin,'(a)') pdbfile
         write (iout,'(a,5x,a)') 'KLAPAUCJUSZ: Opening PDB file',
      &  pdbfile(:ilen(pdbfile))
+        pdbfiles_chomo(k)=pdbfile 
         open(ipdbin,file=pdbfile,status='old',err=33)
         goto 34
   33    write (iout,'(a,5x,a)') 'Error opening PDB file',