WHAM and CLUSTER with HM restraints by AL and FP
[unres.git] / source / cluster / wham / src / probabl.F
index 7fcd29b..3071d4c 100644 (file)
@@ -15,6 +15,7 @@
       include "COMMON.SBRIDGE"
       include "COMMON.CHAIN"
       include "COMMON.CLUSTER"
+      include "COMMON.NAMES"
       real*4 csingle(3,maxres2)
       double precision fT(5),fTprim(5),fTbis(5),quot,quotl1,quotl,kfacl,
      &  eprim,ebis,temper,kfac/2.4d0/,T0/300.0d0/
@@ -22,7 +23,9 @@
      &      ehpb,ecorr,ecorr5,ecorr6,eello_turn4,eello_turn3,
      &      eturn6,eel_loc,edihcnstr,etors_d,estr,evdw2_14,esccor
       integer i,ii,ik,iproc,iscor,j,k,l,ib,nlist,ncon
-      double precision qfree,sumprob,eini,efree,rmsdev
+      integer ires
+      double precision qfree,sumprob,eini,efree,rmsdev,ehomology_constr,
+     &      edfadis,edfator,edfanei,edfabet
       character*80 bxname
       character*2 licz1
       character*5 ctemper
@@ -111,13 +114,20 @@ c        write (iout,*) "i",i," ii",ii
           call int_from_cart1(.false.)
           call etotal(energia(0),fT)
           totfree(i)=energia(0)
-c#define DEBUG
 #ifdef DEBUG
           write (iout,*) i," energia",(energia(j),j=0,20)
           call enerprint(energia(0),ft)
+      write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
+     & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
+      do ires=1,nres
+        write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)')
+     &    restyp(itype(ires)),ires,(c(j,ires),j=1,3),
+     &    (c(j,ires+nres),j=1,3)
+      enddo
+
+          call intout
           call flush(iout)
 #endif
-c#undef DEBUG
           do k=1,max_ene
             enetb(k,i)=energia(k)
           enddo
@@ -153,6 +163,11 @@ cc        if (wcorr6.eq.0) ecorr6=0.0d0
         estr=enetb(18,i)
         esccor=enetb(19,i)
         edihcnstr=enetb(20,i)
+        ehomology_constr=enetb(21,i)
+        edfadis=enetb(22,i)
+        edfator=enetb(23,i)
+        edfanei=enetb(24,i)
+        edfabet=enetb(25,i)
 #ifdef SPLITELE
         etot=wsc*evdw+wscp*evdw2+ft(1)*welec*ees+wvdwpp*evdw1
      &  +wang*ebe+ft(1)*wtor*etors+wscloc*escloc
@@ -161,7 +176,8 @@ cc        if (wcorr6.eq.0) ecorr6=0.0d0
      &  +ft(2)*wturn3*eello_turn3
      &  +ft(5)*wturn6*eturn6+ft(2)*wel_loc*eel_loc
      &  +edihcnstr+ft(2)*wtor_d*etors_d+ft(1)*wsccor*esccor
-     &  +wbond*estr
+     &  +wbond*estr+ehomology_constr+wdfa_dist*edfadis
+     &  +wdfa_tor*edfator+wdfa_nei*edfanei+wdfa_beta*edfabet
 #else
         etot=wsc*evdw+wscp*evdw2+ft(1)*welec*(ees+evdw1)
      &  +wang*ebe+ft(1)*wtor*etors+wscloc*escloc
@@ -169,8 +185,9 @@ cc        if (wcorr6.eq.0) ecorr6=0.0d0
      &  +ft(5)*wcorr6*ecorr6+ft(3)*wturn4*eello_turn4
      &  +ft(2)*wturn3*eello_turn3
      &  +ft(5)*wturn6*eturn6+ft(2)*wel_loc*eel_loc+edihcnstr
-     &  +ft(2)*wtor_d*etors_d+ft(1)*wsccor*esccor
-     &  +wbond*estr
+     &  +ft(2)*wtor_d*etors_d+ft(1)*wsccor*esccor+wdfa_dist*edfadis
+     &  +wdfa_tor*edfator+wdfa_nei*edfanei+wdfa_beta*edfabet
+     &  +wbond*estr+ehomology_constr
 #endif
         Fdimless(i)=beta_h(ib)*etot+entfac(ii)
         totfree(i)=etot
@@ -196,7 +213,6 @@ cc        if (wcorr6.eq.0) ecorr6=0.0d0
      & MPI_COMM_WORLD, IERROR)
       if (me.eq.Master) then
 #endif
-c#define DEBUG
 #ifdef DEBUG
         write (iout,*) "The FDIMLESS array before sorting"
         do i=1,ncon
@@ -210,7 +226,6 @@ c#define DEBUG
           write (iout,*) i,list_conf(i),fdimless(i)
         enddo
 #endif
-c#undef DEBUG
         do i=1,ncon
           totfree(i)=fdimless(i)
         enddo