From 7979ad1093a6ffe7a804e1939170dbb22757e927 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Thu, 22 Jul 2021 14:38:49 -0400 Subject: [PATCH] Fix overlap command --- src/opt_delete.f90 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/opt_delete.f90 b/src/opt_delete.f90 index f631693..b2f79bf 100644 --- a/src/opt_delete.f90 +++ b/src/opt_delete.f90 @@ -126,13 +126,24 @@ module opt_delete end if !Now zero out the larger index - if(i < nei) then - which_cell(:,i) = 0 - cycle atom_loop + if(first) then + if(i > nei) then + which_cell(:,i) = 0 + cycle atom_loop + else + which_cell(:,nei) = 0 + cell_list(num_nei,c(1) + ck, c(2) + cj, c(3) + ci) = 0 + end if else - which_cell(:,nei) = 0 - cell_list(num_nei,c(1) + ck, c(2) + cj, c(3) + ci) = 0 + if(i < nei) then + which_cell(:,i) = 0 + cycle atom_loop + else + which_cell(:,nei) = 0 + cell_list(num_nei,c(1) + ck, c(2) + cj, c(3) + ci) = 0 + end if end if + end if end if end do