<?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" xml:lang="en" dtd-version="3.0"><?xmltex \makeatother\@nolinetrue\makeatletter?>
  <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-11-1627-2018</article-id><title-group><article-title><italic>tran</italic>-SAS v1.0: a numerical model to compute catchment-scale hydrologic transport using StorAge Selection functions</article-title><alt-title>Numerical solution to the age master equation</alt-title>
      </title-group><?xmltex \runningtitle{Numerical solution to the age master equation}?><?xmltex \runningauthor{P. Benettin and E. Bertuzzo}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Benettin</surname><given-names>Paolo</given-names></name>
          <email>paolo.benettin@epfl.ch</email>
        <ext-link>https://orcid.org/0000-0001-7556-1417</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Bertuzzo</surname><given-names>Enrico</given-names></name>
          
        <ext-link>https://orcid.org/0000-0001-5872-0666</ext-link></contrib>
        <aff id="aff1"><label>1</label><institution>Laboratory of Ecohydrology ENAC/IIE/ECHO, École
Polytechinque Fédérale de Lausanne (EPFL), Lausanne, Switzerland</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Department of Environmental Sciences, Informatics and Statistics, Ca' Foscari University of Venice, Venice, Italy</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Paolo Benettin (paolo.benettin@epfl.ch)</corresp></author-notes><pub-date><day>25</day><month>April</month><year>2018</year></pub-date>
      
      <volume>11</volume>
      <issue>4</issue>
      <fpage>1627</fpage><lpage>1639</lpage>
      <history>
        <date date-type="received"><day>1</day><month>December</month><year>2017</year></date>
           <date date-type="rev-request"><day>16</day><month>January</month><year>2018</year></date>
           <date date-type="rev-recd"><day>21</day><month>March</month><year>2018</year></date>
           <date date-type="accepted"><day>31</day><month>March</month><year>2018</year></date>
      </history>
      <permissions>
        
        
      <license license-type="open-access"><license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p></license></permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018.html">This article is available from https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018.pdf</self-uri>
      <abstract>
    <p id="d1e97">This paper presents the “<italic>tran</italic>-SAS” package, which
includes a set of codes to model solute transport and water residence times
through a hydrological system. The model is based on a catchment-scale
approach that aims at reproducing the integrated response of the system at
one of its outlets. The codes are implemented in MATLAB and are meant to be
easy to edit, so that users with minimal programming knowledge can adapt them
to the desired application. The problem of large-scale solute transport has
both theoretical and practical implications. On the one side, the ability to
represent the ensemble of water flow trajectories through a heterogeneous
system helps unraveling streamflow generation processes and allows us to make
inferences on plant–water interactions. On the other side, transport models
are a practical tool that can be used to estimate the persistence of solutes
in the environment. The core of the package is based on the implementation of
an age master equation (ME), which is solved using general StorAge Selection
(SAS) functions. The age ME is first converted into a set of ordinary
differential equations, each addressing the transport of an individual
precipitation input through the catchment, and then it is discretized using
an explicit numerical scheme. Results show that the implementation is
efficient and allows the model to run in short times. The numerical accuracy
is critically evaluated and it is shown to be satisfactory in most cases of
hydrologic interest. Additionally, a higher-order implementation is provided
within the package to evaluate and, if necessary, to improve the numerical
accuracy of the results. The codes can be used to model streamflow age and
solute concentration, but a number of additional outputs can be obtained by
editing the codes to further advance the ability to understand and model
catchment transport processes.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <title>Introduction</title>
      <p id="d1e110">The field of hydrologic transport focuses on how water flows
through a watershed and mobilizes solutes towards the catchment outlets. The
proper representation of transport processes is important for a number of
purposes such as understanding streamflow generation processes
<xref ref-type="bibr" rid="bib1.bibx44 bib1.bibx29 bib1.bibx30" id="paren.1"/>, modeling the fate of
nutrients and pollutants <xref ref-type="bibr" rid="bib1.bibx21 bib1.bibx19" id="paren.2"/>, characterizing
how watersheds respond to change
<xref ref-type="bibr" rid="bib1.bibx22 bib1.bibx31 bib1.bibx13 bib1.bibx45" id="paren.3"/>, and estimating solute mass
export to stream <xref ref-type="bibr" rid="bib1.bibx15 bib1.bibx25" id="paren.4"/>. The spatiotemporal evolution
of a solute is typically expressed <xref ref-type="bibr" rid="bib1.bibx36 bib1.bibx20" id="paren.5"/>
as a combination of displacements, due to the carrier motion, and
biogeochemical reactions, due to the interactions with the surrounding
environment.</p>
      <p id="d1e128">Water trajectories within a catchment are usually considered from the time
water enters as precipitation to the time it leaves as discharge or
evapotranspiration. As watersheds are heterogeneous and subject to
time-variant atmospheric forcing, water flow paths have marked spatiotemporal
variability. For this reason, a formulation of transport by travel time
distributions <xref ref-type="bibr" rid="bib1.bibx12 bib1.bibx9" id="paren.6"><named-content content-type="pre">see</named-content></xref> can be
particularly convenient as it allows the transformation of complex 3-D trajectories
into a single variable: the travel time, i.e., the time elapsed from the
entrance of a water particle to its exit.</p>
      <p id="d1e136">While early catchment-scale approaches <xref ref-type="bibr" rid="bib1.bibx28" id="paren.7"><named-content content-type="pre">see</named-content></xref> focused on
the identification of an appropriate shape for the travel time distributions
(TTDs), emphasis has recently been put on a new generation of<?pagebreak page1628?> catchment-scale
transport models, in which TTDs result from a mass balance equation rather than
being assigned a priori <xref ref-type="bibr" rid="bib1.bibx10" id="paren.8"/>. As a consequence, TTDs change
through time, as observed experimentally <xref ref-type="bibr" rid="bib1.bibx33 bib1.bibx23" id="paren.9"><named-content content-type="pre">e.g.,</named-content></xref>
and as required for consistency with mass conservation. This approach has the
advantage of being consistent with the observed hydrologic fluxes and follows
from the formulation of an age master equation (ME) <xref ref-type="bibr" rid="bib1.bibx10" id="paren.10"/>,
describing the age–time evolution of each individual precipitation input
after entering the catchment. The key ingredient of this new approach is the
“StorAge Selection” (SAS) function, which describes how storage volumes of
different ages contribute to discharge (and evapotranspiration) fluxes. The
direct use of SAS functions has already provided insights on water age in
headwater catchments
<xref ref-type="bibr" rid="bib1.bibx42 bib1.bibx40 bib1.bibx17 bib1.bibx5 bib1.bibx45" id="paren.11"/>,
intensively managed landscapes <xref ref-type="bibr" rid="bib1.bibx13" id="paren.12"/>, lysimeter experiments
<xref ref-type="bibr" rid="bib1.bibx34 bib1.bibx23" id="paren.13"/>, and reach-scale hyporheic transport
<xref ref-type="bibr" rid="bib1.bibx18" id="paren.14"/>, and it has also been applied to non-hydrologic systems
like bird migrations <xref ref-type="bibr" rid="bib1.bibx16" id="paren.15"/>. In principle, applications
can be extended to any system in which the chronology of the inputs plays a role
in the output composition.</p>
      <p id="d1e171">The new theoretical formulation has improved capabilities, including being
less biased to spatial aggregation <xref ref-type="bibr" rid="bib1.bibx14" id="paren.16"/> as opposed to
traditional methods like the lumped convolution approach
<xref ref-type="bibr" rid="bib1.bibx26" id="paren.17"><named-content content-type="pre">e.g.,</named-content></xref>, but the numerical implementation of the
governing equations is more demanding. This can represent a barrier to the
diffusion of the new models, preventing their widespread use in transport
processes investigation. To make the use of the new theory more accessible,
the <italic>tran</italic>-SAS package includes a basic numerical model that solves
the age ME using arbitrary SAS functions. The model is developed to simulate
the transport of tracers in watershed systems, but it can be extended to
other hydrologic systems (e.g., water circulation in lakes and oceans). The
numerical code is written in MATLAB and it is intended to be intuitive and
easy to edit; hence minimal programming knowledge should be sufficient to
adapt it to the desired application.</p>
      <p id="d1e186">The specific objectives of this paper are to (i) provide a numerical model that
solves the age master equation with any form of the SAS functions in a
computationally efficient way, (ii) show the potential of the model for
simulating catchment-scale solute transport, and (iii) assess the numerical
accuracy of the model for different aggregation time steps.</p>
</sec>
<sec id="Ch1.S2">
  <title>Model description</title>
      <p id="d1e195">The model implemented in <italic>tran</italic>-SAS solves the age ME by means of
general SAS functions and uses the solution to compute the concentration of
an ideal tracer (conservative and passive to vegetation uptake) in
streamflow. The model is described here using hydrologic terminology and
applications.</p>
<sec id="Ch1.S2.SS1">
  <title>Definitions</title>
      <p id="d1e206">The general theoretical framework relies on the works by
<xref ref-type="bibr" rid="bib1.bibx10" id="text.18"/>, <xref ref-type="bibr" rid="bib1.bibx42" id="text.19"/>, <xref ref-type="bibr" rid="bib1.bibx17" id="text.20"/> and <xref ref-type="bibr" rid="bib1.bibx3" id="text.21"/>. Here, we
consider a typical hydrologic system with precipitation <inline-formula><mml:math id="M1" display="inline"><mml:mrow><mml:mi>J</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> as input and
evapotranspiration ET<inline-formula><mml:math id="M2" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and streamflow <inline-formula><mml:math id="M3" display="inline"><mml:mrow><mml:mi>Q</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> as outputs. The total system
storage is obtained as <inline-formula><mml:math id="M4" display="inline"><mml:mrow><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M5" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is the initial storage in
the system and <inline-formula><mml:math id="M6" display="inline"><mml:mrow><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the storage variations obtained from the hydrologic
balance equation <inline-formula><mml:math id="M7" display="inline"><mml:mrow><mml:mtext>d</mml:mtext><mml:mi>V</mml:mi><mml:mo>/</mml:mo><mml:mtext>d</mml:mtext><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mi>J</mml:mi><mml:mo>-</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>-</mml:mo><mml:mi>Q</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e346">The system state variable is the age distribution of the water storage.
Indeed, at any time <inline-formula><mml:math id="M8" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula>, the water storage is comprised of precipitation
inputs that occurred in the past and that have not left the system yet. Each
of these past inputs can be associated with an age <inline-formula><mml:math id="M9" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>, representing the time
elapsed since its entrance into the watershed. Hence, at any time <inline-formula><mml:math id="M10" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> the
storage is characterized by a distribution of ages <inline-formula><mml:math id="M11" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
Similarly, discharge and evapotranspiration fluxes are characterized by age
distributions <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M13" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, respectively. Each water
parcel in storage can also be characterized by its solute concentration
<inline-formula><mml:math id="M14" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which in case of an ideal tracer is equal to the
concentration of precipitation upon entering the catchment <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>J</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. Tracer
concentration in streamflow is indicated as <inline-formula><mml:math id="M16" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. A useful, transformed
version of the storage age distribution is the rank storage <inline-formula><mml:math id="M17" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, which is
defined as <inline-formula><mml:math id="M18" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msubsup><mml:mo>∫</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mi>T</mml:mi></mml:msubsup><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mi>d</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:mrow></mml:math></inline-formula> and represents
the volume in storage younger than <inline-formula><mml:math id="M19" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> at time <inline-formula><mml:math id="M20" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula>.</p>
      <p id="d1e572">The key element of the formulation is the SAS function, which formalizes the
