1 |
+ |
!! do_Forces.F90 |
2 |
+ |
!! module do_Forces |
3 |
|
!! Calculates Long Range forces. |
4 |
+ |
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.7 2003-03-10 18:56:37 gezelter Exp $, $Date: 2003-03-10 18:56:37 $, $Name: not supported by cvs2svn $, $Revision: 1.7 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.8 2003-03-10 19:26:45 chuckv Exp $, $Date: 2003-03-10 19:26:45 $, $Name: not supported by cvs2svn $, $Revision: 1.8 $ |
8 |
|
|
9 |
|
|
10 |
|
|
31 |
|
|
32 |
|
contains |
33 |
|
|
34 |
< |
!! FORCE routine Calculates Lennard Jones forces. |
34 |
> |
!! Does force loop over i,j pairs. Calls do_pair to calculates forces. |
35 |
|
!-------------------------------------------------------------> |
36 |
|
subroutine do_force_loop(q,A,mu,u_l,f,t,tau,potE,do_pot,FFerror) |
37 |
|
!! Position array provided by C, dimensioned by getNlocal |
86 |
|
real( kind = DP ) :: rx_ij, ry_ij, rz_ij, rijsq |
87 |
|
real( kind = DP ) :: rlistsq, rcutsq,rlist,rcut |
88 |
|
|
89 |
< |
real( kind = DP ) :: dielectric = 0.0_dp |
89 |
> |
|
90 |
|
|
91 |
|
! a rig that need to be fixed. |
92 |
|
#ifdef IS_MPI |
658 |
|
|
659 |
|
end subroutine zero_module_variables |
660 |
|
|
661 |
< |
#ifdef IS_MPI |
661 |
> |
|
662 |
|
!! Function to properly build neighbor lists in MPI using newtons 3rd law. |
663 |
|
!! We don't want 2 processors doing the same i j pair twice. |
664 |
|
!! Also checks to see if i and j are the same particle. |
665 |
< |
function mpi_cycle_jLoop(i,j) result(do_cycle) |
665 |
> |
function checkExcludes(atom1,atom2) result(do_cycle) |
666 |
|
!--------------- Arguments-------------------------- |
667 |
|
! Index i |
668 |
< |
integer,intent(in) :: i |
668 |
> |
integer,intent(in) :: atom1 |
669 |
|
! Index j |
670 |
< |
integer,intent(in) :: j |
670 |
> |
integer,intent(in), optional :: atom2 |
671 |
|
! Result do_cycle |
672 |
|
logical :: do_cycle |
673 |
|
!--------------- Local variables-------------------- |
674 |
|
integer :: tag_i |
675 |
|
integer :: tag_j |
676 |
< |
!--------------- END DECLARATIONS------------------ |
677 |
< |
tag_i = tagRow(i) |
676 |
> |
integer :: i |
677 |
> |
!--------------- END DECLARATIONS------------------ |
678 |
> |
do_cycle = .false. |
679 |
> |
|
680 |
> |
#ifdef IS_MPI |
681 |
> |
tag_i = tagRow(atom1) |
682 |
> |
#else |
683 |
> |
tag_i = tag(atom1) |
684 |
> |
#endif |
685 |
> |
|
686 |
> |
!! Check global excludes first |
687 |
> |
if (.not. present(atom2)) then |
688 |
> |
do i = 1,nGlobalExcludes |
689 |
> |
if (excludeGlobal(i) == tag_i) then |
690 |
> |
do_cycle = .true. |
691 |
> |
return |
692 |
> |
end if |
693 |
> |
end do |
694 |
> |
return !! return after checking globals |
695 |
> |
end if |
696 |
> |
|
697 |
> |
!! we return if j not present here. |
698 |
|
tag_j = tagColumn(j) |
699 |
|
|
700 |
< |
do_cycle = .false. |
700 |
> |
|
701 |
|
|
702 |
|
if (tag_i == tag_j) then |
703 |
|
do_cycle = .true. |
710 |
|
else |
711 |
|
if (mod(tag_i + tag_j,2) == 1) do_cycle = .true. |
712 |
|
endif |
690 |
– |
end function mpi_cycle_jLoop |
691 |
– |
#endif |
713 |
|
|
714 |
+ |
|
715 |
+ |
|
716 |
+ |
do i = 1, nLocalExcludes |
717 |
+ |
if (tag_i = excludes(1,i) .and. excludes(2,i) < 0) then |
718 |
+ |
do_cycle = .true. |
719 |
+ |
return |
720 |
+ |
end if |
721 |
+ |
end do |
722 |
+ |
|
723 |
+ |
|
724 |
+ |
end function checkExcludes |
725 |
+ |
|
726 |
+ |
|
727 |
|
end module do_Forces |