2D replica exchange with homology constraints
[unres.git] / source / unres / src_MD / readrtns.F
index d21d3b9..18e2c2e 100644 (file)
@@ -1166,6 +1166,8 @@ c        write (iout,*) "constr_dist",constr_dist,nstart_sup,nsup
 
       if (constr_homology.gt.0) then
         call read_constr_homology
+      else
+        homol_nset=0
       endif
 
 
@@ -2412,6 +2414,7 @@ c-------------------------------------------------------------------------------
       include 'COMMON.CHAIN'
       include 'COMMON.IOUNITS'
       include 'COMMON.MD'
+      include 'COMMON.CONTROL'
       open(irest2,file=rest2name,status='unknown')
       read(irest2,*) totT,EK,potE,totE,t_bath
       do i=1,2*nres
@@ -2420,7 +2423,7 @@ c-------------------------------------------------------------------------------
       do i=1,2*nres
          read(irest2,'(3e15.5)') (dc(j,i),j=1,3)
       enddo
-      if(usampl) then
+      if(usampl.or.homol_nset.gt.1) then
              read (irest2,*) iset
       endif
       close(irest2)
@@ -2637,12 +2640,26 @@ c-------------------------------------------------------------------------------
       character*2 kic2
       character*24 model_ki_dist, model_ki_angle
       character*500 controlcard
+      character*3200 controlcard1
       integer ki, i, j, k, l
       logical lprn /.true./
 
       call card_concat(controlcard)
-      call reada(controlcard,"HOMOL_DIST",waga_dist,1.0d0)
-      call reada(controlcard,"HOMOL_ANGLE",waga_angle,1.0d0)
+      call readi(controlcard,"HOMOL_NSET",homol_nset,1)       
+      if (homol_nset.gt.1)then
+         call card_concat(controlcard)
+         read(controlcard,*) (waga_dist(i),i=1,homol_nset) 
+         call card_concat(controlcard)
+         read(controlcard,*) (waga_angle(i),i=1,homol_nset) 
+         write(iout,*) "iset distance_weight angle_weight"
+         do i=1,homol_nset
+           write(iout,*) i,waga_dist(i),waga_angle(i)
+         enddo
+      else
+       iset=1
+       call reada(controlcard,"HOMOL_DIST",waga_dist(1),1.0d0)
+       call reada(controlcard,"HOMOL_ANGLE",waga_angle(1),1.0d0)
+      endif
 
       write (iout,*) "nnt",nnt," nct",nct
       call flush(iout)