Skip to content

Commit f5ecf19

Browse files
committed
Updating the 'through surface' kernel to place the particle at the ocean surface (rather than delete)
1 parent 6643291 commit f5ecf19

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

plasticparcels/kernels.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,17 +621,16 @@ def checkErrorThroughSurface(particle, fieldset, time):
621621
622622
Description
623623
----------
624-
Kernel to delete a particle if it goes through the surface.
624+
Kernel to place a particle back on the surface if it goes through the surface.
625625
626626
Kernel Requirements
627627
----------
628628
Order of Operations:
629629
This kernel should be performed after all other movement kernels, as it is an error kernel.
630630
"""
631631
if particle.state == StatusCode.ErrorThroughSurface:
632-
# particle_ddepth = - particle.depth # Set so that final depth = 0 # TODO why not use this instead of delete?
633-
# particle.state = StatusCode.Success
634-
particle.delete()
632+
particle_ddepth = fieldset.z_start - particle.depth # Set ddepth so that final depth is the ocean surface
633+
particle.state = StatusCode.Success
635634

636635

637636
def deleteParticle(particle, fieldset, time):

0 commit comments

Comments
 (0)