dist1cut
[unres.git] / source / unres / src-HCD-5D / readrtns_CSA.F
index 58b86cc..afad609 100644 (file)
@@ -196,6 +196,12 @@ c      print *,'AFMlog',AFMlog,selfguide,"KUPA"
       call readi(controlcard,'TUBEMOD',tubelog,0)
 c      write (iout,*) TUBElog,"TUBEMODE"
       call readi(controlcard,'IPRINT',iprint,0)
+c 6/22/2021 AL: alpha_GB: parameter to switch between the GB SC-SC
+c    interaction potential and the all-repulsive potential with singularity
+c    at zero site-site distance
+      call reada(controlcard,'ALPHA_GB',alpha_GB,1.0d-2)
+      alpha_GB1 = 1.0d0+1.0d0/alpha_GB
+      write (iout,*) "alpha_GB",alpha_GB," alpha_GB1",alpha_GB1
 C SHIELD keyword sets if the shielding effect of side-chains is used
 C 0 denots no shielding is used all peptide are equally despite the 
 C solvent accesible area
@@ -3066,7 +3072,8 @@ c    &    sigma_odl_temp(maxres,maxres,max_template)
       character*2 kic2
       character*24 model_ki_dist, model_ki_angle
       character*500 controlcard
-      integer ki,i,ii,j,k,l,ii_in_use(maxdim_cont),i_tmp,idomain_tmp,
+      integer ki,i,ii,j,k,l,ii_in_use(maxchain*maxdim),i_tmp,
+     & idomain_tmp,
      & irec,ik,iistart,nres_temp
       integer ilen
       external ilen
@@ -3098,6 +3105,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)
       start_from_model=(index(controlcard,'START_FROM_MODELS').gt.0)
@@ -3240,7 +3248,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
 
@@ -3280,6 +3300,7 @@ c    &                       constr_homology
 c              ii=ii+1
 c              l_homo(k,ii)=.false.
             endif
+           endif
             enddo
           enddo
         lim_odl=ii