functional relationship between the age distribution of the system storage
and that of the outflows. Different forms have been proposed to express the
SAS function directly as a function of age or as a derived distribution of
the storage age distribution, (e.g., absolute, fractional or ranked SAS
functions; see <xref ref-type="bibr" rid="bib1.bibx17" id="altparen.22"/>). For numerical convenience, here SAS
functions are expressed in terms of cumulative distribution
functions (CDFs) of the rank storage, for both
discharge (<inline-formula><mml:math id="M21" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) and evapotranspiration
(<inline-formula><mml:math id="M22" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>). Namely, <inline-formula><mml:math id="M23" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is, at any time
<inline-formula><mml:math id="M24" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula>, the fraction of total discharge which is produced by <inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
Hence, it is equal to the fraction of discharge younger than <inline-formula><mml:math id="M26" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>. The
corresponding probability density functions are indicated as
<inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M28" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. The main model variables
are illustrated in Fig. <xref ref-type="fig" rid="Ch1.F1"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1" specific-use="star"><caption><p id="d1e738">Conceptual illustration of the main variables of the theoretical
formulation. Precipitation volumes are represented through colored circles,
with darker colors indicating the older precipitations with respect to
current time <inline-formula><mml:math id="M29" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula>. Due to transport and mixing processes, precipitation
volumes are retained in the catchment storage and released to
streamflow <bold>(a)</bold>. Both the catchment storage and its outfluxes are
characterized by a distribution of ages <bold>(b, c)</bold>. For example, the
youngest water (age <inline-formula><mml:math id="M30" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, light blue color) accounts for <inline-formula><mml:math id="M31" display="inline"><mml:mrow><mml:mn mathvariant="normal">8</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">20</mml:mn></mml:mrow></mml:math></inline-formula> of the
storage and <inline-formula><mml:math id="M32" display="inline"><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> of streamflow. By cumulating such distributions one gets
the rank storage <inline-formula><mml:math id="M33" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and the cumulative discharge age distribution
<inline-formula><mml:math id="M34" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> (<bold>d</bold>, <bold>e</bold>, red lines). The relationship between
<inline-formula><mml:math id="M35" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M36" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is quantified by the SAS function
<inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> <bold>(f)</bold>.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f01.pdf"/>

        </fig>

</sec>
<sec id="Ch1.S2.SS2">
  <title>The age master equation</title>
      <?pagebreak page1629?><p id="d1e924">The age ME <xref ref-type="bibr" rid="bib1.bibx10" id="paren.23"/> can be seen as a hydrologic balance applied
to every parcel of water stored in the catchment. Two different equations can
be formulated that describe the forward-in-time or the backward-in-time
process <xref ref-type="bibr" rid="bib1.bibx3 bib1.bibx11 bib1.bibx35" id="paren.24"/>. Here, we
focus on the backward form, as it is the most convenient to model solute
concentration in streamflow. The backward form of the ME can be written in a
number of equivalent forms that have been proposed in the literature
<xref ref-type="bibr" rid="bib1.bibx10 bib1.bibx42 bib1.bibx17" id="paren.25"><named-content content-type="pre">e.g.,</named-content></xref>. Here, we employ the
cumulative version, which has a less intuitive physical interpretation but a
better suitability to numerical implementation. The complete set of equations
reads as follows.

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M38" display="block"><mml:mtable rowspacing="0ex 8.535827pt 0ex" displaystyle="true"><mml:mlabeledtr id="Ch1.E1"><mml:mtd/><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi>J</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi>Q</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E2"><mml:mtd/><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtext>Initial condition:</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E3"><mml:mtd/><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtext>Boundary condition:</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            The initial condition <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> indicates some initial distribution of
the rank storage at time 0. Note that to ensure that <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>ET</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> are distributions over the age domain <inline-formula><mml:math id="M43" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∞</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the SAS
functions must verify the condition <inline-formula><mml:math id="M44" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>→</mml:mo><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>→</mml:mo><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>. This condition,
however, is automatically verified as the SAS functions were defined as CDFs.</p>
      <?pagebreak page1630?><p id="d1e1312">The solution of Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) gives the rank storage <inline-formula><mml:math id="M45" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, from
which the discharge age distributions <inline-formula><mml:math id="M46" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> can be obtained as

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M47" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E4"><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

            where <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the cumulative distribution of <inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M50" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> by definition. Stream solute concentration
<inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> follows from

                <disp-formula id="Ch1.E5" content-type="numbered"><mml:math id="M52" display="block"><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∫</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">∞</mml:mi></mml:munderover><mml:msub><mml:mi>C</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mtext>d</mml:mtext><mml:mi>T</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e1681">The same reasoning applies to the age distributions and concentration of the
evapotranspiration flux.</p>
</sec>
<sec id="Ch1.S2.SS3">
  <title>The SAS functions</title>
      <p id="d1e1690">As explained in Sect. <xref ref-type="sec" rid="Ch1.S2.SS1"/>, SAS functions are CDFs over the finite
interval <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>. A simple class of probability distributions that is
suitable to serve as an SAS function is the power-law distribution
<xref ref-type="bibr" rid="bib1.bibx34 bib1.bibx5" id="paren.26"/>, which takes the form

                <disp-formula id="Ch1.E6" content-type="numbered"><mml:math id="M54" display="block"><mml:mstyle class="stylechange" displaystyle="true"/><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msup><mml:mfenced close="]" open="["><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>k</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:msup><mml:mfenced open="[" close="]"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>k</mml:mi></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          The parameter <inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∞</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> controls the affinity of the outflow for
relatively younger or older water in storage. Specifically, <inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> [<inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>]
implies affinity for young (old) water, whereas the case <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> represents
random sampling, i.e., outfluxes select water irrespective of its age. <inline-formula><mml:math id="M59" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>
can be conveniently made time variant (e.g., dependent on the system wetness)
to account for possible changes in the properties of the system
<xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx17" id="paren.27"><named-content content-type="pre">see</named-content></xref>. Equation (<xref ref-type="disp-formula" rid="Ch1.E6"/>) also
requires knowledge of the initial storage in the system <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, which can be
difficult to estimate experimentally and it is often treated as a calibration
parameter. When using power-law SAS functions for both <inline-formula><mml:math id="M61" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula> and ET, the system
only requires three calibration parameters: <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mtext>ET</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>.
Different classes of probability distributions can be used to have more
flexibility in the SAS function shape, e.g., the beta
<xref ref-type="bibr" rid="bib1.bibx42 bib1.bibx16" id="paren.28"/> or the gamma
<xref ref-type="bibr" rid="bib1.bibx17 bib1.bibx45" id="paren.29"/> distributions. Such functions can be more
difficult to implement numerically, but they are usually available in
software libraries.</p>
</sec>
<sec id="Ch1.S2.SS4">
  <title>The special case of well-mixed or random sampling</title>
      <p id="d1e1958">In case all the outflows remove the stored ages proportionally to their
abundance, the outflow age distributions become a perfect sample (or
random sample, RS) of the storage age distribution. The SAS
functions in this case assume the linear form
<inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and
Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) has the analytical solution <xref ref-type="bibr" rid="bib1.bibx7" id="paren.30"/>

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M66" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E7"><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>J</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi>exp⁡</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mo>-</mml:mo><mml:munderover><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:munderover><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>Q</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>(</mml:mo><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mtext>d</mml:mtext><mml:mi mathvariant="italic">τ</mml:mi></mml:mrow></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

            Equation (<xref ref-type="disp-formula" rid="Ch1.E7"/>) can be seen as a generalization of the linear reservoir
equation to fluctuating storage. Indeed, in the special case of a stationary
system, where <inline-formula><mml:math id="M67" display="inline"><mml:mrow><mml:mi>J</mml:mi><mml:mo>=</mml:mo><mml:mi>Q</mml:mi><mml:mo>+</mml:mo><mml:mtext>ET</mml:mtext></mml:mrow></mml:math></inline-formula> and the ratio <inline-formula><mml:math id="M68" display="inline"><mml:mrow><mml:mi>J</mml:mi><mml:mo>/</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:math></inline-formula> is a constant <inline-formula><mml:math id="M69" display="inline"><mml:mi>c</mml:mi></mml:math></inline-formula>,
Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) takes the simple form <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>c</mml:mi><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mi>exp⁡</mml:mi><mml:mo>(</mml:mo><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
</sec>
</sec>
<sec id="Ch1.S3">
  <title>Model implementation</title>
<sec id="Ch1.S3.SS1">
  <title>Problem discretization</title>
      <p id="d1e2261">Equation (<xref ref-type="disp-formula" rid="Ch1.E1"/>) does not have an exact solution, except for the particular
case of randomly sampled storage (Sect. <xref ref-type="sec" rid="Ch1.S2.SS4"/>). Thus in general a
numerical implementation is required. Following the approach by
<xref ref-type="bibr" rid="bib1.bibx34" id="text.31"/> and <xref ref-type="bibr" rid="bib1.bibx17" id="text.32"/>, the partial differential equation
(Eq. <xref ref-type="disp-formula" rid="Ch1.E1"/>) is first converted into a set of ordinary differential
equations using the method of characteristics. Indeed, along a characteristic
line of the type <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) simplifies into an ordinary
differential equation in the single variable <inline-formula><mml:math id="M72" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>:

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M73" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E8"><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mtext>d</mml:mtext><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mtext>d</mml:mtext><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mi>J</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi>Q</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>-</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

            with initial conditions <inline-formula><mml:math id="M74" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>. In this context, reformulating the
problem along characteristic lines means following the variable
<inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, i.e., the fraction of storage younger than the water input
entered in <inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. This can be equally interpreted as the amount of water
storage entered after time <inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. The solution <inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> starts from
the value 0, corresponding to the initial time <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. Then, as time (and age)
grows, <inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> increases when precipitation <inline-formula><mml:math id="M81" display="inline"><mml:mi>J</mml:mi></mml:math></inline-formula> introduces younger
water into the system and decreases when outfluxes <inline-formula><mml:math id="M82" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula> and ET withdraw water
younger than <inline-formula><mml:math id="M83" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>. Water entered after <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> gradually replaces the water
entered before <inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and for very large <inline-formula><mml:math id="M86" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> the solution reaches
(asymptotically) the total storage in the system, as no water that had
entered before <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is still present in the system.</p>
      <p id="d1e2674">We discretize time and age using the same time steps <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>,
resulting in <inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>j</mml:mi><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>∈</mml:mo><mml:mi mathvariant="double-struck">N</mml:mi></mml:mrow></mml:math></inline-formula> and
we use the convention that the discrete variables <inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M93" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> refer to
the beginning of the time step. To simplify the notation, square brackets are
used to indicate the numerical evaluation of a function and the indexes <inline-formula><mml:math id="M94" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>
and <inline-formula><mml:math id="M95" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> are used for <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, respectively. For example, <inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
indicates the numerical evaluation of function <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. The conventions
used for the discretization are illustrated in Fig. <xref ref-type="fig" rid="Ch1.F2"/>. For
numerical convenience and because real-world data often represent an average
over a certain time interval, all fluxes (<inline-formula><mml:math id="M100" display="inline"><mml:mi>J</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M101" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula>, ET) are considered as
averages over the time step <inline-formula><mml:math id="M102" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> (e.g.,
<inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:mi>J</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mi>h</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msubsup><mml:mo>∫</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mi>j</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:msubsup><mml:mi>J</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>)</mml:mo><mml:mtext>d</mml:mtext><mml:mi mathvariant="italic">τ</mml:mi></mml:mrow></mml:math></inline-formula>). As a consequence, storage
variations obtained from a hydrologic balance are linear during a time step
and each value refers to the beginning of the time step.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2"><caption><p id="d1e2935">Illustration of the conventions used to discretize the time domain.
Time steps have a fixed length <inline-formula><mml:math id="M104" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> (e.g., 12 h) and each time step <inline-formula><mml:math id="M105" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> starts
in <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>j</mml:mi><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>. The numerical evaluation of a function <inline-formula><mml:math id="M107" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> at time <inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>
is indicated as <inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p></caption>
          <?xmltex \igopts{width=184.942913pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f02.pdf"/>

        </fig>

      <p id="d1e3010">To solve Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>), we implement a forward Euler scheme. This
explicit numerical scheme is intuitive and fast to<?pagebreak page1631?> solve, and its numerical
accuracy is shown to be satisfactory for many hydrologic applications (see
model verification, Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>). By terming
<inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the discretized problem becomes

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M111" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E9"><mml:mtd/><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi>J</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:mi>Q</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

            for <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>N</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M113" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> indicating the number of time steps in the
simulation, and boundary condition <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>. In a pure forward Euler
scheme, this boundary condition implies that <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>,
meaning that no input can be part of an output during the same time step. This
can be a limitation for catchment applications, where “event” water is
often not negligible and it can bear important information on catchment form
and function. For this reason, in Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>) we use a modified
<inline-formula><mml:math id="M116" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> defined as

                <disp-formula id="Ch1.E10" content-type="numbered"><mml:math id="M117" display="block"><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>,</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msub><mml:mi>t</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M118" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is an estimate of the youngest water stored in the system at the
