Journal article

FastFlow: GPU Acceleration of Flow and Depression Routing for Landscape Simulation

Guillaume Cordonnier, Bernhard Kerbl, Aryamaan Jain, Brandon Finley, James Gain · 2024 · Wiley

Algorithm 4: Re-routing flow paths


Input : Terrain cells \mathcal{T}, set of depression basins \mathcal{D}
Output: Updated recipients


1 if Depression jumping variant then
2   foreach depression d \in \mathcal{D} in parallel do
3     l \leftarrow local minimum of d
4     recipient of l \leftarrow outlet of d
5   end
6 else
7   // Depression Carving Variant
8   tag \leftarrow False for all cells
9   foreach depression d \in \mathcal{D} in parallel do
10    tag[saddle of d] \leftarrow True
11    end
12    // recipient is local to next two loops
13    for i \leftarrow 1 to \log_2(|\mathcal{T}|) do
14      foreach cell c \in \mathcal{T} in parallel do
15        if tag[c] then
16          tag[recipient of c] \leftarrow True
17          recipient of c \leftarrow recipient of recipient of c
18        end
19      end
20      foreach cell c \in \mathcal{T} in parallel do
21        if tag[recipient of c] and c is not a local minimum
22        then
23          recipient of recipient of c \leftarrow c
24        end
25      end
26    end
27    foreach depression d \in \mathcal{D} in parallel do
28      recipient of saddle of d \leftarrow outlet of d
29    end