Adam's changes from nostromo to wham with homology
[unres.git] / source / wham / src / molread_zs.F
index b12fcfd..34b3210 100644 (file)
@@ -5,6 +5,7 @@ C
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
       include 'DIMENSIONS.ZSCOPT'
+      include 'DIMENSIONS.FREE'
       include 'COMMON.IOUNITS'
       include 'COMMON.GEO'
       include 'COMMON.VAR'
@@ -353,6 +354,7 @@ c-------------------------------------------------------------------------------
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
       include 'DIMENSIONS.ZSCOPT'
+      include 'DIMENSIONS.FREE'
       include 'COMMON.CONTROL'
       include 'COMMON.CHAIN'
       include 'COMMON.IOUNITS'
@@ -483,6 +485,7 @@ c====-------------------------------------------------------------------
 
       include 'DIMENSIONS'
       include 'DIMENSIONS.ZSCOPT'
+      include 'DIMENSIONS.FREE'
 #ifdef MPI
       include 'mpif.h'
 #endif
@@ -509,6 +512,7 @@ c    &    sigma_odl_temp(maxres,maxres,max_template)
       character*500 controlcard
       integer ki, i, j, k, l
       logical lprn /.true./
+      logical unres_pdb
 c
 c     FP - Nov. 2014 Temporary specifications for new vars
 c
@@ -531,6 +535,7 @@ c Alternative: reading from input
       call reada(controlcard,'DIST_CUT',dist_cut,5.0d0) ! for diff ways of calc sigma
  
       call readi(controlcard,"HOMOL_NSET",homol_nset,1)       
+      call readi(controlcard,"IHSET",ihset,1)       
       if (homol_nset.gt.1)then
          call card_concat(controlcard,.true.)
          read(controlcard,*) (waga_homology(i),i=1,homol_nset) 
@@ -636,7 +641,7 @@ c         write(iout,*) "tpl_k_rescore - ",tpl_k_rescore
             read (ientin,*,end=1401) rescore_tmp
 c           rescore(k,irec)=rescore_tmp+1.0d0 ! to avoid 0 values
             rescore(k,irec)=0.5d0*(rescore_tmp+0.5d0) ! alt transf to reduce scores
-c           write(iout,*) "rescore(",k,irec,") =",rescore(k,irec)
+c            write(iout,*) "rescore(",k,irec,") =",rescore(k,irec)
  1301     continue
           enddo  
  1401   continue
@@ -678,7 +683,7 @@ c             write (iout,*) "dist(",i,j,") =",dist(i,j)
 c             write (iout,*) "distal = ",distal
 c             write (iout,*) "odl(",k,ii,") =",odl(k,ii)
 c            write(iout,*) "rescore(",k,i,") =",rescore(k,i),
-c    &                      "rescore(",k,j,") =",rescore(k,j)
+c     &                      "rescore(",k,j,") =",rescore(k,j)
 c
 c  Calculation of sigma from res sim
 c
@@ -689,10 +694,17 @@ c
             if (odl(k,ii).le.dist_cut) then
               sigma_odl(k,ii)=rescore(k,i)+rescore(k,j) ! other exprs possible
 c             sigma_odl(k,ii)=hmscore(k)*rescore(k,i)*rescore(k,j)
+c              write (iout,*) "c sigma_odl",k,ii,sigma_odl(k,ii)
             else
-              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error 
+#ifdef OLDSIGMA
+              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error
      &                      dexp(0.5d0*(odl(k,ii)/dist_cut)**2)
-
+#else
+              sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))* ! sigma ~ rescore ~ error
+     &                      dexp(0.5d0*(odl(k,ii)/dist_cut)**2-0.5d0)
+c              write (iout,*) "d sigma_odl",k,ii,sigma_odl(k,ii),
+c     &           odl(k,ii),dist_cut
+#endif
 c   Following expr replaced by a positive exp argument
 c             sigma_odl(k,ii)=(rescore(k,i)+rescore(k,j))*
 c    &                      dexp(-0.5d0*(odl(k,ii)/dist_cut)**2)
@@ -850,6 +862,7 @@ cd      write(iout,*) "waga_theta",waga_theta,"waga_d",waga_d
      &   1.0d0/dsqrt(sigma_d(ki,i)),ki=1,constr_homology)
        enddo
       endif
+      call flush_(iout)
 c -----------------------------------------------------------------
       return
       end