end of time step <inline-formula><mml:math id="M119" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula>. Such an estimate is obtained here as
<inline-formula><mml:math id="M120" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mo>max⁡</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>J</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:mi>Q</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:mtext>ET</mml:mtext><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
i.e., it is a water balance for current precipitation input using the SAS
functions evaluated at a previous time step. The classic Euler scheme is
returned if <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>. This modification of the classic numerical scheme only
affects the behavior of the youngest age in the system and it is a simple and
efficient way to account for transport of event water. The accuracy of this
numerical scheme is evaluated in Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>.</p>
</sec>
<sec id="Ch1.S3.SS2">
  <title>Numerical routine</title>
      <p id="d1e3516">The model solves Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>) by implementing an external for-loop on <inline-formula><mml:math id="M122" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula>
(i.e., on the chronological time) and an internal for-loop on <inline-formula><mml:math id="M123" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> (i.e., on the
ages). This means that during one time step <inline-formula><mml:math id="M124" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> all the characteristic curves
(Eq. <xref ref-type="disp-formula" rid="Ch1.E9"/>) are updated by one time step. The internal loop is
implemented using vector operations. The vector length is indicated as <inline-formula><mml:math id="M125" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>
and it depends on the number of age classes (which is also the number of
characteristic curves) that are included in the computations at time <inline-formula><mml:math id="M126" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> (see
Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>). At any time step, the two fundamental operations to
solve the discretized ME are
<list list-type="bullet"><list-item>
      <p id="d1e3567">compute <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi><mml:mo>*</mml:mo></mml:msubsup><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext><mml:mo>*</mml:mo></mml:msubsup><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> using Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>)</p></list-item><list-item>
      <p id="d1e3619">compute <inline-formula><mml:math id="M129" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> using Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>) for <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p></list-item></list></p>
      <p id="d1e3668">To compute the model output, further operations are required. In particular,
<list list-type="bullet"><list-item>
      <p id="d1e3673">update <inline-formula><mml:math id="M131" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>S</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi>J</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>-</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, which is valid for conservative solutes entering through
precipitation;</p></list-item><list-item>
      <p id="d1e3716">compute <inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>;</p></list-item><list-item>
      <p id="d1e3785">compute <inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:msub><mml:mi>C</mml:mi><mml:mi>S</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>.</p></list-item></list></p>
      <p id="d1e3861">Starting from these basic routines, many additional operations can be
implemented to, for example, characterize the nonconservative behavior of solutes or
to compute some age distribution statistics.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <title>Additional numerical details</title>
      <p id="d1e3870">A first issue that the model needs to take into account is that age
distributions are defined over an age domain <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∞</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, meaning that the
rank storage is made of an infinite number of elements where the oldest
elements typically represent infinitesimal stored volumes. To have a finite
number of elements in the computations, an arbitrary old fraction of rank
storage can be considered as a single undifferentiated volume of “older”
water. This allows us to merge a high number of very little residual volumes into
a single old pool. Note that the term old should be used carefully as
its definition depends on the particular system under consideration and it
may differ depending on the characteristic timescales of the solute used to
infer water age <xref ref-type="bibr" rid="bib1.bibx4" id="paren.33"/>. The old pool is defined here as the
volume <inline-formula><mml:math id="M135" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&gt;</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is a numerical parameter
that can be fixed for each different application. <inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> also defines
the age <inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, corresponding to <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>,
which indicates the oldest age that is computed individually. Numerically,
the parameter <inline-formula><mml:math id="M140" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> controls the number <inline-formula><mml:math id="M141" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of age classes (or
equivalently rank storage volumes) that are taken into account in the
computations. <inline-formula><mml:math id="M142" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> should be chosen so that the number of elements
used in the computations remains small but the numerical accuracy is not
compromised. It can be convenient to define a nondimensional threshold
<inline-formula><mml:math id="M143" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> such that <inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi>S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. In this
case, a value <inline-formula><mml:math id="M145" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.9</mml:mn></mml:mrow></mml:math></inline-formula> means that the old pool comprises the oldest
10 % of the water storage. When <inline-formula><mml:math id="M146" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> no old pool is taken into
account. Once a storage element is merged to the old pool, its individual age
and concentration properties cannot be retrieved, but the mean properties of
the old pool like the mean solute concentration are preserved.</p>
      <p id="d1e4102">A second, connected problem regards the initial conditions of the system,
i.e., the unknown storage age distribution and<?pagebreak page1632?> solute concentration to be used
at the beginning of the calculations. In the absence of information, the
initial storage can be considered as one single old pool; hence the initial
number of age classes <inline-formula><mml:math id="M147" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is equal to 1. Once computations start, new
elements are introduced and accounted for in the balance, reducing the impact
and the influence of the initial conditions. The old pool gets progressively
smaller (and vector length <inline-formula><mml:math id="M148" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> larger) until it reaches the stationary
value defined by <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mtext>th</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. An initial spinup period can be used to
initialize the ME balance and reduce the size of the initial old water pool.
This is particularly indicated when modeling solutes with long turnover times
like tritium. The influence of the initial conditions decreases with time,
but given the long timescales that may characterize transport processes, it
is likely never completely exhausted. This has little impact on the output
concentration but it limits the maximum computable age to the time elapsed
since the start of the simulation.</p>
      <p id="d1e4138">The computational time of a simulation can be reduced by not accounting for
zero-precipitation inputs as they have no influence in the balance but
increase the number of operations required at each time step. In such a case,
however, the position of an element in the vector does not correspond with
its age anymore and age has to be counted separately. To keep the model
intuitive, we decided to not remove zero-precipitation inputs.</p>
</sec>
</sec>
<sec id="Ch1.S4">
  <title>Application example</title>
      <p id="d1e4148">Application of the approach requires knowledge of the input or output water
fluxes to or from the catchment, the input solute concentration, and the
initial conditions for the water storage magnitude and concentration. Then,
an SAS function must be specified for each outflow. The code comes with
example virtual data that can be used to evaluate the model capabilities.
Hydrologic data for 4 years were obtained from recorded precipitation and
streamflow at the Mebre-Aval catchment near Lausanne (CH). Evapotranspiration was obtained from regional
daily estimates around the Lausanne area and modified to match the long-term
mass balance. On average, yearly precipitation is 1100 mm, discharge is
580 mm (53 % of precipitation) and evapotranspiration is 520 mm. The
storage variations, computed by solving the hydrologic balance, were
normalized to the interval [0,1] to serve as a nondimensional metric of
catchment wetness (variable wi). Overall, the data are not meant to be
representative of a particular location, but they constitute a realistic set
of hydrologic variables to test the model.</p>
      <p id="d1e4151">The code was run on the example data using the four illustrative shapes for the
