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 378 by mmeineke, Fri Mar 21 17:42:12 2003 UTC vs.
Revision 460 by chuckv, Fri Apr 4 22:22:30 2003 UTC

# Line 3 | Line 3 | module reaction_field
3    use definitions
4    use atype_module
5    use vector_class
6 +  use simulation
7   #ifdef IS_MPI
8    use mpiSimulation
9   #endif
# Line 27 | Line 28 | contains
28      rrfsq = rrf * rrf
29      pre = 14.38362d0*2.0d0*(dielect-1.0d0)/((2.0d0*dielect+1.0d0)*rrfsq*rrf)
30      
31 +
32 +    write(*,*) 'rrf = ', rrf
33 +    write(*,*) 'rt = ', rt
34 +    write(*,*) 'dielect = ', dielect
35 +    write(*,*) 'pre = ', pre
36      rf_initialized = .true.
37      
38      return
# Line 36 | Line 42 | contains
42  
43      integer, intent(in) :: atom1, atom2
44      real (kind = dp), intent(in) :: rij
45 <    real (kind = dp), dimension(:,:) :: u_l    
45 >    real (kind = dp), dimension(3,getNlocal()) :: u_l    
46  
47      integer :: me1, me2
48      real (kind = dp) :: taper, mu1, mu2
# Line 87 | Line 93 | contains
93         rf_Row(2,atom1) = rf_Row(2,atom1) + ul2(2)*mu2*taper
94         rf_Row(3,atom1) = rf_Row(3,atom1) + ul2(3)*mu2*taper
95        
96 <       rf_Col(1,atom2) = rf_Col(1,atom2) + ul1(1)*mu2*taper
97 <       rf_Col(2,atom2) = rf_Col(2,atom2) + ul1(2)*mu2*taper
98 <       rf_Col(3,atom2) = rf_Col(3,atom2) + ul1(3)*mu2*taper
96 >       rf_Col(1,atom2) = rf_Col(1,atom2) + ul1(1)*mu1*taper
97 >       rf_Col(2,atom2) = rf_Col(2,atom2) + ul1(2)*mu1*taper
98 >       rf_Col(3,atom2) = rf_Col(3,atom2) + ul1(3)*mu1*taper
99   #else
100         rf(1,atom1) = rf(1,atom1) + ul2(1)*mu2*taper
101         rf(2,atom1) = rf(2,atom1) + ul2(2)*mu2*taper
102         rf(3,atom1) = rf(3,atom1) + ul2(3)*mu2*taper
103        
104 <       rf(1,atom2) = rf(1,atom2) + ul1(1)*mu2*taper
105 <       rf(2,atom2) = rf(2,atom2) + ul1(2)*mu2*taper
106 <       rf(3,atom2) = rf(3,atom2) + ul1(3)*mu2*taper    
104 >       rf(1,atom2) = rf(1,atom2) + ul1(1)*mu1*taper
105 >       rf(2,atom2) = rf(2,atom2) + ul1(2)*mu1*taper
106 >       rf(3,atom2) = rf(3,atom2) + ul1(3)*mu1*taper    
107   #endif
108        
109      endif
# Line 108 | Line 114 | contains
114      
115      integer, intent(in) :: atom1
116      real(kind=dp), intent(in) :: mu1
117 <    real(kind=dp), dimension(:,:) :: u_l
117 >    real(kind=dp), dimension(3,getNlocal()) :: u_l
118      
119      !! should work for both MPI and non-MPI version since this is not pairwise.
120      rf(1,atom1) = rf(1,atom1) + u_l(1,atom1)*mu1
# Line 124 | Line 130 | contains
130      real (kind=dp), intent(in) :: mu1
131      real (kind=dp), intent(inout) :: rfpot
132      logical, intent(in) :: do_pot
133 <    real (kind = dp), dimension(:,:) :: u_l    
134 <    real (kind = dp), dimension(:,:) :: t
133 >    real (kind = dp), dimension(3,getNlocal()) :: u_l    
134 >    real (kind = dp), dimension(3,getNlocal()) :: t
135  
136      if (.not.rf_initialized) then
137         write(default_error,*) 'Reaction field not initialized!'
# Line 135 | Line 141 | contains
141      ! compute torques on dipoles:
142      ! pre converts from mu in units of debye to kcal/mol
143      
144 <    ! The torque contribution is dipole cross reaction_field
145 <    
144 >    ! The torque contribution is dipole cross reaction_field  
145 >
146      t(1,a1) = t(1,a1) + pre*mu1*(u_l(2,a1)*rf(3,a1) - u_l(3,a1)*rf(2,a1))
147      t(2,a1) = t(2,a1) + pre*mu1*(u_l(3,a1)*rf(1,a1) - u_l(1,a1)*rf(3,a1))
148      t(3,a1) = t(3,a1) + pre*mu1*(u_l(1,a1)*rf(2,a1) - u_l(2,a1)*rf(1,a1))
# Line 156 | Line 162 | contains
162      integer, intent(in) :: atom1, atom2
163      real(kind=dp), dimension(3), intent(in) :: d
164      real(kind=dp), intent(in) :: rij
165 <    real( kind = dp ), dimension(:,:) :: u_l
166 <    real( kind = dp ), dimension(:,:) :: f
165 >    real( kind = dp ), dimension(3,getNlocal()) :: u_l
166 >    real( kind = dp ), dimension(3,getNlocal()) :: f
167      logical, intent(in) :: do_stress
168      
169      real (kind = dp), dimension(3) :: ul1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines