update
[unres.git] / source / unres / src_MD-M / energy_split.F
index 4a09d29..1b496a1 100644 (file)
@@ -370,7 +370,7 @@ c        write (iout,*) "Processor",myrank," BROADCAST vbld_inv"
       endif
 c      write (iout,*) 'Processor',myrank,
 c     &  ' calling etotal_short ipot=',ipot
-      call flush(iout)
+c      call flush(iout)
 c      print *,'Processor',myrank,' nnt=',nnt,' nct=',nct
 #endif     
 c      call int_from_cart1(.false.)
@@ -385,7 +385,19 @@ C from other distance constraints.
 C
 C Calculate the virtual-bond-angle energy.
 C
-      call ebend(ebe)
+      if (wang.gt.0d0) then
+       if (tor_mode.eq.0) then
+         call ebend(ebe)
+       else
+C ebend kcc is Kubo cumulant clustered rigorous attemp to derive the
+C energy function
+         call ebend_kcc(ebe)
+       endif
+      else
+        ebe=0.0d0
+      endif
+      ethetacnstr=0.0d0
+      if (with_theta_constr) call etheta_constr(ethetacnstr)
 C
 C Calculate the SC local energy.
 C
@@ -394,11 +406,29 @@ C
 C
 C Calculate the virtual-bond torsional energy.
 C
-      call etor(etors,edihcnstr)
+      if (wtor.gt.0.0d0) then
+         if (tor_mode.eq.0) then
+           call etor(etors)
+         else
+C etor kcc is Kubo cumulant clustered rigorous attemp to derive the
+C energy function
+           call etor_kcc(etors)
+         endif
+      else
+        etors=0.0d0
+      endif
+      edihcnstr=0.0d0
+      if (ndih_constr.gt.0) call etor_constr(edihcnstr)
+c      print *,"Processor",myrank," computed Utor"
 C
 C 6/23/01 Calculate double-torsional energy
 C
-      call etor_d(etors_d)
+      if ((wtor_d.gt.0.0d0).and.(tor_mode.eq.0)) then
+        call etor_d(etors_d)
+      else
+        etors_d=0
+      endif
+
       do i=1,n_ene
         energia(i)=0.0d0
       enddo