ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/do_Forces.F90
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/do_Forces.F90 (file contents):
Revision 304 by gezelter, Mon Mar 10 18:56:37 2003 UTC vs.
Revision 306 by chuckv, Mon Mar 10 19:26:45 2003 UTC

# Line 1 | Line 1
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  
# Line 28 | Line 31 | contains
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
# Line 83 | Line 86 | contains
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
# Line 655 | Line 658 | contains
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.
# Line 687 | Line 710 | contains
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines