CONSTR_HOMOL in mutlichain, debug and output cleaning
[unres.git] / source / wham / src / enecalc1.F
index dcf6a97..3d878ad 100644 (file)
      &    ((csingle(l,k+nres),l=1,3),k=nnt,nct),
      &    nss,(ihpb(k),jhpb(k),k=1,nss),
      &    eini,efree,rmsdev,(q(j,iii+1),j=1,nQ),iR,ib,ipar
+#ifdef DEBUG
+        write (iout,*) "homol_nset",homol_nset,
+     &    "  i",i," iR",iR," ib",ib," iset",iset
+#endif
+        if (homol_nset.gt.1) iset=iR
+#ifdef DEBUG
+        write (iout,*) "homol_nset",homol_nset,
+     &    "  i",i," iR",iR," ib",ib," iset",iset
+#endif
 cc       write(iout,*), 'NAWEJ',i,eini
          if (indpdb.gt.0) then
            do k=1,nres
@@ -156,18 +165,22 @@ c     &   " kfac",kfac,"quot",quot," fT",fT
      &      wtor_d,wsccor,wbond
 #endif
         call etotal(energia(0),fT)
+        if (constr_homology) energia(0)=energia(0)+
+     &   waga_homology(iset)*energia(22)
+        write (iout,*) "constr_homology",constr_homology," iset",iset,
+     &   " waga_homology",waga_homology(iset)
 #ifdef DEBUG
         write (iout,*) "Conformation",i
         call enerprint(energia(0),fT)
 c        write (iout,'(2i5,21f8.2)') i,iparm,(energia(k),k=1,21)
 c        write (iout,*) "ftors",ftors
-      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
+c      write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
+c     & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
+c      do ires=1,nres
+c        write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)')
+c     &    restyp(itype(ires)),ires,(c(j,ires),j=1,3),
+c     &    (c(j,ires+nres),j=1,3)
+c      enddo
         call intout
 #endif
         if (energia(0).ge.1.0d20) then
@@ -508,7 +521,7 @@ c        else
 c     &    potE(i,iparm),-entfac(i),rms_nat,iscore
      &    potE(i,nparmset),-entfac(i),rms_nat,iscore
 c        endif
-        write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
+c        write (iout,'(2i5,3e15.5)') i,me,potE(i,iparm),-entfac(i)
 #ifndef MPI
         if (cxfile) call cxwrite(ixdrf,csingle,potE(i,nparmset),
      &    -entfac(i),rms_nat,iscore)