Skip to content

Commit c99e29f

Browse files
Only calling remove-indices when there are particles to be removed
1 parent d64d896 commit c99e29f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

parcels/kernel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def remove_deleted(self, pset):
7575
# TODO v4: need to implement ParticleFile writing of deleted particles
7676
# if len(indices) > 0 and self.fieldset.particlefile is not None:
7777
# self.fieldset.particlefile.write(pset, None, indices=indices)
78-
pset.remove_indices(indices)
78+
if len(indices) > 0:
79+
pset.remove_indices(indices)
7980

8081

8182
class Kernel(BaseKernel):

0 commit comments

Comments
 (0)