ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/doForces.F90
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/doForces.F90 (file contents):
Revision 2354 by chuckv, Tue Oct 11 22:00:30 2005 UTC vs.
Revision 2355 by chuckv, Wed Oct 12 18:59:16 2005 UTC

# Line 45 | Line 45
45  
46   !! @author Charles F. Vardeman II
47   !! @author Matthew Meineke
48 < !! @version $Id: doForces.F90,v 1.53 2005-10-11 22:00:30 chuckv Exp $, $Date: 2005-10-11 22:00:30 $, $Name: not supported by cvs2svn $, $Revision: 1.53 $
48 > !! @version $Id: doForces.F90,v 1.54 2005-10-12 18:59:16 chuckv Exp $, $Date: 2005-10-12 18:59:16 $, $Name: not supported by cvs2svn $, $Revision: 1.54 $
49  
50  
51   module doForces
# Line 749 | Line 749 | contains
749  
750      !! Stress Tensor
751      real( kind = dp), dimension(9) :: tau  
752 <    real ( kind = dp ) :: pot
752 >    real ( kind = dp ),dimension(POT_ARRAY_SIZE) :: pot
753      logical ( kind = 2) :: do_pot_c, do_stress_c
754      logical :: do_pot
755      logical :: do_stress
756      logical :: in_switching_region
757   #ifdef IS_MPI
758 <    real( kind = DP ) :: pot_local
758 >    real( kind = DP ), dimension(POT_ARRAY_SIZE) :: pot_local
759      integer :: nAtomsInRow
760      integer :: nAtomsInCol
761      integer :: nprocs
# Line 1139 | Line 1139 | contains
1139                  !! potential and torques:
1140                  call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot)
1141   #ifdef IS_MPI
1142 <                pot_local = pot_local + rfpot
1142 >                pot_local(RF_POT) = pot_local(RF_POT) + rfpot
1143   #else
1144 <                pot = pot + rfpot
1144 >                pot(RF_POT) = pot(RF_POT) + rfpot
1145  
1146   #endif
1147               endif
# Line 1153 | Line 1153 | contains
1153   #ifdef IS_MPI
1154  
1155      if (do_pot) then
1156 <       pot = pot + pot_local
1156 >       pot(1:SIZE_POT_ARRAY) = pot(1:SIZE_POT_ARRAY) &
1157 >            + pot_local(1:SIZE_POT_ARRAY)
1158         !! we assume the c code will do the allreduce to get the total potential
1159         !! we could do it right here if we needed to...
1160      endif
# Line 1179 | Line 1180 | contains
1180    subroutine do_pair(i, j, rijsq, d, sw, do_pot, &
1181         eFrame, A, f, t, pot, vpair, fpair)
1182  
1183 <    real( kind = dp ) :: pot, vpair, sw
1183 >    real( kind = dp ) :: vpair, sw
1184 >    real( kind = dp ), dimension(POT_ARRAY_SIZE) :: pot
1185      real( kind = dp ), dimension(3) :: fpair
1186      real( kind = dp ), dimension(nLocal)   :: mfact
1187      real( kind = dp ), dimension(9,nLocal) :: eFrame
# Line 1211 | Line 1213 | contains
1213      iHash = InteractionHash(me_i, me_j)
1214  
1215      if ( iand(iHash, LJ_PAIR).ne.0 ) then
1216 <       call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot)
1216 >       call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot(LJ_POT), f, do_pot)
1217      endif
1218  
1219      if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then
1220         call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, &
1221 <            pot, eFrame, f, t, do_pot)
1221 >            pot(ELECTROSTATIC_POT), eFrame, f, t, do_pot)
1222  
1223         if (electrostaticSummationMethod == REACTION_FIELD) then
1224  
# Line 1229 | Line 1231 | contains
1231  
1232      if ( iand(iHash, STICKY_PAIR).ne.0 ) then
1233         call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1234 <            pot, A, f, t, do_pot)
1234 >            pot(STICKY_POT), A, f, t, do_pot)
1235      endif
1236  
1237      if ( iand(iHash, STICKYPOWER_PAIR).ne.0 ) then
1238         call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1239 <            pot, A, f, t, do_pot)
1239 >            pot(STICKYPOWER_POT), A, f, t, do_pot)
1240      endif
1241  
1242      if ( iand(iHash, GAYBERNE_PAIR).ne.0 ) then
1243         call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1244 <            pot, A, f, t, do_pot)
1244 >            pot(GAYBERNE_POT), A, f, t, do_pot)
1245      endif
1246      
1247      if ( iand(iHash, GAYBERNE_LJ).ne.0 ) then
1248   !      call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1249 < !           pot, A, f, t, do_pot)
1249 > !           pot(GAYBERNE_LJ_POT), A, f, t, do_pot)
1250      endif
1251  
1252      if ( iand(iHash, EAM_PAIR).ne.0 ) then      
1253 <       call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, &
1253 >       call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot(EAM_POT), f, &
1254              do_pot)
1255      endif
1256  
1257      if ( iand(iHash, SHAPE_PAIR).ne.0 ) then      
1258         call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1259 <            pot, A, f, t, do_pot)
1259 >            pot(SHAPE_POT), A, f, t, do_pot)
1260      endif
1261  
1262      if ( iand(iHash, SHAPE_LJ).ne.0 ) then      
1263         call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
1264 <            pot, A, f, t, do_pot)
1264 >            pot(SHAPE_LJ_POT), A, f, t, do_pot)
1265      endif
1266      
1267    end subroutine do_pair
# Line 1267 | Line 1269 | contains
1269    subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, &
1270         do_pot, do_stress, eFrame, A, f, t, pot)
1271  
1272 <    real( kind = dp ) :: pot, sw
1272 >    real( kind = dp ) :: sw
1273 >    real( kind = dp ), dimension(POT_ARRAY_SIZE) :: pot
1274      real( kind = dp ), dimension(9,nLocal) :: eFrame
1275      real (kind=dp), dimension(9,nLocal) :: A
1276      real (kind=dp), dimension(3,nLocal) :: f
# Line 1302 | Line 1305 | contains
1305  
1306    subroutine do_preforce(nlocal,pot)
1307      integer :: nlocal
1308 <    real( kind = dp ) :: pot
1308 >    real( kind = dp ),dimension(POT_ARRAY_SIZE) :: pot
1309  
1310      if (FF_uses_EAM .and. SIM_uses_EAM) then
1311 <       call calc_EAM_preforce_Frho(nlocal,pot)
1311 >       call calc_EAM_preforce_Frho(nlocal,pot(EAM_POT))
1312      endif
1313  
1314  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines