update
[unres.git] / source / unres / src_MD-M / energy_split-sep.F
index 24ab8dd..d8ee63d 100644 (file)
@@ -25,6 +25,7 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.VAR'
       include 'COMMON.LOCAL'
       include 'COMMON.MD'
+      include 'COMMON.CONTROL'
 c      write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
       if (modecalc.eq.12.or.modecalc.eq.14) then
 #ifdef MPI
@@ -132,6 +133,13 @@ C Calculate electrostatic (H-bonding) energy of the main chain.
 C
   107 continue
       call vec_and_deriv
+c      write (iout,*) "etotal_long: shield_mode",shield_mode
+      if (shield_mode.eq.1) then
+       call set_shield_fac
+      else if  (shield_mode.eq.2) then
+       call set_shield_fac2
+      endif
+
       if (ipot.lt.6) then
 #ifdef SPLITELE
          if (welec.gt.0d0.or.wvdwpp.gt.0d0.or.wel_loc.gt.0d0.or.
@@ -195,7 +203,11 @@ C If performing constraint dynamics, call the constraint energy
 C  after the equilibration time
       if(usampl.and.totT.gt.eq_time) then
          call EconstrQ   
-         call Econstr_back
+         if (loc_qlike) then
+           call Econstr_back_qlike
+         else
+           call Econstr_back
+         endif
       else
          Uconst=0.0d0
          Uconst_back=0.0d0
@@ -261,6 +273,8 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.CHAIN'
       include 'COMMON.VAR'
       include 'COMMON.LOCAL'
+      include 'COMMON.CONTROL'
+      include 'COMMON.TORCNSTR'
 
 c      write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
 c      call flush(iout)
@@ -414,7 +428,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
@@ -423,11 +449,28 @@ 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
 C
 C 21/5/07 Calculate local sicdechain correlation energy
 C
@@ -451,10 +494,19 @@ C
       energia(18)=0.0d0
 #endif
 #ifdef SPLITELE
+      energia(3)=ees
       energia(16)=evdw1
 #else
-      energia(3)=evdw1
+      energia(3)=ees+evdw1
+      energia(16)=0.0d0
 #endif
+      energia(4)=ecorr
+      energia(5)=ecorr5
+      energia(6)=ecorr6
+      energia(7)=eel_loc
+      energia(8)=eello_turn3
+      energia(9)=eello_turn4
+
       energia(11)=ebe
       energia(12)=escloc
       energia(13)=etors
@@ -463,6 +515,7 @@ C
       energia(17)=estr
       energia(19)=edihcnstr
       energia(21)=esccor
+      energia(24)=ethetacnstr
 c      write (iout,*) "ETOTAL_SHORT before SUM_ENERGY"
       call flush(iout)
       call sum_energy(energia,.true.)