Adam's unres update
[unres.git] / source / unres / src-HCD-5D / lagrangian_lesyng.F
index 1180645..6dd113b 100644 (file)
@@ -8,7 +8,7 @@ c-------------------------------------------------------------------------
        include 'DIMENSIONS'
 #ifdef MPI
        include 'mpif.h'
-       integer time00
+       double precision time00
 #endif
        include 'COMMON.VAR'
        include 'COMMON.CHAIN'
@@ -55,7 +55,7 @@ c-------------------------------------------------------------------------
 #endif
 #ifdef FIVEDIAG
       call grad_transform
-      d_a=0.0d0
+      d_a(:,:2*nres)=0.0d0
       if (lprn) then
         write (iout,*) "Potential forces backbone"
         do i=1,nres
@@ -459,9 +459,9 @@ c          write (iout,*) "i",i," itype",itype(i),ntyp1
           endif
         enddo
       enddo
-      DMorig=DM
-      DU1orig=DU1
-      DU2orig=DU2
+      DMorig(:2*nres)=DM(:2*nres)
+      DU1orig(:2*nres)=DU1(:2*nres)
+      DU2orig(:2*nres)=DU2(:2*nres)
       if (gmatout) then
       write (iout,*)"The upper part of the five-diagonal inertia matrix"
       endif
@@ -886,6 +886,9 @@ c---------------------------------------------------------------------------
 c---------------------------------------------------------------------------
       subroutine fivediaginv_mult(ndim,forces,d_a_vec)
       implicit none
+#ifdef MPI
+      include 'mpif.h'
+#endif
       include 'DIMENSIONS'
       include 'COMMON.CHAIN'
       include 'COMMON.IOUNITS'
@@ -896,7 +899,12 @@ c---------------------------------------------------------------------------
       double precision forces(3*ndim),accel(3,0:maxres2),rs(ndim),
      &  xsolv(ndim),d_a_vec(6*nres)
       integer i,j,ind,ichain,n,iposc,innt,inct,inct_prev
-      accel=0.0d0
+#ifdef TIMING
+      include 'COMMON.TIME1'
+      double precision time01
+      time01=MPI_Wtime()
+#endif
+      accel(:,:2*nres)=0.0d0
       do j=1,3
 Compute accelerations in Calpha and SC
         do ichain=1,nchain
@@ -996,6 +1004,9 @@ C Convert d_a to virtual-bon-vector basis
           ind=ind+3
         endif
       enddo
+#ifdef TIMING
+        time_ginvmult=time_ginvmult+MPI_Wtime()-time01
+#endif
 #ifdef DEBUG
       write (iout,*) "d_a_vec"
       write (iout,'(3f10.5)') (d_a_vec(j),j=1,3*(nct-nnt+nside))