cluster average over multiple temperatures
[unres.git] / source / cluster / wham / src-M / readrtns.F
index 92feaf7..5a42f4b 100644 (file)
@@ -110,7 +110,9 @@ C long axis of side chain
       lside = index(controlcard,"SIDE").gt.0
       efree = index(controlcard,"EFREE").gt.0
       call readi(controlcard,'NTEMP',nT,1)
-      write (iout,*) "nT",nT
+      cumul_prob=nt.lt.0
+      nT=iabs(nT)
+      write (iout,*) "nT",nT," cumul_prob",cumul_prob
       call multreada(controlcard,'TEMPER',beta_h,nT,300.0d0)
       write (iout,*) "nT",nT
       write (iout,*) 'beta_h',(beta_h(i),i=1,nT)
@@ -1229,6 +1231,7 @@ c Alternative: reading from input
       call reada(controlcard,"HOMOL_SCD",waga_d,1.0d0) ! new
       call reada(controlcard,'DIST_CUT',dist_cut,5.0d0) ! for diff ways of calc sigma
       call reada(controlcard,'DIST2_CUT',dist2_cut,9999.0d0)
+      dist1cut=(index(controlcard,'DIST1CUT').gt.0)
       call readi(controlcard,"HOMOL_NSET",homol_nset,1)
       read2sigma=(index(controlcard,'READ2SIGMA').gt.0)
       if (homol_nset.gt.1)then
@@ -1389,7 +1392,19 @@ c           write(iout,*) "rescore(",k,irec,") =",rescore(k,irec)
               z12=c(3,i)-c(3,j)
               distal=dsqrt(x12*x12+y12*y12+z12*z12) 
 c              write (iout,*) k,i,j,distal,dist2_cut
-
+           if (dist1cut .and. k.gt.1) then
+              ii=ii+1
+              if (l_homo(1,ii)) then
+                ii_in_use(ii)=1
+                l_homo(k,ii)=.true.
+                ires_homo(ii)=i
+                jres_homo(ii)=j
+                odl(k,ii)=distal
+                sigma_odl(k,ii)=sigma_odl(1,ii)
+              else
+                l_homo(k,ii)=.false.
+              endif   
+           else
             if (idomain(k,i).eq.idomain(k,j).and.idomain(k,i).ne.0
      &            .and. distal.le.dist2_cut ) then
 
@@ -1429,6 +1444,7 @@ c    &                       constr_homology
               ii=ii+1
               l_homo(k,ii)=.false.
             endif
+           endif
             enddo
           enddo
         lim_odl=ii
@@ -1685,7 +1701,7 @@ c Read pdb files
         stop
   34    continue
         unres_pdb=.false.
-        call readpdb
+        call readpdb_template(k)
         do i=1,2*nres
           do j=1,3
             chomo(j,i,k)=c(j,i)
@@ -1730,6 +1746,7 @@ C Copy the coordinates from reference coordinates (?)
 c           write (iout,*) "c(",j,i,") =",c(j,i)
           enddo
         enddo
+        call int_from_cart1(.false.)
         call int_from_cart(.true.,.false.)
         call sc_loc_geom(.false.)
         do i=1,nres