45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.69 2005-11-21 22:58:35 gezelter Exp $, $Date: 2005-11-21 22:58:35 $, $Name: not supported by cvs2svn $, $Revision: 1.69 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.77 2006-04-16 02:51:16 chrisfen Exp $, $Date: 2006-04-16 02:51:16 $, $Name: not supported by cvs2svn $, $Revision: 1.77 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
64 |
|
use eam |
65 |
|
use suttonchen |
66 |
|
use status |
67 |
+ |
use interpolation |
68 |
|
#ifdef IS_MPI |
69 |
|
use mpiSimulation |
70 |
|
#endif |
282 |
|
logical :: i_is_GB |
283 |
|
logical :: i_is_EAM |
284 |
|
logical :: i_is_Shape |
285 |
+ |
logical :: i_is_SC |
286 |
|
logical :: GtypeFound |
287 |
|
|
288 |
|
integer :: myStatus, nAtypes, i, j, istart, iend, jstart, jend |
312 |
|
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
313 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
314 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
315 |
< |
|
315 |
> |
call getElementProperty(atypes, i, "is_SC", i_is_SC) |
316 |
|
|
317 |
|
if (haveDefaultCutoffs) then |
318 |
|
atypeMaxCutoff(i) = defaultRcut |
345 |
|
thisRcut = getShapeCut(i) |
346 |
|
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
347 |
|
endif |
348 |
+ |
if (i_is_SC) then |
349 |
+ |
thisRcut = getSCCut(i) |
350 |
+ |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
351 |
+ |
endif |
352 |
|
endif |
353 |
|
|
354 |
|
if (atypeMaxCutoff(i).gt.biggestAtypeCutoff) then |
400 |
|
allocate(groupToGtypeCol(jend)) |
401 |
|
end if |
402 |
|
|
403 |
< |
if(.not.associated(groupToGtypeCol)) then |
404 |
< |
allocate(groupToGtypeCol(jend)) |
403 |
> |
if(.not.associated(groupMaxCutoffCol)) then |
404 |
> |
allocate(groupMaxCutoffCol(jend)) |
405 |
|
else |
406 |
< |
deallocate(groupToGtypeCol) |
407 |
< |
allocate(groupToGtypeCol(jend)) |
406 |
> |
deallocate(groupMaxCutoffCol) |
407 |
> |
allocate(groupMaxCutoffCol(jend)) |
408 |
|
end if |
409 |
|
if(.not.associated(gtypeMaxCutoffCol)) then |
410 |
|
allocate(gtypeMaxCutoffCol(jend)) |
427 |
|
|
428 |
|
tol = 1.0d-6 |
429 |
|
nGroupTypesRow = 0 |
430 |
< |
|
430 |
> |
nGroupTypesCol = 0 |
431 |
|
do i = istart, iend |
432 |
|
n_in_i = groupStartRow(i+1) - groupStartRow(i) |
433 |
|
groupMaxCutoffRow(i) = 0.0_dp |
442 |
|
groupMaxCutoffRow(i)=atypeMaxCutoff(me_i) |
443 |
|
endif |
444 |
|
enddo |
439 |
– |
|
445 |
|
if (nGroupTypesRow.eq.0) then |
446 |
|
nGroupTypesRow = nGroupTypesRow + 1 |
447 |
|
gtypeMaxCutoffRow(nGroupTypesRow) = groupMaxCutoffRow(i) |
584 |
|
|
585 |
|
localError = 0 |
586 |
|
call setLJDefaultCutoff( defaultRcut, defaultDoShift ) |
587 |
+ |
call setElectrostaticCutoffRadius( defaultRcut, defaultRsw ) |
588 |
|
call setCutoffEAM( defaultRcut, localError) |
589 |
|
if (localError /= 0) then |
590 |
|
write(errMsg, *) 'An error has occured in setting the EAM cutoff' |
591 |
|
call handleError("setCutoffs", errMsg) |
592 |
|
end if |
593 |
|
call set_switch(GROUP_SWITCH, defaultRsw, defaultRcut) |
594 |
< |
|
594 |
> |
call setHmatDangerousRcutValue(defaultRcut) |
595 |
> |
|
596 |
|
haveDefaultCutoffs = .true. |
597 |
+ |
haveGtypeCutoffMap = .false. |
598 |
|
end subroutine setCutoffs |
599 |
|
|
600 |
|
subroutine cWasLame() |
610 |
|
|
611 |
|
cutoffPolicy = cutPolicy |
612 |
|
haveCutoffPolicy = .true. |
613 |
< |
|
606 |
< |
call createGtypeCutoffMap() |
613 |
> |
haveGtypeCutoffMap = .false. |
614 |
|
|
615 |
|
end subroutine setCutoffPolicy |
616 |
|
|
628 |
|
real(kind=dp), intent(in) :: thisSkin |
629 |
|
|
630 |
|
skinThickness = thisSkin |
631 |
< |
haveSkinThickness = .true. |
632 |
< |
|
626 |
< |
call createGtypeCutoffMap() |
631 |
> |
haveSkinThickness = .true. |
632 |
> |
haveGtypeCutoffMap = .false. |
633 |
|
|
634 |
|
end subroutine setSkinThickness |
635 |
|
|
639 |
|
SIM_requires_postpair_calc = SimRequiresPostpairCalc() |
640 |
|
SIM_requires_prepair_calc = SimRequiresPrepairCalc() |
641 |
|
SIM_uses_PBC = SimUsesPBC() |
642 |
+ |
SIM_uses_SC = SimUsesSC() |
643 |
|
|
644 |
|
haveSIMvariables = .true. |
645 |
|
|
664 |
|
|
665 |
|
if (VisitCutoffsAfterComputing) then |
666 |
|
call set_switch(GROUP_SWITCH, largestRcut, largestRcut) |
667 |
+ |
call setHmatDangerousRcutValue(largestRcut) |
668 |
|
endif |
669 |
|
|
670 |
|
|
720 |
|
FF_uses_Dipoles = .false. |
721 |
|
FF_uses_GayBerne = .false. |
722 |
|
FF_uses_EAM = .false. |
723 |
+ |
FF_uses_SC = .false. |
724 |
|
|
725 |
|
call getMatchingElementList(atypes, "is_Directional", .true., & |
726 |
|
nMatches, MatchList) |
736 |
|
|
737 |
|
call getMatchingElementList(atypes, "is_EAM", .true., nMatches, MatchList) |
738 |
|
if (nMatches .gt. 0) FF_uses_EAM = .true. |
739 |
+ |
|
740 |
+ |
call getMatchingElementList(atypes, "is_SC", .true., nMatches, MatchList) |
741 |
+ |
if (nMatches .gt. 0) FF_uses_SC = .true. |
742 |
|
|
743 |
|
|
744 |
|
haveSaneForceField = .true. |