discharge SAS function listed in Table <xref ref-type="table" rid="Ch1.T1"/>. All simulations share the
following settings: 12 h time step, 4-year spinup period obtained by
repeating the example data, storage threshold <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mtext>th</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> (i.e., no
old-pool schematization), initial storage parameter <inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula>, and
evapotranspiration SAS function selected as a power law with parameter <inline-formula><mml:math id="M152" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>
(equivalent to a random sampling). The different shapes for the discharge SAS
function were selected to test different functional forms (power law, power
law time variant, beta distribution) and to illustrate the transition from
the preferential release of younger water volumes (examples <inline-formula><mml:math id="M153" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M154" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) to the random sampling case (<inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) and the preferential
release of older waters (<inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>). The time-variant power-law SAS
(<inline-formula><mml:math id="M157" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) was obtained by using Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>) with a time-variant
exponent <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mtext>wi</mml:mtext><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mo>(</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, with parameters
<inline-formula><mml:math id="M159" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M160" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> corresponding to the exponent <inline-formula><mml:math id="M161" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> during the wettest
(wi <inline-formula><mml:math id="M162" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) and driest (wi <inline-formula><mml:math id="M163" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>) conditions. This parameter choice is used
for illustration purposes and should not be taken as representative of a
general catchment behavior.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1"><caption><p id="d1e4381">Description of the discharge SAS functions used in the application.
All the functions were tested with the same initial total storage
<inline-formula><mml:math id="M164" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula> mm.</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="left"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1">Name</oasis:entry>

         <oasis:entry colname="col2">Type</oasis:entry>

         <oasis:entry colname="col3">Parameters</oasis:entry>

         <oasis:entry colname="col4">Value</oasis:entry>

       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>

         <oasis:entry rowsep="1" colname="col1" morerows="1"><inline-formula><mml:math id="M165" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry rowsep="1" colname="col2" morerows="1">Power law time variant</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">0.3</oasis:entry>

       </oasis:row>
       <oasis:row rowsep="1">

         <oasis:entry colname="col3"><inline-formula><mml:math id="M167" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">0.9</oasis:entry>

       </oasis:row>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1"><inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">Power law</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">0.7</oasis:entry>

       </oasis:row>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1"><inline-formula><mml:math id="M170" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">Random sampling</oasis:entry>

         <oasis:entry colname="col3">–</oasis:entry>

         <oasis:entry colname="col4">–</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1" morerows="1"><inline-formula><mml:math id="M171" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2" morerows="1">Beta</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M172" display="inline"><mml:mi>a</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">1.5</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M173" display="inline"><mml:mi>b</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">0.8</oasis:entry>

       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e4592">Two different examples of solute transport were simulated in the test. In the
first case, solute input concentration was generated by adding noise to a
sinusoidal wave with an annual cycle. This example can be representative of
atmospheric tracers with a yearly period (like stable water isotopes). In the
second case, the initial storage was set to a concentration of
100 mg L<inline-formula><mml:math id="M174" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> and any subsequent input was assigned a concentration of
0 mg L<inline-formula><mml:math id="M175" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, causing the system to dilute. This example can be
representative of a diluting system, e.g., a catchment with conservative
agricultural inputs like chloride <xref ref-type="bibr" rid="bib1.bibx27 bib1.bibx41" id="paren.34"/> that
undergoes a step reduction. Results of both examples are shown in
Fig. <xref ref-type="fig" rid="Ch1.F3"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><caption><p id="d1e4627">Example of results that can be obtained from the model.
<bold>(a)</bold> Streamflow solute response in the case of sinusoidal tracer input;
<bold>(b)</bold> streamflow solute response in the case of step reduction of the
tracer input; <bold>(c)</bold> illustration of the different <inline-formula><mml:math id="M176" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> used in
the simulations and listed in Table <xref ref-type="table" rid="Ch1.T1"/> (as <inline-formula><mml:math id="M177" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is
time variant; its possible shapes are represented by a colored band);
<bold>(d)</bold> cumulative streamflow travel time distributions (TTDs) extracted
on a specific day (15 February 2016, indicated with a cross in <bold>a</bold>
and <bold>b</bold>). All simulations share the same settings and only differ in
the choice of the <inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> function.</p></caption>
        <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f03.pdf"/>

      </fig>

      <p id="d1e4690">Each discharge SAS function simulates different transport mechanisms and
provides rather different outputs, both in terms of water age and streamflow
concentration. In the first solute transport example (Fig. <xref ref-type="fig" rid="Ch1.F3"/>a),
discharge concentration gets progressively damped and shifted as the SAS
function moves from younger-water preference to older-water preference. The
travel time distributions extracted for 15 February 2016
(Fig. <xref ref-type="fig" rid="Ch1.F3"/>d) show that the median age of streamflow may vary by a
factor of 3–8 simply based on the selection of the SAS function (i.e.,
leaving the storage parameter unchanged). The affinity for younger water is
rather typical in catchments, at least during wet conditions, while the
release of older water is more representative of soil columns or aquifers.
The second solute example (Fig. <xref ref-type="fig" rid="Ch1.F3"/>b) evaluates the<?pagebreak page1633?> “memory” of a
system, i.e., the time needed to adapt to a new condition. Again, the
preferential release of older storage volumes and the implied lack of young
water in streamflow makes the system response more damped. However, this also
means that the old water gets depleted faster; hence in the long term the
trend may be reversed and the residual legacy of the initial conditions may
be stronger in systems with a high affinity for younger water. This is
visible in Fig. <xref ref-type="fig" rid="Ch1.F3"/>b right after year 2, although the effect is
very mild in this case. The time-variant SAS function (<inline-formula><mml:math id="M179" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ω</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) is
particularly illustrative in this example because it shows that streamflow
concentration can increase in time (e.g., around year 1 in
Fig. <xref ref-type="fig" rid="Ch1.F3"/>b), even in the absence of new solute input, just as a
consequence of the changing transport mechanisms.</p>
      <p id="d1e4715">Overall, these quick examples were used to illustrate the model capabilities
and to show that results may change significantly depending on the choice of
the parameters. A sensitivity analysis is generally advised to identify the
parameters that have the highest impact on model results. For example,
previous catchment studies <xref ref-type="bibr" rid="bib1.bibx5" id="paren.35"><named-content content-type="pre">e.g.,</named-content></xref> highlighted the
challenge in constraining the SAS function of ET flux when based on
streamflow concentration measurements only. As a consequence, the hypothesis
of random sampling for the ET flux is often as valid as the preference for
the younger or older stored water, but it is more parsimonious. Different model
outputs are affected by parameters in different ways, and water ages (for
example the median age, Fig. <xref ref-type="fig" rid="Ch1.F3"/>d) are typically more sensitive
than solute concentration to parameter variations. The low computational
times of the model aid the development of sensitivity analyses.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4" specific-use="star"><caption><p id="d1e4727">Numerical errors on the storage age distribution <bold>(a)</bold> and on
streamflow concentration <bold>(b)</bold> as a function of the aggregation time
step. The error time series are summarized through their standard
deviation (SD). Each plot shows the
performance of two different numerical schemes: classic Euler forward (EF)
and modified Euler forward (EF<inline-formula><mml:math id="M180" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula>, which is the default model version). The
EF<inline-formula><mml:math id="M181" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> implementation shows significant improvements with respect to EF in
the accuracy of streamflow concentration.</p></caption>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f04.pdf"/>

      </fig>

</sec>
<sec id="Ch1.S5">
  <title>Discussion</title>
<sec id="Ch1.S5.SS1">
  <title>Model verification</title>
      <?pagebreak page1634?><p id="d1e4772">Here we evaluate the numerical accuracy of the model in computing the
solution of the age ME (i.e., the rank storage <inline-formula><mml:math id="M182" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>) and streamflow
concentration <inline-formula><mml:math id="M183" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. The numerical model is first evaluated by comparing our
modified Euler solution (Eq. <xref ref-type="disp-formula" rid="Ch1.E9"/>) to a numerical implementation of the
analytic solution (Eq. <xref ref-type="disp-formula" rid="Ch1.E1"/>). This comparison is only possible for the
case of random sampling (see Sect. <xref ref-type="sec" rid="Ch1.S2.SS4"/>), as no analytic solution is
usually available for other transport schemes. Then, the comparison is made
for other shapes of the SAS function, approximating the true solution
with a higher-order implementation of Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>). As in
Sect. <xref ref-type="sec" rid="Ch1.S4"/>, comparisons are made on the example dataset, using
daily average fluxes and the sinusoidal tracer input concentration.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><caption><p id="d1e4810">Solute concentration (<inline-formula><mml:math id="M184" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>) time series obtained from power-law SAS
functions with parameter <inline-formula><mml:math id="M185" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula> and parameter <inline-formula><mml:math id="M186" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0.2</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">3.0</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, using a
24 h time step <bold>(a)</bold>. The time series are rather different, as they
are
progressively more lagged and damped for increasing values of <inline-formula><mml:math id="M187" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>. The
difference with the higher-order solution forms the residual time series
(<bold>b</bold>, same scale as <bold>a</bold>). Residuals are overall limited and
they do not cumulate during the 8-year simulation.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f05.pdf"/>

        </fig>

      <p id="d1e4882">For the RS comparison, the analytic solution was obtained by implementing
Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) at a daily scale, considering that fluxes are piecewise
constant while the storage is piecewise linear during the time step. The
numerical solution for the RS was obtained by setting both <inline-formula><mml:math id="M188" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> as power laws with parameters <inline-formula><mml:math id="M190" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mtext>ET</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>. The
numerical model was run for eight different aggregation time steps <inline-formula><mml:math id="M191" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula>: 1, 2,
3, 4, 6, 8, 12 and 24 h. For each run, the resulting streamflow
concentration and one rank storage (corresponding to the end of day 2745)
were used for comparison with the analytic solution. Models were run for
8 years using 4 years of spinup. To allow direct comparisons across different
aggregation time steps, streamflow concentrations were extracted at the end
of each day, resulting in eight different time series (one per <inline-formula><mml:math id="M192" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula>) of 2920
elements. The time series were then normalized by the mean and standard
deviation of the analytic solution. A time series of model errors on
streamflow concentration (err<inline-formula><mml:math id="M193" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>) was finally obtained from the
difference between the analytic and the numerical (normalized) solutions. The
rank storage was evaluated on the entire age domain every 24 h (again, to
allow comparisons across different time steps). To avoid comparisons between
cumulative functions, the rank storage was used to compute the storage age
probability density function <inline-formula><mml:math id="M194" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> (see Sect. <xref ref-type="sec" rid="Ch1.S2.SS1"/>). The
errors on <inline-formula><mml:math id="M195" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> were obtained from the difference between the analytic
and the numerical solutions. In this case, the error time series
(err<inline-formula><mml:math id="M196" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>) consists, for each of the eight aggregation time steps,
of 2745 elements. For additional comparisons, the performance of our
numerical implementation (EF<inline-formula><mml:math id="M197" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula>) was compared to the classic implementation
of the forward Euler scheme (EF, i.e., Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>) with <inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>).
Results are obtained for four different values of the initial storage <inline-formula><mml:math id="M199" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>:
300, 500, 1000 and 2000 mm. The standard deviations of err<inline-formula><mml:math id="M200" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>
and err<inline-formula><mml:math id="M201" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula> are shown in Fig. <xref ref-type="fig" rid="Ch1.F4"/> as a function of the
aggregation time step. The EF and EF<inline-formula><mml:math id="M202" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> implementations almost have the same
error on <inline-formula><mml:math id="M203" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, indicating that accounting for the event water does
not have a major impact on the overall solution of the age ME. However, as
different ages do not contribute equally to streamflow, the event water can
have a larger impact on streamflow concentration. This is evident in the
performance on err<inline-formula><mml:math id="M204" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>, where the modified EF<inline-formula><mml:math id="M205" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> implementation is about
1 order of magnitude more accurate than the classic Euler scheme. The error
is on average smaller than 10<inline-formula><mml:math id="M206" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> the variance of the <inline-formula><mml:math id="M207" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> signal, which
is lower than most measurement errors. The performance on err<inline-formula><mml:math id="M208" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula> also
shows that the errors tend to grow with decreasing values of the mean
storage, i.e., when the storage gets depleted (or filled) faster. The error
of the EF<inline-formula><mml:math id="M209" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> scheme shows a good stability. This is not surprising as the RS
case resembles a linear reservoir (see Sect. <xref ref-type="sec" rid="Ch1.S2.SS4"/>) with a coefficient
<inline-formula><mml:math id="M210" display="inline"><mml:mi>c</mml:mi></mml:math></inline-formula> approximately equal to the mean ratio between the fluxes and the storage
<inline-formula><mml:math id="M211" display="inline"><mml:mrow><mml:mo>〈</mml:mo><mml:mi>J</mml:mi><mml:mo>/</mml:mo><mml:mi>S</mml:mi><mml:mo>〉</mml:mo></mml:mrow></mml:math></inline-formula> during a time step. The stability condition for the
Euler forward scheme in the case of a linear reservoir requires that <inline-formula><mml:math id="M212" display="inline"><mml:mrow><mml:mi>c</mml:mi><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>/</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>
(no fast decay). In typical hydrologic applications, fluxes are usually much
smaller than the storage; hence <inline-formula><mml:math id="M213" display="inline"><mml:mrow><mml:mo>〈</mml:mo><mml:mi>J</mml:mi><mml:mo>/</mml:mo><mml:mi>S</mml:mi><mml:mo>〉</mml:mo><mml:mo>≪</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula> and the EF
solution is stable.</p>
      <p id="d1e5220">Results show that the numerical implementation of the ME is satisfactory for
