File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ subroutine update_gridpoints_and_viability( &
159159 ! ! Distance between atom and gridpoint.
160160 logical , dimension (size (points,dim= 2 )) :: viable
161161 ! ! Temporary list of gridpoints.
162+ real (real32), dimension (3 ) :: diff
163+ ! ! Difference between atom and gridpoint (direct coorindates).
162164 real (real32), dimension (:,:), allocatable :: points_tmp
163165 ! ! Temporary list of gridpoints.
164166
@@ -173,7 +175,9 @@ subroutine update_gridpoints_and_viability( &
173175 min_radius = minval (radius_list) * distribs_container% radius_distance_tol(1 )
174176 associate( atom_pos = > [ basis% spec(atom(1 ))% atom(atom(2 ),1 :3 ) ] )
175177 do i = 1 , num_points
176- distance = modu( matmul ( atom_pos - points(1 :3 ,i), basis% lat ) )
178+ diff = atom_pos - points(1 :3 ,i)
179+ diff = diff - ceiling (diff - 0.5_real32 )
180+ distance = modu( matmul ( diff, basis% lat ) )
177181 if ( distance .lt. min_radius )then
178182 points(4 :,i) = 0._real32
179183 viable(i) = .false.
You can’t perform that action at this time.
0 commit comments