Merge branch 'ft--opt-dislloop' into development

This commit is contained in:
Alex Selimov 2020-01-13 20:24:15 -05:00
commit c89b7d3b59
11 changed files with 788 additions and 35 deletions

View file

@ -3,6 +3,7 @@ module elements
!This module contains the elements data structures, structures needed for building regions
!and operations that are done on elements
use parameters
use functions
use subroutines
implicit none
@ -373,4 +374,26 @@ module elements
return
end subroutine rhombshape
subroutine delete_atoms(num, index)
!This subroutine deletes atoms from the atom arrays
integer, intent(in) :: num
integer, intent(inout), dimension(num) :: index
integer :: i, j
call heapsort(index)
!We go from largest index to smallest index just to make sure that we don't miss
!accidentally overwrite values which need to be deleted
do i = num, 1, -1
if(index(i) == atom_num) then
r_atom(:,index(i)) = 0.0_dp
type_atom(index(i)) = 0
else
r_atom(:,index(i)) = r_atom(:, atom_num)
type_atom(index(i)) = type_atom(atom_num)
end if
atom_num = atom_num - 1
end do
end subroutine
end module elements