Out of boundaries error #1086
Replies: 2 comments 7 replies
-
Dear @mainarabgouveia. You will have to include a recovery kernel to your execution: pset.execute(..., recovery={ErrorCode.ErrorOutOfBounds: DeleteParticle}) And then create a Recovery Kernel to delete the particle: def DeleteParticle(particle, fieldset, time):
particle.delete() See also https://github.com/OceanParcels/parcels/blob/master/parcels/examples/tutorial_Agulhasparticles.ipynb for a full example |
Beta Was this translation helpful? Give feedback.
7 replies
-
Tks for your help and time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
How do I make my released particles that leave the domain or arrive on the land don't cause my simulations to stop?
I'm getting this error:
INFO: Compiled ArrayJITParticleAdvectionRK45AdvectionDiffusionM1 ==> /tmp/parcels-1000/lib77962480406540cb0477e74d24ef8364_0.so
98% (14938200.0 of 15120000.0) |####### | Elapsed Time: 0:15:43 ETA: 0:00:11
OutOfBoundsError Traceback (most recent call last)
/tmp/ipykernel_32755/3033041448.py in
1 # Now run the remaining ParticleSet (using less accurate Euler Forward for speedup)
2
----> 3 pset.execute(pset.Kernel(AdvectionRK45) + AdvectionDiffusionM1, # the kernel (which defines how particles move)
4 runtime=timedelta(days=175), # the total length of the run
5 dt=-timedelta(minutes=5), # the timestep of the kernel (negative timestep for backwards run)
~/anaconda3/envs/py3_parcels/lib/python3.9/site-packages/parcels/particleset/baseparticleset.py in execute(self, pyfunc, pyfunc_inter, endtime, runtime, dt, moviedt, recovery, output_file, movie_background_field, verbose_progress, postIterationCallbacks, callbackdt)
456 # If we don't perform interaction, only execute the normal kernel efficiently.
457 if self.interaction_kernel is None:
--> 458 self.kernel.execute(self, endtime=next_time, dt=dt, recovery=recovery, output_file=output_file,
459 execute_once=execute_once)
460 # Interaction: interleave the interaction and non-interaction kernel for each time step.
~/anaconda3/envs/py3_parcels/lib/python3.9/site-packages/parcels/kernel/kernelsoa.py in execute(self, pset, endtime, dt, recovery, output_file, execute_once)
225 recovery_kernel = recovery_map[p.state]
226 p.set_state(StateCode.Success)
--> 227 recovery_kernel(p, self.fieldset, p.time)
228 if p.isComputed():
229 p.reset_state()
~/anaconda3/envs/py3_parcels/lib/python3.9/site-packages/parcels/tools/statuscodes.py in recovery_kernel_out_of_bounds(particle, fieldset, time)
194 # TODO: JIT does not yet provide the context that created
195 # the exception. We need to pass that info back from C.
--> 196 raise OutOfBoundsError(particle, fieldset)
197 else:
198 error = particle.exception
OutOfBoundsError: 0
Particle P[4](lon=17.006130, lat=-29.650196, depth=0.000000, time=36208800.000000)
Time: 2021-02-23T02:30:00.000000000, timestep dt: -3600.000000
Out-of-bounds sampling by particle at (17.006130, -29.650196, 0.000000)
Beta Was this translation helpful? Give feedback.
All reactions