make cp src-HCD-5D
[unres.git] / source / unres / src-HCD-5D / energy_split-sep.F
index 9abad39..1b033a5 100644 (file)
@@ -1,5 +1,5 @@
       subroutine etotal_long(energia)
-      implicit real*8 (a-h,o-z)
+      implicit none
       include 'DIMENSIONS'
 c
 c Compute the long-range slow-varying contributions to the energy
@@ -13,6 +13,8 @@ cMS$ATTRIBUTES C ::  proc_proc
 #ifdef MPI
       include "mpif.h"
       double precision weights_(n_ene)
+      double precision time00,time_Bcast,time_BcastW
+      integer ierror,ierr
 #endif
       include 'COMMON.SETUP'
       include 'COMMON.IOUNITS'
@@ -24,8 +26,15 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.CHAIN'
       include 'COMMON.VAR'
       include 'COMMON.LOCAL'
+      include 'COMMON.QRESTR'
       include 'COMMON.MD'
       include 'COMMON.CONTROL'
+      double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
+     & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
+     & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
+     & eliptran,Eafmforce,Etube,
+     & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
+      integer i,n_corr,n_corr1
 c      write(iout,'(a,i2)')'Calling etotal_long ipot=',ipot
       if (modecalc.eq.12.or.modecalc.eq.14) then
 #ifdef MPI
@@ -66,7 +75,13 @@ C FG slaves as WEIGHTS array.
           weights_(17)=wbond
           weights_(18)=scal14
           weights_(21)=wsccor
+          weights_(22)=wliptran
+          weights_(25)=wtube
           weights_(26)=wsaxs
+          weights_(28)=wdfa_dist
+          weights_(29)=wdfa_tor
+          weights_(30)=wdfa_nei
+          weights_(31)=wdfa_beta
 C FG Master broadcasts the WEIGHTS_ array
           call MPI_Bcast(weights_(1),n_ene,
      &        MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
@@ -93,7 +108,13 @@ C FG slaves receive the WEIGHTS array
           wbond=weights(17)
           scal14=weights(18)
           wsccor=weights(21)
+          wliptran=weights(22)
+          wtube=weights(25)
           wsaxs=weights(26)
+          wdfa_dist=weights_(28)
+          wdfa_tor=weights_(29)
+          wdfa_nei=weights_(30)
+          wdfa_beta=weights_(31)
         endif
         call MPI_Bcast(dc(1,1),6*nres,MPI_DOUBLE_PRECISION,
      &    king,FG_COMM,IERR)
@@ -181,6 +202,7 @@ C
       else
         call escp_soft_sphere(evdw2,evdw2_14)
       endif
+#ifdef FOURBODY
 C 
 C 12/1/95 Multi-body terms
 C
@@ -200,6 +222,7 @@ c     &" ecorr",ecorr," ecorr5",ecorr5," ecorr6",ecorr6," eturn6",eturn6
       if ((wcorr4.eq.0.0d0 .and. wcorr.gt.0.0d0) .and. ipot.lt.6) then
          call multibody_hb(ecorr,ecorr5,ecorr6,n_corr,n_corr1)
       endif
+#endif
 C 
 C If performing constraint dynamics, call the constraint energy
 C  after the equilibration time
@@ -269,6 +292,8 @@ cMS$ATTRIBUTES C ::  proc_proc
 #ifdef MPI
       include "mpif.h"
       double precision weights_(n_ene)
+      double precision time00
+      integer ierror,ierr
 #endif
       include 'COMMON.SETUP'
       include 'COMMON.IOUNITS'
@@ -281,8 +306,14 @@ cMS$ATTRIBUTES C ::  proc_proc
       include 'COMMON.VAR'
       include 'COMMON.LOCAL'
       include 'COMMON.CONTROL'
+      include 'COMMON.SAXS'
       include 'COMMON.TORCNSTR'
-
+      double precision evdw,evdw1,evdw2,evdw2_14,ees,eel_loc,
+     & eello_turn3,eello_turn4,edfadis,estr,ehpb,ebe,ethetacnstr,
+     & escloc,etors,edihcnstr,etors_d,esccor,ecorr,ecorr5,ecorr6,eturn6,
+     & eliptran,Eafmforce,Etube,
+     & esaxs_constr,ehomology_constr,edfator,edfanei,edfabet
+      integer i,n_corr,n_corr1
 c      write(iout,'(a,i2)')'Calling etotal_short ipot=',ipot
 c      call flush(iout)
       if (modecalc.eq.12.or.modecalc.eq.14) then
@@ -479,6 +510,13 @@ C energy function
         etors=0.0d0
       endif
       edihcnstr=0.0d0
+c Lipid transfer
+      if (wliptran.gt.0) then
+        call Eliptransfer(eliptran)
+      else
+        eliptran=0.0d0
+      endif
+
       if (ndih_constr.gt.0) call etor_constr(edihcnstr)
 c      print *,"Processor",myrank," computed Utor"
 C