Adam's changes to wham and cluster following previous commit
[unres.git] / source / wham / src / cxread.F
index 65372e3..d7dcbf8 100644 (file)
@@ -5,6 +5,7 @@
       include 'DIMENSIONS.FREE'
       integer MaxTraj
       parameter (MaxTraj=2050)
+      include 'COMMON.CONTROL'
       include 'COMMON.CHAIN'
       include 'COMMON.INTERACT'
       include 'COMMON.NAMES'
@@ -17,7 +18,8 @@
       include 'COMMON.VAR'
       include 'COMMON.GEO'
       include 'COMMON.PROT'
-      character*64 nazwa,bprotfile_temp
+      character*64 nazwa
+      character*128 bprotfile_temp
       real*4 rtime,rpotE,ruconst,rt_bath,rprop(maxQ)
       double precision time
       integer iret,itmp,itraj,ntraj
@@ -70,12 +72,20 @@ c      print *,"bumbum"
       write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
 #endif
       do j=1,nss
+       if (dyn_ss) then
+        call xdrfint_(ixdrf, idssb(j), iret)
+        call xdrfint_(ixdrf, jdssb(j), iret)
+       idssb(j)=idssb(j)-nres
+       jdssb(j)=jdssb(j)-nres
+       else
         call xdrfint_(ixdrf, ihpb(j), iret)
         call xdrfint_(ixdrf, jhpb(j), iret)
+       endif
       enddo
       call xdrfint_(ixdrf, nprop, iret)
-      if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep) 
-     &  call xdrfint(ixdrf, iset, iret)
+      if (umbrella(iparm) .or. homol_nset.gt.1 .or. read_iset(iparm) 
+     &  .or. hamil_rep) 
+     &  call xdrfint_(ixdrf, iset, iret)
       do i=1,nprop
         call xdrffloat_(ixdrf, rprop(i), iret)
       enddo
@@ -96,8 +106,16 @@ c      print *,"bumbum"
       write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
 #endif
       do j=1,nss
+       if (dyn_ss) then
+        call xdrfint(ixdrf, idssb(j), iret)
+        call xdrfint(ixdrf, jdssb(j), iret)
+cc        idssb(j)=idssb(j)-nres
+cc        jdssb(j)=jdssb(j)-nres
+cc        write(iout,*) idssb(j),jdssb(j)
+       else
         call xdrfint(ixdrf, ihpb(j), iret)
         call xdrfint(ixdrf, jhpb(j), iret)
+       endif
       enddo
       call xdrfint(ixdrf, nprop, iret)
 c      write (iout,*) "nprop",nprop
@@ -109,7 +127,8 @@ c      write (iout,*) "nprop",nprop
         nprop_prev=nprop
       endif
       call flush(iout)
-      if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep) 
+      if (umbrella(iparm) .or. homol_nset.gt.1 .or. read_iset(iparm) 
+     &  .or. hamil_rep) 
      &  call xdrfint(ixdrf, iset, iret)
       do i=1,nprop
         call xdrffloat(ixdrf, rprop(i), iret)
@@ -239,7 +258,7 @@ c            write (iout,*) "Opening file ",
 c     &          bprotfile_temp(:ilen(bprotfile_temp))
             islice1=islice
           endif
-          if (umbrella(iparm)) then
+          if (umbrella(iparm) .or. homol_nset.gt.1) then
             write(ientout,rec=ll(islice))
      &        ((xoord(l,k),l=1,3),k=1,nres),
      &        ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
@@ -262,6 +281,8 @@ c     &          bprotfile_temp(:ilen(bprotfile_temp))
      &        iR,iib,iparm
           endif
 #ifdef DEBUG
+          write (iout,*) " constr_homology",constr_homology,
+     &      " ll",ll(islice)," iset",iset
           call int_from_cart1(.false.)
           write (iout,*) "Writing conformation, record",ll(islice)
           write (iout,*) "Cartesian coordinates"