Input : Terrain cells , set of depression basins
Output: Updated recipients
1 if Depression jumping variant then 2 foreach depression in parallel do 3 local minimum of 4 recipient of outlet of 5 end 6 else 7 // Depression Carving Variant 8 tag False for all cells 9 foreach depression in parallel do 10 tag[saddle of ] True 11 end 12 // recipient is local to next two loops 13 for to do 14 foreach cell in parallel do 15 if tag[] then 16 tag[recipient of ] True 17 recipient of recipient of recipient of 18 end 19 end 20 foreach cell in parallel do 21 if tag[recipient of ] and is not a local minimum 22 then 23 recipient of recipient of 24 end 25 end 26 end 27 foreach depression in parallel do 28 recipient of saddle of outlet of 29 end