the RS solution in terms of both accuracy and stability. However, solutions
other than the RS case may be more challenging owing to the nonuniform age
selection played by the outflows. For this reason, we tested power-law SAS
functions (Eq. <xref ref-type="disp-formula" rid="Ch1.E6"/>) with different values of the exponent <inline-formula><mml:math id="M214" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>: 0.2,
0.3, 0.5, 0.7, 1, 1.2, 1.5, 2 and 3. The same exponent was used each time for
both <inline-formula><mml:math id="M215" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M216" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mtext>ET</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. The model was run with a fixed
initial storage <inline-formula><mml:math id="M217" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula>, for the same<?pagebreak page1635?> timespan and aggregation time steps
as in the RS case, and the performance was again evaluated in terms of
err<inline-formula><mml:math id="M218" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula> and err<inline-formula><mml:math id="M219" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula>. Given the lack of analytical solutions,
we approximated the true solution by using a higher-order implementation
(built-in MATLAB solver “ode113”; <xref ref-type="bibr" rid="bib1.bibx37" id="altparen.36"/>) for
Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>). An example of the <inline-formula><mml:math id="M220" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> time series obtained from the
different values of <inline-formula><mml:math id="M221" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> for <inline-formula><mml:math id="M222" display="inline"><mml:mrow><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">24</mml:mn></mml:mrow></mml:math></inline-formula> h is reported in Fig. <xref ref-type="fig" rid="Ch1.F5"/>. The
<inline-formula><mml:math id="M223" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> time series are rather different, being progressively more lagged and
damped for increasing values of <inline-formula><mml:math id="M224" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>. Although the residual with respect to
the higher-order solution can occasionally be up to 1.3 mg L<inline-formula><mml:math id="M225" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, it is
on average very low compared to the signal. Thus in this case the accuracy of
the model is satisfactory even for <inline-formula><mml:math id="M226" display="inline"><mml:mrow><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">24</mml:mn></mml:mrow></mml:math></inline-formula> h. Note that for this dataset, the
parameters of the SAS function (<inline-formula><mml:math id="M227" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.2</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M228" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula>) imply that 30 %
of the input, on average, becomes output during the same day. The residuals
are overall low and do not accumulate during the 8-year simulation,
suggesting that even the 24 h simulation is stable. The performance on <inline-formula><mml:math id="M229" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>
was further evaluated in the same way as for the RS case: we normalized the
concentration signals and obtained the error time series err<inline-formula><mml:math id="M230" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula> from the
difference with the higher-order solution. Similarly, we computed the errors
err<inline-formula><mml:math id="M231" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:msub></mml:math></inline-formula> with respect to the higher-order solution for simulation
day 2745.</p>
      <p id="d1e5442">The standard deviations of the errors are shown in Fig. <xref ref-type="fig" rid="Ch1.F6"/> for
different values of <inline-formula><mml:math id="M232" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> and aggregation time steps. The errors on <inline-formula><mml:math id="M233" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>
grow for increasing preference of the SAS functions for the younger stored
volumes (lower values of <inline-formula><mml:math id="M234" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>). This indicates that the young water preference
is a more challenging numerical condition for the solution of the age ME.
This behavior is to be mostly attributed to the errors on the youngest waters
in storage. Although we use a modified version of the EF scheme to account
for the presence of event water in the outflows (Eq. <xref ref-type="disp-formula" rid="Ch1.E10"/>), this
approximation has some limitations. In particular, the youngest age in
storage (<inline-formula><mml:math id="M235" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>[</mml:mo><mml:mi>j</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>) is quantified through the SAS function from previous
time step; thus it may give rise to errors at the onset of intense storm events.
The interpretation of the behavior of the error on <inline-formula><mml:math id="M236" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>Q</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>
(Fig. <xref ref-type="fig" rid="Ch1.F6"/>b) is less straightforward as the errors on the solution
<inline-formula><mml:math id="M237" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>S</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> can be amplified in various ways by the different SAS functions.
Errors appear not too dissimilar for <inline-formula><mml:math id="M238" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> in the range 0.5–1.2 and they are all
reduced by 1 order of magnitude moving from daily to hourly time steps.
The more extreme age selections (i.e., <inline-formula><mml:math id="M239" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>≤</mml:mo><mml:mn mathvariant="normal">0.3</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M240" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>≥</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>) tend to
result in higher errors, although the error magnitude remains low (less than
10<inline-formula><mml:math id="M241" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> the signal variance) and the solution is stable.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><caption><p id="d1e5559">Numerical errors on the storage age distribution <bold>(a)</bold> and on
streamflow concentration <bold>(b)</bold> as a function of the aggregation
time step. The error time series are summarized through their standard
deviation. Each plot shows the model performance for several shapes of the
SAS function, parameterized as a power-law distribution with parameter <inline-formula><mml:math id="M242" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>
(Eq. <xref ref-type="disp-formula" rid="Ch1.E6"/>). The color code is the same as in Fig. <xref ref-type="fig" rid="Ch1.F5"/>. The
random-sampling case (i.e., <inline-formula><mml:math id="M243" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) is indicated in black and it is equivalent
to the curves featuring <inline-formula><mml:math id="M244" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1000</mml:mn></mml:mrow></mml:math></inline-formula> in Fig. <xref ref-type="fig" rid="Ch1.F4"/>.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/11/1627/2018/gmd-11-1627-2018-f06.pdf"/>

        </fig>

      <p id="d1e5615">These examples suggest that the behavior of the system can be interpreted
using a (nonlinear) reservoir analogy. Each individual water parcel can be
seen as a depleting reservoir that decreases in time owing to the particular
outflow removal (Eq. <xref ref-type="disp-formula" rid="Ch1.E8"/>). This removal is mediated by the SAS
functions; thus it can become large corresponding to high values of
<inline-formula><mml:math id="M245" display="inline"><mml:mrow><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, potentially leading to an unstable fast decay. The
depletion pattern of the reservoir is rather complex as it is nonlinear and
it changes at every time step, but it suggests that very pronounced age
selections should be considered carefully and checked for potential numerical
instabilities. Note that for illustration purposes the effects of the two
power-law SAS function parameters <inline-formula><mml:math id="M246" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M247" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> were presented separately
(Figs. <xref ref-type="fig" rid="Ch1.F4"/> and <xref ref-type="fig" rid="Ch1.F6"/>), but they should be considered
together as lower storage values may enhance the selection of younger<?pagebreak page1636?> or older
waters and increase the numerical errors. The model was tested here for
several shapes of the SAS functions on a realistic hydrochemical dataset.
Although every dataset is different and it would be impossible to perform a model
verification valid for all applications, these results provide some first
guidelines as to where the explicit numerical implementation may become
critical.</p>
</sec>
<sec id="Ch1.S5.SS2">
  <title>Model applicability, limitations and perspectives</title>
      <p id="d1e5670">The model is based on a catchment-scale approach, so it only requires
catchment-scale fluxes like precipitation, discharge and evapotranspiration.
These fluxes can often be measured (or modeled in the case of ET) without the
need for a full hydrologic model. Moreover, the pure SAS function
approach implies that, differently from previous approaches
<xref ref-type="bibr" rid="bib1.bibx6 bib1.bibx2" id="paren.37"><named-content content-type="pre">e.g.,</named-content></xref>, the transport equations which are
solved in the model are completely decoupled from the way fluxes were
obtained. This notably reduces the number of involved parameters and it
simplifies the applicability of the model to different datasets and contexts.
Although more research is needed to classify the expected shapes of the SAS
functions based on measurable catchment properties, one can quickly obtain
first-order evaluations of solute transport by using SAS functions already
tested in the literature
<xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx17 bib1.bibx34 bib1.bibx5 bib1.bibx45" id="paren.38"><named-content content-type="pre">e.g.,</named-content></xref>
and a reasonable choice of the initial storage <inline-formula><mml:math id="M248" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5694">The use of an explicit numerical scheme has the potential of greatly reducing
the computational times. Short aggregation time steps are generally
recommended, especially when testing the affinity for younger storage volumes
(e.g., Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>) with parameter <inline-formula><mml:math id="M249" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">0.3</mml:mn></mml:mrow></mml:math></inline-formula>), but in case larger time steps
(e.g., <inline-formula><mml:math id="M250" display="inline"><mml:mrow><mml:mi>h</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">24</mml:mn></mml:mrow></mml:math></inline-formula> h) prove satisfactory, the model can typically run in less than
a second on a normal computer. The short computational times make the use of
calibration techniques easier and the model structure is directly compatible
with the DREAM <xref ref-type="bibr" rid="bib1.bibx43 bib1.bibx39" id="paren.39"/> calibration packages. The model
can be made faster by not considering the zero-precipitation times but, as
explained in Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>, this improvement is currently not
implemented to keep the model more intuitive.</p>
      <p id="d1e5728">The model is based on a catchment-scale formulation of transport processes; thus it cannot provide spatial information unless the system is partitioned
into a series of spatial compartments <xref ref-type="bibr" rid="bib1.bibx38" id="paren.40"><named-content content-type="pre">e.g.,</named-content></xref>. Even in
this case, one would need to know the fluxes to and from each compartment, hence
losing one of the main advantages of the general SAS approach. The
catchment-scale nature of the formulation also implies that SAS functions
have a conceptual character and they cannot be determined directly from
physical properties of the system. Their general shape, however, can be
traced back to elementary advection–dispersion processes
<xref ref-type="bibr" rid="bib1.bibx1" id="paren.41"/> and the mechanistic basis for time-variable SAS
functions has recently been highlighted <xref ref-type="bibr" rid="bib1.bibx32" id="paren.42"/>.</p>
      <p id="d1e5742">Although the numerical accuracy of the computations has to be evaluated for
each different application, Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/> provides some first guidelines
to cases in which the numerical accuracy may not be satisfactory. Systems whose
storage is quickly depleted by the fluxes are prone to inaccuracies and
instabilities. This can happen, for instance, if the system storage is small
compared to the fluxes and the SAS functions have a very strong preference
for some storage portions. In such cases, higher-order schemes may become
desirable. The model package already provides a higher-order solution to
Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) (obtained through the MATLAB built-in<?pagebreak page1637?> function
“ode113”) that can help evaluate the numerical accuracy of the results.</p>
      <p id="d1e5750">The codes implemented in the <italic>tran</italic>-SAS package can be used to
simulate the transport of conservative solutes through a catchment. This
represents a first step towards the modeling of large-scale solute transport.
Simple reactive transport equations can be easily implemented in the main
model routine (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>) using effective formulations that
integrate biogeochemical processes across the catchment heterogeneity
<xref ref-type="bibr" rid="bib1.bibx36" id="paren.43"/>. Being based on a travel time formulation of
transport, the model is obviously not suited to simulating the circulation of
solutes for which the chronology of the inputs and the age of water are
irrelevant. For a number of cases of interest, however, both the time of
entry into the catchment and the residence time of water within the catchment
storage may play an important role in the transport process. Many such
examples have been addressed in the literature using a catchment-scale
approach, including the case of nitrate export from agricultural catchments
<xref ref-type="bibr" rid="bib1.bibx8 bib1.bibx42" id="paren.44"/>, solutes influenced by evapoconcentration
effects <xref ref-type="bibr" rid="bib1.bibx34" id="paren.45"/>, pesticide transport
<xref ref-type="bibr" rid="bib1.bibx6 bib1.bibx24" id="paren.46"/> and solutes produced by mineral weathering
<xref ref-type="bibr" rid="bib1.bibx2" id="paren.47"/>. The provided codes are designed to be easy to
understand, so that they can be easily customized by the user and adapted to
different contexts and applications. The next step is then to adapt the model
to real-world problems, for which solutes' nonconservative behavior has to be
taken into account.</p>
</sec>
</sec>
<sec id="Ch1.S6" sec-type="conclusions">
  <title>Conclusions</title>
      <p id="d1e5781">The <italic>tran</italic>-SAS package includes a basic implementation of the age
master equation (Eq. <xref ref-type="disp-formula" rid="Ch1.E1"/>) using general SAS functions. The codes can be
used to simulate the transport of solutes through a catchment and to evaluate
water residence times. The package is ready to go and it includes some
example data that can be used to test the main model features. The codes are
extensively commented on so that they can be edited according to the user's
needs. The model is based on a catchment-scale formulation of solute
transport and it only relies on measurable data. Main model equations are
implemented using an explicit Euler scheme that allows us to reduce
computational times. The numerical accuracy of the model was verified on the
example data and was shown to be generally satisfactory even at larger (e.g.,
daily) computation time steps. The most critical cases are those in which the
stored water parcels are rapidly removed by the outflows. This situation can
occur when the SAS function assumes very high values for some stored water
volumes. In such cases, higher-order model implementations (provided within
the package) should be used to check the numerical accuracy of the solution.
The model allows us to test different SAS functions and evaluate solute
transport in the catchment storage and outflows. Applications can be oriented
to different catchments and solutes, advancing our ability to understand and
model catchment transport processes.</p>
</sec>

      
      </body>
    <back><notes notes-type="codeavailability">

      <p id="d1e5793">The current model release, including example data and
documentation, is available at <ext-link xlink:href="https://doi.org/10.5281/zenodo.1203600" ext-link-type="DOI">10.5281/zenodo.1203600</ext-link>. A maintained
GitHub project is available at the following GitHub repository:
<uri>https://github.com/pbenettin/tran-SAS</uri>.</p>
  </notes><notes notes-type="competinginterests">

      <p id="d1e5805">The authors declare that they have no conflict of
interest.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e5811">The authors thank Andrea Rinaldo and Gianluca Botter for the useful
discussions that inspired this work and Damiano Pasetto for support in the
numerical implementation of the model equations. Paolo Benettin thanks the
ENAC school at EPFL for financial support.<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
Edited by: Jeffrey Neal<?xmltex \hack{\newline}?> Reviewed by: three anonymous referees</p></ack><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><label>Benettin et al.(2013)</label><mixed-citation>Benettin, P., Rinaldo, A., and Botter, G.: Kinematics of age mixing in
advection-dispersion models, Water Resour. Res., 49, 8539–8551,
<ext-link xlink:href="https://doi.org/10.1002/2013WR014708" ext-link-type="DOI">10.1002/2013WR014708</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx2"><label>Benettin et al.(2015a)</label><mixed-citation>Benettin, P., Bailey, S. W., Campbell, J. L., Green, M. B., Rinaldo, A.,
Likens, G. E., McGuire, K. J., and Botter, G.: Linking water age and solute
dynamics in streamflow at the Hubbard Brook Experimental Forest, NH, USA,
Water Resour. Res., 51, 9256–9272, <ext-link xlink:href="https://doi.org/10.1002/2015WR017552" ext-link-type="DOI">10.1002/2015WR017552</ext-link>, 2015a.</mixed-citation></ref>
      <ref id="bib1.bibx3"><label>Benettin et al.(2015b)</label><mixed-citation>Benettin, P., Rinaldo, A., and Botter, G.: Tracking residence times in
hydrological systems: forward and backward formulations, Hydrol. Proc.,
29, 5203–5213, <ext-link xlink:href="https://doi.org/10.1002/hyp.10513" ext-link-type="DOI">10.1002/hyp.10513</ext-link>, 2015b.</mixed-citation></ref>
      <ref id="bib1.bibx4"><label>Benettin et al.(2017a)</label><mixed-citation>Benettin, P., Bailey, S. W., Rinaldo, A., Likens, G. E., McGuire, K. J., and
Botter, G.: Young runoff fractions control streamwater age and solute
concentration dynamics, Hydrol. Proc., 31, 2982–2986,
<ext-link xlink:href="https://doi.org/10.1002/hyp.11243" ext-link-type="DOI">10.1002/hyp.11243</ext-link>, 2017a.</mixed-citation></ref>
      <ref id="bib1.bibx5"><label>Benettin et al.(2017b)</label><mixed-citation>Benettin, P., Soulsby, C., Birkel, C., Tetzlaff, D., Botter, G., and Rinaldo,
A.: Using SAS functions and high resolution isotope data to unravel travel
time distributions in headwater catchments, Water Resour. Res., 53,
1864–1878, <ext-link xlink:href="https://doi.org/10.1002/2016WR020117" ext-link-type="DOI">10.1002/2016WR020117</ext-link>, 2017b.</mixed-citation></ref>
      <ref id="bib1.bibx6"><label>Bertuzzo et al.(2013)</label><mixed-citation>Bertuzzo, E., Thomet, M., Botter, G., and Rinaldo, A.: Catchment-scale
herbicides transport: Theory and application, Adv. Water Resour., 52,
232–242, <ext-link xlink:href="https://doi.org/10.1016/j.advwatres.2012.11.007" ext-link-type="DOI">10.1016/j.advwatres.2012.11.007</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx7"><label>Botter(2012)</label><mixed-citation>Botter, G.: Catchment mixing processes and travel time distributions,
Water Resour. Res., 48, W05545, <ext-link xlink:href="https://doi.org/10.1029/2011WR011160" ext-link-type="DOI">10.1029/2011WR011160</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx8"><label>Botter et al.(2006)</label><mixed-citation>Botter, G., Settin, T., Marani, M., and Rinaldo, A.: A stochastic model of
nitrate transport and cycling at basin scale, Water Resour. Res., 42, W04415,
<ext-link xlink:href="https://doi.org/10.1029/2005WR004599" ext-link-type="DOI">10.1029/2005WR004599</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx9"><label>Botter et al.(2005)</label><mixed-citation>Botter, G., Bertuzzo, E., Bellin, A., and Rinaldo, A.: On the Lagrangian
formulations of reactive solute transport in the hydrologic response, Water
Resour. Res., 41, W04008, <ext-link xlink:href="https://doi.org/10.1029/2004WR003544" ext-link-type="DOI">10.1029/2004WR003544</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx10"><label>Botter et al.(2011)</label><mixed-citation>Botter, G., Bertuzzo, E., and Rinaldo, A.: Catchment residence and travel
time distributions: The master equation, Geophys. Res. Lett., 38,
L11403, <ext-link xlink:href="https://doi.org/10.1029/2011GL047666" ext-link-type="DOI">10.1029/2011GL047666</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx11"><label>Calabrese and Porporato(2015)</label><mixed-citation>Calabrese, S. and Porporato, A.: Linking age, survival, and transit time
distributions, Water Resour. Res., 51, 8316–8330,
<ext-link xlink:href="https://doi.org/10.1002/2015WR017785" ext-link-type="DOI">10.1002/2015WR017785</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx12"><label>Cvetkovic and Dagan(1994)</label><mixed-citation>Cvetkovic, V. and Dagan, G.: Transport of kinetically sorbing solute by
steady random velocity in heterogeneous porous formations, J. Fluid Mech.,
265, 189–215, <ext-link xlink:href="https://doi.org/10.1017/S0022112094000807" ext-link-type="DOI">10.1017/S0022112094000807</ext-link>, 1994.</mixed-citation></ref>
      <ref id="bib1.bibx13"><label>Danesh-Yazdi et al.(2016)</label><mixed-citation>Danesh-Yazdi, M., Foufoula-Georgiou, E., Karwan, D. L., and Botter, G.:
Inferring changes in water cycle dynamics of intensively managed landscapes
via the theory of time-variant travel time distributions, Water Resour. Res.,
52, 7593–7614, <ext-link xlink:href="https://doi.org/10.1002/2016WR019091" ext-link-type="DOI">10.1002/2016WR019091</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx14"><label>Danesh-Yazdi et al.(2017)</label><mixed-citation>Danesh-Yazdi, M., Botter, G., and Foufoula-Georgiou, E.: Time-variant
Lagrangian transport formulation reduces aggregation bias of water and solute
mean travel time in heterogeneous catchments, Geophys. Res. Lett., 44,
4880–4888, <ext-link xlink:href="https://doi.org/10.1002/2017GL073827" ext-link-type="DOI">10.1002/2017GL073827</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx15"><label>Destouni et al.(2010)</label><mixed-citation>Destouni, G., Persson, K., Prieto, C., and Jarsjö, J.: General
Quantification of Catchment-Scale Nutrient and Pollutant Transport through
the Subsurface to Surface and Coastal Waters, Environ. Sci. Technol., 44,
2048–2055, <ext-link xlink:href="https://doi.org/10.1021/es902338y" ext-link-type="DOI">10.1021/es902338y</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx16"><label>Drever and Hrachowitz(2017)</label><mixed-citation>Drever, M. C. and Hrachowitz, M.: Migration as flow: using hydrological
concepts to estimate the residence time of migrating birds from the daily
counts, Methods Ecol. Evol., 8, 1146–1157, <ext-link xlink:href="https://doi.org/10.1111/2041-210X.12727" ext-link-type="DOI">10.1111/2041-210X.12727</ext-link>,
2017.</mixed-citation></ref>
      <ref id="bib1.bibx17"><label>Harman(2015)</label><mixed-citation>Harman, C. J.: Time-variable transit time distributions and transport: Theory
and application to storage-dependent transport of chloride in a watershed,
Water Resour. Res., 51, 1–30, <ext-link xlink:href="https://doi.org/10.1002/2014WR015707" ext-link-type="DOI">10.1002/2014WR015707</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx18"><label>Harman et al.(2016)</label><mixed-citation>Harman, C. J., Ward, A. S., and Ball, A.: How does reach-scale
stream-hyporheic transport vary with discharge? Insights from rSAS analysis
of sequential tracer injections in a headwater mountain stream, Water Resour.
Res., 52, 7130–7150, <ext-link xlink:href="https://doi.org/10.1002/2016WR018832" ext-link-type="DOI">10.1002/2016WR018832</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx19"><label>Hrachowitz et al.(2015)</label><mixed-citation>Hrachowitz, M., Fovet, O., Ruiz, L., and Savenije, H. H. G.: Transit time
distributions, legacy contamination and variability in biogeochemical
<inline-formula><mml:math id="M251" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:msup><mml:mi>f</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> scaling: how are hydrological response dynamics linked to water
quality at the catchment scale?, Hydrol. Proc., 29, 5241–5256,
<ext-link xlink:href="https://doi.org/10.1002/hyp.10546" ext-link-type="DOI">10.1002/hyp.10546</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx20"><label>Hrachowitz et al.(2016)</label><mixed-citation>Hrachowitz, M., Benettin, P., Breukelen, B. M. V., Fovet, O., Howden, N.
J. K., Ruiz, L., Velde, Y. V. D., and Wade, A. J.: Transit times –the link
between hydrology and water quality at the catchment scale, WIRES Water, 3,
629–657, <ext-link xlink:href="https://doi.org/10.1002/wat2.1155" ext-link-type="DOI">10.1002/wat2.1155</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx21"><label>Jackson et al.(2007)</label><mixed-citation>Jackson, B., Wheater, H., Wade, A., Butterfield, D., Mathias, S., Ireson, A.,
Butler, A., McIntyre, N., and Whitehead, P.: Catchment-scale modelling of
flow and nutrient transport in the Chalk unsaturated zone, Ecol. Model., 209,
41–52, <ext-link xlink:href="https://doi.org/10.1016/j.ecolmodel.2007.07.005" ext-link-type="DOI">10.1016/j.ecolmodel.2007.07.005</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx22"><label>Kauffman et al.(2003)</label><mixed-citation>Kauffman, S. J., Royer, D. L., Chang, S., and Berner, R. A.: Export of
chloride after clear-cutting in the Hubbard Brook sandbox experiment,
Biogeochemistry, 63, 23–33, <ext-link xlink:href="https://doi.org/10.1023/A:1023335002926" ext-link-type="DOI">10.1023/A:1023335002926</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx23"><label>Kim et al.(2016)</label><mixed-citation>Kim, M., Pangle, L. A., Cardoso, C., Lora, M., Volkmann, T. H. M., Wang, Y.,
Harman, C. J., and Troch, P. A.: Transit time distributions and StorAge
Selection functions in a sloping soil lysimeter with time-varying flow paths:
Direct observation of internal and external transport variability, Water
Resour. Res., 52, 7105–7129, <ext-link xlink:href="https://doi.org/10.1002/2016WR018620" ext-link-type="DOI">10.1002/2016WR018620</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx24"><label>Lutz et al.(2017)</label><mixed-citation>Lutz, S. R., Velde, Y. V. D., Elsayed, O. F., Imfeld, G., Lefrancq, M.,
Payraudeau, S., and van Breukelen, B. M.: Pesticide fate on catchment scale:
conceptual modelling of stream CSIA data, Hydrol. Earth Syst. Sci., 21,
5243–5261, <ext-link xlink:href="https://doi.org/10.5194/hess-21-5243-2017" ext-link-type="DOI">10.5194/hess-21-5243-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx25"><label>Maher(2011)</label><mixed-citation>Maher, K.: The role of fluid residence time and topographic scales in
determining chemical fluxes from landscapes, Earth Planet. Sc. Lett., 312,
48–58, <ext-link xlink:href="https://doi.org/10.1016/j.epsl.2011.09.040" ext-link-type="DOI">10.1016/j.epsl.2011.09.040</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx26"><label>Maloszewski and Zuber(1993)</label><mixed-citation>Maloszewski, P. and Zuber, A.: Principles and practice of calibration and
validation of mathematical models for the interpretation of environmental
tracer data in aquifers, Adv. Water Resour., 16, 173–190,
<ext-link xlink:href="https://doi.org/10.1016/0309-1708(93)90036-F" ext-link-type="DOI">10.1016/0309-1708(93)90036-F</ext-link>, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx27"><label>Martin et al.(2004)</label><mixed-citation>Martin, C., Aquilina, L., Gascuel-Odoux, C., Molénat, J., Faucheux, M.,
and Ruiz, L.: Seasonal and interannual variations of nitrate and chloride in
stream waters related to spatial and temporal patterns of groundwater
concentrations in agricultural catchments, Hydrol. Proc., 18, 1237–1254,
<ext-link xlink:href="https://doi.org/10.1002/hyp.1395" ext-link-type="DOI">10.1002/hyp.1395</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx28"><label>McGuire and McDonnell(2006)</label><mixed-citation>McGuire, K. J. and McDonnell, J. J.: A review and evaluation of catchment
transit time modeling, J. Hydrol., 330, 543–563,
<ext-link xlink:href="https://doi.org/10.1016/j.jhydrol.2006.04.020" ext-link-type="DOI">10.1016/j.jhydrol.2006.04.020</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx29"><label>McGuire and McDonnell(2010)</label><mixed-citation>McGuire, K. J. and McDonnell, J. J.: Hydrological connectivity of hillslopes
and streams: Characteristic time scales and nonlinearities, Water Resour.
Res., 46, W10543,<ext-link xlink:href="https://doi.org/10.1029/2010WR009341" ext-link-type="DOI">10.1029/2010WR009341</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx30"><label>McMillan et al.(2012)</label><mixed-citation>McMillan, H., Tetzlaff, D., Clark, M., and Soulsby, C.: Do time-variable
tracers aid the evaluation of hydrological model structure? A multimodel
approach, Water Resour. Res., 48, W05501, <ext-link xlink:href="https://doi.org/10.1029/2011WR011688" ext-link-type="DOI">10.1029/2011WR011688</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx31"><label>Oda et al.(2009)</label><mixed-citation>Oda, T., Asano, Y., and Suzuki, M.: Transit time evaluation using a chloride
concentration input step shift after forest cutting in a Japanese headwater
catchment, Hydrol. Proc., 23, 2705–2713, <ext-link xlink:href="https://doi.org/10.1002/hyp.7361" ext-link-type="DOI">10.1002/hyp.7361</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx32"><label>Pangle et al.(2017)</label><mixed-citation>Pangle, L. A., Kim, M., Cardoso, C., Lora, M., Meira Neto, A. A., Volkmann,
T. H. M., Wang, Y., Troch, P. A., and Harman, C. J.: The mechanistic basis
for storage-dependent age distributions of water discharged from an
experimental hillslope, Water Resour. Res., 53, 2733–2754,
<ext-link xlink:href="https://doi.org/10.1002/2016WR019901" ext-link-type="DOI">10.1002/2016WR019901</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx33"><label>Queloz et al.(2015a)</label><mixed-citation>Queloz, P., Bertuzzo, E., Carraro, L., Botter, G., Miglietta, F., Rao, P.,
and Rinaldo, A.: Transport of fluorobenzoate tracers in a vegetated
hydrologic control volume: 1. Experimental results, Water Resour. Res., 51,
2773–2792, <ext-link xlink:href="https://doi.org/10.1002/2014WR016433" ext-link-type="DOI">10.1002/2014WR016433</ext-link>, 2015a.</mixed-citation></ref>
      <ref id="bib1.bibx34"><label>Queloz et al.(2015b)</label><mixed-citation>Queloz, P., Carraro, L., Benettin, P., Botter, G., Rinaldo, A., and Bertuzzo,
E.: Transport of fluorobenzoate tracers in a vegetated hydrologic control
volume: 2. Theoretical inferences and modeling, Water Resour. Res., 51,
2793–2806, <ext-link xlink:href="https://doi.org/10.1002/2014WR016508" ext-link-type="DOI">10.1002/2014WR016508</ext-link>, 2015b.</mixed-citation></ref>
      <?pagebreak page1639?><ref id="bib1.bibx35"><label>Rigon et al.(2016)</label><mixed-citation>Rigon, R., Bancheri, M., and Green, T. R.: Age-ranked hydrological budgets
and a travel time description of catchment hydrology, Hydrol. Earth Syst.
Sci., 20, 4929–4947, <ext-link xlink:href="https://doi.org/10.5194/hess-20-4929-2016" ext-link-type="DOI">10.5194/hess-20-4929-2016</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx36"><label>Rinaldo and Marani(1987)</label><mixed-citation>Rinaldo, A. and Marani, A.: Basin scale-model of solute transport, Water
Resour. Res., 23, 2107–2118, <ext-link xlink:href="https://doi.org/10.1029/WR023i011p02107" ext-link-type="DOI">10.1029/WR023i011p02107</ext-link>, 1987.</mixed-citation></ref>
      <ref id="bib1.bibx37"><label>Shampine and Reichelt(1997)</label><mixed-citation>Shampine, L. F. and Reichelt, M. W.: The MATLAB ODE Suite, SIAM J. Sci.
Comput., 18, 1–22, <ext-link xlink:href="https://doi.org/10.1137/S1064827594276424" ext-link-type="DOI">10.1137/S1064827594276424</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx38"><label>Soulsby et al.(2015)</label><mixed-citation>Soulsby, C., Birkel, C., Geris, J., and Tetzlaff, D.: Spatial aggregation of
time-variant stream water ages in urbanizing catchments, Hydrol. Proc., 29,
3038–3050, <ext-link xlink:href="https://doi.org/10.1002/hyp.10500" ext-link-type="DOI">10.1002/hyp.10500</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx39"><label>ter Braak and Vrugt(2008)</label><mixed-citation>ter Braak, C. J. F. and Vrugt, J. A.: Differential Evolution Markov Chain
with snooker updater and fewer chains, Stat. Comput., 18, 435–446,
<ext-link xlink:href="https://doi.org/10.1007/s11222-008-9104-9" ext-link-type="DOI">10.1007/s11222-008-9104-9</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx40"><label>van der Velde et al.(2015)</label><mixed-citation>van der Velde, Y., Heidbüchel, I., Lyon, S. W., Nyberg, L., Rodhe, A.,
Bishop, K., and Troch, P. A.: Consequences of mixing assumptions for
time-variable travel time distributions, Hydrol. Proc., 29, 3460–3474,
<ext-link xlink:href="https://doi.org/10.1002/hyp.10372" ext-link-type="DOI">10.1002/hyp.10372</ext-link>, 2015. </mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx41"><label>van der Velde et al.(2010)</label><mixed-citation>van der Velde, Y., de Rooij, G. H., Rozemeijer, J. C., van Geer, F. C., and
Broers, H. P.: Nitrate response of a lowland catchment: On the relation
between stream concentration and travel time distribution dynamics, Water
Resour. Res., 46, W11534, <ext-link xlink:href="https://doi.org/10.1029/2010WR009105" ext-link-type="DOI">10.1029/2010WR009105</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx42"><label>van der Velde et al.(2012)</label><mixed-citation>van der Velde, Y., Torfs, P. J. J. F., van der Zee, S. E. A. T. M., and
Uijlenhoet, R.: Quantifying catchment-scale mixing and its effect on
time-varying travel time distributions, Water Resour. Res., 48, W06536,
<ext-link xlink:href="https://doi.org/10.1029/2011WR011310" ext-link-type="DOI">10.1029/2011WR011310</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx43"><label>Vrugt et al.(2009)</label><mixed-citation>Vrugt, J., Braak, C. T., Diks, C., Robinson, B., Hyman, J., and Higdon, D.:
Accelerating Markov chain Monte Carlo simulation by differential evolution
with self-adaptive randomized subspace sampling, Int. J. Nonlin. Sci. Num.,
10, 271–288, <ext-link xlink:href="https://doi.org/10.1515/IJNSNS.2009.10.3.273" ext-link-type="DOI">10.1515/IJNSNS.2009.10.3.273</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx44"><label>Weiler et al.(2003)</label><mixed-citation>Weiler, M., McGlynn, B. L., McGuire, K. J., and McDonnell, J. J.: How does
rainfall become runoff? A combined tracer and runoff transfer function
approach, Water Resour. Res., 39, 1315, <ext-link xlink:href="https://doi.org/10.1029/2003WR002331" ext-link-type="DOI">10.1029/2003WR002331</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx45"><label>Wilusz et al.(2017)</label><mixed-citation>Wilusz, D. C., Harman, C. J., and Ball, W. P.: Sensitivity of Catchment
Transit Times to Rainfall Variability Under Present and Future Climates,
Water Resour. Res., 53, 10231–10256, <ext-link xlink:href="https://doi.org/10.1002/2017WR020894" ext-link-type="DOI">10.1002/2017WR020894</ext-link>, 2017.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html><i>tran</i>-SAS v1.0: a numerical model to compute catchment-scale hydrologic transport using StorAge Selection functions</article-title-html>
<abstract-html><p>This paper presents the <q><i>tran</i>-SAS</q> package, which
includes a set of codes to model solute transport and water residence times
through a hydrological system. The model is based on a catchment-scale
approach that aims at reproducing the integrated response of the system at
one of its outlets. The codes are implemented in MATLAB and are meant to be
easy to edit, so that users with minimal programming knowledge can adapt them
to the desired application. The problem of large-scale solute transport has
both theoretical and practical implications. On the one side, the ability to
represent the ensemble of water flow trajectories through a heterogeneous
system helps unraveling streamflow generation processes and allows us to make
inferences on plant–water interactions. On the other side, transport models
are a practical tool that can be used to estimate the persistence of solutes
in the environment. The core of the package is based on the implementation of
an age master equation (ME), which is solved using general StorAge Selection
(SAS) functions. The age ME is first converted into a set of ordinary
differential equations, each addressing the transport of an individual
precipitation input through the catchment, and then it is discretized using
an explicit numerical scheme. Results show that the implementation is
efficient and allows the model to run in short times. The numerical accuracy
is critically evaluated and it is shown to be satisfactory in most cases of
hydrologic interest. Additionally, a higher-order implementation is provided
within the package to evaluate and, if necessary, to improve the numerical
accuracy of the results. The codes can be used to model streamflow age and
solute concentration, but a number of additional outputs can be obtained by
editing the codes to further advance the ability to understand and model
catchment transport processes.</p></abstract-html>
<ref-html id="bib1.bib1"><label>Benettin et al.(2013)</label><mixed-citation>
Benettin, P., Rinaldo, A., and Botter, G.: Kinematics of age mixing in
advection-dispersion models, Water Resour. Res., 49, 8539–8551,
<a href="https://doi.org/10.1002/2013WR014708" target="_blank">https://doi.org/10.1002/2013WR014708</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Benettin et al.(2015a)</label><mixed-citation>
Benettin, P., Bailey, S. W., Campbell, J. L., Green, M. B., Rinaldo, A.,
Likens, G. E., McGuire, K. J., and Botter, G.: Linking water age and solute
dynamics in streamflow at the Hubbard Brook Experimental Forest, NH, USA,
Water Resour. Res., 51, 9256–9272, <a href="https://doi.org/10.1002/2015WR017552" target="_blank">https://doi.org/10.1002/2015WR017552</a>, 2015a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Benettin et al.(2015b)</label><mixed-citation>
Benettin, P., Rinaldo, A., and Botter, G.: Tracking residence times in
hydrological systems: forward and backward formulations, Hydrol. Proc.,
29, 5203–5213, <a href="https://doi.org/10.1002/hyp.10513" target="_blank">https://doi.org/10.1002/hyp.10513</a>, 2015b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Benettin et al.(2017a)</label><mixed-citation>
Benettin, P., Bailey, S. W., Rinaldo, A., Likens, G. E., McGuire, K. J., and
Botter, G.: Young runoff fractions control streamwater age and solute
concentration dynamics, Hydrol. Proc., 31, 2982–2986,
<a href="https://doi.org/10.1002/hyp.11243" target="_blank">https://doi.org/10.1002/hyp.11243</a>, 2017a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Benettin et al.(2017b)</label><mixed-citation>
Benettin, P., Soulsby, C., Birkel, C., Tetzlaff, D., Botter, G., and Rinaldo,
A.: Using SAS functions and high resolution isotope data to unravel travel
time distributions in headwater catchments, Water Resour. Res., 53,
1864–1878, <a href="https://doi.org/10.1002/2016WR020117" target="_blank">https://doi.org/10.1002/2016WR020117</a>, 2017b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Bertuzzo et al.(2013)</label><mixed-citation>
Bertuzzo, E., Thomet, M., Botter, G., and Rinaldo, A.: Catchment-scale
herbicides transport: Theory and application, Adv. Water Resour., 52,
232–242, <a href="https://doi.org/10.1016/j.advwatres.2012.11.007" target="_blank">https://doi.org/10.1016/j.advwatres.2012.11.007</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Botter(2012)</label><mixed-citation>
Botter, G.: Catchment mixing processes and travel time distributions,
Water Resour. Res., 48, W05545, <a href="https://doi.org/10.1029/2011WR011160" target="_blank">https://doi.org/10.1029/2011WR011160</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Botter et al.(2006)</label><mixed-citation>
Botter, G., Settin, T., Marani, M., and Rinaldo, A.: A stochastic model of
nitrate transport and cycling at basin scale, Water Resour. Res., 42, W04415,
<a href="https://doi.org/10.1029/2005WR004599" target="_blank">https://doi.org/10.1029/2005WR004599</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Botter et al.(2005)</label><mixed-citation>
Botter, G., Bertuzzo, E., Bellin, A., and Rinaldo, A.: On the Lagrangian
formulations of reactive solute transport in the hydrologic response, Water
Resour. Res., 41, W04008, <a href="https://doi.org/10.1029/2004WR003544" target="_blank">https://doi.org/10.1029/2004WR003544</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Botter et al.(2011)</label><mixed-citation>
Botter, G., Bertuzzo, E., and Rinaldo, A.: Catchment residence and travel
time distributions: The master equation, Geophys. Res. Lett., 38,
L11403, <a href="https://doi.org/10.1029/2011GL047666" target="_blank">https://doi.org/10.1029/2011GL047666</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Calabrese and Porporato(2015)</label><mixed-citation>
Calabrese, S. and Porporato, A.: Linking age, survival, and transit time
distributions, Water Resour. Res., 51, 8316–8330,
<a href="https://doi.org/10.1002/2015WR017785" target="_blank">https://doi.org/10.1002/2015WR017785</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Cvetkovic and Dagan(1994)</label><mixed-citation>
Cvetkovic, V. and Dagan, G.: Transport of kinetically sorbing solute by
steady random velocity in heterogeneous porous formations, J. Fluid Mech.,
265, 189–215, <a href="https://doi.org/10.1017/S0022112094000807" target="_blank">https://doi.org/10.1017/S0022112094000807</a>, 1994.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Danesh-Yazdi et al.(2016)</label><mixed-citation>
Danesh-Yazdi, M., Foufoula-Georgiou, E., Karwan, D. L., and Botter, G.:
Inferring changes in water cycle dynamics of intensively managed landscapes
via the theory of time-variant travel time distributions, Water Resour. Res.,
52, 7593–7614, <a href="https://doi.org/10.1002/2016WR019091" target="_blank">https://doi.org/10.1002/2016WR019091</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Danesh-Yazdi et al.(2017)</label><mixed-citation>
Danesh-Yazdi, M., Botter, G., and Foufoula-Georgiou, E.: Time-variant
Lagrangian transport formulation reduces aggregation bias of water and solute
mean travel time in heterogeneous catchments, Geophys. Res. Lett., 44,
4880–4888, <a href="https://doi.org/10.1002/2017GL073827" target="_blank">https://doi.org/10.1002/2017GL073827</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Destouni et al.(2010)</label><mixed-citation>
Destouni, G., Persson, K., Prieto, C., and Jarsjö, J.: General
Quantification of Catchment-Scale Nutrient and Pollutant Transport through
the Subsurface to Surface and Coastal Waters, Environ. Sci. Technol., 44,
2048–2055, <a href="https://doi.org/10.1021/es902338y" target="_blank">https://doi.org/10.1021/es902338y</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Drever and Hrachowitz(2017)</label><mixed-citation>
Drever, M. C. and Hrachowitz, M.: Migration as flow: using hydrological
concepts to estimate the residence time of migrating birds from the daily
counts, Methods Ecol. Evol., 8, 1146–1157, <a href="https://doi.org/10.1111/2041-210X.12727" target="_blank">https://doi.org/10.1111/2041-210X.12727</a>,
2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Harman(2015)</label><mixed-citation>
Harman, C. J.: Time-variable transit time distributions and transport: Theory
and application to storage-dependent transport of chloride in a watershed,
Water Resour. Res., 51, 1–30, <a href="https://doi.org/10.1002/2014WR015707" target="_blank">https://doi.org/10.1002/2014WR015707</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Harman et al.(2016)</label><mixed-citation>
Harman, C. J., Ward, A. S., and Ball, A.: How does reach-scale
stream-hyporheic transport vary with discharge? Insights from rSAS analysis
of sequential tracer injections in a headwater mountain stream, Water Resour.
Res., 52, 7130–7150, <a href="https://doi.org/10.1002/2016WR018832" target="_blank">https://doi.org/10.1002/2016WR018832</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Hrachowitz et al.(2015)</label><mixed-citation>
Hrachowitz, M., Fovet, O., Ruiz, L., and Savenije, H. H. G.: Transit time
distributions, legacy contamination and variability in biogeochemical
1∕<i>f</i><sup><i>α</i></sup> scaling: how are hydrological response dynamics linked to water
quality at the catchment scale?, Hydrol. Proc., 29, 5241–5256,
<a href="https://doi.org/10.1002/hyp.10546" target="_blank">https://doi.org/10.1002/hyp.10546</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Hrachowitz et al.(2016)</label><mixed-citation>
Hrachowitz, M., Benettin, P., Breukelen, B. M. V., Fovet, O., Howden, N.
J. K., Ruiz, L., Velde, Y. V. D., and Wade, A. J.: Transit times –the link
between hydrology and water quality at the catchment scale, WIRES Water, 3,
629–657, <a href="https://doi.org/10.1002/wat2.1155" target="_blank">https://doi.org/10.1002/wat2.1155</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Jackson et al.(2007)</label><mixed-citation>
Jackson, B., Wheater, H., Wade, A., Butterfield, D., Mathias, S., Ireson, A.,
Butler, A., McIntyre, N., and Whitehead, P.: Catchment-scale modelling of
flow and nutrient transport in the Chalk unsaturated zone, Ecol. Model., 209,
41–52, <a href="https://doi.org/10.1016/j.ecolmodel.2007.07.005" target="_blank">https://doi.org/10.1016/j.ecolmodel.2007.07.005</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Kauffman et al.(2003)</label><mixed-citation>
Kauffman, S. J., Royer, D. L., Chang, S., and Berner, R. A.: Export of
chloride after clear-cutting in the Hubbard Brook sandbox experiment,
Biogeochemistry, 63, 23–33, <a href="https://doi.org/10.1023/A:1023335002926" target="_blank">https://doi.org/10.1023/A:1023335002926</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Kim et al.(2016)</label><mixed-citation>
Kim, M., Pangle, L. A., Cardoso, C., Lora, M., Volkmann, T. H. M., Wang, Y.,
Harman, C. J., and Troch, P. A.: Transit time distributions and StorAge
Selection functions in a sloping soil lysimeter with time-varying flow paths:
Direct observation of internal and external transport variability, Water
Resour. Res., 52, 7105–7129, <a href="https://doi.org/10.1002/2016WR018620" target="_blank">https://doi.org/10.1002/2016WR018620</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Lutz et al.(2017)</label><mixed-citation>
Lutz, S. R., Velde, Y. V. D., Elsayed, O. F., Imfeld, G., Lefrancq, M.,
Payraudeau, S., and van Breukelen, B. M.: Pesticide fate on catchment scale:
conceptual modelling of stream CSIA data, Hydrol. Earth Syst. Sci., 21,
5243–5261, <a href="https://doi.org/10.5194/hess-21-5243-2017" target="_blank">https://doi.org/10.5194/hess-21-5243-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Maher(2011)</label><mixed-citation>
Maher, K.: The role of fluid residence time and topographic scales in
determining chemical fluxes from landscapes, Earth Planet. Sc. Lett., 312,
48–58, <a href="https://doi.org/10.1016/j.epsl.2011.09.040" target="_blank">https://doi.org/10.1016/j.epsl.2011.09.040</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Maloszewski and Zuber(1993)</label><mixed-citation>
Maloszewski, P. and Zuber, A.: Principles and practice of calibration and
validation of mathematical models for the interpretation of environmental
tracer data in aquifers, Adv. Water Resour., 16, 173–190,
<a href="https://doi.org/10.1016/0309-1708(93)90036-F" target="_blank">https://doi.org/10.1016/0309-1708(93)90036-F</a>, 1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Martin et al.(2004)</label><mixed-citation>
Martin, C., Aquilina, L., Gascuel-Odoux, C., Molénat, J., Faucheux, M.,
and Ruiz, L.: Seasonal and interannual variations of nitrate and chloride in
stream waters related to spatial and temporal patterns of groundwater
concentrations in agricultural catchments, Hydrol. Proc., 18, 1237–1254,
<a href="https://doi.org/10.1002/hyp.1395" target="_blank">https://doi.org/10.1002/hyp.1395</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>McGuire and McDonnell(2006)</label><mixed-citation>
McGuire, K. J. and McDonnell, J. J.: A review and evaluation of catchment
transit time modeling, J. Hydrol., 330, 543–563,
<a href="https://doi.org/10.1016/j.jhydrol.2006.04.020" target="_blank">https://doi.org/10.1016/j.jhydrol.2006.04.020</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>McGuire and McDonnell(2010)</label><mixed-citation>
McGuire, K. J. and McDonnell, J. J.: Hydrological connectivity of hillslopes
and streams: Characteristic time scales and nonlinearities, Water Resour.
Res., 46, W10543,<a href="https://doi.org/10.1029/2010WR009341" target="_blank">https://doi.org/10.1029/2010WR009341</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>McMillan et al.(2012)</label><mixed-citation>
McMillan, H., Tetzlaff, D., Clark, M., and Soulsby, C.: Do time-variable
tracers aid the evaluation of hydrological model structure? A multimodel
approach, Water Resour. Res., 48, W05501, <a href="https://doi.org/10.1029/2011WR011688" target="_blank">https://doi.org/10.1029/2011WR011688</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Oda et al.(2009)</label><mixed-citation>
Oda, T., Asano, Y., and Suzuki, M.: Transit time evaluation using a chloride
concentration input step shift after forest cutting in a Japanese headwater
catchment, Hydrol. Proc., 23, 2705–2713, <a href="https://doi.org/10.1002/hyp.7361" target="_blank">https://doi.org/10.1002/hyp.7361</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>Pangle et al.(2017)</label><mixed-citation>
Pangle, L. A., Kim, M., Cardoso, C., Lora, M., Meira Neto, A. A., Volkmann,
T. H. M., Wang, Y., Troch, P. A., and Harman, C. J.: The mechanistic basis
for storage-dependent age distributions of water discharged from an
experimental hillslope, Water Resour. Res., 53, 2733–2754,
<a href="https://doi.org/10.1002/2016WR019901" target="_blank">https://doi.org/10.1002/2016WR019901</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib33"><label>Queloz et al.(2015a)</label><mixed-citation>
Queloz, P., Bertuzzo, E., Carraro, L., Botter, G., Miglietta, F., Rao, P.,
and Rinaldo, A.: Transport of fluorobenzoate tracers in a vegetated
hydrologic control volume: 1. Experimental results, Water Resour. Res., 51,
2773–2792, <a href="https://doi.org/10.1002/2014WR016433" target="_blank">https://doi.org/10.1002/2014WR016433</a>, 2015a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib34"><label>Queloz et al.(2015b)</label><mixed-citation>
Queloz, P., Carraro, L., Benettin, P., Botter, G., Rinaldo, A., and Bertuzzo,
E.: Transport of fluorobenzoate tracers in a vegetated hydrologic control
volume: 2. Theoretical inferences and modeling, Water Resour. Res., 51,
2793–2806, <a href="https://doi.org/10.1002/2014WR016508" target="_blank">https://doi.org/10.1002/2014WR016508</a>, 2015b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib35"><label>Rigon et al.(2016)</label><mixed-citation>
Rigon, R., Bancheri, M., and Green, T. R.: Age-ranked hydrological budgets
and a travel time description of catchment hydrology, Hydrol. Earth Syst.
Sci., 20, 4929–4947, <a href="https://doi.org/10.5194/hess-20-4929-2016" target="_blank">https://doi.org/10.5194/hess-20-4929-2016</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib36"><label>Rinaldo and Marani(1987)</label><mixed-citation>
Rinaldo, A. and Marani, A.: Basin scale-model of solute transport, Water
Resour. Res., 23, 2107–2118, <a href="https://doi.org/10.1029/WR023i011p02107" target="_blank">https://doi.org/10.1029/WR023i011p02107</a>, 1987.
</mixed-citation></ref-html>
<ref-html id="bib1.bib37"><label>Shampine and Reichelt(1997)</label><mixed-citation>
Shampine, L. F. and Reichelt, M. W.: The MATLAB ODE Suite, SIAM J. Sci.
Comput., 18, 1–22, <a href="https://doi.org/10.1137/S1064827594276424" target="_blank">https://doi.org/10.1137/S1064827594276424</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib38"><label>Soulsby et al.(2015)</label><mixed-citation>
Soulsby, C., Birkel, C., Geris, J., and Tetzlaff, D.: Spatial aggregation of
time-variant stream water ages in urbanizing catchments, Hydrol. Proc., 29,
3038–3050, <a href="https://doi.org/10.1002/hyp.10500" target="_blank">https://doi.org/10.1002/hyp.10500</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib39"><label>ter Braak and Vrugt(2008)</label><mixed-citation>
ter Braak, C. J. F. and Vrugt, J. A.: Differential Evolution Markov Chain
with snooker updater and fewer chains, Stat. Comput., 18, 435–446,
<a href="https://doi.org/10.1007/s11222-008-9104-9" target="_blank">https://doi.org/10.1007/s11222-008-9104-9</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib40"><label>van der Velde et al.(2015)</label><mixed-citation>
van der Velde, Y., Heidbüchel, I., Lyon, S. W., Nyberg, L., Rodhe, A.,
Bishop, K., and Troch, P. A.: Consequences of mixing assumptions for
time-variable travel time distributions, Hydrol. Proc., 29, 3460–3474,
<a href="https://doi.org/10.1002/hyp.10372" target="_blank">https://doi.org/10.1002/hyp.10372</a>, 2015. 
</mixed-citation></ref-html>
<ref-html id="bib1.bib41"><label>van der Velde et al.(2010)</label><mixed-citation>
van der Velde, Y., de Rooij, G. H., Rozemeijer, J. C., van Geer, F. C., and
Broers, H. P.: Nitrate response of a lowland catchment: On the relation
between stream concentration and travel time distribution dynamics, Water
Resour. Res., 46, W11534, <a href="https://doi.org/10.1029/2010WR009105" target="_blank">https://doi.org/10.1029/2010WR009105</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib42"><label>van der Velde et al.(2012)</label><mixed-citation>
van der Velde, Y., Torfs, P. J. J. F., van der Zee, S. E. A. T. M., and
Uijlenhoet, R.: Quantifying catchment-scale mixing and its effect on
time-varying travel time distributions, Water Resour. Res., 48, W06536,
<a href="https://doi.org/10.1029/2011WR011310" target="_blank">https://doi.org/10.1029/2011WR011310</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib43"><label>Vrugt et al.(2009)</label><mixed-citation>
Vrugt, J., Braak, C. T., Diks, C., Robinson, B., Hyman, J., and Higdon, D.:
Accelerating Markov chain Monte Carlo simulation by differential evolution
with self-adaptive randomized subspace sampling, Int. J. Nonlin. Sci. Num.,
10, 271–288, <a href="https://doi.org/10.1515/IJNSNS.2009.10.3.273" target="_blank">https://doi.org/10.1515/IJNSNS.2009.10.3.273</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib44"><label>Weiler et al.(2003)</label><mixed-citation>
Weiler, M., McGlynn, B. L., McGuire, K. J., and McDonnell, J. J.: How does
rainfall become runoff? A combined tracer and runoff transfer function
approach, Water Resour. Res., 39, 1315, <a href="https://doi.org/10.1029/2003WR002331" target="_blank">https://doi.org/10.1029/2003WR002331</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib45"><label>Wilusz et al.(2017)</label><mixed-citation>
Wilusz, D. C., Harman, C. J., and Ball, W. P.: Sensitivity of Catchment
Transit Times to Rainfall Variability Under Present and Future Climates,
Water Resour. Res., 53, 10231–10256, <a href="https://doi.org/10.1002/2017WR020894" target="_blank">https://doi.org/10.1002/2017WR020894</a>, 2017.
</mixed-citation></ref-html>--></article>
