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

Comparing trunk/OOPSE/libmdtools/calc_dipole_dipole.F90 (file contents):
Revision 611 by gezelter, Tue Jul 15 17:10:50 2003 UTC vs.
Revision 730 by gezelter, Wed Aug 27 16:25:11 2003 UTC

# Line 10 | Line 10 | module dipole_dipole
10   #endif
11    implicit none
12  
13 +  PRIVATE
14    real(kind=dp), save :: rrf = 0.0
15    real(kind=dp), save :: rt  = 0.0
16 <  real(kind=dp), save :: rrfsq = 0.0
16 <  real(kind=dp), save :: pre = 0.0
16 >   real(kind=dp), save :: pre = 0.0
17    logical, save :: dipole_initialized = .false.
18  
19 +
20 +  public::setCutoffsDipole
21 +  public::do_dipole_pair
22 +
23   contains
24      
25 <  subroutine initialize_dipole(this_rrf, this_rt)
25 >  subroutine setCutoffsDipole(this_rrf, this_rt)
26      real(kind=dp), intent(in) :: this_rrf, this_rt
27      rrf = this_rrf
28      rt = this_rt    
29 <    rrfsq = rrf * rrf
26 <    ! pre converts from mu in units of debye to kcal/mol
29 >     ! pre converts from mu in units of debye to kcal/mol
30      pre = 14.38362_dp
31  
32      dipole_initialized = .true.
33      
34      return
35 <  end subroutine initialize_dipole
35 >  end subroutine setCutoffsDipole
36  
34
37    subroutine do_dipole_pair(atom1, atom2, d, rij, r2, pot, u_l, f, t, &
38         do_pot, do_stress)
39      
40      logical :: do_pot, do_stress
41  
42 <    integer atom1, atom2, me1, me2
42 >    integer atom1, atom2, me1, me2, id1, id2
43      real(kind=dp) :: rij, mu1, mu2
44      real(kind=dp) :: dfact1, dfact2, dip2, r2, r3, r5
45      real(kind=dp) :: dudx, dudy, dudz, dudu1x, dudu1y, dudu1z
# Line 173 | Line 175 | contains
175         t(2,atom2) = t(2,atom2) - ul2(3)*dudu2x + ul2(1)*dudu2z
176         t(3,atom2) = t(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x
177   #endif
178 <      
178 >
179         if (do_stress) then          
180  
181 <          if (molMembershipList(atom1) .ne. molMembershipList(atom2)) then
181 > #ifdef IS_MPI
182 >          id1 = tagRow(atom1)
183 >          id2 = tagColumn(atom2)
184 > #else
185 >          id1 = atom1
186 >          id2 = atom2
187 > #endif                
188 >          if (molMembershipList(id1) .ne. molMembershipList(id2)) then
189  
190               ! because the d vector is the rj - ri vector, and
191               ! because dudx, dudy, dudz are the (positive) force on

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines