4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.29 2003-08-13 21:20:20 chuckv Exp $, $Date: 2003-08-13 21:20:20 $, $Name: not supported by cvs2svn $, $Revision: 1.29 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.39 2003-12-19 17:25:00 mmeineke Exp $, $Date: 2003-12-19 17:25:00 $, $Name: not supported by cvs2svn $, $Revision: 1.39 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
46 |
|
public :: setRlistDF |
47 |
|
|
48 |
|
#ifdef PROFILE |
49 |
< |
real(kind = dp) :: forceTime |
50 |
< |
real(kind = dp) :: forceTimeInitial, forceTimeFinal |
51 |
< |
real(kind = dp) :: globalForceTime |
52 |
< |
real(kind = dp) :: maxForceTime |
53 |
< |
integer, save :: nloops = 0 |
49 |
> |
public :: getforcetime |
50 |
> |
real, save :: forceTime = 0 |
51 |
> |
real :: forceTimeInitial, forceTimeFinal |
52 |
|
#endif |
53 |
|
|
54 |
|
contains |
152 |
|
|
153 |
|
|
154 |
|
if (FF_uses_EAM) then |
155 |
< |
call init_EAM_FF(my_status) |
155 |
> |
call init_EAM_FF(my_status) |
156 |
|
if (my_status /= 0) then |
157 |
+ |
write(*,*) "init_EAM_FF returned a bad status" |
158 |
|
thisStat = -1 |
159 |
|
return |
160 |
|
end if |
229 |
|
integer :: listerror, error |
230 |
|
integer :: localError |
231 |
|
|
232 |
< |
real(kind=dp) :: listSkin = 1.0 |
234 |
< |
|
232 |
> |
real(kind=dp) :: listSkin = 1.0 |
233 |
|
|
234 |
|
!! initialize local variables |
235 |
|
|
442 |
|
#ifdef IS_MPI |
443 |
|
|
444 |
|
if (update_nlist) then |
447 |
– |
|
445 |
|
!! save current configuration, construct neighbor list, |
446 |
|
!! and calculate forces |
447 |
|
call saveNeighborList(nlocal, q) |
507 |
|
#else |
508 |
|
|
509 |
|
if (update_nlist) then |
510 |
< |
|
510 |
> |
|
511 |
|
! save current configuration, contruct neighbor list, |
512 |
|
! and calculate forces |
513 |
|
call saveNeighborList(natoms, q) |
694 |
|
tau = tau_Temp |
695 |
|
virial = virial_Temp |
696 |
|
endif |
697 |
< |
|
697 |
> |
|
698 |
|
#endif |
699 |
< |
|
700 |
< |
#ifdef PROFILE |
701 |
< |
if (do_pot) then |
705 |
< |
|
706 |
< |
#ifdef IS_MPI |
707 |
< |
|
708 |
< |
|
709 |
< |
call printCommTime() |
710 |
< |
|
711 |
< |
call mpi_allreduce(forceTime,globalForceTime,1,MPI_DOUBLE_PRECISION, & |
712 |
< |
mpi_sum,mpi_comm_world,mpi_err) |
713 |
< |
|
714 |
< |
call mpi_allreduce(forceTime,maxForceTime,1,MPI_DOUBLE_PRECISION, & |
715 |
< |
MPI_MAX,mpi_comm_world,mpi_err) |
716 |
< |
|
717 |
< |
call mpi_comm_size( MPI_COMM_WORLD, nprocs,mpi_err) |
718 |
< |
|
719 |
< |
if (getMyNode() == 0) then |
720 |
< |
write(*,*) "Total processor time spent in force calculations is: ", globalForceTime |
721 |
< |
write(*,*) "Total Time spent in force loop per processor is: ", globalforceTime/nprocs |
722 |
< |
write(*,*) "Maximum force time on any processor is: ", maxForceTime |
723 |
< |
end if |
724 |
< |
#else |
725 |
< |
write(*,*) "Time spent in force loop is: ", forceTime |
726 |
< |
#endif |
727 |
< |
|
728 |
< |
|
729 |
< |
endif |
730 |
< |
|
731 |
< |
#endif |
732 |
< |
|
733 |
< |
|
734 |
< |
|
699 |
> |
|
700 |
> |
|
701 |
> |
|
702 |
|
end subroutine do_force_loop |
703 |
|
|
704 |
|
subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot) |
751 |
|
call getElementProperty(atypes, me_j, "is_DP", is_DP_j) |
752 |
|
|
753 |
|
if ( is_DP_i .and. is_DP_j ) then |
787 |
– |
|
754 |
|
call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, & |
755 |
|
do_pot, do_stress) |
756 |
|
if (FF_uses_RF .and. SimUsesRF()) then |
775 |
|
|
776 |
|
if (FF_uses_GB .and. SimUsesGB()) then |
777 |
|
|
778 |
+ |
|
779 |
|
call getElementProperty(atypes, me_i, "is_GB", is_GB_i) |
780 |
|
call getElementProperty(atypes, me_j, "is_GB", is_GB_j) |
781 |
|
|
1088 |
|
doesit = FF_uses_RF |
1089 |
|
end function FF_RequiresPostpairCalc |
1090 |
|
|
1091 |
+ |
#ifdef PROFILE |
1092 |
+ |
function getforcetime() return(totalforcetime) |
1093 |
+ |
real(kind=dp) :: totalforcetime |
1094 |
+ |
totalforcetime = forcetime |
1095 |
+ |
end function getforcetime |
1096 |
+ |
#endif |
1097 |
+ |
|
1098 |
|
!! This cleans componets of force arrays belonging only to fortran |
1099 |
|
|
1100 |
|
end module do_Forces |