Working shift command for merge
This commit is contained in:
parent
14dd8ad755
commit
cde96402e2
3 changed files with 94 additions and 2 deletions
|
@ -249,4 +249,23 @@ module subroutines
|
|||
end do
|
||||
|
||||
end subroutine siftdown
|
||||
|
||||
|
||||
subroutine apply_periodic(r)
|
||||
!This function checks if an atom is outside the box and wraps it back in. This is generally used when some
|
||||
!kind of displacement is applied but the simulation cell is desired to be maintained as the same size.
|
||||
|
||||
real(kind=dp), dimension(3), intent(inout) :: r
|
||||
|
||||
integer :: j
|
||||
|
||||
do j = 1, 3
|
||||
if (r(j) > box_bd(2*j)) then
|
||||
r(j) = r(j) - box_bd(2*j)
|
||||
else if (r(j) < box_bd(2*j-1)) then
|
||||
r(j) = r(j) + box_bd(2*j-1)
|
||||
end if
|
||||
end do
|
||||
end subroutine
|
||||
|
||||
end module subroutines
|
Loading…
Add table
Add a link
Reference in a new issue