45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.57 2005-10-12 21:00:45 gezelter Exp $, $Date: 2005-10-12 21:00:45 $, $Name: not supported by cvs2svn $, $Revision: 1.57 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.70 2005-12-08 22:04:40 gezelter Exp $, $Date: 2005-12-08 22:04:40 $, $Name: not supported by cvs2svn $, $Revision: 1.70 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
58 |
|
use lj |
59 |
|
use sticky |
60 |
|
use electrostatic_module |
61 |
< |
use reaction_field_module |
62 |
< |
use gb_pair |
61 |
> |
use gayberne |
62 |
|
use shapes |
63 |
|
use vector_class |
64 |
|
use eam |
65 |
+ |
use suttonchen |
66 |
|
use status |
67 |
|
#ifdef IS_MPI |
68 |
|
use mpiSimulation |
87 |
|
logical, save :: haveInteractionHash = .false. |
88 |
|
logical, save :: haveGtypeCutoffMap = .false. |
89 |
|
logical, save :: haveDefaultCutoffs = .false. |
90 |
< |
logical, save :: haveRlist = .false. |
90 |
> |
logical, save :: haveSkinThickness = .false. |
91 |
> |
logical, save :: haveElectrostaticSummationMethod = .false. |
92 |
> |
logical, save :: haveCutoffPolicy = .false. |
93 |
> |
logical, save :: VisitCutoffsAfterComputing = .false. |
94 |
|
|
95 |
|
logical, save :: FF_uses_DirectionalAtoms |
96 |
|
logical, save :: FF_uses_Dipoles |
97 |
|
logical, save :: FF_uses_GayBerne |
98 |
|
logical, save :: FF_uses_EAM |
99 |
+ |
logical, save :: FF_uses_SC |
100 |
+ |
logical, save :: FF_uses_MEAM |
101 |
+ |
|
102 |
|
|
103 |
|
logical, save :: SIM_uses_DirectionalAtoms |
104 |
|
logical, save :: SIM_uses_EAM |
105 |
+ |
logical, save :: SIM_uses_SC |
106 |
+ |
logical, save :: SIM_uses_MEAM |
107 |
|
logical, save :: SIM_requires_postpair_calc |
108 |
|
logical, save :: SIM_requires_prepair_calc |
109 |
|
logical, save :: SIM_uses_PBC |
110 |
|
|
111 |
|
integer, save :: electrostaticSummationMethod |
112 |
+ |
integer, save :: cutoffPolicy = TRADITIONAL_CUTOFF_POLICY |
113 |
|
|
114 |
+ |
real(kind=dp), save :: defaultRcut, defaultRsw, largestRcut |
115 |
+ |
real(kind=dp), save :: skinThickness |
116 |
+ |
logical, save :: defaultDoShift |
117 |
+ |
|
118 |
|
public :: init_FF |
119 |
< |
public :: setDefaultCutoffs |
119 |
> |
public :: setCutoffs |
120 |
> |
public :: cWasLame |
121 |
> |
public :: setElectrostaticMethod |
122 |
> |
public :: setCutoffPolicy |
123 |
> |
public :: setSkinThickness |
124 |
|
public :: do_force_loop |
108 |
– |
public :: createInteractionHash |
109 |
– |
public :: createGtypeCutoffMap |
110 |
– |
public :: getStickyCut |
111 |
– |
public :: getStickyPowerCut |
112 |
– |
public :: getGayBerneCut |
113 |
– |
public :: getEAMCut |
114 |
– |
public :: getShapeCut |
125 |
|
|
126 |
|
#ifdef PROFILE |
127 |
|
public :: getforcetime |
149 |
|
end type gtypeCutoffs |
150 |
|
type(gtypeCutoffs), dimension(:,:), allocatable :: gtypeCutoffMap |
151 |
|
|
142 |
– |
integer, save :: cutoffPolicy = TRADITIONAL_CUTOFF_POLICY |
143 |
– |
real(kind=dp),save :: defaultRcut, defaultRsw, defaultRlist |
144 |
– |
real(kind=dp),save :: listSkin |
145 |
– |
|
152 |
|
contains |
153 |
|
|
154 |
< |
subroutine createInteractionHash(status) |
154 |
> |
subroutine createInteractionHash() |
155 |
|
integer :: nAtypes |
150 |
– |
integer, intent(out) :: status |
156 |
|
integer :: i |
157 |
|
integer :: j |
158 |
|
integer :: iHash |
164 |
|
logical :: i_is_GB |
165 |
|
logical :: i_is_EAM |
166 |
|
logical :: i_is_Shape |
167 |
+ |
logical :: i_is_SC |
168 |
+ |
logical :: i_is_MEAM |
169 |
|
logical :: j_is_LJ |
170 |
|
logical :: j_is_Elect |
171 |
|
logical :: j_is_Sticky |
173 |
|
logical :: j_is_GB |
174 |
|
logical :: j_is_EAM |
175 |
|
logical :: j_is_Shape |
176 |
+ |
logical :: j_is_SC |
177 |
+ |
logical :: j_is_MEAM |
178 |
|
real(kind=dp) :: myRcut |
179 |
|
|
171 |
– |
status = 0 |
172 |
– |
|
180 |
|
if (.not. associated(atypes)) then |
181 |
< |
call handleError("atype", "atypes was not present before call of createInteractionHash!") |
175 |
< |
status = -1 |
181 |
> |
call handleError("doForces", "atypes was not present before call of createInteractionHash!") |
182 |
|
return |
183 |
|
endif |
184 |
|
|
185 |
|
nAtypes = getSize(atypes) |
186 |
|
|
187 |
|
if (nAtypes == 0) then |
188 |
< |
status = -1 |
188 |
> |
call handleError("doForces", "nAtypes was zero during call of createInteractionHash!") |
189 |
|
return |
190 |
|
end if |
191 |
|
|
211 |
|
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
212 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
213 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
214 |
+ |
call getElementProperty(atypes, i, "is_SC", i_is_SC) |
215 |
+ |
call getElementProperty(atypes, i, "is_MEAM", i_is_MEAM) |
216 |
|
|
217 |
|
do j = i, nAtypes |
218 |
|
|
226 |
|
call getElementProperty(atypes, j, "is_GayBerne", j_is_GB) |
227 |
|
call getElementProperty(atypes, j, "is_EAM", j_is_EAM) |
228 |
|
call getElementProperty(atypes, j, "is_Shape", j_is_Shape) |
229 |
+ |
call getElementProperty(atypes, j, "is_SC", j_is_SC) |
230 |
+ |
call getElementProperty(atypes, j, "is_MEAM", j_is_MEAM) |
231 |
|
|
232 |
|
if (i_is_LJ .and. j_is_LJ) then |
233 |
|
iHash = ior(iHash, LJ_PAIR) |
249 |
|
iHash = ior(iHash, EAM_PAIR) |
250 |
|
endif |
251 |
|
|
252 |
+ |
if (i_is_SC .and. j_is_SC) then |
253 |
+ |
iHash = ior(iHash, SC_PAIR) |
254 |
+ |
endif |
255 |
+ |
|
256 |
|
if (i_is_GB .and. j_is_GB) iHash = ior(iHash, GAYBERNE_PAIR) |
257 |
|
if (i_is_GB .and. j_is_LJ) iHash = ior(iHash, GAYBERNE_LJ) |
258 |
|
if (i_is_LJ .and. j_is_GB) iHash = ior(iHash, GAYBERNE_LJ) |
272 |
|
haveInteractionHash = .true. |
273 |
|
end subroutine createInteractionHash |
274 |
|
|
275 |
< |
subroutine createGtypeCutoffMap(stat) |
275 |
> |
subroutine createGtypeCutoffMap() |
276 |
|
|
263 |
– |
integer, intent(out), optional :: stat |
277 |
|
logical :: i_is_LJ |
278 |
|
logical :: i_is_Elect |
279 |
|
logical :: i_is_Sticky |
288 |
|
integer :: nGroupsInRow |
289 |
|
integer :: nGroupsInCol |
290 |
|
integer :: nGroupTypesRow,nGroupTypesCol |
291 |
< |
real(kind=dp):: thisSigma, bigSigma, thisRcut, tradRcut, tol, skin |
291 |
> |
real(kind=dp):: thisSigma, bigSigma, thisRcut, tradRcut, tol |
292 |
|
real(kind=dp) :: biggestAtypeCutoff |
293 |
|
|
281 |
– |
stat = 0 |
294 |
|
if (.not. haveInteractionHash) then |
295 |
< |
call createInteractionHash(myStatus) |
284 |
< |
if (myStatus .ne. 0) then |
285 |
< |
write(default_error, *) 'createInteractionHash failed in doForces!' |
286 |
< |
stat = -1 |
287 |
< |
return |
288 |
< |
endif |
295 |
> |
call createInteractionHash() |
296 |
|
endif |
297 |
|
#ifdef IS_MPI |
298 |
|
nGroupsInRow = getNgroupsInRow(plan_group_row) |
344 |
|
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
345 |
|
endif |
346 |
|
endif |
347 |
< |
|
341 |
< |
|
347 |
> |
|
348 |
|
if (atypeMaxCutoff(i).gt.biggestAtypeCutoff) then |
349 |
|
biggestAtypeCutoff = atypeMaxCutoff(i) |
350 |
|
endif |
351 |
|
|
352 |
|
endif |
353 |
|
enddo |
348 |
– |
|
349 |
– |
|
354 |
|
|
355 |
|
istart = 1 |
356 |
|
jstart = 1 |
499 |
|
groupMaxCutoffCol => groupMaxCutoffRow |
500 |
|
#endif |
501 |
|
|
498 |
– |
|
499 |
– |
|
500 |
– |
|
501 |
– |
|
502 |
|
!! allocate the gtypeCutoffMap here. |
503 |
|
allocate(gtypeCutoffMap(nGroupTypesRow,nGroupTypesCol)) |
504 |
|
!! then we do a double loop over all the group TYPES to find the cutoff |
505 |
|
!! map between groups of two types |
506 |
|
tradRcut = max(maxval(gtypeMaxCutoffRow),maxval(gtypeMaxCutoffCol)) |
507 |
|
|
508 |
< |
do i = 1, nGroupTypesRow |
508 |
> |
do i = 1, nGroupTypesRow |
509 |
|
do j = 1, nGroupTypesCol |
510 |
|
|
511 |
|
select case(cutoffPolicy) |
520 |
|
return |
521 |
|
end select |
522 |
|
gtypeCutoffMap(i,j)%rcut = thisRcut |
523 |
+ |
|
524 |
+ |
if (thisRcut.gt.largestRcut) largestRcut = thisRcut |
525 |
+ |
|
526 |
|
gtypeCutoffMap(i,j)%rcutsq = thisRcut*thisRcut |
527 |
< |
skin = defaultRlist - defaultRcut |
528 |
< |
listSkin = skin ! set neighbor list skin thickness |
529 |
< |
gtypeCutoffMap(i,j)%rlistsq = (thisRcut + skin)**2 |
527 |
> |
|
528 |
> |
if (.not.haveSkinThickness) then |
529 |
> |
skinThickness = 1.0_dp |
530 |
> |
endif |
531 |
|
|
532 |
+ |
gtypeCutoffMap(i,j)%rlistsq = (thisRcut + skinThickness)**2 |
533 |
+ |
|
534 |
|
! sanity check |
535 |
|
|
536 |
|
if (haveDefaultCutoffs) then |
540 |
|
endif |
541 |
|
enddo |
542 |
|
enddo |
543 |
+ |
|
544 |
|
if(allocated(gtypeMaxCutoffRow)) deallocate(gtypeMaxCutoffRow) |
545 |
|
if(allocated(groupMaxCutoffRow)) deallocate(groupMaxCutoffRow) |
546 |
|
if(allocated(atypeMaxCutoff)) deallocate(atypeMaxCutoff) |
554 |
|
haveGtypeCutoffMap = .true. |
555 |
|
end subroutine createGtypeCutoffMap |
556 |
|
|
557 |
< |
subroutine setDefaultCutoffs(defRcut, defRsw, defRlist, cutPolicy) |
551 |
< |
real(kind=dp),intent(in) :: defRcut, defRsw, defRlist |
552 |
< |
integer, intent(in) :: cutPolicy |
557 |
> |
subroutine setCutoffs(defRcut, defRsw) |
558 |
|
|
559 |
+ |
real(kind=dp),intent(in) :: defRcut, defRsw |
560 |
+ |
character(len = statusMsgSize) :: errMsg |
561 |
+ |
integer :: localError |
562 |
+ |
|
563 |
|
defaultRcut = defRcut |
564 |
|
defaultRsw = defRsw |
565 |
< |
defaultRlist = defRlist |
566 |
< |
cutoffPolicy = cutPolicy |
565 |
> |
|
566 |
> |
defaultDoShift = .false. |
567 |
> |
if (abs(defaultRcut-defaultRsw) .lt. 0.0001) then |
568 |
> |
|
569 |
> |
write(errMsg, *) & |
570 |
> |
'cutoffRadius and switchingRadius are set to the same', newline & |
571 |
> |
// tab, 'value. OOPSE will use shifted ', newline & |
572 |
> |
// tab, 'potentials instead of switching functions.' |
573 |
> |
|
574 |
> |
call handleInfo("setCutoffs", errMsg) |
575 |
> |
|
576 |
> |
defaultDoShift = .true. |
577 |
> |
|
578 |
> |
endif |
579 |
|
|
580 |
+ |
localError = 0 |
581 |
+ |
call setLJDefaultCutoff( defaultRcut, defaultDoShift ) |
582 |
+ |
call setCutoffEAM( defaultRcut, localError) |
583 |
+ |
if (localError /= 0) then |
584 |
+ |
write(errMsg, *) 'An error has occured in setting the EAM cutoff' |
585 |
+ |
call handleError("setCutoffs", errMsg) |
586 |
+ |
end if |
587 |
+ |
call set_switch(GROUP_SWITCH, defaultRsw, defaultRcut) |
588 |
+ |
|
589 |
|
haveDefaultCutoffs = .true. |
590 |
< |
end subroutine setDefaultCutoffs |
590 |
> |
end subroutine setCutoffs |
591 |
|
|
592 |
+ |
subroutine cWasLame() |
593 |
+ |
|
594 |
+ |
VisitCutoffsAfterComputing = .true. |
595 |
+ |
return |
596 |
+ |
|
597 |
+ |
end subroutine cWasLame |
598 |
+ |
|
599 |
|
subroutine setCutoffPolicy(cutPolicy) |
600 |
< |
|
600 |
> |
|
601 |
|
integer, intent(in) :: cutPolicy |
602 |
+ |
|
603 |
|
cutoffPolicy = cutPolicy |
604 |
+ |
haveCutoffPolicy = .true. |
605 |
+ |
write(*,*) 'have cutoffPolicy in F = ', cutPolicy |
606 |
+ |
|
607 |
|
call createGtypeCutoffMap() |
567 |
– |
end subroutine setCutoffPolicy |
568 |
– |
|
608 |
|
|
609 |
< |
subroutine setSimVariables() |
610 |
< |
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
611 |
< |
SIM_uses_EAM = SimUsesEAM() |
573 |
< |
SIM_requires_postpair_calc = SimRequiresPostpairCalc() |
574 |
< |
SIM_requires_prepair_calc = SimRequiresPrepairCalc() |
575 |
< |
SIM_uses_PBC = SimUsesPBC() |
609 |
> |
end subroutine setCutoffPolicy |
610 |
> |
|
611 |
> |
subroutine setElectrostaticMethod( thisESM ) |
612 |
|
|
613 |
< |
haveSIMvariables = .true. |
613 |
> |
integer, intent(in) :: thisESM |
614 |
|
|
615 |
< |
return |
616 |
< |
end subroutine setSimVariables |
615 |
> |
electrostaticSummationMethod = thisESM |
616 |
> |
haveElectrostaticSummationMethod = .true. |
617 |
> |
|
618 |
> |
end subroutine setElectrostaticMethod |
619 |
> |
|
620 |
> |
subroutine setSkinThickness( thisSkin ) |
621 |
> |
|
622 |
> |
real(kind=dp), intent(in) :: thisSkin |
623 |
> |
|
624 |
> |
skinThickness = thisSkin |
625 |
> |
haveSkinThickness = .true. |
626 |
> |
|
627 |
> |
call createGtypeCutoffMap() |
628 |
> |
|
629 |
> |
end subroutine setSkinThickness |
630 |
> |
|
631 |
> |
subroutine setSimVariables() |
632 |
> |
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
633 |
> |
SIM_uses_EAM = SimUsesEAM() |
634 |
> |
SIM_requires_postpair_calc = SimRequiresPostpairCalc() |
635 |
> |
SIM_requires_prepair_calc = SimRequiresPrepairCalc() |
636 |
> |
SIM_uses_PBC = SimUsesPBC() |
637 |
> |
|
638 |
> |
haveSIMvariables = .true. |
639 |
> |
|
640 |
> |
return |
641 |
> |
end subroutine setSimVariables |
642 |
|
|
643 |
|
subroutine doReadyCheck(error) |
644 |
|
integer, intent(out) :: error |
648 |
|
error = 0 |
649 |
|
|
650 |
|
if (.not. haveInteractionHash) then |
651 |
< |
myStatus = 0 |
591 |
< |
call createInteractionHash(myStatus) |
592 |
< |
if (myStatus .ne. 0) then |
593 |
< |
write(default_error, *) 'createInteractionHash failed in doForces!' |
594 |
< |
error = -1 |
595 |
< |
return |
596 |
< |
endif |
651 |
> |
call createInteractionHash() |
652 |
|
endif |
653 |
|
|
654 |
|
if (.not. haveGtypeCutoffMap) then |
655 |
< |
myStatus = 0 |
656 |
< |
call createGtypeCutoffMap(myStatus) |
657 |
< |
if (myStatus .ne. 0) then |
658 |
< |
write(default_error, *) 'createGtypeCutoffMap failed in doForces!' |
659 |
< |
error = -1 |
660 |
< |
return |
606 |
< |
endif |
655 |
> |
call createGtypeCutoffMap() |
656 |
> |
endif |
657 |
> |
|
658 |
> |
|
659 |
> |
if (VisitCutoffsAfterComputing) then |
660 |
> |
call set_switch(GROUP_SWITCH, largestRcut, largestRcut) |
661 |
|
endif |
662 |
|
|
663 |
+ |
|
664 |
|
if (.not. haveSIMvariables) then |
665 |
|
call setSimVariables() |
666 |
|
endif |
694 |
|
end subroutine doReadyCheck |
695 |
|
|
696 |
|
|
697 |
< |
subroutine init_FF(thisESM, thisStat) |
697 |
> |
subroutine init_FF(thisStat) |
698 |
|
|
644 |
– |
integer, intent(in) :: thisESM |
699 |
|
integer, intent(out) :: thisStat |
700 |
|
integer :: my_status, nMatches |
701 |
|
integer, pointer :: MatchList(:) => null() |
648 |
– |
real(kind=dp) :: rcut, rrf, rt, dielect |
702 |
|
|
703 |
|
!! assume things are copacetic, unless they aren't |
704 |
|
thisStat = 0 |
705 |
|
|
653 |
– |
electrostaticSummationMethod = thisESM |
654 |
– |
|
706 |
|
!! init_FF is called *after* all of the atom types have been |
707 |
|
!! defined in atype_module using the new_atype subroutine. |
708 |
|
!! |
732 |
|
|
733 |
|
haveSaneForceField = .true. |
734 |
|
|
684 |
– |
!! check to make sure the reaction field setting makes sense |
685 |
– |
|
686 |
– |
if (FF_uses_Dipoles) then |
687 |
– |
if (electrostaticSummationMethod == REACTION_FIELD) then |
688 |
– |
dielect = getDielect() |
689 |
– |
call initialize_rf(dielect) |
690 |
– |
endif |
691 |
– |
else |
692 |
– |
if (electrostaticSummationMethod == REACTION_FIELD) then |
693 |
– |
write(default_error,*) 'Using Reaction Field with no dipoles? Huh?' |
694 |
– |
thisStat = -1 |
695 |
– |
haveSaneForceField = .false. |
696 |
– |
return |
697 |
– |
endif |
698 |
– |
endif |
699 |
– |
|
735 |
|
if (FF_uses_EAM) then |
736 |
|
call init_EAM_FF(my_status) |
737 |
|
if (my_status /= 0) then |
742 |
|
end if |
743 |
|
endif |
744 |
|
|
710 |
– |
if (FF_uses_GayBerne) then |
711 |
– |
call check_gb_pair_FF(my_status) |
712 |
– |
if (my_status .ne. 0) then |
713 |
– |
thisStat = -1 |
714 |
– |
haveSaneForceField = .false. |
715 |
– |
return |
716 |
– |
endif |
717 |
– |
endif |
718 |
– |
|
745 |
|
if (.not. haveNeighborList) then |
746 |
|
!! Create neighbor lists |
747 |
|
call expandNeighborList(nLocal, my_status) |
796 |
|
integer :: nlist |
797 |
|
real( kind = DP ) :: ratmsq, rgrpsq, rgrp, vpair, vij |
798 |
|
real( kind = DP ) :: sw, dswdr, swderiv, mf |
799 |
+ |
real( kind = DP ) :: rVal |
800 |
|
real(kind=dp),dimension(3) :: d_atm, d_grp, fpair, fij |
801 |
|
real(kind=dp) :: rfpot, mu_i, virial |
802 |
+ |
real(kind=dp):: rCut |
803 |
|
integer :: me_i, me_j, n_in_i, n_in_j |
804 |
|
logical :: is_dp_i |
805 |
|
integer :: neighborListSize |
808 |
|
integer :: propPack_i, propPack_j |
809 |
|
integer :: loopStart, loopEnd, loop |
810 |
|
integer :: iHash |
811 |
+ |
integer :: i1 |
812 |
|
|
813 |
|
|
814 |
|
!! initialize local variables |
873 |
|
! (but only on the first time through): |
874 |
|
if (loop .eq. loopStart) then |
875 |
|
#ifdef IS_MPI |
876 |
< |
call checkNeighborList(nGroupsInRow, q_group_row, listSkin, & |
876 |
> |
call checkNeighborList(nGroupsInRow, q_group_row, skinThickness, & |
877 |
|
update_nlist) |
878 |
|
#else |
879 |
< |
call checkNeighborList(nGroups, q_group, listSkin, & |
879 |
> |
call checkNeighborList(nGroups, q_group, skinThickness, & |
880 |
|
update_nlist) |
881 |
|
#endif |
882 |
|
endif |
956 |
|
|
957 |
|
list(nlist) = j |
958 |
|
endif |
959 |
< |
|
931 |
< |
if (loop .eq. PAIR_LOOP) then |
932 |
< |
vij = 0.0d0 |
933 |
< |
fij(1:3) = 0.0d0 |
934 |
< |
endif |
959 |
> |
|
960 |
|
|
961 |
< |
call get_switch(rgrpsq, sw, dswdr, rgrp, group_switch, & |
962 |
< |
in_switching_region) |
961 |
> |
|
962 |
> |
if (rgrpsq < gtypeCutoffMap(groupToGtypeRow(i),groupToGtypeCol(j))%rCutsq) then |
963 |
|
|
964 |
< |
n_in_j = groupStartCol(j+1) - groupStartCol(j) |
965 |
< |
|
966 |
< |
do ia = groupStartRow(i), groupStartRow(i+1)-1 |
967 |
< |
|
968 |
< |
atom1 = groupListRow(ia) |
969 |
< |
|
970 |
< |
inner: do jb = groupStartCol(j), groupStartCol(j+1)-1 |
971 |
< |
|
972 |
< |
atom2 = groupListCol(jb) |
973 |
< |
|
974 |
< |
if (skipThisPair(atom1, atom2)) cycle inner |
975 |
< |
|
976 |
< |
if ((n_in_i .eq. 1).and.(n_in_j .eq. 1)) then |
977 |
< |
d_atm(1:3) = d_grp(1:3) |
978 |
< |
ratmsq = rgrpsq |
979 |
< |
else |
964 |
> |
rCut = gtypeCutoffMap(groupToGtypeRow(i),groupToGtypeCol(j))%rCut |
965 |
> |
if (loop .eq. PAIR_LOOP) then |
966 |
> |
vij = 0.0d0 |
967 |
> |
fij(1:3) = 0.0d0 |
968 |
> |
endif |
969 |
> |
|
970 |
> |
call get_switch(rgrpsq, sw, dswdr, rgrp, & |
971 |
> |
group_switch, in_switching_region) |
972 |
> |
|
973 |
> |
n_in_j = groupStartCol(j+1) - groupStartCol(j) |
974 |
> |
|
975 |
> |
do ia = groupStartRow(i), groupStartRow(i+1)-1 |
976 |
> |
|
977 |
> |
atom1 = groupListRow(ia) |
978 |
> |
|
979 |
> |
inner: do jb = groupStartCol(j), groupStartCol(j+1)-1 |
980 |
> |
|
981 |
> |
atom2 = groupListCol(jb) |
982 |
> |
|
983 |
> |
if (skipThisPair(atom1, atom2)) cycle inner |
984 |
> |
|
985 |
> |
if ((n_in_i .eq. 1).and.(n_in_j .eq. 1)) then |
986 |
> |
d_atm(1:3) = d_grp(1:3) |
987 |
> |
ratmsq = rgrpsq |
988 |
> |
else |
989 |
|
#ifdef IS_MPI |
990 |
< |
call get_interatomic_vector(q_Row(:,atom1), & |
991 |
< |
q_Col(:,atom2), d_atm, ratmsq) |
990 |
> |
call get_interatomic_vector(q_Row(:,atom1), & |
991 |
> |
q_Col(:,atom2), d_atm, ratmsq) |
992 |
|
#else |
993 |
< |
call get_interatomic_vector(q(:,atom1), & |
994 |
< |
q(:,atom2), d_atm, ratmsq) |
993 |
> |
call get_interatomic_vector(q(:,atom1), & |
994 |
> |
q(:,atom2), d_atm, ratmsq) |
995 |
|
#endif |
996 |
< |
endif |
997 |
< |
|
998 |
< |
if (loop .eq. PREPAIR_LOOP) then |
996 |
> |
endif |
997 |
> |
|
998 |
> |
if (loop .eq. PREPAIR_LOOP) then |
999 |
|
#ifdef IS_MPI |
1000 |
< |
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
1001 |
< |
rgrpsq, d_grp, do_pot, do_stress, & |
1002 |
< |
eFrame, A, f, t, pot_local) |
1003 |
< |
#else |
1004 |
< |
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
1005 |
< |
rgrpsq, d_grp, do_pot, do_stress, & |
1006 |
< |
eFrame, A, f, t, pot) |
1007 |
< |
#endif |
1008 |
< |
else |
1000 |
> |
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
1001 |
> |
rgrpsq, d_grp, rCut, do_pot, do_stress, & |
1002 |
> |
eFrame, A, f, t, pot_local) |
1003 |
> |
#else |
1004 |
> |
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
1005 |
> |
rgrpsq, d_grp, rCut, do_pot, do_stress, & |
1006 |
> |
eFrame, A, f, t, pot) |
1007 |
> |
#endif |
1008 |
> |
else |
1009 |
|
#ifdef IS_MPI |
1010 |
< |
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
1011 |
< |
do_pot, & |
1012 |
< |
eFrame, A, f, t, pot_local, vpair, fpair) |
1010 |
> |
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
1011 |
> |
do_pot, eFrame, A, f, t, pot_local, vpair, & |
1012 |
> |
fpair, d_grp, rgrp, rCut) |
1013 |
|
#else |
1014 |
< |
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
1015 |
< |
do_pot, & |
1016 |
< |
eFrame, A, f, t, pot, vpair, fpair) |
1014 |
> |
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
1015 |
> |
do_pot, eFrame, A, f, t, pot, vpair, fpair, & |
1016 |
> |
d_grp, rgrp, rCut) |
1017 |
|
#endif |
1018 |
+ |
vij = vij + vpair |
1019 |
+ |
fij(1:3) = fij(1:3) + fpair(1:3) |
1020 |
+ |
endif |
1021 |
+ |
enddo inner |
1022 |
+ |
enddo |
1023 |
|
|
1024 |
< |
vij = vij + vpair |
1025 |
< |
fij(1:3) = fij(1:3) + fpair(1:3) |
1026 |
< |
endif |
1027 |
< |
enddo inner |
1028 |
< |
enddo |
1029 |
< |
|
1030 |
< |
if (loop .eq. PAIR_LOOP) then |
1031 |
< |
if (in_switching_region) then |
1032 |
< |
swderiv = vij*dswdr/rgrp |
1033 |
< |
fij(1) = fij(1) + swderiv*d_grp(1) |
995 |
< |
fij(2) = fij(2) + swderiv*d_grp(2) |
996 |
< |
fij(3) = fij(3) + swderiv*d_grp(3) |
997 |
< |
|
998 |
< |
do ia=groupStartRow(i), groupStartRow(i+1)-1 |
999 |
< |
atom1=groupListRow(ia) |
1000 |
< |
mf = mfactRow(atom1) |
1024 |
> |
if (loop .eq. PAIR_LOOP) then |
1025 |
> |
if (in_switching_region) then |
1026 |
> |
swderiv = vij*dswdr/rgrp |
1027 |
> |
fij(1) = fij(1) + swderiv*d_grp(1) |
1028 |
> |
fij(2) = fij(2) + swderiv*d_grp(2) |
1029 |
> |
fij(3) = fij(3) + swderiv*d_grp(3) |
1030 |
> |
|
1031 |
> |
do ia=groupStartRow(i), groupStartRow(i+1)-1 |
1032 |
> |
atom1=groupListRow(ia) |
1033 |
> |
mf = mfactRow(atom1) |
1034 |
|
#ifdef IS_MPI |
1035 |
< |
f_Row(1,atom1) = f_Row(1,atom1) + swderiv*d_grp(1)*mf |
1036 |
< |
f_Row(2,atom1) = f_Row(2,atom1) + swderiv*d_grp(2)*mf |
1037 |
< |
f_Row(3,atom1) = f_Row(3,atom1) + swderiv*d_grp(3)*mf |
1035 |
> |
f_Row(1,atom1) = f_Row(1,atom1) + swderiv*d_grp(1)*mf |
1036 |
> |
f_Row(2,atom1) = f_Row(2,atom1) + swderiv*d_grp(2)*mf |
1037 |
> |
f_Row(3,atom1) = f_Row(3,atom1) + swderiv*d_grp(3)*mf |
1038 |
|
#else |
1039 |
< |
f(1,atom1) = f(1,atom1) + swderiv*d_grp(1)*mf |
1040 |
< |
f(2,atom1) = f(2,atom1) + swderiv*d_grp(2)*mf |
1041 |
< |
f(3,atom1) = f(3,atom1) + swderiv*d_grp(3)*mf |
1039 |
> |
f(1,atom1) = f(1,atom1) + swderiv*d_grp(1)*mf |
1040 |
> |
f(2,atom1) = f(2,atom1) + swderiv*d_grp(2)*mf |
1041 |
> |
f(3,atom1) = f(3,atom1) + swderiv*d_grp(3)*mf |
1042 |
|
#endif |
1043 |
< |
enddo |
1044 |
< |
|
1045 |
< |
do jb=groupStartCol(j), groupStartCol(j+1)-1 |
1046 |
< |
atom2=groupListCol(jb) |
1047 |
< |
mf = mfactCol(atom2) |
1043 |
> |
enddo |
1044 |
> |
|
1045 |
> |
do jb=groupStartCol(j), groupStartCol(j+1)-1 |
1046 |
> |
atom2=groupListCol(jb) |
1047 |
> |
mf = mfactCol(atom2) |
1048 |
|
#ifdef IS_MPI |
1049 |
< |
f_Col(1,atom2) = f_Col(1,atom2) - swderiv*d_grp(1)*mf |
1050 |
< |
f_Col(2,atom2) = f_Col(2,atom2) - swderiv*d_grp(2)*mf |
1051 |
< |
f_Col(3,atom2) = f_Col(3,atom2) - swderiv*d_grp(3)*mf |
1049 |
> |
f_Col(1,atom2) = f_Col(1,atom2) - swderiv*d_grp(1)*mf |
1050 |
> |
f_Col(2,atom2) = f_Col(2,atom2) - swderiv*d_grp(2)*mf |
1051 |
> |
f_Col(3,atom2) = f_Col(3,atom2) - swderiv*d_grp(3)*mf |
1052 |
|
#else |
1053 |
< |
f(1,atom2) = f(1,atom2) - swderiv*d_grp(1)*mf |
1054 |
< |
f(2,atom2) = f(2,atom2) - swderiv*d_grp(2)*mf |
1055 |
< |
f(3,atom2) = f(3,atom2) - swderiv*d_grp(3)*mf |
1053 |
> |
f(1,atom2) = f(1,atom2) - swderiv*d_grp(1)*mf |
1054 |
> |
f(2,atom2) = f(2,atom2) - swderiv*d_grp(2)*mf |
1055 |
> |
f(3,atom2) = f(3,atom2) - swderiv*d_grp(3)*mf |
1056 |
|
#endif |
1057 |
< |
enddo |
1058 |
< |
endif |
1057 |
> |
enddo |
1058 |
> |
endif |
1059 |
|
|
1060 |
< |
if (do_stress) call add_stress_tensor(d_grp, fij) |
1060 |
> |
if (do_stress) call add_stress_tensor(d_grp, fij) |
1061 |
> |
endif |
1062 |
|
endif |
1063 |
< |
end if |
1063 |
> |
endif |
1064 |
|
enddo |
1065 |
< |
|
1065 |
> |
|
1066 |
|
enddo outer |
1067 |
|
|
1068 |
|
if (update_nlist) then |
1144 |
|
endif |
1145 |
|
#endif |
1146 |
|
|
1147 |
< |
if (FF_RequiresPostpairCalc() .and. SIM_requires_postpair_calc) then |
1147 |
> |
if (SIM_requires_postpair_calc) then |
1148 |
> |
do i = 1, nlocal |
1149 |
> |
|
1150 |
> |
! we loop only over the local atoms, so we don't need row and column |
1151 |
> |
! lookups for the types |
1152 |
> |
|
1153 |
> |
me_i = atid(i) |
1154 |
> |
|
1155 |
> |
! is the atom electrostatic? See if it would have an |
1156 |
> |
! electrostatic interaction with itself |
1157 |
> |
iHash = InteractionHash(me_i,me_i) |
1158 |
|
|
1159 |
< |
if (electrostaticSummationMethod == REACTION_FIELD) then |
1116 |
< |
|
1159 |
> |
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
1160 |
|
#ifdef IS_MPI |
1161 |
< |
call scatter(rf_Row,rf,plan_atom_row_3d) |
1162 |
< |
call scatter(rf_Col,rf_Temp,plan_atom_col_3d) |
1120 |
< |
do i = 1,nlocal |
1121 |
< |
rf(1:3,i) = rf(1:3,i) + rf_Temp(1:3,i) |
1122 |
< |
end do |
1123 |
< |
#endif |
1124 |
< |
|
1125 |
< |
do i = 1, nLocal |
1126 |
< |
|
1127 |
< |
rfpot = 0.0_DP |
1128 |
< |
#ifdef IS_MPI |
1129 |
< |
me_i = atid_row(i) |
1161 |
> |
call self_self(i, eFrame, pot_local(ELECTROSTATIC_POT), & |
1162 |
> |
t, do_pot) |
1163 |
|
#else |
1164 |
< |
me_i = atid(i) |
1164 |
> |
call self_self(i, eFrame, pot(ELECTROSTATIC_POT), & |
1165 |
> |
t, do_pot) |
1166 |
|
#endif |
1167 |
< |
iHash = InteractionHash(me_i,me_j) |
1167 |
> |
endif |
1168 |
> |
|
1169 |
> |
|
1170 |
> |
if (electrostaticSummationMethod.eq.REACTION_FIELD) then |
1171 |
|
|
1172 |
< |
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
1173 |
< |
|
1174 |
< |
mu_i = getDipoleMoment(me_i) |
1175 |
< |
|
1176 |
< |
!! The reaction field needs to include a self contribution |
1177 |
< |
!! to the field: |
1178 |
< |
call accumulate_self_rf(i, mu_i, eFrame) |
1179 |
< |
!! Get the reaction field contribution to the |
1180 |
< |
!! potential and torques: |
1181 |
< |
call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot) |
1182 |
< |
#ifdef IS_MPI |
1183 |
< |
pot_local(ELECTROSTATIC_POT) = pot_local(ELECTROSTATIC_POT) + rfpot |
1172 |
> |
! loop over the excludes to accumulate RF stuff we've |
1173 |
> |
! left out of the normal pair loop |
1174 |
> |
|
1175 |
> |
do i1 = 1, nSkipsForAtom(i) |
1176 |
> |
j = skipsForAtom(i, i1) |
1177 |
> |
|
1178 |
> |
! prevent overcounting of the skips |
1179 |
> |
if (i.lt.j) then |
1180 |
> |
call get_interatomic_vector(q(:,i), & |
1181 |
> |
q(:,j), d_atm, ratmsq) |
1182 |
> |
rVal = dsqrt(ratmsq) |
1183 |
> |
call get_switch(ratmsq, sw, dswdr, rVal, group_switch, & |
1184 |
> |
in_switching_region) |
1185 |
> |
#ifdef IS_MPI |
1186 |
> |
call rf_self_excludes(i, j, sw, eFrame, d_atm, rVal, & |
1187 |
> |
vpair, pot_local(ELECTROSTATIC_POT), f, t, do_pot) |
1188 |
|
#else |
1189 |
< |
pot(ELECTROSTATIC_POT) = pot(ELECTROSTATIC_POT) + rfpot |
1190 |
< |
|
1189 |
> |
call rf_self_excludes(i, j, sw, eFrame, d_atm, rVal, & |
1190 |
> |
vpair, pot(ELECTROSTATIC_POT), f, t, do_pot) |
1191 |
|
#endif |
1192 |
< |
endif |
1193 |
< |
enddo |
1194 |
< |
endif |
1192 |
> |
endif |
1193 |
> |
enddo |
1194 |
> |
endif |
1195 |
> |
enddo |
1196 |
|
endif |
1197 |
< |
|
1156 |
< |
|
1197 |
> |
|
1198 |
|
#ifdef IS_MPI |
1199 |
< |
|
1199 |
> |
|
1200 |
|
if (do_pot) then |
1201 |
< |
pot(1:LR_POT_TYPES) = pot(1:LR_POT_TYPES) & |
1202 |
< |
+ pot_local(1:LR_POT_TYPES) |
1162 |
< |
!! we assume the c code will do the allreduce to get the total potential |
1163 |
< |
!! we could do it right here if we needed to... |
1201 |
> |
call mpi_allreduce(pot_local, pot, LR_POT_TYPES,mpi_double_precision,mpi_sum, & |
1202 |
> |
mpi_comm_world,mpi_err) |
1203 |
|
endif |
1204 |
< |
|
1204 |
> |
|
1205 |
|
if (do_stress) then |
1206 |
|
call mpi_allreduce(tau_Temp, tau, 9,mpi_double_precision,mpi_sum, & |
1207 |
|
mpi_comm_world,mpi_err) |
1208 |
|
call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & |
1209 |
|
mpi_comm_world,mpi_err) |
1210 |
|
endif |
1211 |
< |
|
1211 |
> |
|
1212 |
|
#else |
1213 |
< |
|
1213 |
> |
|
1214 |
|
if (do_stress) then |
1215 |
|
tau = tau_Temp |
1216 |
|
virial = virial_Temp |
1217 |
|
endif |
1218 |
< |
|
1218 |
> |
|
1219 |
|
#endif |
1220 |
< |
|
1220 |
> |
|
1221 |
|
end subroutine do_force_loop |
1222 |
|
|
1223 |
|
subroutine do_pair(i, j, rijsq, d, sw, do_pot, & |
1224 |
< |
eFrame, A, f, t, pot, vpair, fpair) |
1224 |
> |
eFrame, A, f, t, pot, vpair, fpair, d_grp, r_grp, rCut) |
1225 |
|
|
1226 |
|
real( kind = dp ) :: vpair, sw |
1227 |
|
real( kind = dp ), dimension(LR_POT_TYPES) :: pot |
1235 |
|
logical, intent(inout) :: do_pot |
1236 |
|
integer, intent(in) :: i, j |
1237 |
|
real ( kind = dp ), intent(inout) :: rijsq |
1238 |
< |
real ( kind = dp ) :: r |
1238 |
> |
real ( kind = dp ), intent(inout) :: r_grp |
1239 |
|
real ( kind = dp ), intent(inout) :: d(3) |
1240 |
+ |
real ( kind = dp ), intent(inout) :: d_grp(3) |
1241 |
+ |
real ( kind = dp ), intent(inout) :: rCut |
1242 |
+ |
real ( kind = dp ) :: r |
1243 |
|
integer :: me_i, me_j |
1244 |
|
|
1245 |
|
integer :: iHash |
1257 |
|
#endif |
1258 |
|
|
1259 |
|
iHash = InteractionHash(me_i, me_j) |
1260 |
< |
|
1260 |
> |
|
1261 |
|
if ( iand(iHash, LJ_PAIR).ne.0 ) then |
1262 |
< |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1262 |
> |
call do_lj_pair(i, j, d, r, rijsq, rcut, sw, vpair, fpair, & |
1263 |
|
pot(VDW_POT), f, do_pot) |
1264 |
|
endif |
1265 |
< |
|
1265 |
> |
|
1266 |
|
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
1267 |
< |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1267 |
> |
call doElectrostaticPair(i, j, d, r, rijsq, rcut, sw, vpair, fpair, & |
1268 |
|
pot(ELECTROSTATIC_POT), eFrame, f, t, do_pot) |
1227 |
– |
|
1228 |
– |
if (electrostaticSummationMethod == REACTION_FIELD) then |
1229 |
– |
|
1230 |
– |
! CHECK ME (RF needs to know about all electrostatic types) |
1231 |
– |
call accumulate_rf(i, j, r, eFrame, sw) |
1232 |
– |
call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair) |
1233 |
– |
endif |
1234 |
– |
|
1269 |
|
endif |
1270 |
< |
|
1270 |
> |
|
1271 |
|
if ( iand(iHash, STICKY_PAIR).ne.0 ) then |
1272 |
|
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1273 |
|
pot(HB_POT), A, f, t, do_pot) |
1274 |
|
endif |
1275 |
< |
|
1275 |
> |
|
1276 |
|
if ( iand(iHash, STICKYPOWER_PAIR).ne.0 ) then |
1277 |
|
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1278 |
|
pot(HB_POT), A, f, t, do_pot) |
1279 |
|
endif |
1280 |
< |
|
1280 |
> |
|
1281 |
|
if ( iand(iHash, GAYBERNE_PAIR).ne.0 ) then |
1282 |
|
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1283 |
|
pot(VDW_POT), A, f, t, do_pot) |
1284 |
|
endif |
1285 |
|
|
1286 |
|
if ( iand(iHash, GAYBERNE_LJ).ne.0 ) then |
1287 |
< |
! call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1288 |
< |
! pot(VDW_POT), A, f, t, do_pot) |
1287 |
> |
call do_gb_lj_pair(i, j, d, r, rijsq, rcut, sw, vpair, fpair, & |
1288 |
> |
pot(VDW_POT), A, f, t, do_pot) |
1289 |
|
endif |
1290 |
< |
|
1290 |
> |
|
1291 |
|
if ( iand(iHash, EAM_PAIR).ne.0 ) then |
1292 |
|
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1293 |
|
pot(METALLIC_POT), f, do_pot) |
1294 |
|
endif |
1295 |
< |
|
1295 |
> |
|
1296 |
|
if ( iand(iHash, SHAPE_PAIR).ne.0 ) then |
1297 |
|
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1298 |
|
pot(VDW_POT), A, f, t, do_pot) |
1299 |
|
endif |
1300 |
< |
|
1300 |
> |
|
1301 |
|
if ( iand(iHash, SHAPE_LJ).ne.0 ) then |
1302 |
|
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1303 |
|
pot(VDW_POT), A, f, t, do_pot) |
1304 |
|
endif |
1305 |
+ |
|
1306 |
+ |
if ( iand(iHash, SC_PAIR).ne.0 ) then |
1307 |
+ |
call do_SC_pair(i, j, d, r, rijsq, rcut, sw, vpair, fpair, & |
1308 |
+ |
pot(METALLIC_POT), f, do_pot) |
1309 |
+ |
endif |
1310 |
+ |
|
1311 |
|
|
1312 |
+ |
|
1313 |
|
end subroutine do_pair |
1314 |
|
|
1315 |
< |
subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, & |
1315 |
> |
subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, rCut, & |
1316 |
|
do_pot, do_stress, eFrame, A, f, t, pot) |
1317 |
|
|
1318 |
|
real( kind = dp ) :: sw |
1324 |
|
|
1325 |
|
logical, intent(inout) :: do_pot, do_stress |
1326 |
|
integer, intent(in) :: i, j |
1327 |
< |
real ( kind = dp ), intent(inout) :: rijsq, rcijsq |
1327 |
> |
real ( kind = dp ), intent(inout) :: rijsq, rcijsq, rCut |
1328 |
|
real ( kind = dp ) :: r, rc |
1329 |
|
real ( kind = dp ), intent(inout) :: d(3), dc(3) |
1330 |
|
|
1343 |
|
iHash = InteractionHash(me_i, me_j) |
1344 |
|
|
1345 |
|
if ( iand(iHash, EAM_PAIR).ne.0 ) then |
1346 |
< |
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1346 |
> |
call calc_EAM_prepair_rho(i, j, d, r, rijsq) |
1347 |
|
endif |
1348 |
+ |
|
1349 |
+ |
if ( iand(iHash, SC_PAIR).ne.0 ) then |
1350 |
+ |
call calc_SC_prepair_rho(i, j, d, r, rijsq, rcut ) |
1351 |
+ |
endif |
1352 |
|
|
1353 |
|
end subroutine do_prepair |
1354 |
|
|
1359 |
|
|
1360 |
|
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1361 |
|
call calc_EAM_preforce_Frho(nlocal,pot(METALLIC_POT)) |
1362 |
+ |
endif |
1363 |
+ |
if (FF_uses_SC .and. SIM_uses_SC) then |
1364 |
+ |
call calc_SC_preforce_Frho(nlocal,pot(METALLIC_POT)) |
1365 |
|
endif |
1366 |
|
|
1367 |
|
|
1447 |
|
pot_Col = 0.0_dp |
1448 |
|
pot_Temp = 0.0_dp |
1449 |
|
|
1402 |
– |
rf_Row = 0.0_dp |
1403 |
– |
rf_Col = 0.0_dp |
1404 |
– |
rf_Temp = 0.0_dp |
1405 |
– |
|
1450 |
|
#endif |
1451 |
|
|
1452 |
|
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1453 |
|
call clean_EAM() |
1454 |
|
endif |
1455 |
|
|
1412 |
– |
rf = 0.0_dp |
1456 |
|
tau_Temp = 0.0_dp |
1457 |
|
virial_Temp = 0.0_dp |
1458 |
|
end subroutine zero_work_arrays |
1546 |
|
|
1547 |
|
function FF_RequiresPrepairCalc() result(doesit) |
1548 |
|
logical :: doesit |
1549 |
< |
doesit = FF_uses_EAM |
1549 |
> |
doesit = FF_uses_EAM .or. FF_uses_SC & |
1550 |
> |
.or. FF_uses_MEAM |
1551 |
|
end function FF_RequiresPrepairCalc |
1552 |
|
|
1509 |
– |
function FF_RequiresPostpairCalc() result(doesit) |
1510 |
– |
logical :: doesit |
1511 |
– |
if (electrostaticSummationMethod == REACTION_FIELD) doesit = .true. |
1512 |
– |
end function FF_RequiresPostpairCalc |
1513 |
– |
|
1553 |
|
#ifdef PROFILE |
1554 |
|
function getforcetime() result(totalforcetime) |
1555 |
|
real(kind=dp) :: totalforcetime |