ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/do_Forces.F90
(Generate patch)

Comparing trunk/OOPSE/libmdtools/do_Forces.F90 (file contents):
Revision 673 by chuckv, Fri Aug 8 21:22:37 2003 UTC vs.
Revision 891 by mmeineke, Fri Dec 19 20:36:35 2003 UTC

# Line 4 | Line 4
4  
5   !! @author Charles F. Vardeman II
6   !! @author Matthew Meineke
7 < !! @version $Id: do_Forces.F90,v 1.28 2003-08-08 21:22:37 chuckv Exp $, $Date: 2003-08-08 21:22:37 $, $Name: not supported by cvs2svn $, $Revision: 1.28 $
7 > !! @version $Id: do_Forces.F90,v 1.40 2003-12-19 20:36:35 mmeineke Exp $, $Date: 2003-12-19 20:36:35 $, $Name: not supported by cvs2svn $, $Revision: 1.40 $
8  
9   module do_Forces
10    use force_globals
# Line 45 | Line 45 | contains
45    public :: do_force_loop
46    public :: setRlistDF
47  
48 + #ifdef PROFILE
49 +  public :: getforcetime
50 +  real, save :: forceTime = 0
51 +  real :: forceTimeInitial, forceTimeFinal
52 +  integer :: nLoops
53 + #endif
54 +
55   contains
56  
57    subroutine setRlistDF( this_rlist )
# Line 146 | Line 153 | contains
153  
154  
155      if (FF_uses_EAM) then
156 <       call init_EAM_FF(my_status)
156 >         call init_EAM_FF(my_status)
157         if (my_status /= 0) then
158 +          write(*,*) "init_EAM_FF returned a bad status"
159            thisStat = -1
160            return
161         end if
# Line 206 | Line 214 | contains
214      real( kind = DP ) :: pot_local
215      integer :: nrow
216      integer :: ncol
217 +    integer :: nprocs
218   #endif
219      integer :: nlocal
220      integer :: natoms    
# Line 221 | Line 230 | contains
230      integer :: listerror, error
231      integer :: localError
232  
233 <    real(kind=dp) :: listSkin = 1.0
225 <    
233 >    real(kind=dp) :: listSkin = 1.0  
234  
235      !! initialize local variables  
236  
# Line 263 | Line 271 | contains
271         call gather(A,A_Col,plan_col_rotation)
272      endif
273      
274 + #endif
275 +
276 + !! Begin force loop timing:
277 + #ifdef PROFILE
278 +    call cpu_time(forceTimeInitial)
279 +    nloops = nloops + 1
280   #endif
281    
282      if (FF_RequiresPrepairCalc() .and. SimRequiresPrepairCalc()) then
# Line 429 | Line 443 | contains
443   #ifdef IS_MPI
444      
445      if (update_nlist) then
432      
446         !! save current configuration, construct neighbor list,
447         !! and calculate forces
448         call saveNeighborList(nlocal, q)
# Line 495 | Line 508 | contains
508   #else
509      
510      if (update_nlist) then
511 <      
511 >
512         ! save current configuration, contruct neighbor list,
513         ! and calculate forces
514         call saveNeighborList(natoms, q)
# Line 563 | Line 576 | contains
576   #endif
577      
578      ! phew, done with main loop.
579 <    
579 >
580 > !! Do timing
581 > #ifdef PROFILE
582 >    call cpu_time(forceTimeFinal)
583 >    forceTime = forceTime + forceTimeFinal - forceTimeInitial
584 > #endif
585 >
586 >
587   #ifdef IS_MPI
588      !!distribute forces
589    
# Line 675 | Line 695 | contains
695         tau = tau_Temp
696         virial = virial_Temp
697      endif
698 <
698 >    
699   #endif
700      
701 +    
702 +    
703    end subroutine do_force_loop
704  
705    subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot)
# Line 730 | Line 752 | contains
752         call getElementProperty(atypes, me_j, "is_DP", is_DP_j)
753        
754         if ( is_DP_i .and. is_DP_j ) then
733          
755            call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, &
756                 do_pot, do_stress)
757            if (FF_uses_RF .and. SimUsesRF()) then
# Line 755 | Line 776 | contains
776  
777      if (FF_uses_GB .and. SimUsesGB()) then
778  
779 +
780         call getElementProperty(atypes, me_i, "is_GB", is_GB_i)
781         call getElementProperty(atypes, me_j, "is_GB", is_GB_j)
782        
# Line 1067 | Line 1089 | contains
1089      doesit = FF_uses_RF
1090    end function FF_RequiresPostpairCalc
1091    
1092 + #ifdef PROFILE
1093 +  function getforcetime() result(totalforcetime)
1094 +    real(kind=dp) :: totalforcetime
1095 +    totalforcetime = forcetime
1096 +  end function getforcetime
1097 + #endif
1098 +
1099   !! This cleans componets of force arrays belonging only to fortran
1100  
1101   end module do_Forces

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines