250 |
|
subroutine allocateEAM(status) |
251 |
|
integer, intent(out) :: status |
252 |
|
|
253 |
– |
integer :: nlocal |
253 |
|
#ifdef IS_MPI |
254 |
|
integer :: nrow |
255 |
|
integer :: ncol |
257 |
|
integer :: alloc_stat |
258 |
|
|
259 |
|
|
261 |
– |
nlocal = getNlocal() |
260 |
|
status = 0 |
261 |
|
#ifdef IS_MPI |
262 |
|
nrow = getNrow(plan_row) |
651 |
|
|
652 |
|
|
653 |
|
!! Does EAM pairwise Force calculation. |
654 |
< |
subroutine do_eam_pair(atom1,atom2,d,rij,r2,pot,f,do_pot,do_stress) |
654 |
> |
subroutine do_eam_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
655 |
> |
pot, f, do_pot) |
656 |
|
!Arguments |
657 |
|
integer, intent(in) :: atom1, atom2 |
658 |
|
real( kind = dp ), intent(in) :: rij, r2 |
659 |
< |
real( kind = dp ) :: pot |
660 |
< |
real( kind = dp ), dimension(3,getNlocal()) :: f |
659 |
> |
real( kind = dp ) :: pot, sw, vpair |
660 |
> |
real( kind = dp ), dimension(3,nLocal) :: f |
661 |
|
real( kind = dp ), intent(in), dimension(3) :: d |
662 |
< |
logical, intent(in) :: do_pot, do_stress |
662 |
> |
real( kind = dp ), intent(inout), dimension(3) :: fpair |
663 |
> |
|
664 |
> |
logical, intent(in) :: do_pot |
665 |
|
|
666 |
|
real( kind = dp ) :: drdx,drdy,drdz |
667 |
|
real( kind = dp ) :: d2 |
812 |
|
f(1,atom2) = f(1,atom2) - fx |
813 |
|
f(2,atom2) = f(2,atom2) - fy |
814 |
|
f(3,atom2) = f(3,atom2) - fz |
815 |
+ |
#endif |
816 |
+ |
|
817 |
+ |
vpair = vpair + phab |
818 |
+ |
#ifdef IS_MPI |
819 |
+ |
id1 = tagRow(atom1) |
820 |
+ |
id2 = tagColumn(atom2) |
821 |
+ |
#else |
822 |
+ |
id1 = atom1 |
823 |
+ |
id2 = atom2 |
824 |
|
#endif |
825 |
|
|
826 |
+ |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
827 |
+ |
|
828 |
+ |
fpair(1) = fpair(1) + fx |
829 |
+ |
fpair(2) = fpair(2) + fy |
830 |
+ |
fpair(3) = fpair(3) + fz |
831 |
+ |
|
832 |
+ |
endif |
833 |
+ |
|
834 |
|
if (nmflag) then |
835 |
|
|
836 |
|
drhoidr = drha |
854 |
|
drhojdr*drhojdr*d2frhodrhodrho(atom1) |
855 |
|
#endif |
856 |
|
end if |
839 |
– |
|
840 |
– |
|
857 |
|
|
858 |
< |
|
843 |
< |
if (do_stress) then |
844 |
< |
|
845 |
< |
#ifdef IS_MPI |
846 |
< |
id1 = tagRow(atom1) |
847 |
< |
id2 = tagColumn(atom2) |
848 |
< |
#else |
849 |
< |
id1 = atom1 |
850 |
< |
id2 = atom2 |
851 |
< |
#endif |
852 |
< |
|
853 |
< |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
854 |
< |
|
855 |
< |
tau_Temp(1) = tau_Temp(1) - d(1) * fx |
856 |
< |
tau_Temp(2) = tau_Temp(2) - d(1) * fy |
857 |
< |
tau_Temp(3) = tau_Temp(3) - d(1) * fz |
858 |
< |
tau_Temp(4) = tau_Temp(4) - d(2) * fx |
859 |
< |
tau_Temp(5) = tau_Temp(5) - d(2) * fy |
860 |
< |
tau_Temp(6) = tau_Temp(6) - d(2) * fz |
861 |
< |
tau_Temp(7) = tau_Temp(7) - d(3) * fx |
862 |
< |
tau_Temp(8) = tau_Temp(8) - d(3) * fy |
863 |
< |
tau_Temp(9) = tau_Temp(9) - d(3) * fz |
864 |
< |
|
865 |
< |
virial_Temp = virial_Temp + & |
866 |
< |
(tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) |
867 |
< |
|
868 |
< |
endif |
869 |
< |
endif |
870 |
< |
endif |
871 |
< |
|
872 |
< |
|
858 |
> |
endif |
859 |
|
end subroutine do_eam_pair |
860 |
|
|
861 |
|
|