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

Comparing trunk/OOPSE/libmdtools/calc_reaction_field.F90 (file contents):
Revision 999 by chrisfen, Fri Jan 30 15:01:09 2004 UTC vs.
Revision 1160 by gezelter, Tue May 11 21:31:15 2004 UTC

# Line 97 | Line 97 | contains
97      
98    end subroutine createMomentMap  
99  
100 <  subroutine accumulate_rf(atom1, atom2, rij, u_l)
100 >  subroutine accumulate_rf(atom1, atom2, rij, u_l, taper)
101  
102      integer, intent(in) :: atom1, atom2
103      real (kind = dp), intent(in) :: rij
104      real (kind = dp), dimension(3,nLocal) :: u_l    
105  
106      integer :: me1, me2
107 <    real (kind = dp) :: taper, mu1, mu2
107 >    real (kind = dp), intent(in) :: taper
108 >    real (kind = dp):: mu1, mu2
109      real (kind = dp), dimension(3) :: ul1
110      real (kind = dp), dimension(3) :: ul2  
111  
# Line 124 | Line 125 | contains
125         end if
126      endif
127      
127    if (rij.le.rrf) then
128          
129       if (rij.lt.rt) then
130          taper = 1.0d0
131       else
132  !        write(*,*) 'rf in taper region'
133          taper = (rrf + 2.0d0*rij - 3.0d0*rt)*(rrf-rij)**2/ ((rrf-rt)**3)
134       endif
128        
129   #ifdef IS_MPI
130 <       me1 = atid_Row(atom1)
131 <       ul1(1) = u_l_Row(1,atom1)
132 <       ul1(2) = u_l_Row(2,atom1)
133 <       ul1(3) = u_l_Row(3,atom1)
134 <      
135 <       me2 = atid_Col(atom2)
136 <       ul2(1) = u_l_Col(1,atom2)
137 <       ul2(2) = u_l_Col(2,atom2)
138 <       ul2(3) = u_l_Col(3,atom2)
130 >    me1 = atid_Row(atom1)
131 >    ul1(1) = u_l_Row(1,atom1)
132 >    ul1(2) = u_l_Row(2,atom1)
133 >    ul1(3) = u_l_Row(3,atom1)
134 >    
135 >    me2 = atid_Col(atom2)
136 >    ul2(1) = u_l_Col(1,atom2)
137 >    ul2(2) = u_l_Col(2,atom2)
138 >    ul2(3) = u_l_Col(3,atom2)
139   #else
140 <       me1 = atid(atom1)
141 <       ul1(1) = u_l(1,atom1)
142 <       ul1(2) = u_l(2,atom1)
143 <       ul1(3) = u_l(3,atom1)
144 <      
145 <       me2 = atid(atom2)
146 <       ul2(1) = u_l(1,atom2)
147 <       ul2(2) = u_l(2,atom2)
148 <       ul2(3) = u_l(3,atom2)
149 < #endif
150 <      
151 <       mu1 = MomentMap(me1)%dipole_moment
152 <       mu2 = MomentMap(me2)%dipole_moment
153 <      
140 >    me1 = atid(atom1)
141 >    ul1(1) = u_l(1,atom1)
142 >    ul1(2) = u_l(2,atom1)
143 >    ul1(3) = u_l(3,atom1)
144 >    
145 >    me2 = atid(atom2)
146 >    ul2(1) = u_l(1,atom2)
147 >    ul2(2) = u_l(2,atom2)
148 >    ul2(3) = u_l(3,atom2)
149 > #endif
150 >    
151 >    mu1 = MomentMap(me1)%dipole_moment
152 >    mu2 = MomentMap(me2)%dipole_moment
153 >    
154   #ifdef IS_MPI
155 <       rf_Row(1,atom1) = rf_Row(1,atom1) + ul2(1)*mu2*taper
156 <       rf_Row(2,atom1) = rf_Row(2,atom1) + ul2(2)*mu2*taper
157 <       rf_Row(3,atom1) = rf_Row(3,atom1) + ul2(3)*mu2*taper
158 <      
159 <       rf_Col(1,atom2) = rf_Col(1,atom2) + ul1(1)*mu1*taper
160 <       rf_Col(2,atom2) = rf_Col(2,atom2) + ul1(2)*mu1*taper
161 <       rf_Col(3,atom2) = rf_Col(3,atom2) + ul1(3)*mu1*taper
155 >    rf_Row(1,atom1) = rf_Row(1,atom1) + ul2(1)*mu2*taper
156 >    rf_Row(2,atom1) = rf_Row(2,atom1) + ul2(2)*mu2*taper
157 >    rf_Row(3,atom1) = rf_Row(3,atom1) + ul2(3)*mu2*taper
158 >    
159 >    rf_Col(1,atom2) = rf_Col(1,atom2) + ul1(1)*mu1*taper
160 >    rf_Col(2,atom2) = rf_Col(2,atom2) + ul1(2)*mu1*taper
161 >    rf_Col(3,atom2) = rf_Col(3,atom2) + ul1(3)*mu1*taper
162   #else
163 <       rf(1,atom1) = rf(1,atom1) + ul2(1)*mu2*taper
164 <       rf(2,atom1) = rf(2,atom1) + ul2(2)*mu2*taper
165 <       rf(3,atom1) = rf(3,atom1) + ul2(3)*mu2*taper
166 <      
167 <       rf(1,atom2) = rf(1,atom2) + ul1(1)*mu1*taper
168 <       rf(2,atom2) = rf(2,atom2) + ul1(2)*mu1*taper
169 <       rf(3,atom2) = rf(3,atom2) + ul1(3)*mu1*taper    
163 >    rf(1,atom1) = rf(1,atom1) + ul2(1)*mu2*taper
164 >    rf(2,atom1) = rf(2,atom1) + ul2(2)*mu2*taper
165 >    rf(3,atom1) = rf(3,atom1) + ul2(3)*mu2*taper
166 >    
167 >    rf(1,atom2) = rf(1,atom2) + ul1(1)*mu1*taper
168 >    rf(2,atom2) = rf(2,atom2) + ul1(2)*mu1*taper
169 >    rf(3,atom2) = rf(3,atom2) + ul1(3)*mu1*taper    
170   #endif
171 <      
172 <    endif
171 >    
172 >    
173      return  
174    end subroutine accumulate_rf
175  
# Line 238 | Line 231 | contains
231      return
232    end subroutine reaction_field_final
233    
234 <  subroutine rf_correct_forces(atom1, atom2, d, rij, u_l, f, do_stress)
234 >  subroutine rf_correct_forces(atom1, atom2, d, rij, u_l, taper, f, do_stress)
235      
236      integer, intent(in) :: atom1, atom2
237      real(kind=dp), dimension(3), intent(in) :: d
238 <    real(kind=dp), intent(in) :: rij
238 >    real(kind=dp), intent(in) :: rij, taper
239      real( kind = dp ), dimension(3,nLocal) :: u_l
240      real( kind = dp ), dimension(3,nLocal) :: f
241      logical, intent(in) :: do_stress

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines