45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.80 2006-04-21 19:32:07 chrisfen Exp $, $Date: 2006-04-21 19:32:07 $, $Name: not supported by cvs2svn $, $Revision: 1.80 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.83 2006-06-05 18:24:45 gezelter Exp $, $Date: 2006-06-05 18:24:45 $, $Name: not supported by cvs2svn $, $Revision: 1.83 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
423 |
|
!! largest cutoff for any atypes present in this group. We also |
424 |
|
!! create gtypes at this point. |
425 |
|
|
426 |
< |
tol = 1.0d-6 |
426 |
> |
tol = 1.0e-6_dp |
427 |
|
nGroupTypesRow = 0 |
428 |
|
nGroupTypesCol = 0 |
429 |
|
do i = istart, iend |
962 |
|
|
963 |
|
rCut = gtypeCutoffMap(groupToGtypeRow(i),groupToGtypeCol(j))%rCut |
964 |
|
if (loop .eq. PAIR_LOOP) then |
965 |
< |
vij = 0.0d0 |
965 |
> |
vij = 0.0_dp |
966 |
|
fij(1) = 0.0_dp |
967 |
|
fij(2) = 0.0_dp |
968 |
|
fij(3) = 0.0_dp |
1182 |
|
! prevent overcounting of the skips |
1183 |
|
if (i.lt.j) then |
1184 |
|
call get_interatomic_vector(q(:,i), q(:,j), d_atm, ratmsq) |
1185 |
< |
rVal = dsqrt(ratmsq) |
1185 |
> |
rVal = sqrt(ratmsq) |
1186 |
|
call get_switch(ratmsq, sw, dswdr, rVal,in_switching_region) |
1187 |
|
#ifdef IS_MPI |
1188 |
|
call rf_self_excludes(i, j, sw, eFrame, d_atm, rVal, & |
1200 |
|
#ifdef IS_MPI |
1201 |
|
|
1202 |
|
if (do_pot) then |
1203 |
+ |
#ifdef SINGLE_PRECISION |
1204 |
+ |
call mpi_allreduce(pot_local, pot, LR_POT_TYPES,mpi_real,mpi_sum, & |
1205 |
+ |
mpi_comm_world,mpi_err) |
1206 |
+ |
#else |
1207 |
|
call mpi_allreduce(pot_local, pot, LR_POT_TYPES,mpi_double_precision,mpi_sum, & |
1208 |
|
mpi_comm_world,mpi_err) |
1209 |
+ |
#endif |
1210 |
|
endif |
1211 |
|
|
1212 |
|
if (do_stress) then |
1213 |
+ |
#ifdef SINGLE_PRECISION |
1214 |
+ |
call mpi_allreduce(tau_Temp, tau, 9,mpi_real,mpi_sum, & |
1215 |
+ |
mpi_comm_world,mpi_err) |
1216 |
+ |
call mpi_allreduce(virial_Temp, virial,1,mpi_real,mpi_sum, & |
1217 |
+ |
mpi_comm_world,mpi_err) |
1218 |
+ |
#else |
1219 |
|
call mpi_allreduce(tau_Temp, tau, 9,mpi_double_precision,mpi_sum, & |
1220 |
|
mpi_comm_world,mpi_err) |
1221 |
|
call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & |
1222 |
|
mpi_comm_world,mpi_err) |
1223 |
+ |
#endif |
1224 |
|
endif |
1225 |
|
|
1226 |
|
#else |
1262 |
|
|
1263 |
|
r = sqrt(rijsq) |
1264 |
|
|
1265 |
< |
vpair = 0.0d0 |
1266 |
< |
fpair(1:3) = 0.0d0 |
1265 |
> |
vpair = 0.0_dp |
1266 |
> |
fpair(1:3) = 0.0_dp |
1267 |
|
|
1268 |
|
#ifdef IS_MPI |
1269 |
|
me_i = atid_row(i) |
1301 |
|
endif |
1302 |
|
|
1303 |
|
if ( iand(iHash, GAYBERNE_LJ).ne.0 ) then |
1304 |
< |
call do_gb_lj_pair(i, j, d, r, rijsq, rcut, sw, vpair, fpair, & |
1304 |
> |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1305 |
|
pot(VDW_POT), A, f, t, do_pot) |
1306 |
|
endif |
1307 |
|
|
1406 |
|
|
1407 |
|
! wrap the scaled coordinates |
1408 |
|
|
1409 |
< |
scaled(1) = scaled(1) - dnint(scaled(1)) |
1410 |
< |
scaled(2) = scaled(2) - dnint(scaled(2)) |
1411 |
< |
scaled(3) = scaled(3) - dnint(scaled(3)) |
1409 |
> |
scaled(1) = scaled(1) - anint(scaled(1), kind=dp) |
1410 |
> |
scaled(2) = scaled(2) - anint(scaled(2), kind=dp) |
1411 |
> |
scaled(3) = scaled(3) - anint(scaled(3), kind=dp) |
1412 |
|
|
1413 |
|
! calc the wrapped real coordinates from the wrapped scaled |
1414 |
|
! coordinates |
1426 |
|
|
1427 |
|
! wrap the scaled coordinates |
1428 |
|
|
1429 |
< |
scaled(1) = scaled(1) - dnint(scaled(1)) |
1430 |
< |
scaled(2) = scaled(2) - dnint(scaled(2)) |
1431 |
< |
scaled(3) = scaled(3) - dnint(scaled(3)) |
1429 |
> |
scaled(1) = scaled(1) - anint(scaled(1), kind=dp) |
1430 |
> |
scaled(2) = scaled(2) - anint(scaled(2), kind=dp) |
1431 |
> |
scaled(3) = scaled(3) - anint(scaled(3), kind=dp) |
1432 |
|
|
1433 |
|
! calc the wrapped real coordinates from the wrapped scaled |
1434 |
|
! coordinates |