<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" dtd-version="3.0"><?xmltex \makeatother\@nolinetrue\makeatletter?><?xmltex \hack{\allowdisplaybreaks}?>
  <front>
    <journal-meta>
<journal-id journal-id-type="publisher">GMD</journal-id>
<journal-title-group>
<journal-title>Geoscientific Model Development</journal-title>
<abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title>
<abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">1991-9603</issn>
<publisher><publisher-name>Copernicus Publications</publisher-name>
<publisher-loc>Göttingen, Germany</publisher-loc>
</publisher>
</journal-meta>

    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-9-4451-2016</article-id><title-group><article-title>A computationally efficient depression-filling algorithm for digital
elevation models, applied to proglacial lake drainage</article-title>
      </title-group><?xmltex \runningtitle{A computationally efficient depression-filling algorithm }?><?xmltex \runningauthor{C.~J. Berends and R. S. W. van de Wal}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Berends</surname><given-names>Constantijn J.</given-names></name>
          <email>c.j.berends@uu.nl</email>
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>van de Wal</surname><given-names>Roderik S. W.</given-names></name>
          
        </contrib>
        <aff id="aff1"><institution>Institute for Marine and Atmospheric research Utrecht, Utrecht
University, Utrecht, 3584 CC, the Netherlands</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Constantijn J. Berends (c.j.berends@uu.nl)</corresp></author-notes><pub-date><day>15</day><month>December</month><year>2016</year></pub-date>
      
      <volume>9</volume>
      <issue>12</issue>
      <fpage>4451</fpage><lpage>4460</lpage>
      <history>
        <date date-type="received"><day>11</day><month>April</month><year>2016</year></date>
           <date date-type="rev-request"><day>17</day><month>May</month><year>2016</year></date>
           <date date-type="rev-recd"><day>22</day><month>November</month><year>2016</year></date>
           <date date-type="accepted"><day>23</day><month>November</month><year>2016</year></date>
      </history>
      <permissions>
<license license-type="open-access">
<license-p>This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/3.0/">http://creativecommons.org/licenses/by/3.0/</ext-link></license-p>
</license>
</permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016.html">This article is available from https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016.html</self-uri>
<self-uri xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016.pdf</self-uri>


      <abstract>
    <p>Many processes govern the deglaciation of ice sheets. One of the processes
that is usually ignored is the calving of ice in lakes that temporarily
surround the ice sheet. In order to capture this process a “flood-fill
algorithm” is needed. Here we present and evaluate several optimizations to a
standard flood-fill algorithm in terms of computational efficiency. As an
example, we determine the land–ocean mask for a 1 km resolution digital
elevation model (DEM) of North America and Greenland, a geographical area of
roughly 7000 by 5000 km (roughly 35 million elements), about half of which
is covered by ocean. Determining the land–ocean mask with our improved
flood-fill algorithm reduces computation time by 90 % relative to using a
standard stack-based flood-fill algorithm. This implies that it is now
feasible to include the calving of ice in lakes as a dynamical process inside
an ice-sheet model. We demonstrate this by using bedrock elevation, ice
thickness and geoid perturbation fields from the output of a coupled
ice-sheet–sea-level equation model at 30 000 years before present and
determine the extent of Lake Agassiz, using both the standard and improved
versions of the flood-fill algorithm. We show that several optimizations to
the flood-fill algorithm used for filling a depression up to a water level,
which is not defined beforehand, decrease the computation time by up to
99 %. The resulting reduction in computation time allows determination of
the extent and volume of depressions in a DEM over large geographical grids
or repeatedly over long periods of time, where computation time might
otherwise be a limiting factor. The algorithm can be used for all
glaciological and hydrological models, which need to trace the evolution over
time of lakes or drainage basins in general.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

      <?xmltex \hack{\newpage}?>
<sec id="Ch1.S1" sec-type="intro">
  <title>Introduction</title>
      <p>Changes in lake extent over time play an important role in hydrology
(Renssen and Knoop, 2000),
palaeo-climatology (Krinner et al., 2004; Goelzer
et al., 2012) and glaciology (Marshall and Clarke, 1999; Tarasov and Peltier,
2006). For this reason it is important to track such changes in water
routing and drainage inside dynamical models, particularly if major changes
in the boundary conditions (topography, ice extent, ocean volume) take place
over time. Several studies have underlined the importance of accounting for
depressions when creating such drainage maps (Zhu et al., 2006; Arnold,
2010).</p>
      <p>An important example is the routing of meltwater and the drainage of
proglacial lakes that formed near the margins of the Laurentide ice sheet.
The retreat of the Laurentide ice sheet during the last deglaciation and the
corresponding release of large fluxes of fresh water into the Arctic Sea and
the northern Atlantic Ocean have been linked to climatic events through
disrupting the Atlantic Meridional Overturning Circulation (Barber et al.,
1999; Clark et al., 2001; Li et al., 2012; Tarasov and Peltier, 2006; Teller
et al., 2002). Meltwater from the remnants of Northern Hemisphere
ice sheets has also been shown to have influenced the climate system during the
previous interglacial (Stone et al., 2016).</p>
      <p>Many studies have focussed on reconstructing the direction and magnitude of
the freshwater flux from geological data (Broecker et al., 1989;
Hillaire-Marcel et al., 2007; LaJeunesse and St.-Onge, 2008; Törnqvist
et al., 2004). More recently these freshwater fluxes have been estimated by
stand-alone ice-sheet models (Goelzer et al., 2012; Marshall et al., 1999;
Tarasov and Peltier, 2006).</p>
      <p>Due to the influence of the local topography, part of the meltwater from
the retreating ice sheet was not directly released into the ocean system but
temporarily stored in proglacial lakes, the largest of which is Lake
Agassiz, along the southern margin of the ice sheet. Lake Agassiz is
estimated to have covered <inline-formula><mml:math display="inline"><mml:mrow><mml:mn>7.1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> km<inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:math></inline-formula> and contained
approximately <inline-formula><mml:math display="inline"><mml:mrow><mml:mn>1.4</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>14</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> m<inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:math></inline-formula> of water, or 0.4 m global mean
sea-level equivalent around 8.4 kyr BP, immediately prior to its
catastrophic drainage (Kendall et al., 2008). The size of the flood is,
however, poorly constrained and higher numbers have also been published (e.g.
Hijma and Cohen, 2010). It is therefore important to accurately model the
extent and volume of the lake over time, since the presence of the lake
affects both the timing and location of the meltwater release into the
ocean system, as well as the local climate (Krinner et al., 2004; Tarasov and
Peltier, 2006).</p>
      <p>In order to model the extent and volume of the lake and the drainage water
flux and drainage location over time we first need to define a
land–ocean mask. This mask delineates areas below sea level, which are
connected to the open ocean from the land points, which may change over
time. Large changes occur, for example, where the ice sheet at times covers
most of the Canadian Archipelago or blocks the Hudson Strait. Changes in this
mask change the location where outflow from the lake reaches the sea over
time. Besides determining the land–ocean mask we need to fill the
depressions in the surface topography to determine the extent and volume of
the lake(s). Both these problems – determining a land–ocean mask and
determining the volume of a lake filling a depression – are solved using
so-called “flood-fill algorithms”. Given an array of elements that
individually may or may not satisfy a certain threshold condition, a
flood-fill algorithm determines which elements of the set have a
neighbour-to-neighbour connection to a given “seed element” that passes
only through elements that satisfy the threshold condition. The
land–ocean mask, for example, consists of the set of elements that have such
a connection to the open ocean, where the threshold condition is met when
the surface elevation of an element lies below sea level.</p>
      <p>When applying commonly used flood-fill algorithms (Arnold, 2010; Döll and
Lehner, 2002; Tarboton et al., 1991; Zhu et al., 2006) to a problem
involving such large geographical grids and long timescales, computation
time can become a limiting factor, particularly when the geometry is
changing over time and the procedure has to be repeated over many time
steps.</p>
      <p>In this study, we describe and evaluate several improvements to a standard
