2 |
|
!! Corresponds to the force field defined in lj_FF.cpp |
3 |
|
!! @author Charles F. Vardeman II |
4 |
|
!! @author Matthew Meineke |
5 |
< |
!! @version $Id: calc_LJ_FF.F90,v 1.17 2004-02-09 14:48:57 chrisfen Exp $, $Date: 2004-02-09 14:48:57 $, $Name: not supported by cvs2svn $, $Revision: 1.17 $ |
5 |
> |
!! @version $Id: calc_LJ_FF.F90,v 1.18 2004-05-07 21:35:04 gezelter Exp $, $Date: 2004-05-07 21:35:04 $, $Name: not supported by cvs2svn $, $Revision: 1.18 $ |
6 |
|
|
7 |
|
module lj |
8 |
|
use definitions |
9 |
|
use atype_module |
10 |
+ |
use switcheroo |
11 |
|
use vector_class |
12 |
|
use simulation |
13 |
|
#ifdef IS_MPI |
90 |
|
subroutine setCutoffLJ(rcut, status) |
91 |
|
integer :: status, myStatus |
92 |
|
real(kind=dp) :: rcut |
93 |
< |
|
93 |
> |
|
94 |
> |
#define __FORTRAN90 |
95 |
> |
#include "fSwitchingFunction.h" |
96 |
> |
|
97 |
|
status = 0 |
98 |
|
|
99 |
|
LJ_rcut = rcut |
100 |
+ |
call set_switch(LJ_SWITCH, rcut, rcut) |
101 |
+ |
|
102 |
|
!!$ ! ATTENTION! This is a hardwiring of rcut! |
103 |
|
!!$ LJ_rcut = 9.0d0 |
104 |
|
haveCut = .true. |
196 |
|
|
197 |
|
end subroutine createMixingList |
198 |
|
|
199 |
< |
subroutine do_lj_pair(atom1, atom2, d, rij, r2, pot, f, do_pot, do_stress) |
199 |
> |
subroutine do_lj_pair(atom1, atom2, d, rij, r2, sw, vpair, pot, f, & |
200 |
> |
do_pot, do_stress) |
201 |
|
|
202 |
|
integer, intent(in) :: atom1, atom2 |
203 |
|
real( kind = dp ), intent(in) :: rij, r2 |
204 |
< |
real( kind = dp ) :: pot |
204 |
> |
real( kind = dp ) :: pot, sw, vpair |
205 |
|
real( kind = dp ), dimension(3,nLocal) :: f |
206 |
|
real( kind = dp ), intent(in), dimension(3) :: d |
207 |
|
logical, intent(in) :: do_pot, do_stress |
224 |
|
#ifdef IS_MPI |
225 |
|
sigma6 = ljMixed(atid_Row(atom1),atid_Col(atom2))%sigma6 |
226 |
|
epsilon = ljMixed(atid_Row(atom1),atid_Col(atom2))%epsilon |
227 |
< |
delta = ljMixed(atid_Row(atom1),atid_Col(atom2))%delta |
227 |
> |
!delta = ljMixed(atid_Row(atom1),atid_Col(atom2))%delta |
228 |
|
#else |
229 |
|
sigma6 = ljMixed(atid(atom1),atid(atom2))%sigma6 |
230 |
|
epsilon = ljMixed(atid(atom1),atid(atom2))%epsilon |
231 |
< |
delta = ljMixed(atid(atom1),atid(atom2))%delta |
231 |
> |
!delta = ljMixed(atid(atom1),atid(atom2))%delta |
232 |
|
#endif |
233 |
|
|
234 |
|
r6 = r2 * r2 * r2 |
236 |
|
t6 = sigma6/ r6 |
237 |
|
t12 = t6 * t6 |
238 |
|
|
239 |
< |
pot_temp = 4.0E0_DP * epsilon * (t12 - t6) + delta |
239 |
> |
!pot_temp = 4.0E0_DP * epsilon * (t12 - t6) + delta |
240 |
> |
pot_temp = 4.0E0_DP * epsilon * (t12 - t6) * sw |
241 |
> |
vpair = vpair + pot_temp |
242 |
|
|
243 |
< |
dudr = 24.0E0_DP * epsilon * (t6 - 2.0E0_DP*t12) / rij |
243 |
> |
dudr = sw * 24.0E0_DP * epsilon * (t6 - 2.0E0_DP*t12) / rij |
244 |
|
|
245 |
|
drdx = d(1) / rij |
246 |
|
drdy = d(2) / rij |
250 |
|
fy = dudr * drdy |
251 |
|
fz = dudr * drdz |
252 |
|
|
253 |
+ |
|
254 |
|
#ifdef IS_MPI |
255 |
|
if (do_pot) then |
256 |
|
pot_Row(atom1) = pot_Row(atom1) + pot_temp*0.5 |