45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.42 2005-09-15 00:13:14 chrisfen Exp $, $Date: 2005-09-15 00:13:14 $, $Name: not supported by cvs2svn $, $Revision: 1.42 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.44 2005-09-15 22:05:17 gezelter Exp $, $Date: 2005-09-15 22:05:17 $, $Name: not supported by cvs2svn $, $Revision: 1.44 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
74 |
|
#define __FORTRAN90 |
75 |
|
#include "UseTheForce/fSwitchingFunction.h" |
76 |
|
#include "UseTheForce/fCutoffPolicy.h" |
77 |
– |
#include "UseTheForce/fCoulombicCorrection.h" |
77 |
|
#include "UseTheForce/DarkSide/fInteractionMap.h" |
78 |
|
|
79 |
|
|
135 |
|
type(gtypeCutoffs), dimension(:,:), allocatable :: gtypeCutoffMap |
136 |
|
|
137 |
|
integer, save :: cutoffPolicy = TRADITIONAL_CUTOFF_POLICY |
139 |
– |
integer, save :: coulombicCorrection = NONE |
138 |
|
real(kind=dp),save :: defaultRcut, defaultRsw, defaultRlist |
139 |
|
real(kind=dp),save :: rcuti |
140 |
|
|
278 |
|
nGroupsInRow = getNgroupsInRow(plan_group_row) |
279 |
|
#endif |
280 |
|
nAtypes = getSize(atypes) |
281 |
< |
|
281 |
> |
! Set all of the initial cutoffs to zero. |
282 |
> |
atypeMaxCutoff = 0.0_dp |
283 |
|
do i = 1, nAtypes |
284 |
|
if (SimHasAtype(i)) then |
285 |
|
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
290 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
291 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
292 |
|
|
293 |
< |
atypeMaxCutoff(i) = 0.0_dp |
293 |
> |
|
294 |
|
if (i_is_LJ) then |
295 |
|
thisRcut = getSigma(i) * 2.5_dp |
296 |
|
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
340 |
|
allocate(groupToGtype(iend)) |
341 |
|
allocate(groupMaxCutoff(iend)) |
342 |
|
allocate(gtypeMaxCutoff(iend)) |
343 |
+ |
groupMaxCutoff = 0.0_dp |
344 |
+ |
gtypeMaxCutoff = 0.0_dp |
345 |
|
endif |
346 |
|
!! first we do a single loop over the cutoff groups to find the |
347 |
|
!! largest cutoff for any atypes present in this group. We also |
522 |
|
!! Fortran's version of a cast: |
523 |
|
FF_uses_RF = use_RF |
524 |
|
|
524 |
– |
!! set the electrostatic correction method |
525 |
– |
select case(coulombicCorrection) |
526 |
– |
case(NONE) |
527 |
– |
corrMethod = 0 |
528 |
– |
case(UNDAMPED_WOLF) |
529 |
– |
corrMethod = 1 |
530 |
– |
case(WOLF) |
531 |
– |
corrMethod = 2 |
532 |
– |
case (REACTION_FIELD) |
533 |
– |
corrMethod = 3 |
534 |
– |
case default |
535 |
– |
call handleError("init_FF", "Unknown Coulombic Correction Method") |
536 |
– |
return |
537 |
– |
end select |
525 |
|
|
526 |
|
!! init_FF is called *after* all of the atom types have been |
527 |
|
!! defined in atype_module using the new_atype subroutine. |