algorithm for filling depressions in a DEM in order to improve the
computational efficiency. The improved algorithm is applied to a 1 km
resolution DEM, including an ice-thickness distribution of North America
30 000 years ago generated by an ice-sheet model in such a way as to create
boundary conditions allowing for the formation of a very large lake. We
determine both the land–ocean mask and the size and extent of the proglacial
lake for this glacial configuration, and compare the required computation
time with the default flood-fill algorithm as presented by Zhu et al. (2006)
and with the drainage pointer approach presented by Tarasov and Peltier (2006).</p>
</sec>
<sec id="Ch1.S2">
  <title>Methodology</title>
<sec id="Ch1.S2.SS1">
  <title>Default algorithm</title>
      <p>The problem of filling a depression up to a pre-defined level can be
envisioned as filling a hole in a true–false mask (whether or not the local
topography is below the a priori chosen water level of the lake or ocean.
There are several algorithms for solving this problem, generally known as
flood-fill algorithms (Zhu et al., 2006). They are commonly known for
their use in the “bucket” tool of several paint programs. A thorough
description of the stack-based flood-fill algorithm is given by Zhu et al. (2006).
The default algorithm as used by Zhu et al. (2006) starts with a
“seed”, defined as a designated element from where neighbouring elements
are flooded. In many hydrological applications, the seed will be a local
minimum in a DEM. Beside the seed element, the algorithm builds a “stack”,
which is an array listing the indices of the map elements. During each
iteration of the algorithm, all stack elements are checked. If the elevation
of a stack element is below the water level, the element is filled with
water, removed from the stack and consequently all its neighbours
are added to the stack, thus expanding the filled area outwards. If the
element does not lie below the water level it is removed from the stack
without any further action. The iterations are continued until the stack is
empty and the elements below the water level are identified.</p>
      <p>Once the horizontal extent of the lake has thus been determined, its volume
is calculated by integrating the water depth over the calculated area.</p>
      <p>A pseudo-code example of this algorithm is illustrated below. A step-by-step
illustration of one iteration of the algorithm being applied to a simple
true–false mask is shown in Fig. 1.</p>
      <p><?xmltex \hack{\vspace*{2mm}}?><?xmltex \igopts{width=227.622047pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-g01.pdf"/><?xmltex \hack{\newpage}?></p>
      <p>An example of a MATLAB implementation of this algorithm is provided in the
Supplement, being script “fill_1km.m”.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1"><caption><p>An illustration of the default flood-fill algorithm. Dark green:
unfilled; light green: stack; blue: filled. Black line: shoreline. <bold>(a)</bold> The
algorithm starts at the first element in the stack (marked with X). <bold>(b)</bold> The
element is found to meet the fill criterion and is filled. Its immediate
neighbours (marked 1–5) are now inspected. Neighbours 1 and 2 are not yet
in the stack and so they are added. Neighbour 3 is already in the stack and
neighbours 4 and 5 are already filled. <bold>(c)</bold> Result of checking the five
neighbours. <bold>(d)</bold> The algorithm now moves on the next element in the stack
(marked with X), which is consequently filled and its top-right neighbour is
added to the stack. <bold>(e)</bold> The next element in the stack is found not to meet
the fill criterion (since it lies above sea level) and so it is removed from
the stack. <bold>(f)</bold> The result after inspecting the whole stack once. <bold>(g)</bold> The
result after inspecting the whole stack again. <bold>(h)</bold> The result after
inspecting the whole stack again. <bold>(i)</bold> The final result.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f01.png"/>

        </fig>

      <p>The number of operations required for filling a hole with this algorithm is
approximately proportional to the number of elements of the depression. This
means that application to a very large area with a high resolution results
in a long computation time, since doubling the resolution in the horizontal
plane will quadruple the number of operations.</p>
      <p>Determining the land–ocean mask of a DEM using this algorithm is
straightforward, since the water level (the elevation of the water surface
with respect to the Earth's centre) that determines the fill criterion for
all elements is, by definition, at sea level. For a lake where the water
inflow is not balanced by evaporation, the water level depends on the
topography surrounding the depression. The water level is then equal to the
elevation of the “spillover point” – the origin of the river that
transports spillover from the lake to the open ocean. The only way to
determine the location of this point, and therefore the water level of the
lake, is to start at the chosen local minimum in the DEM and to iteratively
increase the water level until this spillover point is reached.</p>
      <p>In the case where evaporation balances inflow, such as for several large
present-day inland seas, the water level should be increased iteratively
until the integrated evaporation over the lake matches the inflowing water
flux.</p>
      <p>A pseudo-code example of this algorithm is illustrated below.</p>
      <p><?xmltex \hack{\vspace*{3mm}}?><?xmltex \igopts{width=227.622047pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-g02.pdf"/><?xmltex \hack{\vspace*{3mm}}?></p>
      <p>The threshold condition can be the overflowing of the lake into the sea, the
total evaporation over the lake balancing total water influx, or any other
logical condition.</p>
      <p>Depending on the vertical resolution of the DEM and the accuracy required to
determine the lake depth, such a calculation requires dozens to hundreds of
iterations. This is not always a restriction for practical applications
where one is interested in the water runoff pathways and drainage basins for
a given DEM. However, when performing an ensemble of simulations, or a
simulation where the topography changes over time, reducing the computation
time can be crucial for the performance and feasibility of the application
and optimizations are required. In the next paragraph we present several
optimizations to the standard flood-fill algorithm as described above, which
reduce computation time considerably for maps with a large area or a high
resolution.</p>
</sec>
<sec id="Ch1.S2.SS2">
  <title>Optimizations</title>
<sec id="Ch1.S2.SS2.SSS1">
  <title>Low-resolution block inspection</title>
      <p>When filling a depression to a pre-determined water level, we strongly
reduce the number of operations by starting with creating a lower-resolution
“maximum topography” map. For example, any element of a 4 km maximum
topography map will contain the highest value of the corresponding <inline-formula><mml:math display="inline"><mml:mrow><mml:mn mathvariant="normal">4</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula>
block of 1 km elements. Consequently, we apply the flood-fill algorithm to
this lower-resolution map. If the highest element of a 4 km <inline-formula><mml:math display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 4 km square
lies below the water level, all sixteen 1 km elements must do as well,
implying all of them can be flooded at once. This step yields a first coarse
filling scheme without testing each individual element at the final higher
resolution.</p>
      <p>When this part of the algorithm is finished, some elements may not yet be
flooded, although they should be, but the large majority of them will be
filled already if the distribution is not too scattered. To identify those
elements that still need to be flooded, we take this intermediate map and
stack from the 4 km fill, and use these as a starting point for a 1 km fill.
Applied to the 1 km map, the algorithm will only have to fill in the
“fringes” of the depression – a much smaller area than the part already
processed at low resolution. Figure 2 illustrates this.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2"><caption><p>An illustration of the low-resolution block inspection improvement
upon the default flood-fill algorithm. Dark green: unfilled; light green:
stack; blue: filled. Black line: shoreline at 1 km resolution. <bold>(a)</bold> The 4 km
fill is given a seed in the southwest corner of the map. <bold>(b)</bold> The 4 km fill is
completed. <bold>(c)</bold> The 1 km map and edge created from the intermediate 4 km
output. <bold>(d)</bold> The result of the 1 km fill.</p></caption>
            <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f02.png"/>

          </fig>

      <p>In Fig. 2, the 1 km true–false mask is shown as a black overlay in all
panels. The 4 km stack (light green) is initiated with a seed in the lower
left corner of the map, panel (a). The 4 km algorithm expands from this seed
until no more elements can be added. The final map (blue) and stack (light
green) are shown in panel (b). These are then converted to their 1 km
equivalent, shown in panel (c). As can be seen, the conversion conserves the
filled elements. The 1 km algorithm then continues from this map and stack
until no more elements can be added. The resulting map and stack coincides
with the 1 km true–false mask in panel (d). The decrease in computation time
resulting from using the high-resolution algorithm is larger than the
additional computation time required to create the low-resolution map and to
convert the low-resolution stack to its high-resolution equivalent. This is
shown for an example in Sect. 3.1.</p>
      <p>A further increase in efficiency can be achieved by creating an additional
medium-resolution map in between. For example, we can start with a 10 km
fill, and then convert the resulting map and stack to 5 km resolution. Use
the intermediate result for a 5 km fill algorithm, run this until
completion, convert the resulting map and stack to their 1 km equivalents,
and finalize with the 1 km fill. Note that this will only work when the
different resolutions are integer multiples of each other. Constructing
rules for when this condition is not met are not evident, and will increase
computation time, and are beyond the scope of this study.</p>
      <p>A MATLAB implementation of the fill algorithm is provided in the
Supplement, being script “Demo_FillSea.m”.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><caption><p>The present-day land–ocean mask (uniform deep blue) and the
bedrock topography at 1 km resolution.</p></caption>
            <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f03.png"/>

          </fig>

</sec>
<sec id="Ch1.S2.SS2.SSS2">
  <title>Shoreline memory</title>
      <p>In the case of a depression that must be filled up to overflow conditions,
one small improvement to the flood-fill algorithm is straightforward. Any
element that is filled at a certain water depth will also be filled for any
higher water depth, implying that the lake's shoreline will only expand
outward when the water depth is increased. Hence, in the improved flood-fill
algorithm, a stack element that is found to lie above the water level is not
removed from the stack. Instead it is flagged and not inspected again in any
further loops. This means that when the algorithm is finished, the stack
contains all those, and only those, elements which directly border filled
elements but which are not filled, being the shoreline.</p>
      <p>When the water depth is increased during the filling of a depression, the
final stack from the previous loop is taken as a starting point. This means
that all elements of the final, deepest lake have only been inspected once
during the iteration procedure. For a deep lake, which requires many depth
increments to be filled, the decrease in the required computation time can
be large given this approach, as will be shown in Sect. 3.3.</p>
</sec>
<sec id="Ch1.S2.SS2.SSS3">
  <title>Low-resolution lake depth estimation</title>
      <p>When trying to fill a depression up to the level of overflowing, i.e. with
no pre-determined water level, it is generally not possible to use the
low-resolution block inspection algorithm presented in Sect. 2.2.1. This is
because the algorithm needs to check if overflow is reached for every single
depth increment, which has to be done at 1 km resolution. Because it is not
possible to convert the high-resolution stack and map back to the lower
resolution, we cannot use the final high-resolution shoreline to start a new
low-resolution fill. It is therefore necessary to perform all fill iteration
at high resolution, which is computationally expensive.</p>
      <p>Performing a fill on a low-resolution average topography map solves this
issue. Although not mathematically necessary, in practise the topography of
a geographical area is usually smooth enough to yield a low-resolution water
depth estimate close to the “true” water depth that would be calculated
with a high-resolution fill. This means that, instead of starting at zero
depth, we can initiate the algorithm with a depth slightly below the depth
yielded by the low-resolution estimate. The lake at this depth will be close
to its maximum extent, so we can use the block inspection method to
efficiently fill the majority of the lake's central elements at low
resolution, thus reducing the computation time. The lake's fringes are
filled with the high-resolution algorithm and the depth is increased
incrementally until overflow is reached. Section 3.4 describes an experiment
where this method is implemented. A pseudo-code example of this algorithm is
illustrated below.</p>
      <p><?xmltex \hack{\vspace*{3mm}}?><?xmltex \igopts{width=227.622047pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-g03.pdf"/><?xmltex \hack{\vspace*{3mm}}?></p>
      <p>A MATLAB implementation of this algorithm is provided in the Supplement,
being script “Demo_FillLake.m”.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1" specific-use="star"><caption><p>Computation time in seconds for stack and map conversion between
different resolutions and for flood-filling at different resolutions with
different starting stacks, for the 40, 8, 4, 2 and 1 km series.
The yellow shaded numbers are explained in the text.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="12">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:colspec colnum="7" colname="col7" align="left"/>
     <oasis:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="right"/>
     <oasis:colspec colnum="10" colname="col10" align="right"/>
     <oasis:colspec colnum="11" colname="col11" align="right"/>
     <oasis:colspec colnum="12" colname="col12" align="right"/>
     <oasis:thead>
       <oasis:row>  
         <oasis:entry colname="col1"/>  
         <oasis:entry rowsep="1" namest="col2" nameend="col6" align="center">Stack and map conversion </oasis:entry>  
         <oasis:entry colname="col7"/>  
         <oasis:entry rowsep="1" namest="col8" nameend="col12" align="center">Flood-fill </oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">  
         <oasis:entry colname="col1"/>  
         <oasis:entry colname="col2">40</oasis:entry>  
         <oasis:entry colname="col3">8</oasis:entry>  
         <oasis:entry colname="col4">4</oasis:entry>  
         <oasis:entry colname="col5">2</oasis:entry>  
         <oasis:entry colname="col6">1</oasis:entry>  
         <oasis:entry colname="col7"/>  
         <oasis:entry colname="col8">40</oasis:entry>  
         <oasis:entry colname="col9">8</oasis:entry>  
         <oasis:entry colname="col10">4</oasis:entry>  
         <oasis:entry colname="col11">2</oasis:entry>  
         <oasis:entry colname="col12">1</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>  
         <oasis:entry colname="col1">40</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">0.04</oasis:entry>  
         <oasis:entry colname="col4">0.04</oasis:entry>  
         <oasis:entry colname="col5">0.07</oasis:entry>  
         <oasis:entry colname="col6">0.20</oasis:entry>  
         <oasis:entry colname="col7">40</oasis:entry>  
         <oasis:entry colname="col8">0.05</oasis:entry>  
         <oasis:entry colname="col9">0.19</oasis:entry>  
         <oasis:entry colname="col10">0.85</oasis:entry>  
         <oasis:entry colname="col11">3.73</oasis:entry>  
         <oasis:entry colname="col12">27.54</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">8</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">0.34</oasis:entry>  
         <oasis:entry colname="col5">0.37</oasis:entry>  
         <oasis:entry colname="col6">0.56</oasis:entry>  
         <oasis:entry colname="col7">8</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">0.94</oasis:entry>  
         <oasis:entry colname="col10">0.16</oasis:entry>  
         <oasis:entry colname="col11">0.76</oasis:entry>  
         <oasis:entry colname="col12">11.65</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">4</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">1.30</oasis:entry>  
         <oasis:entry colname="col6">31.22</oasis:entry>  
         <oasis:entry colname="col7">4</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">4.03</oasis:entry>  
         <oasis:entry colname="col11">0.40</oasis:entry>  
         <oasis:entry colname="col12">8.29</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">2</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">–</oasis:entry>  
         <oasis:entry colname="col6">65.98</oasis:entry>  
         <oasis:entry colname="col7">2</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">–</oasis:entry>  
         <oasis:entry colname="col11">16.89</oasis:entry>  
         <oasis:entry colname="col12">5.64</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">1</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">–</oasis:entry>  
         <oasis:entry colname="col6">–</oasis:entry>  
         <oasis:entry colname="col7">1</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">–</oasis:entry>  
         <oasis:entry colname="col11">–</oasis:entry>  
         <oasis:entry colname="col12">82.04</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2" specific-use="star"><caption><p>Computation time in seconds for stack and map conversion between
different resolutions and for flood-filling at different resolutions with
different starting stacks, for the 40, 20, 10, 5 and 1 km
series.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="12">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:colspec colnum="7" colname="col7" align="left"/>
     <oasis:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="right"/>
     <oasis:colspec colnum="10" colname="col10" align="right"/>
     <oasis:colspec colnum="11" colname="col11" align="right"/>
     <oasis:colspec colnum="12" colname="col12" align="right"/>
     <oasis:thead>
       <oasis:row>  
         <oasis:entry colname="col1"/>  
         <oasis:entry rowsep="1" namest="col2" nameend="col6" align="center">Stack and map conversion </oasis:entry>  
         <oasis:entry colname="col7"/>  
         <oasis:entry rowsep="1" namest="col8" nameend="col12" align="center">Flood-fill </oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">  
         <oasis:entry colname="col1"/>  
         <oasis:entry colname="col2">40</oasis:entry>  
         <oasis:entry colname="col3">20</oasis:entry>  
         <oasis:entry colname="col4">10</oasis:entry>  
         <oasis:entry colname="col5">5</oasis:entry>  
         <oasis:entry colname="col6">1</oasis:entry>  
         <oasis:entry colname="col7"/>  
         <oasis:entry colname="col8">40</oasis:entry>  
         <oasis:entry colname="col9">20</oasis:entry>  
         <oasis:entry colname="col10">10</oasis:entry>  
         <oasis:entry colname="col11">5</oasis:entry>  
         <oasis:entry colname="col12">1</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>  
         <oasis:entry colname="col1">40</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">0.04</oasis:entry>  
         <oasis:entry colname="col4">0.03</oasis:entry>  
         <oasis:entry colname="col5">0.05</oasis:entry>  
         <oasis:entry colname="col6">0.21</oasis:entry>  
         <oasis:entry colname="col7">40</oasis:entry>  
         <oasis:entry colname="col8">0.06</oasis:entry>  
         <oasis:entry colname="col9">0.02</oasis:entry>  
         <oasis:entry colname="col10">0.05</oasis:entry>  
         <oasis:entry colname="col11">0.18</oasis:entry>  
         <oasis:entry colname="col12">13.78</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">20</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">0.08</oasis:entry>  
         <oasis:entry colname="col5">0.08</oasis:entry>  
         <oasis:entry colname="col6">0.34</oasis:entry>  
         <oasis:entry colname="col7">20</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">0.17</oasis:entry>  
         <oasis:entry colname="col10">0.02</oasis:entry>  
         <oasis:entry colname="col11">0.12</oasis:entry>  
         <oasis:entry colname="col12">11.26</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">10</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">0.24</oasis:entry>  
         <oasis:entry colname="col6">0.43</oasis:entry>  
         <oasis:entry colname="col7">10</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">0.62</oasis:entry>  
         <oasis:entry colname="col11">0.08</oasis:entry>  
         <oasis:entry colname="col12">9.28</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">5</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">–</oasis:entry>  
         <oasis:entry colname="col6">1.07</oasis:entry>  
         <oasis:entry colname="col7">5</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">–</oasis:entry>  
         <oasis:entry colname="col11">2.45</oasis:entry>  
         <oasis:entry colname="col12">7.97</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">1</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">–</oasis:entry>  
         <oasis:entry colname="col6">–</oasis:entry>  
         <oasis:entry colname="col7">1</oasis:entry>  
         <oasis:entry colname="col8">–</oasis:entry>  
         <oasis:entry colname="col9">–</oasis:entry>  
         <oasis:entry colname="col10">–</oasis:entry>  
         <oasis:entry colname="col11">-</oasis:entry>  
         <oasis:entry colname="col12">82.11</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

</sec>
</sec>
</sec>
<sec id="Ch1.S3">
  <title>Results</title>
      <p>All experiments are performed in MATLAB R2014b on a 2013 iMac with a 3.2 GHz
Intel i5 processor and 8 GB 1600 MHz DDR3 Memory. Note that MATLAB is an
interpreted language and that the performance of the algorithm in a compiled
language such as Fortran or C will generally be much faster. However, the
relative improvements in performance of the optimized algorithms should be
preserved.</p>
<sec id="Ch1.S3.SS1">
  <title>Low-resolution block inspection</title>
      <p>As the first example, we use different versions of the flood-fill algorithm to
determine the land–ocean mask for a DEM of North America and Greenland
(Amante and Eakins, 2009), using an oblique stereographic projection at 1 km
resolution. The region covers an area of roughly 7000 by 5000 km, resulting
in approximately 17 million ocean elements to be filled. This extremely
large size is useful for testing the efficiency of different setups and is
needed in order to model the pressure exerted by lakes in gravitationally
consistent calculations during the evolution of ice sheets in North America.</p>
      <p>The chosen horizontal resolution of 1 km is very high for such models.
However, a lower resolution would overlook topographical features, such as
small river valleys, that would limit the water level of the lake through
drainage. This would lead to a systematic overestimation of the total water
volume unrelated to the uncertainty of the modelled location of the ice
sheet margin, which is usually not as high as 1 km. A comparison between the
calculated water volume of a lake at 1 km resolution versus the calculated
volume of the same lake at 40 km resolution showed that the difference can
be as large as 20 %.</p>
      <p>Creating the land–ocean mask depicted in Fig. 3 with the standard version of
the flood-fill algorithm at a 1 km resolution takes approximately 82 s.
This serves as benchmark to which all subsequent experiments will
be compared.</p>
      <p>We performed two series of experiments with block inspection at different
resolutions. The first series considers a sequence of 40, 8, 4, 2 and
1 km resolutions. The second series considers a sequence of 40, 20, 10,
5 and 1 km resolutions. The results in terms of computational
efficiency are presented in Tables 1 and 2, respectively.</p>
      <p>Both the conversion and filling parts of the tables can be read as “coming
from [row] resolution, going to [column] resolution”. For example (Table 1;
highlighted in yellow), converting a 40 km map and stack to their 1 km
equivalent takes 0.20 s. A 1 km fill starting with that map and stack
will then take 27.54 s. The diagonal elements in the filling parts of
the tables indicate the computation time of a fill at that resolution
starting from a single seed element.</p>
      <p>An overview of several possible resolution schemes is given in Table 3. It
shows that the most efficient scheme (40, 5 and 1 km) is almost an
order of magnitude faster than the default algorithm at 1 km resolution.</p>
</sec>
<sec id="Ch1.S3.SS2">
  <title>Shape dependence</title>
      <p>The total gain in efficiency from the improvements to the algorithm will of
course depend on the details of the problem it is applied to. In the
optimized algorithm, the number of elements that can be filled at the low
resolution roughly scales with the area of the depression, whereas the
number of elements that need to be filled at the high resolution roughly
scales with the depression's circumference. The gain in computational
efficiency therefore depends largely on the shape of the depression,
becoming larger when the depression becomes more circular.</p>
      <p>To illustrate this, the improved algorithm with a 40, 5 and 1 km
resolution scheme was applied to several versions of the same topography
field, passed through increasingly strong high-pass filters with a cut-off
wavelength of 30 km, so that the remaining topographical features that
determine the shape of the depression are all too small to be visible on the
low-resolution map in Fig. 4.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3"><caption><p>Total computation time relative to the 1 km benchmark experiment
for several resolution schemes, sorted ascending.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="6">
     <oasis:colspec colnum="1" colname="col1" align="right"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right" colsep="1"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:thead>
       <oasis:row>  
         <oasis:entry namest="col1" nameend="col5" align="center" colsep="1">Resolution scheme </oasis:entry>  
         <oasis:entry colname="col6">Computation time</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">  
         <oasis:entry namest="col1" nameend="col5" align="center" colsep="1"/>  
         <oasis:entry colname="col6">reduction (%)</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>  
         <oasis:entry colname="col1">40</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">5</oasis:entry>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">88.64</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">40</oasis:entry>  
         <oasis:entry colname="col2">8</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">84.79</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">–</oasis:entry>  
         <oasis:entry colname="col2">8</oasis:entry>  
         <oasis:entry colname="col3">4</oasis:entry>  
         <oasis:entry colname="col4">–</oasis:entry>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">50.13</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">–</oasis:entry>  
         <oasis:entry colname="col2">8</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4">2</oasis:entry>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">10.25</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">–</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">4</oasis:entry>  
         <oasis:entry colname="col4">2</oasis:entry>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">5.80</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">–</oasis:entry>  
         <oasis:entry colname="col2">–</oasis:entry>  
         <oasis:entry colname="col3">–</oasis:entry>  
         <oasis:entry colname="col4"/>  
         <oasis:entry colname="col5">1</oasis:entry>  
         <oasis:entry colname="col6">0.00</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p>The results of the experiment are given in Table 4. The area of the ocean
basin and therefore the number of elements that require filling does not
change much. However, the compactness factor <inline-formula><mml:math display="inline"><mml:mi>C</mml:mi></mml:math></inline-formula> of the ocean basin, which is
defined as
            <disp-formula id="Ch1.Ex1"><mml:math display="block"><mml:mrow><mml:mi>C</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mi>A</mml:mi><mml:mrow><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msup><mml:mi mathvariant="normal">∅</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula>
          with <inline-formula><mml:math display="inline"><mml:mi mathvariant="normal">∅</mml:mi></mml:math></inline-formula> the circumference and <inline-formula><mml:math display="inline"><mml:mi>A</mml:mi></mml:math></inline-formula> the area of the basin, decreases
sharply when the small-scale topographical features become more prominent.</p>
      <p>This illustrates that the gain in computational efficiency from the block
inspection depends strongly on the shape of the topography in which a
depression must be filled. Natural topographical features generally have a
vertical scale proportional to their horizontal scale, which leads to the
relatively circular shapes of most natural lakes. This means that, for most
natural topographies, the block inspection algorithm will substantially
decrease the computation time required for filling depressions.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4"><caption><p>Land–ocean mask for the same region, with the topography passed
through a high-pass filter. <bold>(a)</bold> 40 % reduction in amplitude for
wavelengths above 30 km. <bold>(b)</bold> 60 % reduction. <bold>(c)</bold> 80 %
reduction. <bold>(d)</bold> 90 % reduction. The ocean area increases slightly and
the length of the coastline increases strongly.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f04.png"/>

        </fig>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T4"><caption><p>Reduction in computation time for the 40, 5 and 1 km
resolution scheme with respect to the 1 km benchmark experiment for
different bedrock topographies. Also listed are the area and compactness
factor of the resulting ocean basin.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:thead>
       <oasis:row>  
         <oasis:entry colname="col1">Filter</oasis:entry>  
         <oasis:entry colname="col2">Compactness</oasis:entry>  
         <oasis:entry colname="col3">Ocean</oasis:entry>  
         <oasis:entry colname="col4">Computation time</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">  
         <oasis:entry colname="col1">(%)</oasis:entry>  
         <oasis:entry colname="col2">factor</oasis:entry>  
         <oasis:entry colname="col3">area (km<inline-formula><mml:math display="inline"><mml:mrow><mml:msup><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">reduction (%)</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>  
         <oasis:entry colname="col1"><inline-formula><mml:math display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:msup><mml:mn>100</mml:mn><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col2">6.0 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.72 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">95.48</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">0</oasis:entry>  
         <oasis:entry colname="col2">5.1 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.72 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">91.56</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">20</oasis:entry>  
         <oasis:entry colname="col2">2.7 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.76 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">89.37</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">40</oasis:entry>  
         <oasis:entry colname="col2">1.4 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.77 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">74.48</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">60</oasis:entry>  
         <oasis:entry colname="col2">7.4 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.76 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">58.89</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">80</oasis:entry>  
         <oasis:entry colname="col2">2.6 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.79 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">35.35</oasis:entry>
       </oasis:row>
       <oasis:row>  
         <oasis:entry colname="col1">90</oasis:entry>  
         <oasis:entry colname="col2">1.4 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col3">1.86 <inline-formula><mml:math display="inline"><mml:mrow><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>  
         <oasis:entry colname="col4">18.72</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table><table-wrap-foot><p><inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> 30 km low-pass filter; “smoothed” topography.</p></table-wrap-foot></table-wrap>

</sec>
<sec id="Ch1.S3.SS3">
  <title>Shoreline memory</title>
      <p>Similar to the previous experiment, we consider the lake formation in the
North American region 30 000 years ago as a second example. At this time,
large parts of the North American continent were covered by the Laurentide
ice sheet. The depression left in the bedrock by the weight of the ice,
combined with the mass of ice damming off the Hudson Strait lead to the
formation of a massive proglacial lake over the area of what is now known as
the Hudson Bay. The situation is shown in Fig. 5.</p>
      <p>We apply the flood-fill algorithm to the same 1 km resolution topographic
map, combined with an ice-thickness distribution, a bedrock deformation
field and a geoid perturbation field (all generated by the ANICE–SELEN model
– de Boer et al., 2014) to determine the size of the lake. These data fields
have a 40 km resolution and are used to perturb the 1 km resolution DEM,
such that the small topographic features are preserved. The 40 km resolution
perturbation fields are mapped onto the 1 km resolution data fields using
bilinear interpolation. The lake is found to cover an area of <inline-formula><mml:math display="inline"><mml:mrow><mml:mn>3.5</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> km<inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:math></inline-formula>, with a volume of <inline-formula><mml:math display="inline"><mml:mrow><mml:mn>6.0</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>14</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> m<inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:math></inline-formula> or about
1.7 m eustatic sea-level equivalent of water.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><caption><p>North America, the Laurentide ice sheet and Lake Agassiz, 30 ky
before present. The red outlined region is shown in close-up in Fig. 6.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f05.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><caption><p>The area around the eastern shore of the lake, outlined in red in
Fig. 5. <bold>(a)</bold> The 40 km resolution estimate. <bold>(b)</bold> The result of the
40 km maximum topography fill to a water depth 20 % below that of the 40 km
estimate. <bold>(c)</bold> The final 1 km lake. Note that the algorithm allows
for ice to float when the water column is high enough, creating a small
ice shelf along the margin, visible in <bold>(c)</bold> where part of the lake's
shoreline runs beneath the ice.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/9/4451/2016/gmd-9-4451-2016-f06.png"/>

        </fig>

      <p>As a benchmark, we apply the standard flood-fill algorithm without any
optimizations, using a 5 m depth increment. This means that the algorithm
fills the depression up to a certain water level, increases the depth by 5 m
and fills the depression up to the new water level from the same seed, until
the lake overflows into the sea. This run costs 351 s (almost 6 min)
to complete. This implies that for a 120 000 year period which is
resolved every 5 years, which is a time step typically used to resolve the
last glacial cycle in an ice-sheet model, computational time is excessive
relative to the approximately 50 h such a simulation would otherwise
require.</p>
      <p>Performing the same test with a depth increment of 10 m takes 179 s.
This is far less time because for each depth interval the complete lake has to be
filled, the number of fills increases more or less linearly with the
requested accuracy. A 5 m depth interval leads to an accuracy of about 3 %
in the lake's volume, which is considered to be sufficiently accurate.</p>
      <p>By implementing the “shoreline memory” improvement described in Sect. 2.2.2 to
the algorithm we improve the performance in terms of computation time. As
explained earlier, the improved shoreline memory implies that every element
will only be checked once, yielding a drastic reduction in computation time,
which is particularly relevant for large lakes. Filling the same lake at 1 km
resolution only takes 23 s in the optimized case, a reduction in
computation time of about 90 % with respect to the benchmark.</p>
</sec>
<sec id="Ch1.S3.SS4">
  <title>Low-resolution lake depth estimation</title>
      <p>As a final improvement, we implement the depth estimation method. This
method starts by filling the same lake on the 40 km resolution topography,
in order to get a depth estimate. The resulting lake is depicted in Fig. 5.
It has a volume of <inline-formula><mml:math display="inline"><mml:mrow><mml:mn>6.6</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mn>14</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> m<inline-formula><mml:math display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:math></inline-formula>, overestimating the
“true” 1 km volume by about 10 %. The 40 km estimate covers several
river valleys visible in Fig. 6c, which should drain the lake. Since these
valleys are only a few kilometres wide they do not appear on the smoothed 40 km
resolution topography map. This causes the overestimation of the water
level and the lake's extent and volume – hence a high resolution is needed.
The resulting depth is reduced by an arbitrary amount of 20 % and a fill
to this new depth is performed on the 40 km maximum topography field. The
resulting lake, which will serve as a starting point for the final 1 km
fill, is depicted in Fig. 6b.</p>
      <p>The water level is then incrementally increased, while using the 1 km fill
algorithm, until the lake overflows into the sea. The complete process takes
4.4 s to complete. This is about 5 times faster than the 1 km fill
with shoreline memory and about 80 times faster than the default
implementation, a reduction in computation time of about 99 % with
respect to the benchmark experiment.</p>
      <p>Note that the 20 % reduction in depth from the 40 km estimate is chosen
somewhat arbitrarily. Depending on the smoothness of the local topography,
it is possible that the 40 km estimate will be much more accurate. In such
cases, it is justifiable to reduce the depth less, and hence improve
efficiency even more. For this reason, it is advisable to check if the depth
reduction from the 40 km estimate is enough to prevent overflow. If not, the
depth needs to be increased even further before starting the 40 km maximum
topography fill.</p>
</sec>
<sec id="Ch1.S3.SS5">
  <title>Comparison to the drainage-pointer method</title>
      <p>As a benchmark of our method, we compare the computational performance of
our optimized algorithm to that of the commonly used drainage-pointer
approach (Tarasov and Peltier, 2006). This method assigns to every map
element a drainage pointer, indicating which one of its immediate neighbours
receives run-off from that element. By following the run-off from an element
until it reaches the sea, elements can be grouped together by the location
where run-off reaches the sea, thus creating drainage basins.</p>
      <p>We found that a MATLAB implementation of the first step of this approach,
where drainage pointers are assigned to all high-resolution elements,
required about five times more computation time than our optimized algorithm
when used for determining the land–ocean mask as in Sect. 3.1. The reason
for this is that the drainage-pointer approach needs to assign these
pointers to every single high-resolution map element in order to work,
whereas our method only needs to treat those elements that are beneath the
water level and then only those near the shoreline at high resolution, thus
limiting the number of operations.</p>
</sec>
</sec>
<sec id="Ch1.S4" sec-type="conclusions">
  <title>Conclusions</title>
      <p>We have presented and evaluated several optimizations to a standard
flood-fill algorithm. When determining the land–ocean mask over a large
grid, the optimized algorithm is up to nine times faster than the default
algorithm. When determining the extent and depth of Lake Agassiz from a
given DEM and ice thickness map, the optimized algorithm is even up to 80
times faster than the default algorithm as proposed by Zhu et al. (2006).
The gain in computational efficiency depends on the smoothness of the
topography, with the largest reduction in computation time achieved when
most of the volume of the depression is contributed by topographical
features with a horizontal scale larger than the lowest resolution of the
block inspection method, as has been explained in Sect. 2.2.2.</p>
      <p>In the example given in this study, the ice thickness, bedrock deformation
and geoid anomaly all initially have a 40 km resolution. In order to do a
1 km lake fill, these fields were interpolated onto a 1 km grid, which is
computationally expensive (about 11 s in our MATLAB implementation).
If all input fields are already initially available at high resolution, they
only need to be downscaled to a low resolution for the block inspection
step, which takes considerably less time. For this reason, the computation
time for this interpolation step is not included in the results.</p>
      <p>The algorithm presented takes into account the bedrock deformation and geoid
perturbation caused by the mass changes of an ice sheet, if they have been
calculated. These effects both influence the volume of a lake by deepening
the basin because of the vertical water pressure on the landscape and by
raising the water surface.</p>
      <p>Any study involving either a very large grid or a large number of repeated
simulations will greatly benefit from these optimizations. Examples include
the modelling of large proglacial lakes, the dynamical modelling of run-off
over an evolving ice sheet, changes of water routing by tectonic activity
and changes in a large water basin due to sea-level changes such as in the
Mediterranean.</p>
</sec>
<sec id="Ch1.S5">
  <title>Code and data availability</title>
      <p>Several MATLAB scripts containing different versions of the flood-fill
algorithm, as referenced in this manuscript, are provided in the Supplement.
Two large NetCDF files containing data files required to run these
scripts are available online at <uri>https://zenodo.org/record/49614</uri>.</p>
</sec>

      
      </body>
    <back><app-group>
        <supplementary-material position="anchor"><p><bold>The Supplement related to this article is available online at <inline-supplementary-material xlink:href="http://dx.doi.org/10.5194/gmd-9-4451-2016-supplement" xlink:title="zip">doi:10.5194/gmd-9-4451-2016-supplement</inline-supplementary-material>.</bold></p></supplementary-material>
        </app-group><ack><title>Acknowledgements</title><p>The Ministry of Education, Culture and Science (OCW), in the Netherlands,
provided financial support for this study via the program of the Netherlands
Earth System Science Centre (NESSC). Heiko Goelzer, Lennert Stap and Sarah
Bradley commented on an earlier draft of this paper.<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
Edited by: D. Roche<?xmltex \hack{\newline}?>
Reviewed by: L. Tarasov and one anonymous referee</p></ack><ref-list>
    <title>References</title>

      <ref id="bib1.bib1"><label>1</label><mixed-citation>Amante, C. and Eakins, B. W.: ETOPO1 Arc-Minute Global Relief Model:
Procedures, Data Sources and Analysis, National Oceanic and Atmospheric
Administration Technical Memorandum NESDIS NGDC-24, <ext-link xlink:href="http://dx.doi.org/10.7289/V5C8276M" ext-link-type="DOI">10.7289/V5C8276M</ext-link>,
2009.</mixed-citation></ref>
      <ref id="bib1.bib2"><label>2</label><mixed-citation>Arnold, N.: A new approach for dealing with depressions in digital elevation
models when calculating flow accumulation values, Prog. Phys. Geog., 34,
781–809, <ext-link xlink:href="http://dx.doi.org/10.1177/0309133310384542" ext-link-type="DOI">10.1177/0309133310384542</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bib3"><label>3</label><mixed-citation>Barber, D. C., Dyke, A., Hillaire-Marcel, C., Jennings, A. E., Andrews, J.
T., Kerwin, M. W., Bilodeau, G., McNeely, R., Southon, J., Morehead, M. D.,
and Gagnon, J.-M.: Forcing of the cold event of 8,200 years ago by
catastrophic drainage of Laurentide lakes, Nature, 34, 781–809, <ext-link xlink:href="http://dx.doi.org/10.1038/22504" ext-link-type="DOI">10.1038/22504</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bib4"><label>4</label><mixed-citation>Broecker, W. S., Kenett, J. P., Flower, B. P., Teller, J., Trumbore, S.,
Bonani, G., and Wolfli, W.: Routing of meltwater from the Laurentide Ice
Sheet during the Younger Dryas cold episode, Nature, 341, 318–321,
<ext-link xlink:href="http://dx.doi.org/10.1038/341318a0" ext-link-type="DOI">10.1038/341318a0</ext-link>, 1989.</mixed-citation></ref>
      <ref id="bib1.bib5"><label>5</label><mixed-citation>Clark, P. U., Marshall, S. J., Clarke, G., Hostetler, S. W., Licciardi, J.
M., and Teller, J.: Freshwater Forcing of Abrupt Climate Change During the
Last Glaciation, Science, 293, 283–287, <ext-link xlink:href="http://dx.doi.org/10.1038/341318a0" ext-link-type="DOI">10.1038/341318a0</ext-link>, 2001.</mixed-citation></ref>
      <ref id="bib1.bib6"><label>6</label><mixed-citation>de Boer, B., Stocchi, P., and van de Wal, R. S. W.: A fully coupled
3-D ice-sheet-sea-level model: algorithm and applications, Geosci. Model Dev., 7,
2141–2156, <ext-link xlink:href="http://dx.doi.org/10.5194/gmd-7-2141-2014" ext-link-type="DOI">10.5194/gmd-7-2141-2014</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bib7"><label>7</label><mixed-citation>Döll, P. and Lehner, B.: Validation of a new global 30-min drainage
direction map, J. Hydrol., 258, 214–231, <ext-link xlink:href="http://dx.doi.org/10.1016/S0022-1694(01)00565-0" ext-link-type="DOI">10.1016/S0022-1694(01)00565-0</ext-link>, 2002.</mixed-citation></ref>
      <ref id="bib1.bib8"><label>8</label><mixed-citation>Goelzer, H., Janssens, I., Nemec, J., and Huybrechts, P.: A dynamic continental
runoff routing model applied to the last Northern Hemisphere deglaciation,
Geosci. Model Dev., 5, 599–609, <ext-link xlink:href="http://dx.doi.org/10.5194/gmd-5-599-2012" ext-link-type="DOI">10.5194/gmd-5-599-2012</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bib9"><label>9</label><mixed-citation>Hijma, M. P. and Cohen, K. M.: Timing and magnitude of the sea-level jump
preluding the 8200 yr event, Geology, 38, 275–278, <ext-link xlink:href="http://dx.doi.org/10.1130/G30439.1" ext-link-type="DOI">10.1130/G30439.1</ext-link>,
2010.</mixed-citation></ref>
      <ref id="bib1.bib10"><label>10</label><mixed-citation>Hillaire-Marcel, C., deVernal, A., and Piper, D. J.: Lake Agassiz final
drainage event in the northwest North Atlantic, Geophys. Res. Lett., 34,
L15601, <ext-link xlink:href="http://dx.doi.org/10.1029/2007GL030396" ext-link-type="DOI">10.1029/2007GL030396</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bib11"><label>11</label><mixed-citation>Kendall, R., Mitrovica, J. X., Milne, G. A., Törnqvist, T. E., and Li,
Y.-X.: The sea-level fingerprint of the 8.2 ka climate event, Geology, 36,
423–426, <ext-link xlink:href="http://dx.doi.org/10.1130/G24550A.1" ext-link-type="DOI">10.1130/G24550A.1</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib12"><label>12</label><mixed-citation>Krinner, G., Mangerud, J., Jakobsson, M., Crucifix, M., Ritz, C., and
Svendsen, J. I.: Enhanced ice sheet growth in Eurasia owing to adjacent
ice-dammed lakes, Nature, 427, 429–432, <ext-link xlink:href="http://dx.doi.org/10.1038/nature02233" ext-link-type="DOI">10.1038/nature02233</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bib13"><label>13</label><mixed-citation>Lajeunesse, P. and St-Onge, G.: The subglacial origin of the Lake
Agassiz-Ojibway final outburst flood, Nat. Geosci., 1, 184–188, <ext-link xlink:href="http://dx.doi.org/10.1038/ngeo130" ext-link-type="DOI">10.1038/ngeo130</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib14"><label>14</label><mixed-citation>Li, Y.-X., Törnqvist, T. E., Nevitt, J. M., and Kohl, B.: Synchronizing a
sea-level jump, final Lake Agassiz drainage and abrupt cooling 8200 years
ago, Earth Planet Sc. Lett., 315, 41–50, <ext-link xlink:href="http://dx.doi.org/10.1016/j.epsl.2011.05.034" ext-link-type="DOI">10.1016/j.epsl.2011.05.034</ext-link>,
2012.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bib15"><label>15</label><mixed-citation>Marshall, S. J. and Clarke, G.: Modelling North American Freshwater Runoff
through the Last Glacial Cycle, Quaternary Res., 52, 300–315, <ext-link xlink:href="http://dx.doi.org/10.1006/qres.1999.2079" ext-link-type="DOI">10.1006/qres.1999.2079</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bib16"><label>16</label><mixed-citation>
Renssen, H. and Knoop, J. M.: A global river routing network for use in
hydrological modelling, J. Hydrol., 230, 230–243, 2000.</mixed-citation></ref>
      <ref id="bib1.bib17"><label>17</label><mixed-citation>Stone, E. J., Capron, E., Lunt, D. J., Payne, A. J., Singarayer, J. S.,
Valdes, P. J., and Wolff, E. W.: Impact of meltwater on high-latitude early
Last Interglacial climate, Clim. Past, 12, 1919–1932, <ext-link xlink:href="http://dx.doi.org/10.5194/cp-12-1919-2016" ext-link-type="DOI">10.5194/cp-12-1919-2016</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bib18"><label>18</label><mixed-citation>Tarasov, L. and Peltier, W. R.: A geophysically constrained large ensemble
analysis of the deglacial history of the North American ice-sheet complex,
Quaternary Sci. Rev., 23, 359–388, <ext-link xlink:href="http://dx.doi.org/10.1016/j.quascirev.2003.08.004" ext-link-type="DOI">10.1016/j.quascirev.2003.08.004</ext-link>,
2004.</mixed-citation></ref>
      <ref id="bib1.bib19"><label>19</label><mixed-citation>Tarasov, L. and Peltier, W. R.: A calibrated deglacial chronology for the
North American continent: evidence of an Arctic trigger for the Younger
Dryas, Quaternary Sci. Rev., 25, 659–688,
<ext-link xlink:href="http://dx.doi.org/10.1016/j.quascirev.2005.12.006" ext-link-type="DOI">10.1016/j.quascirev.2005.12.006</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bib20"><label>20</label><mixed-citation>
Tarboton, D. G., Bras, R. L., and Rodriguez-Iturbe, I.: On the extraction of
channel networks from digital elevation data, Hydrol. Process., 5, 81–100,
1991.</mixed-citation></ref>
      <ref id="bib1.bib21"><label>21</label><mixed-citation>Teller, J., Leverington, D., and Mann, J. D.: Freshwater outbursts to the
oceans from glacial Lake Agassiz and their role in climate change during the
last deglaciation, Quaternary Sci. Rev., 21, 879–887,
<ext-link xlink:href="http://dx.doi.org/10.1016/S0277-3791(01)00145-7" ext-link-type="DOI">10.1016/S0277-3791(01)00145-7</ext-link>, 2002.</mixed-citation></ref>
      <ref id="bib1.bib22"><label>22</label><mixed-citation>Törnqvist, T. E., Bick, S. J., Gonzalez, J. L., van der Borg, K., and de
Jong, A. F.: Tracking the sea-level signature of the 8.2 ka cooling event:
New constraints from the Mississippi Delta, Geophys. Res. Lett., 31, L23309,
<ext-link xlink:href="http://dx.doi.org/10.1029/2004GL021429" ext-link-type="DOI">10.1029/2004GL021429</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bib23"><label>23</label><mixed-citation>Zhu, Q., Tian, Y., and Zhao, J.: An efficient depression processing algorithm
for hydrologic analysis, Comput. Geol., 32, 615–623,
<ext-link xlink:href="http://dx.doi.org/10.1016/j.cageo.2005.09.001" ext-link-type="DOI">10.1016/j.cageo.2005.09.001</ext-link>, 2006.</mixed-citation></ref>

  </ref-list><app-group content-type="float"><app><title/>

    </app></app-group></back>
    <!--<article-title-html>A computationally efficient depression-filling algorithm for digital elevation models, applied to proglacial lake drainage</article-title-html>
<abstract-html><p class="p">Many processes govern the deglaciation of ice sheets. One of the processes
that is usually ignored is the calving of ice in lakes that temporarily
surround the ice sheet. In order to capture this process a “flood-fill
algorithm” is needed. Here we present and evaluate several optimizations to a
standard flood-fill algorithm in terms of computational efficiency. As an
example, we determine the land–ocean mask for a 1 km resolution digital
elevation model (DEM) of North America and Greenland, a geographical area of
roughly 7000 by 5000 km (roughly 35 million elements), about half of which
is covered by ocean. Determining the land–ocean mask with our improved
flood-fill algorithm reduces computation time by 90 % relative to using a
standard stack-based flood-fill algorithm. This implies that it is now
feasible to include the calving of ice in lakes as a dynamical process inside
an ice-sheet model. We demonstrate this by using bedrock elevation, ice
thickness and geoid perturbation fields from the output of a coupled
ice-sheet–sea-level equation model at 30 000 years before present and
determine the extent of Lake Agassiz, using both the standard and improved
versions of the flood-fill algorithm. We show that several optimizations to
the flood-fill algorithm used for filling a depression up to a water level,
which is not defined beforehand, decrease the computation time by up to
99 %. The resulting reduction in computation time allows determination of
the extent and volume of depressions in a DEM over large geographical grids
or repeatedly over long periods of time, where computation time might
otherwise be a limiting factor. The algorithm can be used for all
glaciological and hydrological models, which need to trace the evolution over
time of lakes or drainage basins in general.</p></abstract-html>
<ref-html id="bib1.bib1"><label>1</label><mixed-citation>
Amante, C. and Eakins, B. W.: ETOPO1 Arc-Minute Global Relief Model:
Procedures, Data Sources and Analysis, National Oceanic and Atmospheric
Administration Technical Memorandum NESDIS NGDC-24, <a href="http://dx.doi.org/10.7289/V5C8276M" target="_blank">doi:10.7289/V5C8276M</a>,
2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>2</label><mixed-citation>
Arnold, N.: A new approach for dealing with depressions in digital elevation
models when calculating flow accumulation values, Prog. Phys. Geog., 34,
781–809, <a href="http://dx.doi.org/10.1177/0309133310384542" target="_blank">doi:10.1177/0309133310384542</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>3</label><mixed-citation>
Barber, D. C., Dyke, A., Hillaire-Marcel, C., Jennings, A. E., Andrews, J.
T., Kerwin, M. W., Bilodeau, G., McNeely, R., Southon, J., Morehead, M. D.,
and Gagnon, J.-M.: Forcing of the cold event of 8,200 years ago by
catastrophic drainage of Laurentide lakes, Nature, 34, 781–809, <a href="http://dx.doi.org/10.1038/22504" target="_blank">doi:10.1038/22504</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>4</label><mixed-citation>
Broecker, W. S., Kenett, J. P., Flower, B. P., Teller, J., Trumbore, S.,
Bonani, G., and Wolfli, W.: Routing of meltwater from the Laurentide Ice
Sheet during the Younger Dryas cold episode, Nature, 341, 318–321,
<a href="http://dx.doi.org/10.1038/341318a0" target="_blank">doi:10.1038/341318a0</a>, 1989.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>5</label><mixed-citation>
Clark, P. U., Marshall, S. J., Clarke, G., Hostetler, S. W., Licciardi, J.
M., and Teller, J.: Freshwater Forcing of Abrupt Climate Change During the
Last Glaciation, Science, 293, 283–287, <a href="http://dx.doi.org/10.1038/341318a0" target="_blank">doi:10.1038/341318a0</a>, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>6</label><mixed-citation>
de Boer, B., Stocchi, P., and van de Wal, R. S. W.: A fully coupled
3-D ice-sheet-sea-level model: algorithm and applications, Geosci. Model Dev., 7,
2141–2156, <a href="http://dx.doi.org/10.5194/gmd-7-2141-2014" target="_blank">doi:10.5194/gmd-7-2141-2014</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>7</label><mixed-citation>
Döll, P. and Lehner, B.: Validation of a new global 30-min drainage
direction map, J. Hydrol., 258, 214–231, <a href="http://dx.doi.org/10.1016/S0022-1694(01)00565-0" target="_blank">doi:10.1016/S0022-1694(01)00565-0</a>, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>8</label><mixed-citation>
Goelzer, H., Janssens, I., Nemec, J., and Huybrechts, P.: A dynamic continental
runoff routing model applied to the last Northern Hemisphere deglaciation,
Geosci. Model Dev., 5, 599–609, <a href="http://dx.doi.org/10.5194/gmd-5-599-2012" target="_blank">doi:10.5194/gmd-5-599-2012</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>9</label><mixed-citation>
Hijma, M. P. and Cohen, K. M.: Timing and magnitude of the sea-level jump
preluding the 8200 yr event, Geology, 38, 275–278, <a href="http://dx.doi.org/10.1130/G30439.1" target="_blank">doi:10.1130/G30439.1</a>,
2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>10</label><mixed-citation>
Hillaire-Marcel, C., deVernal, A., and Piper, D. J.: Lake Agassiz final
drainage event in the northwest North Atlantic, Geophys. Res. Lett., 34,
L15601, <a href="http://dx.doi.org/10.1029/2007GL030396" target="_blank">doi:10.1029/2007GL030396</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>11</label><mixed-citation>
Kendall, R., Mitrovica, J. X., Milne, G. A., Törnqvist, T. E., and Li,
Y.-X.: The sea-level fingerprint of the 8.2 ka climate event, Geology, 36,
423–426, <a href="http://dx.doi.org/10.1130/G24550A.1" target="_blank">doi:10.1130/G24550A.1</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>12</label><mixed-citation>
Krinner, G., Mangerud, J., Jakobsson, M., Crucifix, M., Ritz, C., and
Svendsen, J. I.: Enhanced ice sheet growth in Eurasia owing to adjacent
ice-dammed lakes, Nature, 427, 429–432, <a href="http://dx.doi.org/10.1038/nature02233" target="_blank">doi:10.1038/nature02233</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>13</label><mixed-citation>
Lajeunesse, P. and St-Onge, G.: The subglacial origin of the Lake
Agassiz-Ojibway final outburst flood, Nat. Geosci., 1, 184–188, <a href="http://dx.doi.org/10.1038/ngeo130" target="_blank">doi:10.1038/ngeo130</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>14</label><mixed-citation>
Li, Y.-X., Törnqvist, T. E., Nevitt, J. M., and Kohl, B.: Synchronizing a
sea-level jump, final Lake Agassiz drainage and abrupt cooling 8200 years
ago, Earth Planet Sc. Lett., 315, 41–50, <a href="http://dx.doi.org/10.1016/j.epsl.2011.05.034" target="_blank">doi:10.1016/j.epsl.2011.05.034</a>,
2012.

</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>15</label><mixed-citation>
Marshall, S. J. and Clarke, G.: Modelling North American Freshwater Runoff
through the Last Glacial Cycle, Quaternary Res., 52, 300–315, <a href="http://dx.doi.org/10.1006/qres.1999.2079" target="_blank">doi:10.1006/qres.1999.2079</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>16</label><mixed-citation>
Renssen, H. and Knoop, J. M.: A global river routing network for use in
hydrological modelling, J. Hydrol., 230, 230–243, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>17</label><mixed-citation>
Stone, E. J., Capron, E., Lunt, D. J., Payne, A. J., Singarayer, J. S.,
Valdes, P. J., and Wolff, E. W.: Impact of meltwater on high-latitude early
Last Interglacial climate, Clim. Past, 12, 1919–1932, <a href="http://dx.doi.org/10.5194/cp-12-1919-2016" target="_blank">doi:10.5194/cp-12-1919-2016</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>18</label><mixed-citation>
Tarasov, L. and Peltier, W. R.: A geophysically constrained large ensemble
analysis of the deglacial history of the North American ice-sheet complex,
Quaternary Sci. Rev., 23, 359–388, <a href="http://dx.doi.org/10.1016/j.quascirev.2003.08.004" target="_blank">doi:10.1016/j.quascirev.2003.08.004</a>,
2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>19</label><mixed-citation>
Tarasov, L. and Peltier, W. R.: A calibrated deglacial chronology for the
North American continent: evidence of an Arctic trigger for the Younger
Dryas, Quaternary Sci. Rev., 25, 659–688,
<a href="http://dx.doi.org/10.1016/j.quascirev.2005.12.006" target="_blank">doi:10.1016/j.quascirev.2005.12.006</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>20</label><mixed-citation>
Tarboton, D. G., Bras, R. L., and Rodriguez-Iturbe, I.: On the extraction of
channel networks from digital elevation data, Hydrol. Process., 5, 81–100,
1991.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>21</label><mixed-citation>
Teller, J., Leverington, D., and Mann, J. D.: Freshwater outbursts to the
oceans from glacial Lake Agassiz and their role in climate change during the
last deglaciation, Quaternary Sci. Rev., 21, 879–887,
<a href="http://dx.doi.org/10.1016/S0277-3791(01)00145-7" target="_blank">doi:10.1016/S0277-3791(01)00145-7</a>, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>22</label><mixed-citation>
Törnqvist, T. E., Bick, S. J., Gonzalez, J. L., van der Borg, K., and de
Jong, A. F.: Tracking the sea-level signature of the 8.2 ka cooling event:
New constraints from the Mississippi Delta, Geophys. Res. Lett., 31, L23309,
<a href="http://dx.doi.org/10.1029/2004GL021429" target="_blank">doi:10.1029/2004GL021429</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>23</label><mixed-citation>
Zhu, Q., Tian, Y., and Zhao, J.: An efficient depression processing algorithm
for hydrologic analysis, Comput. Geol., 32, 615–623,
<a href="http://dx.doi.org/10.1016/j.cageo.2005.09.001" target="_blank">doi:10.1016/j.cageo.2005.09.001</a>, 2006.
</mixed-citation></ref-html>--></article>
