Skip to content

Commit 56314f7

Browse files
Stop execution when particleset is empty
1 parent 4f55da7 commit 56314f7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

parcels/particleset.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,10 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
973973
# End of interaction specific code
974974
time = next_time
975975

976+
# Check for empty ParticleSet
977+
if np.isinf(next_prelease) and len(self) == 0:
978+
return StatusCode.StopAllExecution
979+
976980
if abs(time - next_output) < tol or dt == 0:
977981
for fld in self.fieldset.get_fields():
978982
if hasattr(fld, 'to_write') and fld.to_write:

0 commit comments

Comments
 (0)