4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.26 2003-07-30 21:17:01 chuckv Exp $, $Date: 2003-07-30 21:17:01 $, $Name: not supported by cvs2svn $, $Revision: 1.26 $ |
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 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
235 |
|
nlocal = getNlocal() |
236 |
|
natoms = nlocal |
237 |
|
#endif |
238 |
< |
write(*,*) "Inside do_Force Loop" |
238 |
> |
|
239 |
|
call check_initialization(localError) |
240 |
|
if ( localError .ne. 0 ) then |
241 |
|
call handleError("do_force_loop","Not Initialized") |
247 |
|
do_pot = do_pot_c |
248 |
|
do_stress = do_stress_c |
249 |
|
|
250 |
+ |
|
251 |
|
! Gather all information needed by all force loops: |
252 |
|
|
253 |
|
#ifdef IS_MPI |
264 |
|
endif |
265 |
|
|
266 |
|
#endif |
267 |
< |
|
267 |
> |
|
268 |
|
if (FF_RequiresPrepairCalc() .and. SimRequiresPrepairCalc()) then |
269 |
|
!! See if we need to update neighbor lists |
270 |
|
call checkNeighborList(nlocal, q, listSkin, update_nlist) |
272 |
|
!! do_prepair_loop_if_needed |
273 |
|
!! if_mpi_scatter_stuff_from_prepair |
274 |
|
!! if_mpi_gather_stuff_from_prepair_to_main_loop |
275 |
< |
|
275 |
> |
|
276 |
|
!--------------------PREFORCE LOOP----------->>>>>>>>>>>>>>>>>>>>>>>>>>> |
277 |
|
#ifdef IS_MPI |
278 |
|
|
348 |
|
neighborListSize = size(list) |
349 |
|
|
350 |
|
nlist = 0 |
351 |
< |
|
351 |
> |
|
352 |
|
do i = 1, natoms-1 |
353 |
|
point(i) = nlist + 1 |
354 |
|
|
360 |
|
|
361 |
|
|
362 |
|
if (rijsq < rlistsq) then |
363 |
< |
|
363 |
> |
|
364 |
> |
|
365 |
|
nlist = nlist + 1 |
366 |
|
|
367 |
|
if (nlist > neighborListSize) then |
386 |
|
point(natoms) = nlist + 1 |
387 |
|
|
388 |
|
else !! (update) |
389 |
< |
|
389 |
> |
|
390 |
|
! use the list to find the neighbors |
391 |
|
do i = 1, natoms-1 |
392 |
|
JBEG = POINT(i) |
407 |
|
endif |
408 |
|
#endif |
409 |
|
!! Do rest of preforce calculations |
410 |
< |
call do_preforce(nlocal,pot) |
410 |
> |
!! do necessary preforce calculations |
411 |
> |
call do_preforce(nlocal,pot) |
412 |
> |
! we have already updated the neighbor list set it to false... |
413 |
> |
update_nlist = .false. |
414 |
|
else |
415 |
|
!! See if we need to update neighbor lists for non pre-pair |
416 |
|
call checkNeighborList(nlocal, q, listSkin, update_nlist) |
800 |
|
|
801 |
|
r = sqrt(rijsq) |
802 |
|
|
803 |
+ |
|
804 |
|
#ifdef IS_MPI |
805 |
|
if (tagRow(i) .eq. tagColumn(j)) then |
806 |
|
write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j) |
815 |
|
me_j = atid(j) |
816 |
|
|
817 |
|
#endif |
818 |
< |
|
818 |
> |
|
819 |
|
if (FF_uses_EAM .and. SimUsesEAM()) then |
820 |
|
call getElementProperty(atypes, me_i, "is_EAM", is_EAM_i) |
821 |
|
call getElementProperty(atypes, me_j, "is_EAM", is_EAM_j) |
823 |
|
if ( is_EAM_i .and. is_EAM_j ) & |
824 |
|
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
825 |
|
endif |
820 |
– |
end subroutine do_prepair |
826 |
|
|
827 |
+ |
end subroutine do_prepair |
828 |
|
|
829 |
|
|
830 |
|
|
831 |
+ |
|
832 |
|
subroutine do_preforce(nlocal,pot) |
833 |
|
integer :: nlocal |
834 |
|
real( kind = dp ) :: pot |
835 |
|
|
836 |
< |
if (FF_uses_EAM .and. SimUsesEAM()) then |
837 |
< |
call calc_EAM_preforce_Frho(nlocal,pot) |
838 |
< |
endif |
836 |
> |
if (FF_uses_EAM .and. SimUsesEAM()) then |
837 |
> |
call calc_EAM_preforce_Frho(nlocal,pot) |
838 |
> |
endif |
839 |
|
|
840 |
|
|
841 |
|
end subroutine do_preforce |
946 |
|
|
947 |
|
#endif |
948 |
|
|
949 |
+ |
|
950 |
+ |
if (FF_uses_EAM .and. SimUsesEAM()) then |
951 |
+ |
call clean_EAM() |
952 |
+ |
endif |
953 |
+ |
|
954 |
+ |
|
955 |
+ |
|
956 |
+ |
|
957 |
+ |
|
958 |
|
rf = 0.0_dp |
959 |
|
tau_Temp = 0.0_dp |
960 |
|
virial_Temp = 0.0_dp |
1067 |
|
doesit = FF_uses_RF |
1068 |
|
end function FF_RequiresPostpairCalc |
1069 |
|
|
1070 |
+ |
!! This cleans componets of force arrays belonging only to fortran |
1071 |
+ |
|
1072 |
|
end module do_Forces |