chyba dzialajacy lipid
[unres.git] / source / unres / src_MD-M / MD_A-MTS.F
index 0fe17b0..2dc00c1 100644 (file)
@@ -230,6 +230,9 @@ c Variable time step algorithm.
 #endif
         endif
         if (mod(itime,ntwx).eq.0) then
+          write(iout,*) 'time=',itime
+C          call check_ecartint
+          call returnbox
           write (tytul,'("time",f8.2)') totT
           if(mdpdb) then
              call hairpin(.true.,nharp,iharp)
@@ -996,6 +999,8 @@ c Applying velocity Verlet algorithm - step 1 to coordinates
         d_t(j,0)=d_t_old(j,0)+adt
       enddo
       do i=nnt,nct-1   
+C      SPYTAC ADAMA
+C       do i=0,nres
         do j=1,3    
           adt=d_a_old(j,i)*d_time
           adt2=0.5d0*adt
@@ -1005,6 +1010,7 @@ c Applying velocity Verlet algorithm - step 1 to coordinates
         enddo
       enddo
       do i=nnt,nct
+C        do i=0,nres
         if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then
           inres=i+nres
           do j=1,3    
@@ -1087,12 +1093,25 @@ c Applying velocity Verlet algorithm - step 1 to coordinates
 c
 c Compute friction and stochastic forces
 c
+#ifdef MPI
       time00=MPI_Wtime()
+#else
+      time00=tcpu()
+#endif
       call friction_force
+#ifdef MPI
       time_fric=time_fric+MPI_Wtime()-time00
       time00=MPI_Wtime()
+#else
+      time_fric=time_fric+tcpu()-time00
+      time00=tcpu()
+#endif
       call stochastic_force(stochforcvec) 
+#ifdef MPI
       time_stoch=time_stoch+MPI_Wtime()-time00
+#else
+      time_stoch=time_stoch+tcpu()-time00
+#endif
 c
 c Compute the acceleration due to friction forces (d_af_work) and stochastic
 c forces (d_as_work)
@@ -1510,11 +1529,13 @@ c        statname=statname(:ilen(statname)-5)//qstr(:ipos-1)//'.stat'
        if (restart1file) then
          if (me.eq.king)
      &     inquire(file=mremd_rst_name,exist=file_exist)
+#ifdef MPI
            write (*,*) me," Before broadcast: file_exist",file_exist
          call MPI_Bcast(file_exist,1,MPI_LOGICAL,king,CG_COMM,
      &          IERR)
          write (*,*) me," After broadcast: file_exist",file_exist
 c        inquire(file=mremd_rst_name,exist=file_exist)
+#endif
         if(me.eq.king.or..not.out1file)
      &   write(iout,*) "Initial state read by master and distributed"
        else
@@ -1608,7 +1629,7 @@ c Removing the velocity of the center of mass
       call chainbuild_cart
       call kinetic(EK)
       if (tbf) then
-        call verlet_bath(EK)
+        call verlet_bath
       endif      
       kinetic_T=2.0d0/(dimen3*Rb)*EK
       if(me.eq.king.or..not.out1file)then