<?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" article-type="research-article"><?xmltex \hack{\allowdisplaybreaks}?><?xmltex \bartext{Development and technical paper}?>
  <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-15-6025-2022</article-id><title-group><article-title>Parallel implementation of the SHYFEM (System of HydrodYnamic Finite Element Modules) model</article-title><alt-title>Parallel implementation of the SHYFEM model</alt-title>
      </title-group><?xmltex \runningtitle{Parallel implementation of the SHYFEM model}?><?xmltex \runningauthor{G.~Micaletto~et~al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Micaletto</surname><given-names>Giorgio</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1 aff3">
          <name><surname>Barletta</surname><given-names>Ivano</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Mocavero</surname><given-names>Silvia</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Federico</surname><given-names>Ivan</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="yes" rid="aff1 aff2">
          <name><surname>Epicoco</surname><given-names>Italo</given-names></name>
          <email>italo.epicoco@unisalento.it</email>
        <ext-link>https://orcid.org/0000-0002-6408-1335</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Verri</surname><given-names>Giorgia</given-names></name>
          
        <ext-link>https://orcid.org/0000-0002-7561-618X</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Coppini</surname><given-names>Giovanni</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Schiano</surname><given-names>Pasquale</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1 aff2">
          <name><surname>Aloisio</surname><given-names>Giovanni</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff3">
          <name><surname>Pinardi</surname><given-names>Nadia</given-names></name>
          
        <ext-link>https://orcid.org/0000-0003-4765-0775</ext-link></contrib>
        <aff id="aff1"><label>1</label><institution>Euro-Mediterranean Centre on Climate Change Foundation, via Augusto Imperatore 16, 73100 Lecce, Italy</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Department of Engineering for Innovation, University of Salento, via per Monteroni, 73100 Lecce, Italy</institution>
        </aff>
        <aff id="aff3"><label>3</label><institution>Department of Physics and Astronomy, University of Bologna, 40126 Bologna, Italy​​​​​​​</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Italo Epicoco (italo.epicoco@unisalento.it)</corresp></author-notes><pub-date><day>2</day><month>August</month><year>2022</year></pub-date>
      
      <volume>15</volume>
      <issue>15</issue>
      <fpage>6025</fpage><lpage>6046</lpage>
      <history>
        <date date-type="received"><day>16</day><month>September</month><year>2021</year></date>
           <date date-type="accepted"><day>1</day><month>June</month><year>2022</year></date>
           <date date-type="rev-recd"><day>6</day><month>May</month><year>2022</year></date>
           <date date-type="rev-request"><day>2</day><month>November</month><year>2021</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2022 Giorgio Micaletto et al.</copyright-statement>
        <copyright-year>2022</copyright-year>
      <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/15/6025/2022/gmd-15-6025-2022.html">This article is available from https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d1e179">This paper presents the message passing interface (MPI)-based parallelization of the three-dimensional hydrodynamic model SHYFEM (System of HydrodYnamic Finite Element
Modules). The original sequential version of the code was parallelized in order to reduce the execution time of high-resolution configurations using
state-of-the-art high-performance computing (HPC) systems. A distributed memory approach was used, based on the MPI. Optimized numerical libraries
were used to partition the unstructured grid (with a focus on load balancing) and to solve the sparse linear system of equations in parallel in the
case of semi-to-fully implicit time stepping. The parallel implementation of the model was validated by comparing the outputs with those obtained
from the sequential version. The performance assessment demonstrates a good level of scalability with a realistic configuration used as benchmark.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e191">Ocean sciences are significantly supported by numerical modeling, which helps to understand physical phenomena or provide predictions both in the short
term or from a climate perspective. The reliability of ocean prediction is strictly linked to the ability of numerical models to capture the relevant
physical processes.</p>
      <p id="d1e194">The physical processes taking place in the oceans occupy a wide range of spatial and timescales. The ocean circulation is highly complex, in which
physical processes at large scales are transferred to smaller scales, resulting in mesoscale and sub-mesoscale structures, or eddies
<xref ref-type="bibr" rid="bib1.bibx28" id="paren.1"/>.</p>
      <p id="d1e200">The coastal scale is also rich in features driven by the interaction between the regional-scale dynamics and the complex morphology typical of shelf
areas, tidal flats, estuaries and straits.</p>
      <p id="d1e203">In both large-scale and coastal modeling, the spatial resolution is a key factor.</p>
      <p id="d1e207">Large-scale applications require a finer horizontal resolution than the Rossby radius (in the order of 100 <inline-formula><mml:math id="M1" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> in midlatitudes and less than
10 <inline-formula><mml:math id="M2" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> in high latitudes) to capture the mesoscale <xref ref-type="bibr" rid="bib1.bibx39" id="paren.2"/>. The geometry of the domain drives the selection of spatial resolution
in the coastal environment, where grid spacing can be in the order of meters.</p>
      <p id="d1e229">Ocean circulation models use mostly structured meshes and have a long history of development <xref ref-type="bibr" rid="bib1.bibx26" id="paren.3"/> often organized in a community
model framework.</p>
      <p id="d1e235">In the last few decades, however, the finite-volume <xref ref-type="bibr" rid="bib1.bibx10 bib1.bibx11" id="paren.4"/> or the finite-element approach <xref ref-type="bibr" rid="bib1.bibx16 bib1.bibx63 bib1.bibx56" id="paren.5"/>, applied to unstructured meshes, has become more common, especially in the coastal framework, where the flexibility of the mesh
particularly suits the complexity of the environment.  Applications of unstructured grids include the modeling of storm surges <xref ref-type="bibr" rid="bib1.bibx61" id="paren.6"/>,
ecosystem modeling <xref ref-type="bibr" rid="bib1.bibx64" id="paren.7"/>, sediment transport <xref ref-type="bibr" rid="bib1.bibx53" id="paren.8"/> and flow exchange through straits <xref ref-type="bibr" rid="bib1.bibx52" id="paren.9"/>.</p>
      <p id="d1e257">Representing several spatial scales in the same application renders the unstructured grid appealing in simulations aimed at bridging the gap between
the large-scale flow and the coastal dynamics <xref ref-type="bibr" rid="bib1.bibx47" id="paren.10"/>. Advances in the numerical formulation have meant that unstructured models can
also be used for large-scale simulations that address geostrophic adjustments and conservation properties comparably to regular grids
<xref ref-type="bibr" rid="bib1.bibx26" id="paren.11"/>, thus leading to simulations that are suitable for climate studies <xref ref-type="bibr" rid="bib1.bibx17 bib1.bibx45" id="paren.12"/>.</p>
      <p id="d1e269">The computational cost of a numerical simulation depends on the order of accuracy of the numerical scheme and the grid scale <xref ref-type="bibr" rid="bib1.bibx48" id="paren.13"/>. In
the case of structured grids, the computational cost increases inversely on the grid space with the power of the dimensions represented by the model.
Estimating the computational cost in unstructured grids is not as straightforward as in regular grids, but it is commensurate to the latter when low-order schemes are used <xref ref-type="bibr" rid="bib1.bibx47 bib1.bibx36" id="paren.14"/>.</p>
      <p id="d1e278">Both large-scale and coastal applications may involve significant computational resources because of the high density of mesh descriptor elements
required to resolve dominant physical processes. The computational cost is also determined by upper limits on the time step, making meaningful
simulations prohibitive for conventional machines. Access to HPC resources is essential for performing state-of-the-art simulations.</p>
      <p id="d1e282">Several successful modeling studies have involved the SHYFEM (System of HydrodYnamic Finite Element
Modules) unstructured grid model <xref ref-type="bibr" rid="bib1.bibx56 bib1.bibx6" id="paren.15"/> in the development
of regional <xref ref-type="bibr" rid="bib1.bibx21 bib1.bibx1 bib1.bibx20" id="paren.16"/> and coastal applications <xref ref-type="bibr" rid="bib1.bibx57" id="paren.17"/>.</p>
      <p id="d1e294">The range of applications of SHYFEM was recently extended in a multi-model study to assess the hazards related to climate scenarios
<xref ref-type="bibr" rid="bib1.bibx54" id="paren.18"/>, the change in sea level in tidal marshes in response to hurricanes <xref ref-type="bibr" rid="bib1.bibx43" id="paren.19"/>, and in a high-resolution simulation of
the Turkish Strait System dynamics under realistic atmospheric and lateral forcing <xref ref-type="bibr" rid="bib1.bibx30" id="paren.20"/>.</p>
      <p id="d1e306">SHYFEM was also applied to produce seamless three-dimensional hydrodynamic short-term forecasts on a daily basis <xref ref-type="bibr" rid="bib1.bibx18 bib1.bibx21" id="paren.21"/> from large to coastal scales. SHYFEM has also been used in relocatable mode <xref ref-type="bibr" rid="bib1.bibx55" id="paren.22"/> to support emergency responses to
extreme events and natural hazards in the world's oceans.  Both in forecasting systems and relocatable services, the need for reduced computational
costs is crucial in order to deliver updated forecasts with a longer time window.</p>
      <p id="d1e315">We implemented a version of the SHYFEM code that can be executed on parallel architectures, addressing the problem of load balancing that is strictly
related to the grid partitioning, the parallel scalability and inter-node computational overhead. Our aim was to make all these applications (study
process simulation at different scales, long-term and climatic implementations, forecasting and relocatable systems) practical, also from a future
perspective where the computational cost is constantly increasing with the complexity of the simulations. We adopted a distributed memory approach,
with two key advantages: (i) reduction in runtime with the upper limit determined by the user's choice of resources and (ii) memory scalability, allowing
for highly memory-demanding simulations.</p>
      <p id="d1e318">The distributed memory approach, based on the message passing interface (MPI) <xref ref-type="bibr" rid="bib1.bibx42" id="paren.23"/>, can coexist with the shared memory approach and is
widely used to parallelize unstructured ocean models, such as MPAS <xref ref-type="bibr" rid="bib1.bibx47" id="paren.24"/> and FESOM2 <xref ref-type="bibr" rid="bib1.bibx17" id="paren.25"/>, which are devised for
global configurations. MPI codes that address coastal processes include SLIM3D <xref ref-type="bibr" rid="bib1.bibx33" id="paren.26"/>, SCHISM <xref ref-type="bibr" rid="bib1.bibx63" id="paren.27"/> and FVCOM <xref ref-type="bibr" rid="bib1.bibx11 bib1.bibx15" id="paren.28"/>.</p>
      <p id="d1e340">The MPI developments carried out in this work consist of additional routines that wrap the native MPI directives, without undermining the code
readability. Some aspects of the parallel development, such as the domain decomposition and the solution of free surface equations, were achieved
using external libraries.</p>
      <p id="d1e344">Section <xref ref-type="sec" rid="Ch1.S2"/> introduces the SHYFEM model and its main features. Section <xref ref-type="sec" rid="Ch1.S3"/> describes the
methodology and the design of the distributed memory parallelization, through the partitioning strategy and management of the data dependencies among
the MPI processes. Section <xref ref-type="sec" rid="Ch1.S4"/> describes the implementation; Sect. <xref ref-type="sec" rid="Ch1.S5"/> presents the model
validation and the performance assessment. Finally, the conclusions are drawn in the last section.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>The SHYFEM model</title>
      <p id="d1e363">SHYFEM solves the ocean primitive equations, assuming incompressibility in the continuity equation, and advection–diffusion equation for active
tracers using finite-element discretization based on triangular elements <xref ref-type="bibr" rid="bib1.bibx56" id="paren.29"/>.  The model uses a semi-implicit algorithm for the
time integration of the free surface equation, which makes the solution stable by damping the fastest external gravity waves. The Coriolis term and
pressure gradient in the momentum equation and the divergence terms in the continuity equation are treated semi-implicitly. The vertical eddy
viscosity and vertical eddy diffusivity in the tracer equations are treated fully implicitly for stability reasons. The advective and horizontal
diffusive terms in the momentum and tracer equations are treated explicitly. Smagorinsky's formulation <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx50" id="paren.30"/> is used
to parameterize the horizontal eddy viscosity and diffusivity. To compute the vertical viscosities, a turbulence closure scheme was used. This scheme
is adapted from the k–epsilon​​​​​​​ module of GOTM (General Ocean Turbulence Model) described in <xref ref-type="bibr" rid="bib1.bibx8" id="paren.31"/>. A detailed description of the 3D
model equations is given in <xref ref-type="bibr" rid="bib1.bibx6 bib1.bibx38" id="text.32"/>.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1" specific-use="star"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e381">Notations adopted in this work.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="justify" colwidth="33mm"/>
     <oasis:colspec colnum="2" colname="col2" align="justify" colwidth="90mm"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:colspec colnum="4" colname="col4" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">

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

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

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

         <oasis:entry colname="col4">Index range</oasis:entry>

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

         <oasis:entry colname="col1">nel, nkn, nlv</oasis:entry>

         <oasis:entry colname="col2">total number of elements, nodes, and layers</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M3" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">vertical layer index</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">1:nlv</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M4" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">element index</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M5" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">node index</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M6" display="inline"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">depth of interface <inline-formula><mml:math id="M7" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M8" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">0:nlv</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M9" display="inline"><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">thickness of element <inline-formula><mml:math id="M10" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M11" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M12" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M13" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M14" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M15" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M16" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M17" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">velocity vector in element <inline-formula><mml:math id="M18" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M19" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M20" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M21" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M22" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M23" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M24" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <?xmltex \mrwidth{33mm}?><oasis:entry colname="col1" morerows="1"><inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>U</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">layer-integrated velocity vector in element <inline-formula><mml:math id="M26" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M27" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M28" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M29" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M30" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M31" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M32" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col2"/>

         <oasis:entry colname="col3"/>

         <oasis:entry colname="col4"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M33" display="inline"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">vertical velocity at node <inline-formula><mml:math id="M34" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> at interface <inline-formula><mml:math id="M35" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M36" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M37" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M38" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 0:nlv, <inline-formula><mml:math id="M39" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M40" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>,</oasis:entry>

         <oasis:entry colname="col2">temperature at node <inline-formula><mml:math id="M42" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M43" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3">C<inline-formula><mml:math id="M44" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M45" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M46" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M47" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M48" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">salinity at node <inline-formula><mml:math id="M50" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M51" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

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

         <oasis:entry colname="col4"><inline-formula><mml:math id="M52" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M53" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M54" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M55" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:msubsup><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi><mml:mi>l</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">vertical turbulent viscosity/diffusivity at node <inline-formula><mml:math id="M58" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> at interface <inline-formula><mml:math id="M59" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M60" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M61" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M62" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 0:nlv, <inline-formula><mml:math id="M63" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M64" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:mi mathvariant="italic">η</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">free surface elevation at node <inline-formula><mml:math id="M66" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M67" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M68" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M69" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

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

         <oasis:entry colname="col2">reference density</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M71" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">kg</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>l</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">deviation of density from reference</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M73" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">kg</mml:mi><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M74" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M75" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M76" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M77" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nkn</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M78" display="inline"><mml:mi mathvariant="normal">∇</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">2D nabla operator</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M79" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>​​​​​​​</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M80" display="inline"><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo mathvariant="normal" stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">vertical unit vector</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">model time step</oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M82" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">Coriolis parameter in element <inline-formula><mml:math id="M84" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M85" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M86" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M87" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:msubsup><mml:mi>A</mml:mi><mml:mi>H</mml:mi><mml:mi>l</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">horizontal viscosity coefficient at element <inline-formula><mml:math id="M89" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> at layer <inline-formula><mml:math id="M90" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M91" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M92" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M93" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nlv, <inline-formula><mml:math id="M94" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M95" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 1:nel</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M96" display="inline"><mml:mi mathvariant="italic">γ</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">weight of time level <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> for external pressure gradient, vertical viscosity and Coriolis in momentum</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M100" display="inline"><mml:mi mathvariant="italic">β</mml:mi></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">weight of time level <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> for horizontal divergence in continuity equation</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1"><inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">V</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">D</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2">weight of time level <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> for vertical advection and diffusion in tracers equation</oasis:entry>

         <oasis:entry colname="col3">n/a</oasis:entry>

         <oasis:entry colname="col4">n/a</oasis:entry>

       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table><table-wrap-foot><p id="d1e384">n/a: not applicable.</p></table-wrap-foot></table-wrap>

<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Time discretization</title>
      <p id="d1e1809">SHYFEM equations are discretized in time with a forward time stepping scheme with terms that are evaluated at time level <inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> with weight <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:mn mathvariant="normal">0</mml:mn><mml:mo>≤</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>≤</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> and terms evaluated at time level <inline-formula><mml:math id="M107" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> with weight <inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi></mml:mrow></mml:math></inline-formula>. The time level <inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> of external pressure gradient
in the momentum equations has a weight <inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><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> and the time level of the divergence of barotropic flow in the continuity equation has a weight
<inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:mi mathvariant="italic">β</mml:mi><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>. When one of <inline-formula><mml:math id="M112" display="inline"><mml:mi mathvariant="italic">γ</mml:mi></mml:math></inline-formula> or <inline-formula><mml:math id="M113" display="inline"><mml:mi mathvariant="italic">β</mml:mi></mml:math></inline-formula> is 0, the scheme is considered explicit in time.</p>
      <p id="d1e1926">The treatment of external pressure gradient and divergence in continuity is consistent with the method described in <xref ref-type="bibr" rid="bib1.bibx9" id="text.33"/> and used in
the pressure method of MITgcm <xref ref-type="bibr" rid="bib1.bibx40" id="paren.34"/>.</p>
      <p id="d1e1935">SHYFEM applies a semi-implicit scheme to the Coriolis force and vertical viscosity with weights of time level <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M116" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>,
respectively. As described in <xref ref-type="bibr" rid="bib1.bibx9" id="paren.35"/>, the solution requires a time step for the momentum from time level <inline-formula><mml:math id="M117" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> to the intermediate
level <inline-formula><mml:math id="M118" display="inline"><mml:msup><mml:mi/><mml:mo>∗</mml:mo></mml:msup></mml:math></inline-formula>. Using the notation reported in Table <xref ref-type="table" rid="Ch1.T1"/>, the velocity equation integrated over a generic layer <inline-formula><mml:math id="M119" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> is
            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M120" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mo>∗</mml:mo></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mi>f</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mo>×</mml:mo><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mo>∗</mml:mo></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mo>∗</mml:mo></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">F</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>-</mml:mo><mml:mi>f</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mo>×</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>+</mml:mo><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>-</mml:mo><mml:mi>g</mml:mi><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mi mathvariant="bold">∇</mml:mi><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the vertical viscosity operator and the term <inline-formula><mml:math id="M122" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">F</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> contains advection, horizontal turbulent viscosity and pressure terms:
            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M123" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">F</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mfenced open="(" close=")"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mi mathvariant="normal">∇</mml:mi></mml:mrow></mml:mfenced><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>+</mml:mo><mml:munderover><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:msup><mml:mi>w</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">d</mml:mi><mml:mi>z</mml:mi><mml:mo>+</mml:mo><mml:msubsup><mml:mi>A</mml:mi><mml:mi>H</mml:mi><mml:mi>l</mml:mi></mml:msubsup><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi>p</mml:mi><mml:mtext>atm</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>g</mml:mi><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:munderover><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:munderover><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mi mathvariant="normal">d</mml:mi><mml:mi>z</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e2416">The implementation of <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is given in Appendix <xref ref-type="sec" rid="App1.Ch1.S2"/>. The vertical viscosity in the momentum equation is commonly treated
implicitly in numerical ocean models. This is because the inversion of the tri-diagonal matrix associated with the system is not computationally demanding.</p>
      <p id="d1e2433">SHYFEM considers the semi-implicit treatment of the Coriolis term, since it can lead to instability when the friction is too low. The weights assigned
to time level <inline-formula><mml:math id="M125" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> of this term in the ocean models that perform semi-implicit treatment are commonly <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.5</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula>, which is the most accurate
scheme in the representation of inertial waves <xref ref-type="bibr" rid="bib1.bibx59" id="paren.36"/>.</p>
      <p id="d1e2470">The vertical viscosity terms in Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) introduce a dependency between adjacent layers, and the equations cannot be
inverted trivially. The Coriolis term, also introduces dependency between zonal and meridional momentum, requiring a simultaneous inversion of the two
equations.</p>
      <p id="d1e2475">The subsequent linear system is sparse with a penta-diagonal structure with dimension <inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>l</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M129" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>l</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, where
<inline-formula><mml:math id="M131" display="inline"><mml:mrow><mml:msub><mml:mi>l</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is the number of active layers of the element. The system is solved in each element by Gauss elimination with partial pivoting.</p>
      <p id="d1e2522">The solution of Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) gives the tendency of momentum <inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo>∗</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>,
which is used to calculate the momentum at time level <inline-formula><mml:math id="M133" display="inline"><mml:msup><mml:mi/><mml:mo>∗</mml:mo></mml:msup></mml:math></inline-formula>
            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M134" display="block"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo>∗</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e2599">The elliptic equation of the prediction of free surface <inline-formula><mml:math id="M135" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> is
            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M136" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>(</mml:mo><mml:mi>H</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo mathsize="1.1em">(</mml:mo><mml:mi>H</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo mathsize="1.1em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:msup><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>∗</mml:mo></mml:msup><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mi>n</mml:mi></mml:msup><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>(</mml:mo><mml:mi>P</mml:mi><mml:mo>-</mml:mo><mml:mi>E</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          with <inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mo>=</mml:mo><mml:mi>g</mml:mi><mml:mi mathvariant="italic">γ</mml:mi><mml:mi mathvariant="italic">β</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:msup><mml:mi>t</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mo>-</mml:mo><mml:mi>E</mml:mi></mml:mrow></mml:math></inline-formula> the freshwater flux at the surface and <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M140" display="inline"><mml:mrow><mml:msup><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>∗</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mo>∗</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M141" display="inline"><mml:mrow><mml:msup><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mi>n</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>. The solution of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>) is described in
Sect. <xref ref-type="sec" rid="Ch1.S4.SS3"/>.</p>
      <p id="d1e2864">The advancement of momentum equations is finalized with the correction step, using <inline-formula><mml:math id="M142" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>:
            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M143" display="block"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mo>∗</mml:mo></mml:msubsup><mml:mo>-</mml:mo><mml:mi>g</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mi mathvariant="italic">γ</mml:mi><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1" specific-use="star"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e2955">Example of variables on the SHYFEM horizontal and vertical grids.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f01.png"/>

        </fig>

      <p id="d1e2964">Vertical velocities at time level <inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M145" display="inline"><mml:mrow><mml:msup><mml:mi>w</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> are diagnosed with the continuity equation for the control volume associated with a node <inline-formula><mml:math id="M146" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> (see
Fig. <xref ref-type="fig" rid="Ch1.F1"/>):
            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M147" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mo mathsize="2.0em">[</mml:mo><mml:mi mathvariant="bold">∇</mml:mi><mml:msub><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal" stretchy="false">̃</mml:mo></mml:mover><mml:mi>l</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>Q</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:mi>A</mml:mi><mml:mo mathsize="2.0em">]</mml:mo><mml:mo>+</mml:mo><mml:mo mathsize="2.0em">(</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          with the vertical discretization shown in Fig. <xref ref-type="fig" rid="App1.Ch1.S2.F17"/> and <inline-formula><mml:math id="M148" display="inline"><mml:mrow><mml:msub><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo stretchy="false" mathvariant="normal">̃</mml:mo></mml:mover><mml:mi>l</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>)</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> indicating that the thickness is variable only for surface layer.  The quantity <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> [<inline-formula><mml:math id="M151" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>] represents mass
fluxes from surface or from internal sources, thus the equation contains the area <inline-formula><mml:math id="M152" display="inline"><mml:mi>A</mml:mi></mml:math></inline-formula> of the control volume.  The equation is integrated from the
bottom with the boundary condition <inline-formula><mml:math id="M153" display="inline"><mml:mrow><mml:msubsup><mml:mi>w</mml:mi><mml:mrow><mml:msub><mml:mi>l</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3235">The advection–diffusion equation for a generic tracer <inline-formula><mml:math id="M154" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> is solved treating the vertical diffusion implicitly (default value for <inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">D</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>). The vertical
advection can be treated semi- or fully implicitly in the case of the upwind scheme (default value <inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">V</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>):

                <disp-formula specific-use="gather" content-type="numbered"><mml:math id="M157" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E7"><mml:mtd><mml:mtext>7</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:msubsup><mml:mi>T</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msubsup><mml:mi>T</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mo mathvariant="normal" stretchy="false">̃</mml:mo></mml:mover><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:msub><mml:mo>)</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">V</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:msubsup><mml:mo>)</mml:mo><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>-</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">V</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:msubsup><mml:mo>)</mml:mo><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E8"><mml:mtd><mml:mtext>8</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>+</mml:mo><mml:msubsup><mml:mi>h</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msub><mml:mi>K</mml:mi><mml:mi>H</mml:mi></mml:msub><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:msubsup><mml:mi>T</mml:mi><mml:mi>l</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:mo>+</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">D</mml:mi></mml:msub><mml:mo mathsize="2.0em">[</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:mo mathsize="2.0em">]</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E9"><mml:mtd><mml:mtext>9</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mi mathvariant="normal">D</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo mathsize="2.0em">[</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi>n</mml:mi></mml:msup><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi><mml:mi>n</mml:mi></mml:msubsup><mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi>n</mml:mi></mml:msup><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mi>l</mml:mi></mml:msub><mml:mo mathsize="2.0em">]</mml:mo><mml:mo>+</mml:mo><mml:mi>Q</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            where subscripts t and b indicate the value of the tracer at the top and bottom of the layer, respectively.</p>
      <p id="d1e3674">The horizontal diffusivity follows Smagorinsky's formulation. <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:msub><mml:mi>K</mml:mi><mml:mi mathvariant="normal">V</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represents the background molecular diffusivity plus the turbulent
diffusivity (always at time step <inline-formula><mml:math id="M159" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>) and the <inline-formula><mml:math id="M160" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula> source/sink term, described in <xref ref-type="bibr" rid="bib1.bibx38" id="paren.37"/>. Equation (<xref ref-type="disp-formula" rid="Ch1.E7"/>) is solved with
the Thomas algorithm for tridiagonal matrices in each node column.</p>
      <p id="d1e3707">The density is updated by means of the equation of state (EOS) under the hydrostatic assumption:

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M161" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E10"><mml:mtd><mml:mtext>10</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mtext>EOS</mml:mtext><mml:mo>(</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>S</mml:mi><mml:mi>l</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E11"><mml:mtd><mml:mtext>11</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>p</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mi>g</mml:mi><mml:mo mathsize="2.0em">(</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>l</mml:mi></mml:mrow></mml:munder><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>)</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>)</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            where the EOS can either be the UNESCO EOS80 <xref ref-type="bibr" rid="bib1.bibx22" id="paren.38"/> or the EOS from <xref ref-type="bibr" rid="bib1.bibx31" id="text.39"/>.</p>
      <p id="d1e3871">The sub-steps of the SHYFEM solution method are in Algorithm <xref ref-type="other" rid="Ch1.Prog1"/> with the corresponding equations.</p><?xmltex \floatpos{h}?><boxed-text content-type="algorithm" position="float" id="Ch1.Prog1"><?xmltex \currentcnt{1}?><label>Algorithm 1</label><caption><p id="d1e3878">SHYFEM time loop</p></caption><disp-quote content-type="algorithmic" specific-use="numbering{0}"><list>

    <list-item>

      <p id="d1e3885" specific-use="WHILE"><bold>while</bold> <inline-formula><mml:math id="M162" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>&lt;</mml:mo><mml:mtext>num_timesteps</mml:mtext></mml:mrow></mml:math></inline-formula> <bold>do</bold> <list>
    <list-item>
      <p id="d1e3908" specific-use="STATE">AdvanceMomentum                  <?xmltex \hack{\hspace{1.43cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e3918" specific-use="STATE">SolveBarotropicEquation          <?xmltex \hack{\hspace{0.80cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e3928" specific-use="STATE">FinaliseMomentum                 <?xmltex \hack{\hspace{1.54cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E5"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e3938" specific-use="STATE">CalcVerticalVelocity             <?xmltex \hack{\hspace{1.40cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e3948" specific-use="STATE">SolveTracerAdvection             <?xmltex \hack{\hspace{1.17cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e3959" specific-use="STATE">UpdateDensity                    <?xmltex \hack{\hspace{2.12cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>)}<?COMMENT?></p></list-item></list></p>
            </list-item>

    <list-item>

      <p id="d1e3970" specific-use="ENDWHILE"><bold>end</bold> <bold>while</bold></p>
            </list-item>
          </list></disp-quote></boxed-text>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>Spatial discretization and dependencies</title>
      <p id="d1e3988">Figure <xref ref-type="fig" rid="Ch1.F1"/> shows how the model variables are staggered over the computational grid. Horizontal momentum (<inline-formula><mml:math id="M163" display="inline"><mml:mi mathvariant="bold">U</mml:mi></mml:math></inline-formula>) is located in the
element centers, while all the others are located on the vertexes (vertical velocity <inline-formula><mml:math id="M164" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> and scalars). Each vertex has a corresponding finite volume
(dashed lines in Fig. <xref ref-type="fig" rid="Ch1.F1"/>). The staggering of hydrodynamic variables is essential to have a mass-conserving model
<xref ref-type="bibr" rid="bib1.bibx32 bib1.bibx19" id="paren.40"/>.</p>
      <p id="d1e4012">Variables are also staggered in the vertical grid, as shown in Fig. <xref ref-type="fig" rid="Ch1.F1"/>.</p>
      <p id="d1e4017">The turbulent and molecular stresses and the vertical velocity are computed at the bottom interface of each layer (black dots in
Fig. <xref ref-type="fig" rid="Ch1.F1"/>), the free surface is at the top of the upper layer thus determining the variable volume of the top cells, and all the other
variables are defined at the layer center (red dots in Fig. <xref ref-type="fig" rid="Ch1.F1"/>).</p>
      <p id="d1e4024">Scalar variables (red) are staggered with respect to vertical velocity (black), referenced in the middle and at layer interfaces, respectively. The
sea surface elevation is a 2D field defined only in the <inline-formula><mml:math id="M165" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> points at surface.</p>
      <p id="d1e4035">The grid cells on the top layer can change their volume as a result of the oscillation of the free surface. The number of active cells along the
vertical direction depends on the sea depth.</p>
      <p id="d1e4038">The spatial discretization of the governing equations in the finite-element method (FEM) framework is based on the assumption that the approximate solution is a linear
combination of shape functions defined in the 2D space. In this section we provide suggestions for the practical use of the FEM method in the relevant
terms of the SHYFEM equations.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2" specific-use="star"><?xmltex \currentcnt{2}?><label>Table 2</label><caption><p id="d1e4044">Notation for connectivity and gradient of shape functions. </p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"><inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">Nodes <inline-formula><mml:math id="M167" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> of element <inline-formula><mml:math id="M168" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> (Fig. <xref ref-type="fig" rid="Ch1.F3"/>c)</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">elements <inline-formula><mml:math id="M170" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> around node <inline-formula><mml:math id="M171" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> (Fig. <xref ref-type="fig" rid="Ch1.F3"/>b)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">elements <inline-formula><mml:math id="M173" display="inline"><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> sharing an edge (Fig. <xref ref-type="fig" rid="Ch1.F3"/>a) with element <inline-formula><mml:math id="M174" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M175" display="inline"><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">nodes <inline-formula><mml:math id="M176" display="inline"><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> around node <inline-formula><mml:math id="M177" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> (Fig. <xref ref-type="fig" rid="Ch1.F3"/>d)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M179" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">gradients of <inline-formula><mml:math id="M180" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula> shape function for node <inline-formula><mml:math id="M181" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> in element <inline-formula><mml:math id="M182" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula></oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e4304">Table <xref ref-type="table" rid="Ch1.T2"/> reports the possible connectivities that arise from the physics of the SHYFEM equations. Table <xref ref-type="table" rid="Ch1.T2"/>
also shows the definition for the partial derivatives of the linear shape functions to calculate horizontal gradients of scalar quantities and
divergence of vector fields.  Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/> gives more insights into the shape functions and the calculation of their
gradients.</p>
      <p id="d1e4313">Considering a scalar field, such as the surface elevation <inline-formula><mml:math id="M183" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> in Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>), its gradient is a linear combination of the
gradient of shape functions.
            <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M184" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">)</mml:mo><mml:mi>e</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mo mathsize="2.0em">(</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo><mml:mo mathsize="2.0em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e4460">The resulting gradient is referenced to the element <inline-formula><mml:math id="M185" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula>, and is a combination of values referenced to its nodes. This means that the calculation of the
horizontal gradient of a scalar field consists of a node-to-element dependency (see Fig. <xref ref-type="fig" rid="Ch1.F3"/>c).</p>
      <p id="d1e4472">Considering a vector field, such as <inline-formula><mml:math id="M186" display="inline"><mml:mi mathvariant="bold-italic">U</mml:mi></mml:math></inline-formula>, its horizontal divergence is a linear combination of the same gradients as the shape functions, as
detailed below:
            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M187" display="block"><mml:mrow><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">U</mml:mi><mml:msub><mml:mo>)</mml:mo><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>e</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mi>U</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where the divergence of the horizontal velocity field is referenced to the node <inline-formula><mml:math id="M188" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> and is the sum of the momentum fluxes inside/outside the node
control volume from the elements surrounding the node <inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>. Calculation of the divergence of vector fields consists of an <italic>element-to-node</italic> dependency (see Fig. <xref ref-type="fig" rid="Ch1.F3"/>b).</p>
      <p id="d1e4600">The horizontal viscosity stress in <inline-formula><mml:math id="M190" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> direction (and similarly in <inline-formula><mml:math id="M191" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula> direction) has the form
            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M192" display="block"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>H</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>U</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi>U</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where the contributions come from the differences between the momentum of the current element <inline-formula><mml:math id="M193" display="inline"><mml:mrow><mml:mi>U</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and the momentum of surrounding
elements <inline-formula><mml:math id="M194" display="inline"><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> that share one side with <inline-formula><mml:math id="M195" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> divided by the sum of areas of both elements <inline-formula><mml:math id="M196" display="inline"><mml:mrow><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. <inline-formula><mml:math id="M197" display="inline"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>H</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the viscosity
coefficient calculated according to <xref ref-type="bibr" rid="bib1.bibx50" id="paren.41"/>. The viscosity stress components thus consist in an element-to-element dependency
(see Fig. <xref ref-type="fig" rid="Ch1.F3"/>a).</p>
      <p id="d1e4790">Equation (<xref ref-type="disp-formula" rid="Ch1.E4"/>) can be seen in matrix form for <inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mi mathvariant="bold">B</mml:mi></mml:mrow></mml:math></inline-formula> with <inline-formula><mml:math id="M199" display="inline"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold">I</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mo>(</mml:mo><mml:mi>H</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M200" display="inline"><mml:mi mathvariant="bold">B</mml:mi></mml:math></inline-formula> containing the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>) as well as <inline-formula><mml:math id="M201" display="inline"><mml:mi mathvariant="bold-italic">η</mml:mi></mml:math></inline-formula>, a column vector containing the values of <inline-formula><mml:math id="M202" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> at nodes. The left-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>) is discretized
as follows:
            <disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M203" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>e</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:mo mathsize="2.0em">(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          creating a dependency between node <inline-formula><mml:math id="M204" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> and the surrounding nodes <inline-formula><mml:math id="M205" display="inline"><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mi>k</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5120">The terms <inline-formula><mml:math id="M206" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M207" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> represent diagonal entries if <inline-formula><mml:math id="M208" display="inline"><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:mo>=</mml:mo><mml:mi>k</mml:mi></mml:mrow></mml:math></inline-formula> and terms <inline-formula><mml:math id="M209" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M210" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>H</mml:mi><mml:mi>e</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
represent off-diagonal entries in case <inline-formula><mml:math id="M211" display="inline"><mml:mrow><mml:msup><mml:mi>k</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>≠</mml:mo><mml:mi>k</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5368">The dependency between adjacent nodes of <inline-formula><mml:math id="M212" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> introduced by the discretization of <inline-formula><mml:math id="M213" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is of the kind <italic>node to node</italic> (see
Fig. <xref ref-type="fig" rid="Ch1.F3"/>d).</p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Parallel approach</title>
      <p id="d1e5399">Scientific and engineering numerical simulations involve an ever-growing demand for computing resources due to the increasing model resolution and
complexity. Computer architectures satisfy simulation requirements through a variety of computing hardware, often combined together into heterogeneous
architectures. There are key benefits from the design (or re-design) of a parallel application <xref ref-type="bibr" rid="bib1.bibx62 bib1.bibx23" id="paren.42"/> and the choice
of parallel paradigm, taking into account the features of computing facilities <xref ref-type="bibr" rid="bib1.bibx37" id="paren.43"/>.  Shared and distributed parallel programming
can be mixed to better exploit heterogeneous architectures. MPI<inline-formula><mml:math id="M214" display="inline"><mml:mo>+</mml:mo></mml:math></inline-formula>X​​​​​​​ enables the code to be executed on clusters of non-uniform memory access (NUMA) nodes equipped with CPUs, GPUs,
accelerators, etc. This mixing should be done by taking into account the main features of the two paradigms. The shared memory approach enables
multiple processing units to share data but does not allow the problem to be scaled on more than one computing node, setting an upper bound to the
available memory. The distributed memory approach, on the other hand, enables each computing process to access its own memory space, so that bigger
problems can be addressed by scaling the memory over multiple nodes. However, communication between parallel processes is needed in order to satisfy
data dependencies.  Given that configurations will require even more memory and computing power, the strategy used to parallelize the SHYFEM model is
based on the distributed memory approach with MPI. The parallelization strategy can be easily combined with the existing shared memory implementation
based on OpenMP <xref ref-type="bibr" rid="bib1.bibx44" id="paren.44"/> or with other approaches not yet implemented (e.g., OpenACC).</p>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>The domain partitioning issue</title>
      <p id="d1e5425">Identifying data dependencies is key for the design of the parallel algorithm, since inter-process communications need to be introduced to satisfy
these dependencies.</p>
      <p id="d1e5428">In the case of a structured grid, each grid point usually holds information related to the cell discretized in the space, and data dependencies are
represented by a stencil containing the relations between each cell and its neighbors. For example, we could have five or nine point stencils that
represent the dependencies of the current cell with regards to its four neighbors north, south, east and west, or alternatively cells along diagonals
could also be considered for computation.</p>
      <p id="d1e5431">On the other hand, unstructured grid models can be characterized by dependencies among nodes (the vertexes), elements (triangles), or nodes and
elements. These kinds of dependencies need to be taken into account when the partitioning strategy is defined.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Figure}?><label>Figure 2</label><caption><p id="d1e5437">Element based partitioning and node-based partitioning.</p></caption>
          <?xmltex \igopts{width=426.791339pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f02.png"/>

        </fig>

</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>Partitioning strategy</title>
      <p id="d1e5454">The choice between element-based or node-based partitioning (see Fig. <xref ref-type="fig" rid="Ch1.F2"/>) aims to reduce the data exchange among different processes.</p>
      <p id="d1e5459">The best partitioning strategy cannot be defined absolutely. In fact, it usually depends on the code architecture and its implementation.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e5464">Possible data dependencies on a staggered grid.</p></caption>
          <?xmltex \igopts{width=426.791339pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f03.png"/>

        </fig>

      <p id="d1e5474">Analysis of the SHYFEM code shows that an element-based domain decomposition minimizes the number of communications among the parallel processes. Four
types of data dependencies (see Fig. <xref ref-type="fig" rid="Ch1.F3"/>) were identified within the code: <italic>element-to-element</italic> (A) – the computation on each
element depends on the three adjacent elements; <italic>element-to-node</italic> (B) – the node receives data from the incident elements (usually six);
<italic>node-to-element</italic> (C) – the element needs data from its three nodes; <italic>node-to-node</italic> (D) – the computation on each node depends on the
adjacent nodes.</p>
      <p id="d1e5491">The element-based partitioning needs data exchange when there are dependencies A, B and D, while node-based partitioning needs data exchange with
dependencies C and D. The data dependency A happens only when momentum is exchanged to compute the viscosity operator; the data dependency D happens
in two cases when matrix–vector products are computed for the implicit solution of the free surface equation (FSE) which is solved using the PETSc (Portable, Extensible Toolkit for Scientific Computation) external libraries; finally, the data dependency C is the most common in the code, more frequent than dependency B.</p>
      <p id="d1e5494">We can thus summarize that, after analyzing the SHYFEM code, element-based partitioning reduces the data dependencies that need to be solved through
data exchanges between neighboring processes. Clearly, the computation on nodes shared among different processes is replicated.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>The partitioning algorithm</title>
      <p id="d1e5505">The second step, after selecting the partitioning strategy, is to define the partitioning algorithm. This represents a way of distributing the
workload among the processes for an efficient parallel computation. The standard approach <xref ref-type="bibr" rid="bib1.bibx29" id="paren.45"/> is to consider the computational grid as a graph and to apply a graph partitioning strategy in order to distribute the workload. The graph partitioning problem consists in the
aggregation of nodes into mutually exclusive groups minimizing the number of cutting edges. The graph partitioning problems fall under the category of
NP-hard (non-deterministic polynomial-time hard) problems. Solutions to these problems are generally derived using heuristics and approximation algorithms. There are several parallel tools
that provide solutions to the partitioning problem, such as ParMetis <xref ref-type="bibr" rid="bib1.bibx35" id="paren.46"/>, the parallel extended version of Metis <xref ref-type="bibr" rid="bib1.bibx34" id="paren.47"/>, Jostle
<xref ref-type="bibr" rid="bib1.bibx58" id="paren.48"/>, PT-Scotch <xref ref-type="bibr" rid="bib1.bibx12" id="paren.49"/> and Zoltan <xref ref-type="bibr" rid="bib1.bibx29" id="paren.50"/>.  The scalability of the Zoltan PHG partitioner
<xref ref-type="bibr" rid="bib1.bibx49" id="paren.51"/> was a key factor in the choice of the partitioning tool for the parallel version of SHYFEM. The Zoltan library simplifies the
development and improves the performance of the parallel applications based on geometrically complex grids. The Zoltan framework includes parallel
partitioning algorithms, data migration, parallel graph coloring, distributed data directories, unstructured communication services and memory
management packages. It is available as open-source software.  An offline static partition module was designed and implemented. It is executed once
before beginning the simulation, when the number of parallel processes has been decided. The partitioning phase aims to minimize the inter-process
edge cuts and the differences among the workloads assigned to the various processes. The weights used in the graph partitioning for each element are
proportional to the number of vertical levels of the element itself.</p>
</sec>
</sec>
<sec id="Ch1.S4">
  <label>4</label><title>Parallel code implementation</title>
      <p id="d1e5540">The SHYFEM code has a modular structure. It enables users to customize the execution by changing the parameters defined within a configuration file
(i.e., namelist), to set up the simulation, and to activate the modules that solve hydrodynamics, thermodynamics and turbulence.</p>
      <p id="d1e5543">This section details the changes made to the original code, introducing the additional data structures needed to handle the domain partitioning, the
MPI point-to-point and collective communications, the solution of the FSE using the external PETSc library <xref ref-type="bibr" rid="bib1.bibx2 bib1.bibx3 bib1.bibx4" id="paren.52"/>, and the I/O management.</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>Local–global mapping</title>
      <p id="d1e5556">The domain decomposition over several MPI processes entails mapping the information of local entities to global entities. The entities to be mapped
are the elements and nodes. As a consequence of the partitioning procedure, each process holds two mapping tables, one for the elements and one for
the nodes. The mapping table of the elements stores the correspondence between the global identifier of the element (which is globally unique) with a
local identifier of the same element (which is locally unique). The same also happens with the mapping table associated with the nodes. Mapping
information is stored within two local data structures, containing the global identification number (GID) of elements and nodes. The
order of GID elements in local structures is natural; namely they are set in ascending order of GIDs. The local–global mapping is represented by the
position in the local structure of the GIDs, called local identification number (LID).</p>
      <p id="d1e5559">The GIDs of the nodes are stored in a different order. The GIDs of the nodes that belong to the boundary of the local domain are stored at the end of
the mapping table. This provides some computational benefits: it is easy to identify all of the nodes on the border; in most cases it is better to
first execute the computation over all of the nodes in the inner domain and after the computation over the nodes at the boundary; during the data
exchange it is easy to identify which nodes need to be sent and which ones need to be updated with the data from the neighboring processes.</p>
</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><title>Data exchange</title>
      <p id="d1e5570">Data exchanges are executed when element-to-node and element-to-element dependencies happen and MPI point-to-point communications are used.  In the
first case, each process receives information based on the elements that share the target node from the processes the elements belong to. It keeps
track of the shared nodes in terms of numbers and LIDs. Each process computes the local contribution and sends it to the interested neighboring
processes. The information received is stored in a temporary 3D data structure defined for nodes, vertical levels and processes. A reduction operation
is performed on the information received.</p>
      <p id="d1e5573">The element-to-element dependency happens only once in the time loop required to compute the viscosity operator. In this case, each process sends its
contribution to the neighbors in terms of momentum values. Each process keeps track of the elements to be sent/received in terms of the numbers and
LIDs, using two different data structures. In this case, the data structure extends the local domain in order to include an overlap used to store the
data received from the neighbors as shown in Fig. <xref ref-type="fig" rid="Ch1.F4"/>. Non-blocking point-to-point communications are used to overlap computation
and communications.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e5580">Communication pattern for the calculation of horizontal viscosity.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f04.png"/>

        </fig>

      <p id="d1e5590">Finally, collective communications were introduced to compute properties related to the whole domain, for instance to calculate the minimum or maximum temperature of the basin or to calculate the total water volume.
Algorithm <xref ref-type="other" rid="Ch1.Prog2"/> reports the pseudo-code of the parallel implementation of the SHYFEM model.</p><?xmltex \floatpos{h}?><boxed-text content-type="algorithm" position="float" id="Ch1.Prog2"><?xmltex \currentcnt{2}?><label>Algorithm 2</label><caption><p id="d1e5596">SHYFEM-MPI time loop</p></caption><disp-quote content-type="algorithmic" specific-use="numbering{0}"><list>

    <list-item><label><bold>Require:</bold></label>

      <p id="d1e5606" specific-use="REQUIRE"><inline-formula><mml:math id="M215" display="inline"><mml:mi mathvariant="script">N</mml:mi></mml:math></inline-formula> {Set of neighboring processes}<?COMMENT?></p>

      <p id="d1e5616" specific-use="REQUIRE"><inline-formula><mml:math id="M216" display="inline"><mml:mi mathvariant="script">U</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M217" display="inline"><mml:mi mathvariant="script">V</mml:mi></mml:math></inline-formula> {Set of nodes and edges defined in the current subdomain}<?COMMENT?></p>
            </list-item>

    <list-item>

      <p id="d1e5636" specific-use="FORALL"><bold>for all</bold> <inline-formula><mml:math id="M218" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mi mathvariant="script">N</mml:mi></mml:mrow></mml:math></inline-formula> <bold>do</bold> <list>
    <list-item>
      <p id="d1e5662" specific-use="STATE">SendHalo(<inline-formula><mml:math id="M219" display="inline"><mml:mi mathvariant="script">U</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M220" display="inline"><mml:mi mathvariant="script">V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M221" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>)</p></list-item></list></p>
            </list-item>

    <list-item>

      <p id="d1e5693" specific-use="ENDFOR"><bold>end</bold> <bold>for</bold></p>
            </list-item>

    <list-item>

      <p id="d1e5703" specific-use="WHILE"><bold>while</bold> <inline-formula><mml:math id="M222" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>&lt;</mml:mo><mml:mtext>num_timesteps</mml:mtext></mml:mrow></mml:math></inline-formula> <bold>do</bold> <list>
    <list-item>
      <p id="d1e5726" specific-use="FORALL"><bold>for all</bold> <inline-formula><mml:math id="M223" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mi mathvariant="script">N</mml:mi></mml:mrow></mml:math></inline-formula> <bold>do</bold> <list>
    <list-item>
      <p id="d1e5752" specific-use="STATE">RecvHalo(<inline-formula><mml:math id="M224" display="inline"><mml:mi mathvariant="script">U</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M225" display="inline"><mml:mi mathvariant="script">V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M226" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>)</p></list-item></list></p></list-item>
    <list-item>
      <p id="d1e5782" specific-use="ENDFOR"><bold>end</bold> <bold>for</bold></p></list-item>
    <list-item>
      <p id="d1e5791" specific-use="STATE">SetExplicitTerms</p></list-item>
    <list-item>
      <p id="d1e5796" specific-use="STATE">AdvanceMomentum                <?xmltex \hack{\hspace{1.43cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e5806" specific-use="STATE">GlobalExchange(RHS)</p></list-item>
    <list-item>
      <p id="d1e5812" specific-use="STATE">SolveBarotropicEquation        <?xmltex \hack{\hspace{0.80cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e5822" specific-use="STATE">FinaliseMomentum               <?xmltex \hack{\hspace{1.54cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E5"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e5832" specific-use="FORALL"><bold>for all</bold> <inline-formula><mml:math id="M227" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mi mathvariant="script">N</mml:mi></mml:mrow></mml:math></inline-formula> <bold>do</bold> <list>
    <list-item>
      <p id="d1e5858" specific-use="STATE">SendHalo(<inline-formula><mml:math id="M228" display="inline"><mml:mi mathvariant="script">U</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M229" display="inline"><mml:mi mathvariant="script">V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M230" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>)</p></list-item></list></p></list-item>
    <list-item>
      <p id="d1e5888" specific-use="ENDFOR"><bold>end</bold> <bold>for</bold></p></list-item>
    <list-item>
      <p id="d1e5897" specific-use="STATE">CalcVerticalVelocity            <?xmltex \hack{\hspace{1.40cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e5907" specific-use="STATE">SolveTracerAdvection            <?xmltex \hack{\hspace{1.17cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>)}<?COMMENT?></p></list-item>
    <list-item>
      <p id="d1e5918" specific-use="STATE">UpdateDensity                   <?xmltex \hack{\hspace{2.12cm}}?> {Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>)}<?COMMENT?></p></list-item></list></p>
            </list-item>

    <list-item>

      <p id="d1e5929" specific-use="ENDWHILE"><bold>end</bold> <bold>while</bold></p>
            </list-item>
          </list></disp-quote></boxed-text>
</sec>
<sec id="Ch1.S4.SS3">
  <label>4.3</label><title>Semi-implicit method for free surface equation</title>
      <p id="d1e5947">Semi-implicit schemes are common in computational fluid dynamics (CFD) mainly due to the numerical stability of the solution. In the case of ocean numerical modeling, external
gravity waves are the fastest process and propagate at a speed of up to 200 <inline-formula><mml:math id="M231" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, which puts a strong constraint on the model time step
in order to abide by the Courant–Friedrichs–Levy (CFL) condition for the convergence of the solution.</p>
      <p id="d1e5967">The semi-implicit treatment of barotropic pressure gradient, described in Sect. <xref ref-type="sec" rid="Ch1.S2.SS1"/>, involves the solution of the matrix
system
            <disp-formula id="Ch1.E16" content-type="numbered"><label>16</label><mml:math id="M232" display="block"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mi mathvariant="bold-italic">B</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M233" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is the matrix of coefficients that arise from the FEM discretization of derivatives of the left-hand side of
Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>), <inline-formula><mml:math id="M234" display="inline"><mml:mi mathvariant="bold-italic">η</mml:mi></mml:math></inline-formula> is a column vector containing the solution of <inline-formula><mml:math id="M235" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> with the same size of <inline-formula><mml:math id="M236" display="inline"><mml:mi mathvariant="bold-italic">B</mml:mi></mml:math></inline-formula>, with size <inline-formula><mml:math id="M237" display="inline"><mml:mrow><mml:mi mathvariant="normal">nkn</mml:mi><mml:mo>×</mml:mo><mml:mi mathvariant="normal">nkn</mml:mi></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M238" display="inline"><mml:mi mathvariant="bold-italic">B</mml:mi></mml:math></inline-formula> is the vector of the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>). The
matrix <inline-formula><mml:math id="M239" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is non-singular with an irregular sparse structure. We used PETSc to solve this equation efficiently.</p>
      <p id="d1e6055">Iterative methods are the most convenient methods to solve a large sparse system with <inline-formula><mml:math id="M240" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> not having particular structure
properties since the direct inversion of <inline-formula><mml:math id="M241" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> would be much too expensive. These methods search for an approximate solution for
Eq. (<xref ref-type="disp-formula" rid="Ch1.E16"/>) and include Jacobi, Gauss–Seidel, successive over-relaxation (SOR) and Krylov subspace methods (KSP). KSP is
regarded as one of the most important classes of numerical methods.</p>
      <p id="d1e6074">Algorithms based on KSP search for an approximate solution in the space generated by the matrix <inline-formula><mml:math id="M242" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula>,
            <disp-formula id="Ch1.E17" content-type="numbered"><label>17</label><mml:math id="M243" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϰ</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="normal">span</mml:mi><mml:mo mathvariant="italic">{</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mrow><mml:mi>m</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo mathvariant="italic">}</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          called the <inline-formula><mml:math id="M244" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>th-order Krylov subspace, where <inline-formula><mml:math id="M245" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is an arbitrary vector (generally the right-hand side of the system) with the property that the
approximate solution <inline-formula><mml:math id="M246" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mi>m</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> belongs to this subspace. In the iterative methods based on KSP, the subspace <inline-formula><mml:math id="M247" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϰ</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is enlarged a finite
number of times (<inline-formula><mml:math id="M248" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>), where <inline-formula><mml:math id="M249" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mi>m</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>  represent an acceptable approximate solution, giving a residual <inline-formula><mml:math id="M250" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">r</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="bold-italic">B</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mi>m</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> that has a smaller
norm than a certain tolerance.</p>
      <p id="d1e6264">In a parallel application, each of the <inline-formula><mml:math id="M251" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula> iterations is marked out by a computational cost and a communication cost to calculate the matrix–vector
products in <inline-formula><mml:math id="M252" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϰ</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, since both the matrix and the vector are distributed across the processes. A further cost is the convergence test,
which is generally based on the Euclidean norm of the residual.
            <disp-formula id="Ch1.E18" content-type="numbered"><label>18</label><mml:math id="M253" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mtext>Convergence test</mml:mtext><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mfenced open="{" close=""><mml:mtable rowspacing="0.2ex" columnspacing="1em" class="cases" columnalign="left left" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mo>|</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">r</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>&lt;</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mtext>tol</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mtext>using  absolute  tolerance </mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mo>|</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">r</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:mo>|</mml:mo><mml:mi>B</mml:mi><mml:mo>|</mml:mo><mml:mo>≤</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>tol</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mtext>using  relative  tolerance</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mo>|</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">r</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>&gt;</mml:mo><mml:msub><mml:mi>d</mml:mi><mml:mtext>tol</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mtext>residual  is  larger  than</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow/></mml:mtd><mml:mtd><mml:mtext>divergence  tolerance</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mtext>iters</mml:mtext></mml:msub><mml:mo>≥</mml:mo><mml:msub><mml:mo>max⁡</mml:mo><mml:mtext>iters</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mtext>the  number  of  iterations</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow/></mml:mtd><mml:mtd><mml:mtext>exceeds  the  maximum</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow/></mml:mtd><mml:mtd><mml:mtext>number  of  iterations</mml:mtext></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e6435">The last two criteria are met when the method diverges.</p>
      <p id="d1e6438">The calculation of the norm involves global communication to enable all the processes to have the same norm value. Hence both point-to-point and
global communication burden each iteration, leading to a loss of efficiency for the parallel application if the number of necessary iterations is
high. The number of iterations depends on the physical problem and on its size. An estimate of the problem complexity is given by the condition number
<inline-formula><mml:math id="M254" display="inline"><mml:mrow><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which, for real symmetric matrices, is the ratio <inline-formula><mml:math id="M255" display="inline"><mml:mrow><mml:mo>max⁡</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="italic">λ</mml:mi><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mo>min⁡</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="italic">λ</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> between the maximum and minimum of the
eigenvalues <inline-formula><mml:math id="M256" display="inline"><mml:mi mathvariant="italic">λ</mml:mi></mml:math></inline-formula> of <inline-formula><mml:math id="M257" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula>. In general, the higher <inline-formula><mml:math id="M258" display="inline"><mml:mi>C</mml:mi></mml:math></inline-formula>, the more iterations are necessary. The number of iterations also depends on the
tolerance desired.</p>
      <p id="d1e6500">In the case of complex systems it is convenient to modify the original linear system defined in Eq. (<xref ref-type="disp-formula" rid="Ch1.E16"/>) to get a better
Krylov subspace using a further matrix <inline-formula><mml:math id="M259" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula>, called the preconditioner, to search for an approximate solution in the modified system:
            <disp-formula id="Ch1.E19" content-type="numbered"><label>19</label><mml:math id="M260" display="block"><mml:mrow><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold-italic">B</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M261" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>≈</mml:mo><mml:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> and is computed easily.</p>
      <p id="d1e6568">We used PETSc rather than implementing an internal parallel solver. In fact, PETSc was developed specifically to solve problems that arise from
partial differential equations on parallel architectures and provides a wide variety of solver/preconditioners that can be switched through a
namelist. In addition, the interface to PETSc is independent of the version, and its implementation is highly portable on heterogeneous architectures.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e6574">Example of domain decomposition between two MPI processes for SHYFEM-MPI and the PETSc library. Numbers represent the global (local) ID. Panels <bold>(c)</bold> and <bold>(b)</bold> represent the matrix A within PETSc and SHYFEM-MPI, respectively.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f05.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Figure}?><label>Figure 6</label><caption><p id="d1e6591">Data management related to the forcing files and restart files.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f06.png"/>

        </fig>

      <p id="d1e6600">The PETSc interface creates counterparts of <inline-formula><mml:math id="M262" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M263" display="inline"><mml:mi mathvariant="bold-italic">B</mml:mi></mml:math></inline-formula> as objects of the package. <inline-formula><mml:math id="M264" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is created as a sparse matrix in
coordinate format (row, column, value) using the global ID (see Fig. <xref ref-type="fig" rid="Ch1.F5"/>) of the nodes. This is in order to have the same
non-zero pattern as the sequential case, regardless of the way the domain is decomposed. The same global ID is used to build the right-hand side
<inline-formula><mml:math id="M265" display="inline"><mml:mi mathvariant="bold-italic">B</mml:mi></mml:math></inline-formula>.</p>
      <p id="d1e6633">To solve the free surface in SHYFEM-MPI, we used the flexible biconjugate gradient stabilized method (FBCGSR) with incomplete lower–upper (iLU) factorization
as a preconditioner. We set absolute and relative tolerance to <inline-formula><mml:math id="M266" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M267" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">15</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, respectively. Divergence tolerance and maximum iterations
are set to default values (both <inline-formula><mml:math id="M268" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>).</p>
      <p id="d1e6675">The PETSc library uses a parallel algorithm to solve the linear equations. The decomposition used inside PETSc is different from the domain
decomposition used in SHYFEM-MPI (see Fig. <xref ref-type="fig" rid="Ch1.F5"/>). PETSc divides the matrix <inline-formula><mml:math id="M269" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> in ascending order with the global
ID.  The SHYFEM-MPI partitioning is based on criteria that take into account the geometry of the mesh and is, at any rate, different from PETSc.  For
this reason, after the approximate solution for <inline-formula><mml:math id="M270" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> has been found by PETSc, the solution vector is gathered by the master process and is
redistributed across the MPI processes. The time needed to exchange data between the PETSc representation and the model has been estimated to range from 1 % with a low number of cores used up to 10 % of the overall execution time.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7" specific-use="star"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e6706">Domain of the SANIFS configuration. The model mesh is superimposed over bathymetry.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f07.png"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS4">
  <label>4.4</label><title>I/O management</title>
      <p id="d1e6723">I/O management usually represents a bottleneck in a parallel application. To avoid this, input and output files should be concurrently accessed by the
parallel processes, and each process should load its own data. However, loading the whole file for each process would affect memory scalability. In
fact, the allocated memory should be independent of the number of parallel processes in order to ensure the memory scalability of the code. The two
issues can be addressed by distributing the I/O operations among the parallel processes.  During the initialization phase, SHYFEM needs to read two
files: the basin geometry and the namelist. All the MPI processes perform the same operation and store common information. This phase is not scalable
because each process browses the files. However, this operation is only performed once and has a limited impact on the total execution time. As a
second step, initial conditions and forcing (both lateral and surface) are accessed by all the parallel processes, but each one reads its own portion
of data, as shown in Fig. <xref ref-type="fig" rid="Ch1.F6"/>. Surface atmospheric forcing is defined on a structured grid, so after reading the forcing file, each
process interpolates the data on the unstructured grid used by the model.  The output can be written using external parallel libraries capable of
handling parallel I/O. In this regard, we are evaluating the adoption of efficient external libraries to enhance the I/O for the next version of the
model code. Among the suitable I/O libraries we mention here XIOS, PIO, SCORPIO or ADIOS.  A check-pointing mechanism was implemented in the parallel
version of the model. This is usual when the simulation is divided into dependent chunks in order to maintain the status. Both phases
(reading/writing) are performed in a distributed way among the processes to reduce the impact on the parallel speedup of the model, as shown in
Fig. <xref ref-type="fig" rid="Ch1.F6"/>. Each process generates its own restart file related to its sub-domain and reads its own restart file.</p><?xmltex \hack{\newpage}?>
</sec>
</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Results</title>
      <p id="d1e6740">We ran our experiments to assess the correctness of MPI implementation on the Southern Adriatic Northern Ionian coastal Forecasting System (SANIFS)
configuration, which has a horizontal resolution of 500 <inline-formula><mml:math id="M271" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula> near the coast of up to 3–4 <inline-formula><mml:math id="M272" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> in open waters. The total number of grid
elements is 176 331.  Vertical resolution is 2 <inline-formula><mml:math id="M273" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula> near the surface stepwise increasing towards the sea bottom, dividing the water column into
80 layers. For details of the model grid and the system settings, see <xref ref-type="bibr" rid="bib1.bibx18" id="text.53"/>.</p>
      <p id="d1e6770">Runs are initialized with the motionless velocity field and with temperature and salinity fields from CMEMS NRT products <xref ref-type="bibr" rid="bib1.bibx13" id="paren.54"/>. The
simulations are forced hourly at lateral boundaries with water level fields, total velocities and active tracers from the same products.</p>
      <p id="d1e6776"><?xmltex \hack{\newpage}?>The sea level is imposed with a Dirichlet condition, while relaxation is applied to the parent model total velocities with a relaxation time of
1 <inline-formula><mml:math id="M274" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">h</mml:mi></mml:mrow></mml:math></inline-formula>. For scalars, the inner values are advected outside the domain when the flow is outwards, while a Dirichlet condition is applied for
inflows.</p>
      <p id="d1e6788">The boundary conditions for the upper surface follow the MFS bulk formulation <xref ref-type="bibr" rid="bib1.bibx46" id="paren.55"/>, which requires wind, cloud cover, air and dew
point temperature, available in ECMWF analysis, with a temporal/spatial resolution of 6 <inline-formula><mml:math id="M275" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">h</mml:mi></mml:mrow></mml:math></inline-formula>/0.125<inline-formula><mml:math id="M276" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula>​​​​​​​, respectively. From the same
analysis, we force the surface with precipitation data.</p>
      <p id="d1e6812">We select an upwind scheme for both horizontal and vertical tracer advections. The formulation of bottom stress is quadratic. The time stepping for
the hydrodynamics is semi-implicit with <inline-formula><mml:math id="M277" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.6</mml:mn></mml:mrow></mml:math></inline-formula>. Horizontal viscosity/diffusivity follows the formulation of
<xref ref-type="bibr" rid="bib1.bibx50" id="text.56"/>. Turbulent viscosity/diffusivity is set to a constant value equal to 10<inline-formula><mml:math id="M278" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> <inline-formula><mml:math id="M279" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e6866">The cold start implies strong baroclinic gradients. To prevent instabilities, we select a relatively small time step, set to <inline-formula><mml:math id="M280" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M281" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 15 <inline-formula><mml:math id="M282" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
<sec id="Ch1.S5.SS1">
  <label>5.1</label><title>SHYFEM-MPI model validation</title>
      <p id="d1e6901">The round-off error, given by the representation of floating point numbers, affects all the scientific applications based on numerical solutions
including general circulation models (GCMs). The computational error, such as the round-off error, is present also in the sequential version of all
numerical models. The round-off error is the main reason why when the same sequential code is executed on different computational architectures or it
is executed with different compiler options or with different compilers, the outputs are not bit-to-bit identical. Moreover, only changing the order
of the evaluation of the elements in the domain using the sequential version of SHYFEM we obtain outputs which are not bit-to-bit identical. The
parallel implementation through MPI inherently leads to a different order in the evaluation of elements and hence a different order in the floating
point operations. Although we can force the MPI version to execute the floating point operations in the same order of the sequential version and then
the parallel model results are the same as those of the serial model, we cannot guarantee that the results of the serial model have no uncertainty
because the serial model also contains the round-off error.  <xref ref-type="bibr" rid="bib1.bibx14" id="text.57"/> developed the parallel version of the Princeton Ocean Model (POM) and
found that there is a significant difference between the serial and parallel version of the POM, concluding that the error from the data communication
process via MPI is the main reason for the difference. <xref ref-type="bibr" rid="bib1.bibx60" id="text.58"/> studied the results of the atmospheric model SAMIL simulated with different
CPUs and pointed out that the difference is chiefly caused by the round-off error. <xref ref-type="bibr" rid="bib1.bibx51" id="text.59"/> assessed the round-off error impact, due to
MPI, on the parallel implementation of the Community Climate System Model (CCSM3). <xref ref-type="bibr" rid="bib1.bibx27" id="text.60"/> presented the evaluation of the reproducibility
of the HadGEM3-GC3.1 model on different HPC platforms. <xref ref-type="bibr" rid="bib1.bibx24" id="text.61"/> assessed the limit of reproducibility of the COSMO-CLM5.0 model comparing the same
code executed on different computational architectures. Their analysis showed that the simulation results are dependent on the computational
environments and the magnitude of uncertainty due to the parallel computational error could be in the same order as that of natural variations in the
climate system.</p>
      <p id="d1e6919">The parallel implementation of the SHYFEM model was validated to assess the reproducibility of the results when varying the size of the domain
decomposition and the number of parallel cores used for a simulation. Our baseline was the results from a sequential run, and we compared the results
with those obtained with parallel simulations on 36, 72, 108 and 216 cores. The parallel architecture used for the tests is named Zeus and is available
at the CMCC Supercomputing Center. Zeus is a parallel machine equipped with 348 parallel nodes interconnected with an Infiniband EDR
(100 <inline-formula><mml:math id="M283" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Gbps</mml:mi></mml:mrow></mml:math></inline-formula>) switch. Each node has two Intel Xeon Gold 6154 (18 cores) CPUs and 96 <inline-formula><mml:math id="M284" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">GB</mml:mi></mml:mrow></mml:math></inline-formula> of main memory.</p>
      <p id="d1e6938">The results were compared with a 1 d simulation, saving the outputs every hour (the model executes 5760 time steps) and referring to the data from
the native grid. Only the most significative fields were taken into account for comparison: temperature, salinity, sea surface high and zonal
velocity.  In order to evaluate the differences between the parallel execution with respect to the results obtained with a sequential run, we used the
root mean square error as a metric:
            <disp-formula id="Ch1.Ex1"><mml:math id="M285" display="block"><mml:mrow><mml:mtext>RMSE</mml:mtext><mml:mo>(</mml:mo><mml:mi>X</mml:mi><mml:mo>,</mml:mo><mml:mi>Y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msqrt><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>∑</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>X</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfenced></mml:mrow><mml:mi>N</mml:mi></mml:mfrac></mml:mstyle></mml:msqrt><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e6997">RMSE time series of SHYFEM-MPI outputs compared with the sequential run for all the prognostic fields and with different numbers of cores: 36, 72, 108 and 216.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f08.png"/>

        </fig>

      <p id="d1e7006">As a result, we computed the RMSE for each domain decomposition, for each aforementioned field and for each time step saved in the output files
(hourly), as shown in Fig. <xref ref-type="fig" rid="Ch1.F8"/>. The RMSE time series were calculated using NCOoperators applied to the output on the native
SHYFEM-MPI grid considering all the active cells in the domain.</p>
      <p id="d1e7011">The time series of all the MPI decompositions overlap, which means that the program can reproduce the sequential result close to machine precision. The
time series of the sea surface height (SSH) are noisy, but the RMSE remains steady and of the order of <inline-formula><mml:math id="M286" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">13</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.  The SHYFEM-MPI model is not bit-to-bit reproducible for
two main reasons. The field values computed on the grid nodes belonging to the border between two domains are computed first by the two processes
independently, taking into account only the node neighbors in the local domain, thus giving a partial value. The partial values are then exchanged
between the two processes, and the final value is computed with a sum of the partial values. The order of the floating point operations, executed on
the grid nodes at the border, thus changes when the domain decomposition changes, creating a numerical difference between two simulations that use a
different number of cores. In fact, the floating point operations lose their associative property due to the approximate representation of the numbers
<xref ref-type="bibr" rid="bib1.bibx25" id="paren.62"/>. The second source of non bit-to-bit reproducibility is due to the optimized implementation of the PETSc numerical library, which
makes use of non-blocking MPI communications. This, in turn, creates a non-deterministic order in the execution of the floating point operations,
which generates a numerical difference even between two different executions of the same configuration with the same domain decomposition and the same
number of cores.</p>
      <p id="d1e7031">To further assess the impact of the round-off error induced by the use of PETSc solver, we ran the same configuration five times with the same number
of cores. Again we used the RMSE as a metric to quantify the differences between four simulations with respect to the first one, which was taken as
reference. Figure <xref ref-type="fig" rid="Ch1.F9"/> shows the RMSE time series of the simulations executed with 72 cores.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F9" specific-use="star"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e7038">RMSE evaluated for code reproducibility with 72 MPI processes.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f09.png"/>

        </fig>

      <p id="d1e7048">Although the SHYFEM-MPI implementation is not bit-to-bit reproducible, the RMSE time series show that for each of the model variables, the deviations
of the runs from the reference run remain close to the machine precision, with no effect on the reproducibility of the solution of the physical
problem. We implemented a perfect reproducible version of the model by including a halo over the elements shared between the neighboring
processes. This version can be obtained using the DEBUGON compiler key while compiling the code. This ensures that the order of the floating point
operations is kept the same and forces the PETSc solver for sequential use. However, this version is only for debugging and is beyond the scope of
this work.  Moreover, we tested the restartability of the code comparing the results obtained from a run, a.k.a. the long run, simulating 1 d, but
writing the restart files after 12 <inline-formula><mml:math id="M287" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">h</mml:mi></mml:mrow></mml:math></inline-formula> and running a short run, simulating a half-day, starting from the restart files produced by the long run. The
outputs of both simulations are bit-to-bit identical. For this experiment we used the model compiled in reproducible mode.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F10" specific-use="star"><?xmltex \currentcnt{10}?><?xmltex \def\figurename{Figure}?><label>Figure 10</label><caption><p id="d1e7061">Execution time in a log–log plot of different solvers available in the PETSc library.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f10.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F11" specific-use="star"><?xmltex \currentcnt{11}?><?xmltex \def\figurename{Figure}?><label>Figure 11</label><caption><p id="d1e7072">SANIFS execution time in a log–log plot of three settings of the code: efficient MPI version of the code including I/O; efficient MPI version of the code without I/O; debug version of the code which reproduces bit-to-bit identical output of the sequential version.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f11.png"/>

        </fig>

</sec>
<sec id="Ch1.S5.SS2">
  <label>5.2</label><title>SHYFEM-MPI performance assessment</title>
      <p id="d1e7089">The parallel scalability of the SHYFEM-MPI model was evaluated on Zeus parallel architecture. The SANIFS configuration was simulated for 7 d
and the number of cores varied up to 288, which corresponds to eight nodes of the Zeus supercomputer (each node is equipped with 36 cores).</p>
      <p id="d1e7092">The SHYFEM-MPI implementation relies on the PETSc numerical library, which provides a wide range of numerical solvers. As a preliminary evaluation, we
compared the computational performance of the following solvers: the generalized minimal residual (GMRES) method, the improved biconjugate gradient stabilized method (IBCGS), the flexible biconjugate gradient stabilized (FBCGSR) method and the biconjugate gradient stabilized method (BCGS). The pipelined solvers available in the PETSc library aim at hiding network latencies and synchronizations which can become computational bottlenecks in Krylov methods. Among the available
pipelined solvers we tested pipelined variant of the biconjugate gradient stabilized method (PIPEBGCS) and the pipelined variant of the generalized
minimal residual method (PIPEBCGS). The former method diverges after a few iterations; it was necessary to increase the tolerances by 4 orders of magnitude
in order to use it, and it did not lead to improvements. The latter instead had a worse scalability than the BCGS method used initially. Finally, we
experimented with the use of the free-matrix approach also available in the PETSc library, which does not require explicit storage of the matrix, for the
numerical solution of partial differential equations. The results reported in Fig. <xref ref-type="fig" rid="Ch1.F10"/> show that the FBCGSR solver performs
better.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3" specific-use="star"><?xmltex \currentcnt{3}?><label>Table 3</label><caption><p id="d1e7100">Execution time when scaling the number of computational cores of the efficient MPI version of the model with and without I/O and of the debug version of the code. Time is expressed in seconds.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="7">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:colspec colnum="7" colname="col7" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">​​​​​​​N. cores</oasis:entry>
         <oasis:entry colname="col2">1</oasis:entry>
         <oasis:entry colname="col3">36</oasis:entry>
         <oasis:entry colname="col4">72</oasis:entry>
         <oasis:entry colname="col5">144</oasis:entry>
         <oasis:entry colname="col6">216</oasis:entry>
         <oasis:entry colname="col7">288</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Efficient version with I/O</oasis:entry>
         <oasis:entry colname="col2">26 048.03</oasis:entry>
         <oasis:entry colname="col3">1107.77</oasis:entry>
         <oasis:entry colname="col4">624.95</oasis:entry>
         <oasis:entry colname="col5">328.21</oasis:entry>
         <oasis:entry colname="col6">263.91</oasis:entry>
         <oasis:entry colname="col7">238.67</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Efficient version without I/O</oasis:entry>
         <oasis:entry colname="col2">25 281.33</oasis:entry>
         <oasis:entry colname="col3">1043.77</oasis:entry>
         <oasis:entry colname="col4">573.85</oasis:entry>
         <oasis:entry colname="col5">310.23</oasis:entry>
         <oasis:entry colname="col6">233.57</oasis:entry>
         <oasis:entry colname="col7">208.39</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Debug version</oasis:entry>
         <oasis:entry colname="col2">26 049.53</oasis:entry>
         <oasis:entry colname="col3">1565.96</oasis:entry>
         <oasis:entry colname="col4">1114.94</oasis:entry>
         <oasis:entry colname="col5">927.41</oasis:entry>
         <oasis:entry colname="col6">840.28</oasis:entry>
         <oasis:entry colname="col7">816.08</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e7230">To assess the decoupled effect of the I/O and computational performance of the model, we ran the model with the configuration that does not write the
output, so that the MPI implementation can be clearly assessed. Since I/O can be affected by its way of implementation in the model and the
architecture of the underlying system (number of I/O nodes, their interconnection, number of MDS and OSS servers, RAID configuration, and the parallel
file system used) it would be hard to assess the effect of the I/O in the benchmark results and could add extra uncertainty to the performance measurements
and results.</p>
      <p id="d1e7233">We hence evaluated the model with the SANIFS configuration including the effect of I/O to provide an insight into the model performance when a realistic
configuration is used. Finally we measured the speedup of the debug version of the model, which provides the bit-to-bit identical outputs of the
sequential version. Figure <xref ref-type="fig" rid="Ch1.F11"/> shows a comparison of the total execution time in a log–log plot where the parallel
scalability can also be evaluated. In fact, the behavior of an ideal scalability results in a straight line in the log–log plot. The labels
associated with each point in the plot represent the parallel efficiency. The efficiency drops below 40 % with 288 cores, which can thus be
regarded as the scalability bound of the model for the SANIFS configuration.</p>
      <p id="d1e7238">In Table <xref ref-type="table" rid="Ch1.T3"/> we report the detailed execution times of the computational performance benchmarks.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F12" specific-use="star"><?xmltex \currentcnt{12}?><?xmltex \def\figurename{Figure}?><label>Figure 12</label><caption><p id="d1e7245">SANIFS detailed execution time for different processing phases.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f12.png"/>

        </fig>

      <p id="d1e7254">Deeper insights into the performances are provided in Fig. <xref ref-type="fig" rid="Ch1.F12"/>, which reports the execution time for different processing steps of
the model.  The execution time was partitioned between the routines to evaluate the momentum equation, advection/diffusion equation, sea level
equation (which involves the PETSc solver), the MPI communication time and the I/O. The results demonstrate a very good scalability for the momentum
and tracer processing steps, while the sea level computation which involves the numerical solver does not scale as well as the other parts of the
model. The communication time also includes the idle time required for waiting for the slowest process to reach the communication call. The idle time
can be reduced by enhancing the work load balance among the processes. Although the time spent for I/O is completely unscalable, it is not a limiting
factor in this experiment since it is 2 orders of magnitude smaller than the other processing steps.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F13" specific-use="star"><?xmltex \currentcnt{13}?><?xmltex \def\figurename{Figure}?><label>Figure 13</label><caption><p id="d1e7262">SANIFS processing ratio among the computing phases.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f13.png"/>

        </fig>

      <p id="d1e7271">Figure <xref ref-type="fig" rid="Ch1.F13"/> shows the ratio in the execution time of the model's processing steps. The evaluation of the momentum equation and
the advection/diffusion equation take most of the execution time in the sequential run. Increasing the MPI processes, the ratios among these
components change, and the communication cost becomes an increasing burden on the total execution time.</p>
      <p id="d1e7276">Finally, we measured the memory footprint of the model varying the number of processors. Figure <xref ref-type="fig" rid="Ch1.F14"/> reports the memory allocation per
node when the model is executed on one node up to eight nodes. The results show a good memory scalability. The labels on each point represent the allocated
memory per node expressed in megabytes.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F14" specific-use="star"><?xmltex \currentcnt{14}?><?xmltex \def\figurename{Figure}?><label>Figure 14</label><caption><p id="d1e7283">SANIFS memory usage with different number of computing nodes. The labels on the points refer to the memory per node expressed in MB.</p></caption>
          <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f14.png"/>

        </fig>

      <p id="d1e7292">To conclude, the free surface equation part of the code needs to be better investigated for a more efficient parallelization. Among the investigations
we started to evaluate the use of high-level numerical libraries such as Trilinos and Hypre and the exploitation of the DMPlex module available in the
PETSc package to efficiently handle the unstructured grids. The execution time reported for the free surface solver includes the assembly of the
linear system, the communication time of the internal routines of PETSc for each of the solver iterations and the communication needed to
redistribute the solution onto the model grid. The effects of a non-optimal model mesh partitioning on the solver efficiency have not yet been
assessed. Moreover, a more efficient partition algorithm should be adopted to reduce the idle time and to improve the load balancing.</p>
</sec>
</sec>
<sec id="Ch1.S6" sec-type="conclusions">
  <label>6</label><title>Conclusions</title>
      <p id="d1e7304">The hydrodynamical core of SHYFEM is parallelized with a distributed memory strategy, allowing for both calculation and memory scalability. The
implementation of the parallel version includes external libraries for domain partitioning and the solution of the free surface equation. The parallel
code was validated using a realistic configuration as a benchmark.  The optimized version of the parallel model does not reproduce the output of the
sequential code bit to bit but reproduces the physics of the problem without significant differences with respect to the sequential run. The source
of these differences was considered for different orders of operations in each of the domain decompositions. Forcing the code to exactly reproduce the
order of the operation in the sequential code was found to lead to a dramatic loss of efficiency and was therefore not considered in this work.</p>
      <p id="d1e7307">Our assessment reveals that the limit of scalability in the parallel code is reached at 288 MPI cores, when the parallel efficiency drops below
40 %. The analysis of the parallel performance indicates that with a high level of MPI processes used, the burden of communication and the cost of
solving the free surface equation take up a huge proportion of the single model time step. The workload balance needs to be improved, with a more
suitable solution for domain partitioning. The parallel code, however, enables one of the main tasks of this work to be accomplished, namely to obtain
the results of the simulation in a time that is reasonable and significantly faster than the sequential case. The benchmark has demonstrated that the
execution time is reduced from nearly 8 h for the sequential run to less than 4 min with 288 MPI cores.</p>
</sec>

      
      </body>
    <back><app-group>

<app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>Linear shape functions</title>
      <p id="d1e7321">A continuous function <inline-formula><mml:math id="M288" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> in the 2D space can be represented in a discrete mesh as a linear combination of base functions <inline-formula><mml:math id="M289" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>:
          <disp-formula id="App1.Ch1.S1.E20" content-type="numbered"><label>A1</label><mml:math id="M290" display="block"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M291" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> denote the coefficients of the functions that approximate <inline-formula><mml:math id="M292" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula>. In the context of SHYFEM, <inline-formula><mml:math id="M293" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula> functions are node-referenced linear
functions that overlap only in elements in common between adjacent nodes. In particular, the shape function of a node <inline-formula><mml:math id="M294" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> is 1 on <inline-formula><mml:math id="M295" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M296" display="inline"><mml:mn mathvariant="normal">0</mml:mn></mml:math></inline-formula> on the
others (see Fig. <xref ref-type="fig" rid="App1.Ch1.S1.F15"/>).</p>

      <?xmltex \floatpos{t}?><fig id="App1.Ch1.S1.F15"><?xmltex \currentcnt{A1}?><?xmltex \def\figurename{Figure}?><label>Figure A1</label><caption><p id="d1e7452">Shape function of node <inline-formula><mml:math id="M297" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. The function is 1 in <inline-formula><mml:math id="M298" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and 0 in all the other nodes. <inline-formula><mml:math id="M299" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> overlaps only with the shape functions associated with neighboring nodes.</p></caption>
        <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f15.png"/>

      </fig>

      <p id="d1e7508">Considering an element <inline-formula><mml:math id="M300" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> with its three nodes (<inline-formula><mml:math id="M301" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M302" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M303" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) of coordinates (<inline-formula><mml:math id="M304" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>,<inline-formula><mml:math id="M305" display="inline"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>), (<inline-formula><mml:math id="M306" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>,<inline-formula><mml:math id="M307" display="inline"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>), (<inline-formula><mml:math id="M308" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>,<inline-formula><mml:math id="M309" display="inline"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) with the corresponding
values (<inline-formula><mml:math id="M310" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M311" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M312" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>) of <inline-formula><mml:math id="M313" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> we are interested in the gradient of <inline-formula><mml:math id="M314" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> within the element <inline-formula><mml:math id="M315" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula>. We consider the shape functions that overlap in
this element as <inline-formula><mml:math id="M316" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M317" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M318" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (see Fig. <xref ref-type="fig" rid="App1.Ch1.S1.F16"/>) with the following constraints:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M319" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E21"><mml:mtd><mml:mtext>A2</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</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>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E22"><mml:mtd><mml:mtext>A3</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E23"><mml:mtd><mml:mtext>A4</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e8047">The shape functions satisfy the following relations:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M320" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E24"><mml:mtd><mml:mtext>A5</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E25"><mml:mtd><mml:mtext>A6</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E26"><mml:mtd><mml:mtext>A7</mml:mtext></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 mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          which can be written in matrix form,
          <disp-formula id="App1.Ch1.S1.E27" content-type="numbered"><label>A8</label><mml:math id="M321" display="block"><mml:mrow><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>x</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>y</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        or in compact form:
          <disp-formula id="App1.Ch1.S1.E28" content-type="numbered"><label>A9</label><mml:math id="M322" display="block"><mml:mrow><mml:mi>A</mml:mi><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>x</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>y</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e8459">The shape functions are calculated by inverting the system (Eq. <xref ref-type="disp-formula" rid="App1.Ch1.S1.E28"/>). Here we report the expression of shape functions of the <inline-formula><mml:math id="M323" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> nodes in
the element <inline-formula><mml:math id="M324" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> (see Fig. <xref ref-type="fig" rid="App1.Ch1.S1.F16"/>),

              <disp-formula specific-use="gather" content-type="numbered"><mml:math id="M325" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E29"><mml:mtd><mml:mtext>A10</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>[</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>y</mml:mi><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E30"><mml:mtd><mml:mtext>A11</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>[</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>y</mml:mi><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E31"><mml:mtd><mml:mtext>A12</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>[</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi>y</mml:mi><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          and their derivatives:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M326" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E32"><mml:mtd><mml:mtext>A13</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtext>,</mml:mtext><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E33"><mml:mtd><mml:mtext>A14</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtext>,</mml:mtext><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E34"><mml:mtd><mml:mtext>A15</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mtext>,</mml:mtext><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>A</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula></p>

      <?xmltex \floatpos{t}?><fig id="App1.Ch1.S1.F16" specific-use="star"><?xmltex \currentcnt{A2}?><?xmltex \def\figurename{Figure}?><label>Figure A2</label><caption><p id="d1e9163">Shape functions overlapping in the element <inline-formula><mml:math id="M327" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula>.</p></caption>
        <?xmltex \igopts{width=426.791339pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f16.png"/>

      </fig>

</app>

<app id="App1.Ch1.S2">
  <?xmltex \currentcnt{B}?><label>Appendix B</label><title>Vertical viscosity operator</title>
      <p id="d1e9187">The integration of vertical viscosity term <inline-formula><mml:math id="M328" display="inline"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mo>∂</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>(</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> in the momentum equation over a
generic layer <inline-formula><mml:math id="M329" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> as in Fig. <xref ref-type="fig" rid="App1.Ch1.S2.F17"/> leads to
          <disp-formula id="App1.Ch1.S2.E35" content-type="numbered"><label>B1</label><mml:math id="M330" display="block"><mml:mrow><mml:munderover><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mo>∂</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">(</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">)</mml:mo><mml:mi mathvariant="normal">d</mml:mi><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e9346">The stresses are discretized with centered differences:
          <disp-formula id="App1.Ch1.S2.E36" content-type="numbered"><label>B2</label><mml:math id="M331" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mspace linebreak="nobreak" width="0.25em"/><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e9530">Grouping the velocities by layer and using the identity <inline-formula><mml:math id="M332" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, we write the difference of stresses as a vertical viscosity
operator <inline-formula><mml:math id="M333" display="inline"><mml:mrow><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> applied to the velocity integrated in the layer <inline-formula><mml:math id="M334" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> appearing in Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>):
          <disp-formula id="App1.Ch1.S2.E37" content-type="numbered"><label>B3</label><mml:math id="M335" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo mathsize="2.0em">|</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">[</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="2.0em">]</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>≡</mml:mo><mml:msub><mml:mi>D</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold-italic">U</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>

      <?xmltex \floatpos{h!}?><fig id="App1.Ch1.S2.F17"><?xmltex \currentcnt{B1}?><?xmltex \def\figurename{Figure}?><label>Figure B1</label><caption><p id="d1e9880">Distribution of variables in three generic layers: <inline-formula><mml:math id="M336" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M337" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M338" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
        <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/6025/2022/gmd-15-6025-2022-f17.png"/>

      </fig>

</app>
  </app-group><notes notes-type="codeavailability"><title>Code availability</title>

      <p id="d1e9924">The code of the parallel version of SHYFEM is available at <uri>https://doi.org/10.5281/zenodo.5596734</uri>, and it is citable with the following DOI: 10.5281/zenodo.5596734 <xref ref-type="bibr" rid="bib1.bibx41" id="paren.63"/>.​​​​​​​</p>
  </notes><notes notes-type="dataavailability"><title>Data availability</title>

      <p id="d1e9936">The input dataset used for the SANIFS configuration is available at <ext-link xlink:href="https://doi.org/10.5281/zenodo.6907575" ext-link-type="DOI">10.5281/zenodo.6907575</ext-link> <xref ref-type="bibr" rid="bib1.bibx5" id="paren.64"/>.</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e9948">NP, GA, PS and GC formulated the research goals; SM, IE, GM and IB designed the parallel algorithm; GM and SM developed software for the parallel algorithm; IB, IF and NP validated the parallel model and conducted the formal analysis; GM and IB performed the computational experiments; GA, PS and NP provided the computational resources; GM, SM and IB wrote the first draft of the paper; IB and IF provided the data visualization; GM, SM and IE assessed the computational performance; IF, GV and IB contributed to the code tracking of the model equations; NP, GA, PS and GC supervised the research; all the authors contributed to writing and revising the paper.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e9954">The contact author has declared that neither they nor their co-authors have any competing interests.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d1e9961">Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e9967">This work was part of the Strategic project no. 4 “A multihazard prediction and analysis test bed for the global coastal ocean” of CMCC.</p></ack><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e9972">This paper was edited by Simone Marras and reviewed by Ufuk Utku Turuncoglu and one anonymous referee.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Bajo et~al.(2014)Bajo, Ferrarin, Dinu, Umgiesser, and Stanica}}?><label>Bajo et al.(2014)Bajo, Ferrarin, Dinu, Umgiesser, and Stanica</label><?label Bajo201462?><mixed-citation>
Bajo, M., Ferrarin, C., Dinu, I., Umgiesser, G., and Stanica, A.:
The water circulation near the danube delta and the romanian coast modelled with finite elements, Cont. Shelf Res., 78, 62–74, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Balay et~al.(1997)Balay, Gropp, McInnes, and Smith}}?><label>Balay et al.(1997)Balay, Gropp, McInnes, and Smith</label><?label petsc-efficient?><mixed-citation>Balay, S., Gropp, W. D., McInnes, L. C., and Smith, B. F.:
Efficient Management of Parallelism in Object Oriented Numerical Software Libraries, in: Modern Software Tools in Scientific Computing, edited by: Arge, E., Bruaset, A. M., and Langtangen, H. P., Birkhäuser Press, 163–202, <ext-link xlink:href="https://doi.org/10.1007/978-1-4612-1986-6_8" ext-link-type="DOI">10.1007/978-1-4612-1986-6_8</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Balay et~al.(2020)Balay, Abhyankar, Adams, Brown, Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik, Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and Zhang}}?><label>Balay et al.(2020)Balay, Abhyankar, Adams, Brown, Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik, Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and Zhang</label><?label petsc-user-ref?><mixed-citation>Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D., Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp, K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.:
PETSc Users Manual, Tech. Rep. ANL-95/11 – Revision 3.13, Argonne National Laboratory, <uri>https://www.mcs.anl.gov/petsc</uri> (last access: June 2022), 2020.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Balay et~al.(2021)Balay, Abhyankar, Adams, Benson, Brown, Brune, Buschelman, Constantinescu, Dalcin, Dener, Eijkhout, Gropp, Hapla, Isaac, Jolivet, Karpeev, Kaushik, Knepley, Kong, Kruger, May, McInnes, Mills, Mitchell, Munson, Roman, Rupp, Sanan, Sarich, Smith, Zampini, Zhang, Zhang, and Zhang}}?><label>Balay et al.(2021)Balay, Abhyankar, Adams, Benson, Brown, Brune, Buschelman, Constantinescu, Dalcin, Dener, Eijkhout, Gropp, Hapla, Isaac, Jolivet, Karpeev, Kaushik, Knepley, Kong, Kruger, May, McInnes, Mills, Mitchell, Munson, Roman, Rupp, Sanan, Sarich, Smith, Zampini, Zhang, Zhang, and Zhang</label><?label petsc-web-page?><mixed-citation>Balay, S., Abhyankar, S., Adams, M. F., Benson, S., Brown, J., Brune, P., Buschelman, K., Constantinescu, E. M., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Hapla, V., Isaac, T., Jolivet, P., Karpeev, D., Kaushik, D., Knepley, M. G., Kong, F., Kruger, S., May, D. A., McInnes, L. C., Mills, R. T., Mitchell, L., Munson, T., Roman, J. E., Rupp, K., Sanan, P., Sarich, J., Smith, B. F., Zampini, S., Zhang, H., Zhang, H., and Zhang, J.:
PETSc Web page,  Argonne National Laboratory, <uri>https://petsc.org/</uri> (last access: June 2022), 2021.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{Barletta et~al.(2022)}?><label>Barletta et al.(2022)</label><?label Barletta2022?><mixed-citation>Barletta, I., Federico, I., Verri, G., Coppini, G., and Pinardi, N.: Input dataset for SANIFS configuration, Zenodo [data set], <ext-link xlink:href="https://doi.org/10.5281/zenodo.6907575" ext-link-type="DOI">10.5281/zenodo.6907575</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Bellafiore and Umgiesser(2010)}}?><label>Bellafiore and Umgiesser(2010)</label><?label Bellafiore2010255?><mixed-citation>
Bellafiore, D. and Umgiesser, G.:
Hydrodynamic coastal processes in the North Adriatic investigated with a 3D finite element model, Ocean Dynam., 60, 255–273, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Blumberg and Mellor(1987)}}?><label>Blumberg and Mellor(1987)</label><?label blumberg1987?><mixed-citation>
Blumberg, A. F. and Mellor, G. L.:
A Description of a Three-Dimensional Coastal Ocean Circulation Model, in: Three‐Dimensional Coastal Ocean Models, edited by: Heaps, N. S., American Geophysical Union (AGU),  1–16, 1987.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Burchard and Petersen(1999)}}?><label>Burchard and Petersen(1999)</label><?label Burchard199929?><mixed-citation>
Burchard, H. and Petersen, O.:
Models of turbulence in the marine environment – A comparative study of two-equation turbulence models, J. Marine Syst., 21, 29–53, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{Campin et~al.(2004)Campin, Adcroft, Hill, and Marshall}}?><label>Campin et al.(2004)Campin, Adcroft, Hill, and Marshall</label><?label Campin2004221?><mixed-citation>
Campin, J.-M., Adcroft, A., Hill, C., and Marshall, J.:
Conservation of properties in a free-surface model, Ocean Model., 6, 221–244, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Casulli and Walters(2000)}}?><label>Casulli and Walters(2000)</label><?label casulli2000?><mixed-citation>Casulli, V. and Walters, R. A.:
An unstructured grid, three-dimensional model based on the shallow water equations, Int. J. Numer. Meth. Fl., 32, 331–348, <ext-link xlink:href="https://doi.org/10.1002/(SICI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C">https://doi.org/10.1002/(SI</ext-link><?xmltex \hack{\break}?><ext-link xlink:href="https://doi.org/10.1002/(SICI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C">CI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C</ext-link>, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Chen et~al.(2003)Chen, Liu, and Beardsley}}?><label>Chen et al.(2003)Chen, Liu, and Beardsley</label><?label chen2003?><mixed-citation>Chen, C., Liu, H., and Beardsley, R. C.:
An Unstructured Grid, Finite-Volume, Three-Dimensional, Primitive Equations Ocean Model: Application to Coastal Ocean and Estuaries, J. Atmos. Ocean. Tech., 20, 159–186, <ext-link xlink:href="https://doi.org/10.1175/1520-0426(2003)020&lt;0159:AUGFVT&gt;2.0.CO;2" ext-link-type="DOI">10.1175/1520-0426(2003)020&lt;0159:AUGFVT&gt;2.0.CO;2</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Chevalier and Pellegrini(2008)}}?><label>Chevalier and Pellegrini(2008)</label><?label CHEVALIER2008318?><mixed-citation>Chevalier, C. and Pellegrini, F.:
PT-Scotch: A tool for efficient parallel graph ordering, Parallel Comput., 34, 318–331, <ext-link xlink:href="https://doi.org/10.1016/j.parco.2007.12.001" ext-link-type="DOI">10.1016/j.parco.2007.12.001</ext-link>, Parallel Matrix Algorithms and Applications, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Clementi et~al.(2019)Clementi, Pistoia, Escudier, Delrosso, Drudi, Grandi, R., S., S., G., S., and Pinardi}}?><label>Clementi et al.(2019)Clementi, Pistoia, Escudier, Delrosso, Drudi, Grandi, R., S., S., G., S., and Pinardi</label><?label clementi2019?><mixed-citation>Clementi, E., Pistoia, J., Escudier, R., Delrosso, D., Drudi, M., Grandi, A., Lecci R., Creti' S., Ciliberti S., Coppini G., Masina S., and Pinardi, N.:
Mediterranean Sea Analysis and Forecast (CMEMS MED-Currents, EAS5 system) (Version 1) [data set], Copernicus Monitoring Environment Marine Service (CMEMS), <uri>https://doi.org/10.25423/CMCC/MEDSEA_ANALYSIS_FORECAST_PHY_006_013_EAS5</uri>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Cousins and Xue(2001)}}?><label>Cousins and Xue(2001)</label><?label Cousins2001?><mixed-citation>Cousins, S. and Xue, H.:
Running the POM on a Beowulf Cluster, in: Terrain-Following Coordinates User's Workshop, 20–22 August 2001, Boulder, Colorado, USA, <uri>http://www.myroms.org/Workshops/TOMS2001/presentations/Steve.Cousins.ppt</uri> (last access: June 2022), 2001.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Cowles(2008)}}?><label>Cowles(2008)</label><?label cowles2008?><mixed-citation>Cowles, G. W.:
Parallelization of the Fvcom Coastal Ocean Model, Int. J. High Perform. C., 22, 177–193, <ext-link xlink:href="https://doi.org/10.1177/1094342007083804" ext-link-type="DOI">10.1177/1094342007083804</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Danilov et~al.(2004)Danilov, Kivman, and Schr{\"{o}}ter}}?><label>Danilov et al.(2004)Danilov, Kivman, and Schröter</label><?label DANILOV2004125?><mixed-citation>Danilov, S., Kivman, G., and Schröter, J.:
A finite-element ocean model: principles and evaluation, Ocean Model., 6, 125–150, <ext-link xlink:href="https://doi.org/10.1016/S1463-5003(02)00063-X" ext-link-type="DOI">10.1016/S1463-5003(02)00063-X</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Danilov et~al.(2017)Danilov, Sidorenko, Wang, and Jung}}?><label>Danilov et al.(2017)Danilov, Sidorenko, Wang, and Jung</label><?label gmd-10-765-2017?><mixed-citation>Danilov, S., Sidorenko, D., Wang, Q., and Jung, T.:
The Finite-volumE Sea ice–Ocean Model (FESOM2), Geosci. Model Dev., 10, 765–789, <ext-link xlink:href="https://doi.org/10.5194/gmd-10-765-2017" ext-link-type="DOI">10.5194/gmd-10-765-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx18"><?xmltex \def\ref@label{{Federico et~al.(2017)Federico, Pinardi, Coppini, Oddo, Lecci, and Mossa}}?><label>Federico et al.(2017)Federico, Pinardi, Coppini, Oddo, Lecci, and Mossa</label><?label Federico201745?><mixed-citation>Federico, I., Pinardi, N., Coppini, G., Oddo, P., Lecci, R., and Mossa, M.:
Coastal ocean forecasting with an unstructured grid model in the southern Adriatic and northern Ionian seas, Nat. Hazards Earth Syst. Sci., 17, 45–59, <ext-link xlink:href="https://doi.org/10.5194/nhess-17-45-2017" ext-link-type="DOI">10.5194/nhess-17-45-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{Felten and Lund(2006)}}?><label>Felten and Lund(2006)</label><?label FELTEN2006465?><mixed-citation>Felten, F. N. and Lund, T. S.:
Kinetic energy conservation issues associated with the collocated mesh scheme for incompressible flow, J. Comput. Phys., 215, 465–484, <ext-link xlink:href="https://doi.org/10.1016/j.jcp.2005.11.009" ext-link-type="DOI">10.1016/j.jcp.2005.11.009</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx20"><?xmltex \def\ref@label{{Ferrarin et~al.(2018)Ferrarin, Bellafiore, Sannino, Bajo, and Umgiesser}}?><label>Ferrarin et al.(2018)Ferrarin, Bellafiore, Sannino, Bajo, and Umgiesser</label><?label Ferrarin2018102?><mixed-citation>
Ferrarin, C., Bellafiore, D., Sannino, G., Bajo, M., and Umgiesser, G.:
Tidal dynamics in the inter-connected Mediterranean, Marmara, Black and Azov seas, Prog. Oceanogr., 161, 102–115, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{{Ferrarin et~al.(2019)Ferrarin, Davolio, Bellafiore, Ghezzo, Maicu, Mc Kiver, Drofa, Umgiesser, Bajo, De Pascalis, Malguzzi, Zaggia, Lorenzetti, and Manf{\`{e}}}}?><label>Ferrarin et al.(2019)Ferrarin, Davolio, Bellafiore, Ghezzo, Maicu, Mc Kiver, Drofa, Umgiesser, Bajo, De Pascalis, Malguzzi, Zaggia, Lorenzetti, and Manfè</label><?label Ferrarin201986?><mixed-citation>
Ferrarin, C., Davolio, S., Bellafiore, D., Ghezzo, M., Maicu, F., Mc Kiver, W., Drofa, O., Umgiesser, G., Bajo, M., De Pascalis, F., Malguzzi, P., Zaggia, L., Lorenzetti, G., and Manfè, G.:
Cross-scale operational oceanography in the Adriatic Sea, J. Oper. Oceanogr., 12, 86–103, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{{Fofonoff and Millard(1983)}}?><label>Fofonoff and Millard(1983)</label><?label fofonoff1983?><mixed-citation>
Fofonoff, N. and Millard, R.:
Algorithms for Computation of Fundamental Properties of Seawater, UNESCO Tech. Pap. Mar. Sci., 44, UNESCO, 1983.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Fuhrer et~al.(2014)Fuhrer, Osuna, Lapillonne, Gysi, Cumming, Bianco, Arteaga, and Schulthess}}?><label>Fuhrer et al.(2014)Fuhrer, Osuna, Lapillonne, Gysi, Cumming, Bianco, Arteaga, and Schulthess</label><?label 10.14529/jsfi140103?><mixed-citation>Fuhrer, O., Osuna, C., Lapillonne, X., Gysi, T., Cumming, B., Bianco, M., Arteaga, A., and Schulthess, T.:
Towards a Performance Portable, Architecture Agnostic Implementation Strategy for Weather and Climate Models, Supercomput. Front. Innov. Int. J., 1, 45–62, <ext-link xlink:href="https://doi.org/10.14529/jsfi140103" ext-link-type="DOI">10.14529/jsfi140103</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Geyer et~al.(2021)Geyer, Ludwig, and von Storch}}?><label>Geyer et al.(2021)Geyer, Ludwig, and von Storch</label><?label Geyer2021?><mixed-citation>Geyer, B., Ludwig, T., and von Storch, H.:
Limits of reproducibility and hydrodynamic noise in atmospheric regional modelling, Communications Earth &amp; Environment, 2, 17, <ext-link xlink:href="https://doi.org/10.1038/s43247-020-00085-4" ext-link-type="DOI">10.1038/s43247-020-00085-4</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Goldberg(1991)}}?><label>Goldberg(1991)</label><?label goldberg1991?><mixed-citation>Goldberg, D.:
What Every Computer Scientist Should Know about Floating-Point Arithmetic, ACM Comput. Surv., 23, 5–48, <ext-link xlink:href="https://doi.org/10.1145/103162.103163" ext-link-type="DOI">10.1145/103162.103163</ext-link>, 1991.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Griffies et~al.(2010)Griffies, Adcroft, Banks, Boning, Chassignet, Danabasoglu, Danilov, Deelersnijder, Drange, England, Fox-Kemper, Gerdes, Gnanadesikan, Greatbatch, Hallberge, Hanert, Harrison, Legg, Little, Madec, Marsland, Nikurashin, Pirani, Simmons, Schroter, Samuels, Treguier, Toggweiler, Tsujino, Vallis, and White}}?><label>Griffies et al.(2010)Griffies, Adcroft, Banks, Boning, Chassignet, Danabasoglu, Danilov, Deelersnijder, Drange, England, Fox-Kemper, Gerdes, Gnanadesikan, Greatbatch, Hallberge, Hanert, Harrison, Legg, Little, Madec, Marsland, Nikurashin, Pirani, Simmons, Schroter, Samuels, Treguier, Toggweiler, Tsujino, Vallis, and White</label><?label griffies2010?><mixed-citation>Griffies, S., Adcroft, A., Banks, H., Boning, C., Chassignet, E., Danabasoglu, G., Danilov, S., Deelersnijder, E., Drange, H., England, M., Fox-Kemper, B., Gerdes, R., Gnanadesikan, A., Greatbatch, R., Hallberge, R., Hanert, E., Harrison, M., Legg, S., Little, C., Madec, G., Marsland, S., Nikurashin, M., Pirani, A., Simmons, H., Schroter, J., Samuels, B., Treguier, A.-M., Toggweiler, J., Tsujino, H., Vallis, G., and White, L.:
Problems and prospects in large-scale ocean circulation models, in: Proceedings of OceanObs'09: Sustained Ocean Observations and Information for Society, 21–25 September 2009, Venice, Italy, Vol. 2, edited by: Hall, J., Harrison, D., and Stammer, D., WPP-306, pp. 437–458, European Space Agency, <uri>https://eprints.soton.ac.uk/340646/</uri> (last access: June 2022), 2010.</mixed-citation></ref>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Guarino et~al.(2020)Guarino, Sime, Schroeder, Lister, and Hatcher}}?><label>Guarino et al.(2020)Guarino, Sime, Schroeder, Lister, and Hatcher</label><?label gmd-13-139-2020?><mixed-citation>Guarino, M.-V., Sime, L. C., Schroeder, D., Lister, G. M. S., and Hatcher, R.:
Machine dependence and reproducibility for coupled climate simulations: the HadGEM3-GC3.1 CMIP Preindustrial simulation, Geosci. Model Dev., 13, 139–154, <ext-link xlink:href="https://doi.org/10.5194/gmd-13-139-2020" ext-link-type="DOI">10.5194/gmd-13-139-2020</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Hallberg(2013)}}?><label>Hallberg(2013)</label><?label HALLBERG201392?><mixed-citation>Hallberg, R.:
Using a resolution function to regulate parameterizations of oceanic mesoscale eddy effects, Ocean Model., 72, 92–103, <ext-link xlink:href="https://doi.org/10.1016/j.ocemod.2013.08.007" ext-link-type="DOI">10.1016/j.ocemod.2013.08.007</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx29"><?xmltex \def\ref@label{{Hendrickson and Kolda(2000)}}?><label>Hendrickson and Kolda(2000)</label><?label HENDRICKSON20001519?><mixed-citation>Hendrickson, B. and Kolda, T. G.:
Graph partitioning models for parallel computing, Parallel Comput., 26, 1519–1534, <ext-link xlink:href="https://doi.org/10.1016/S0167-8191(00)00048-X" ext-link-type="DOI">10.1016/S0167-8191(00)00048-X</ext-link>, Graph Partitioning and Parallel Computing, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx30"><?xmltex \def\ref@label{{Ilicak et~al.(2021)Ilicak, Federico, Barletta, Mutlu, Karan, Ciliberti, Clementi, Coppini, and Pinardi}}?><label>Ilicak et al.(2021)Ilicak, Federico, Barletta, Mutlu, Karan, Ciliberti, Clementi, Coppini, and Pinardi</label><?label ilicak2021?><mixed-citation>Ilicak, M., Federico, I., Barletta, I., Mutlu, S., Karan, H., Ciliberti, S., Clementi, E., Coppini, G., and Pinardi, N.:
Modelling of the Turkish Strait System using a high resolution unstructured ocean circulation model, Journal of Marine Science and Engineering, 9, 769, <ext-link xlink:href="https://doi.org/10.3390/jmse9070769" ext-link-type="DOI">10.3390/jmse9070769</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx31"><?xmltex \def\ref@label{{Jackett and McDougall(1997)}}?><label>Jackett and McDougall(1997)</label><?label Jackett1997AND?><mixed-citation>
Jackett, D. and McDougall, T.:
A Neutral Density Variable for the World's Oceans, J. Phys. Oceanogr., 27, 237–263, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx32"><?xmltex \def\ref@label{{Jofre et~al.(2014)Jofre, Lehmkuhl, Ventosa, Trias, and Oliva}}?><label>Jofre et al.(2014)Jofre, Lehmkuhl, Ventosa, Trias, and Oliva</label><?label lehmkuhl2014?><mixed-citation>Jofre, L., Lehmkuhl, O., Ventosa, J., Trias, F. X., and Oliva, A.:
Conservation Properties of Unstructured Finite-Volume Mesh Schemes for the Navier–Stokes Equations, Numer. Heat Tr. B-Fund., 65, 53–79, <ext-link xlink:href="https://doi.org/10.1080/10407790.2013.836335" ext-link-type="DOI">10.1080/10407790.2013.836335</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx33"><?xmltex \def\ref@label{{K{\"{a}}rn{\"{a}} et~al.(2013)K{\"{a}}rn{\"{a}}, Legat, and Deleersnijder}}?><label>Kärnä et al.(2013)Kärnä, Legat, and Deleersnijder</label><?label KARNA20131?><mixed-citation>Kärnä, T., Legat, V., and Deleersnijder, E.:
A baroclinic discontinuous Galerkin finite element model for coastal flows, Ocean Model., 61, 1–20, <ext-link xlink:href="https://doi.org/10.1016/j.ocemod.2012.09.009" ext-link-type="DOI">10.1016/j.ocemod.2012.09.009</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx34"><?xmltex \def\ref@label{{Karypis and Kumar(1999)}}?><label>Karypis and Kumar(1999)</label><?label Metis?><mixed-citation>
Karypis, G. and  Kumar, V.:
METIS: A software package for partitioning unstructured graphs, partitioning meshes, and computing fill-reducing orderings of sparse matrices, version 4.0, University of Minnesota, Department of Computer Science and Engineering, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx35"><?xmltex \def\ref@label{{Karypis et~al.(1997)}}?><label>Karypis et al.(1997)</label><?label Parmetis?><mixed-citation>
Karypis, G.,  Schloegel, K., and Kumar, V.:
PARMETIS: Parallel graph partitioning and sparse matrix ordering library, University of Minnesota, Department of Computer Science and Engineering, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx36"><?xmltex \def\ref@label{{Koldunov et~al.(2019)Koldunov, Aizinger, Rakowsky, Scholz, Sidorenko, Danilov, and Jung}}?><label>Koldunov et al.(2019)Koldunov, Aizinger, Rakowsky, Scholz, Sidorenko, Danilov, and Jung</label><?label koldunov2019?><mixed-citation>Koldunov, N. V., Aizinger, V., Rakowsky, N., Scholz, P., Sidorenko, D., Danilov, S., and Jung, T.:
Scalability and some optimization of the Finite-volumE Sea ice–Ocean Model, Version 2.0 (FESOM2), Geosci. Model Dev., 12, 3991–4012, <ext-link xlink:href="https://doi.org/10.5194/gmd-12-3991-2019" ext-link-type="DOI">10.5194/gmd-12-3991-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx37"><?xmltex \def\ref@label{{Lawrence et~al.(2018)Lawrence, Rezny, Budich, Bauer, Behrens, Carter, Deconinck, Ford, Maynard, Mullerworth, Osuna, Porter, Serradell, Valcke, Wedi, and Wilson}}?><label>Lawrence et al.(2018)Lawrence, Rezny, Budich, Bauer, Behrens, Carter, Deconinck, Ford, Maynard, Mullerworth, Osuna, Porter, Serradell, Valcke, Wedi, and Wilson</label><?label gmd-11-1799-2018?><mixed-citation>Lawrence, B. N., Rezny, M., Budich, R., Bauer, P., Behrens, J., Carter, M., Deconinck, W., Ford, R., Maynard, C., Mullerworth, S., Osuna, C., Porter, A., Serradell, K., Valcke, S., Wedi, N., and Wilson, S.:
Crossing the chasm: how to develop weather and climate models for next generation computers?, Geosci. Model Dev., 11, 1799–1821, <ext-link xlink:href="https://doi.org/10.5194/gmd-11-1799-2018" ext-link-type="DOI">10.5194/gmd-11-1799-2018</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx38"><?xmltex \def\ref@label{{Maicu et~al.(2021)Maicu, Alessandri, Pinardi, Verri, Umgiesser, Lovo, Turolla, Paccagnella, and Valentini}}?><label>Maicu et al.(2021)Maicu, Alessandri, Pinardi, Verri, Umgiesser, Lovo, Turolla, Paccagnella, and Valentini</label><?label maicu2021?><mixed-citation>Maicu, F., Alessandri, J., Pinardi, N., Verri, G., Umgiesser, G., Lovo, S., Turolla, S., Paccagnella, T., and Valentini, A.:
Downscaling With an Unstructured Coastal-Ocean Model to the Goro Lagoon and the Po River Delta Branches, Frontiers in Marine Science, 8, 647781, <ext-link xlink:href="https://doi.org/10.3389/fmars.2021.647781" ext-link-type="DOI">10.3389/fmars.2021.647781</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx39"><?xmltex \def\ref@label{{{Maltrud} and {McClean}(2005)}}?><label>Maltrud and McClean(2005)</label><?label maltrud2005?><mixed-citation>Maltrud, M. E. and McClean, J. L.:
An eddy resolving global 1/10<inline-formula><mml:math id="M339" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> ocean simulation, Ocean Model., 8, 31–54, <ext-link xlink:href="https://doi.org/10.1016/j.ocemod.2003.12.001" ext-link-type="DOI">10.1016/j.ocemod.2003.12.001</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx40"><?xmltex \def\ref@label{{Marshall et~al.(1997)Marshall, Hill, Perelman, and Adcroft}}?><label>Marshall et al.(1997)Marshall, Hill, Perelman, and Adcroft</label><?label marshall1997?><mixed-citation>Marshall, J., Hill, C., Perelman, L., and Adcroft, A.:
Hydrostatic, quasi-hydrostatic, and nonhydrostatic ocean modeling, J. Geophys. Res.-Oceans, 102, 5733–5752, <ext-link xlink:href="https://doi.org/10.1029/96JC02776" ext-link-type="DOI">10.1029/96JC02776</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx41"><?xmltex \def\ref@label{{Micaletto et~al.(2021)}}?><label>Micaletto et al.(2021)</label><?label Micaletto2021?><mixed-citation>Micaletto, G., Barletta, I., Mocavero, S., Federico, I., Epicoco, I., Verri, G., Coppini, G., Schiano, P., Aloisio, G., and Pinardi, N.:  Parallel Implementation of the SHYFEM Model (sanifs_v1), Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.5596734" ext-link-type="DOI">10.5281/zenodo.5596734</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx42"><?xmltex \def\ref@label{{The MPI Forum(1993)}}?><label>The MPI Forum(1993)</label><?label mpiforum1993?><mixed-citation>The MPI Forum, CORPORATE: MPI: A Message Passing Interface, in: Proceedings of the 1993 ACM/IEEE Conference on Supercomputing, Supercomputing '93,
19 November 1993,
Portland, OR, USA, Association for Computing Machinery, New York, NY, USA, <ext-link xlink:href="https://doi.org/10.1145/169627.169855" ext-link-type="DOI">10.1145/169627.169855</ext-link>, p. 878–883, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx43"><?xmltex \def\ref@label{{Park et~al.(2022)Park, Federico, {Di Lorenzo}, Ezer, Cobb, Pinardi, and Coppini}}?><label>Park et al.(2022)Park, Federico, Di Lorenzo, Ezer, Cobb, Pinardi, and Coppini</label><?label PARK2022104098?><mixed-citation>Park, K., Federico, I., Di Lorenzo, E., Ezer, T., Cobb, K. M., Pinardi, N., and Coppini, G.:
The contribution of hurricane remote ocean forcing to storm surge along the Southeastern U. S. coast, Coast. Eng., 173, 104098, <ext-link xlink:href="https://doi.org/10.1016/j.coastaleng.2022.104098" ext-link-type="DOI">10.1016/j.coastaleng.2022.104098</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx44"><?xmltex \def\ref@label{{{Pascolo} et~al.(2016){Pascolo}, {Salon}, {Canu}, {Solidoro}, {Cavazzoni}, and {Umgiesser}}}?><label>Pascolo et al.(2016)Pascolo, Salon, Canu, Solidoro, Cavazzoni, and Umgiesser</label><?label Pascolo2016901?><mixed-citation>Pascolo, E., Salon, S., Canu, D. M., Solidoro, C., Cavazzoni, C., and Umgiesser, G.:
OpenMP tasks: Asynchronous programming made easy, in: 2016 International Conference on High Performance Computing Simulation (HPCS), 18–22 July 2016,
Innsbruck, Austria, Institute of Electrical and Electronics Engineers Inc., <ext-link xlink:href="https://doi.org/10.1109/HPCSim.2016.7568430" ext-link-type="DOI">10.1109/HPCSim.2016.7568430</ext-link>, pp. 901–907, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx45"><?xmltex \def\ref@label{{Petersen et~al.(2019)Petersen, Asay-Davis, Berres, Chen, Feige, Hoffman, Jacobsen, Jones, Maltrud, Price, Ringler, Streletz, Turner, Van Roekel, Veneziani, Wolfe, Wolfram, and Woodring}}?><label>Petersen et al.(2019)Petersen, Asay-Davis, Berres, Chen, Feige, Hoffman, Jacobsen, Jones, Maltrud, Price, Ringler, Streletz, Turner, Van Roekel, Veneziani, Wolfe, Wolfram, and Woodring</label><?label petersen2019?><mixed-citation>Petersen, M. R., Asay-Davis, X. S., Berres, A. S., Chen, Q., Feige, N., Hoffman, M. J., Jacobsen, D. W., Jones, P. W., Maltrud, M. E., Price, S. F., Ringler, T. D., Streletz, G. J., Turner, A. K., Van Roekel, L. P., Veneziani, M., Wolfe, J. D., Wolfram, P. J., and Woodring, J. L.:
An Evaluation of the Ocean and Sea Ice Climate of E3SM Using MPAS and Interannual CORE-II Forcing, J. Adv. Model. Earth Sy., 11, 1438–1458, <ext-link xlink:href="https://doi.org/10.1029/2018MS001373" ext-link-type="DOI">10.1029/2018MS001373</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx46"><?xmltex \def\ref@label{{Pettenuzzo et~al.(2010)Pettenuzzo, Large, and Pinardi}}?><label>Pettenuzzo et al.(2010)Pettenuzzo, Large, and Pinardi</label><?label Pettenuzzo2010?><mixed-citation>Pettenuzzo, D., Large, W., and Pinardi, N.:
On the corrections of ERA-40 surface flux products consistent with the Mediterranean heat and water budgets and the connection between basin surface total heat flux and NAO, J. Geophys. Res.-Oceans, 115, C06022, <ext-link xlink:href="https://doi.org/10.1029/2009JC005631" ext-link-type="DOI">10.1029/2009JC005631</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx47"><?xmltex \def\ref@label{{Ringler et~al.(2013)Ringler, Petersen, Higdon, Jacobsen, Jones, and Maltrud}}?><label>Ringler et al.(2013)Ringler, Petersen, Higdon, Jacobsen, Jones, and Maltrud</label><?label RINGLER2013211?><mixed-citation>Ringler, T., Petersen, M., Higdon, R. L., Jacobsen, D., Jones, P. W., and Maltrud, M.:
A multi-resolution approach to global ocean modeling, Ocean Model., 69, 211–232, <ext-link xlink:href="https://doi.org/10.1016/j.ocemod.2013.04.010" ext-link-type="DOI">10.1016/j.ocemod.2013.04.010</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx48"><?xmltex \def\ref@label{{Sanderson(1998)}}?><label>Sanderson(1998)</label><?label sanderson1998?><mixed-citation>Sanderson, B. G.:
Order and Resolution for Computational Ocean Dynamics, J. Phys. Oceanogr., 28, 1271–1286, <ext-link xlink:href="https://doi.org/10.1175/1520-0485(1998)028&lt;1271:OARFCO&gt;2.0.CO;2" ext-link-type="DOI">10.1175/1520-0485(1998)028&lt;1271:OARFCO&gt;2.0.CO;2</ext-link>, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx49"><?xmltex \def\ref@label{{Sivasankaran Rajamanickam(2012)}}?><label>Sivasankaran Rajamanickam(2012)</label><?label Zoltan?><mixed-citation>
Sivasankaran Rajamanickam, E. G. B.:
An evaluation of the zoltan parallel graphand hypergraph partitioners, Technical report, Sandia National Laboratories (SNL-NM), Albuquerque, NM, USA, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx50"><?xmltex \def\ref@label{{Smagorinsky(1963)}}?><label>Smagorinsky(1963)</label><?label smagorinsky1963?><mixed-citation>Smagorinsky, J.:
GENERAL CIRCULATION EXPERIMENTS WITH THE PRIMITIVE EQUATIONS, Mon. Weather Rev., 91, 99–164, <ext-link xlink:href="https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2" ext-link-type="DOI">10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2</ext-link>, 1963.</mixed-citation></ref>
      <ref id="bib1.bibx51"><?xmltex \def\ref@label{{Song et~al.(2012)Song, Qiao, Lei, and Wang}}?><label>Song et al.(2012)Song, Qiao, Lei, and Wang</label><?label gmd-5-313-2012?><mixed-citation>Song, Z., Qiao, F., Lei, X., and Wang, C.:
Influence of parallel computational uncertainty on simulations of the Coupled General Climate Model, Geosci. Model Dev., 5, 313–319, <ext-link xlink:href="https://doi.org/10.5194/gmd-5-313-2012" ext-link-type="DOI">10.5194/gmd-5-313-2012</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx52"><?xmltex \def\ref@label{{Stanev et~al.(2018)Stanev, Pein, Grashorn, Zhang, and Schrum}}?><label>Stanev et al.(2018)Stanev, Pein, Grashorn, Zhang, and Schrum</label><?label stanev2018?><mixed-citation>Stanev, E., Pein, J., Grashorn, S., Zhang, Y., and Schrum, C.:
Dynamics of the Baltic Sea Straits via Numerical Simulation of Exchange Flows, Ocean Model., 131, 40–58, <ext-link xlink:href="https://doi.org/10.1016/j.ocemod.2018.08.009" ext-link-type="DOI">10.1016/j.ocemod.2018.08.009</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx53"><?xmltex \def\ref@label{{Stanev et~al.(2019)Stanev, Jacob, and Pein}}?><label>Stanev et al.(2019)Stanev, Jacob, and Pein</label><?label STANEV201948?><mixed-citation>Stanev, E. V., Jacob, B., and Pein, J.:
German Bight estuaries: An inter-comparison on the basis of numerical modeling, Cont. Shelf Res., 174, 48–65, <ext-link xlink:href="https://doi.org/10.1016/j.csr.2019.01.001" ext-link-type="DOI">10.1016/j.csr.2019.01.001</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx54"><?xmltex \def\ref@label{{Torresan et~al.(2019)Torresan, Gallina, Gualdi, Bellafiore, Umgiesser, Carniel, Sclavo, Benetazzo, Giubilato, and Critto}}?><label>Torresan et al.(2019)Torresan, Gallina, Gualdi, Bellafiore, Umgiesser, Carniel, Sclavo, Benetazzo, Giubilato, and Critto</label><?label torresan2019?><mixed-citation>Torresan, S., Gallina, V., Gualdi, S., Bellafiore, D., Umgiesser, G., Carniel, S., Sclavo, M., Benetazzo, A., Giubilato, E., and Critto, A.:
Assessment of Climate Change Impacts in the North Adriatic Coastal Area. Part I: A Multi-Model Chain for the Definition of Climate Change Hazard Scenarios, Water, 11, 1157, <ext-link xlink:href="https://doi.org/10.3390/w11061157" ext-link-type="DOI">10.3390/w11061157</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx55"><?xmltex \def\ref@label{{Trotta et~al.(2021)Trotta, Federico, Pinardi, Coppini, Causio, Jansen, Iovino, and Masina}}?><label>Trotta et al.(2021)Trotta, Federico, Pinardi, Coppini, Causio, Jansen, Iovino, and Masina</label><?label trotta2021?><mixed-citation>Trotta, F., Federico, I., Pinardi, N., Coppini, G., Causio, S., Jansen, E., Iovino, D., and Masina, S.:
A Relocatable Ocean Modeling Platform for Downscaling to Shelf-Coastal Areas to Support Disaster Risk Reduction, Frontiers in Marine Science, 8, 642815, <ext-link xlink:href="https://doi.org/10.3389/fmars.2021.642815" ext-link-type="DOI">10.3389/fmars.2021.642815</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx56"><?xmltex \def\ref@label{{Umgiesser et~al.(2004)Umgiesser, Canu, Cucco, and Solidoro}}?><label>Umgiesser et al.(2004)Umgiesser, Canu, Cucco, and Solidoro</label><?label UMGIESSER2004123?><mixed-citation>Umgiesser, G., Canu, D. M., Cucco, A., and Solidoro, C.:
A finite element model for the Venice Lagoon. Development, set up, calibration and validation, J. Marine Syst., 51, 123–145, <ext-link xlink:href="https://doi.org/10.1016/j.jmarsys.2004.05.009" ext-link-type="DOI">10.1016/j.jmarsys.2004.05.009</ext-link>, Lagoon of Venice. Circulation, Water Exchange and Ecosystem Functioning, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx57"><?xmltex \def\ref@label{{Umgiesser et~al.(2014)Umgiesser, Ferrarin, Cucco, De Pascalis, Bellafiore, Ghezzo, and Bajo}}?><label>Umgiesser et al.(2014)Umgiesser, Ferrarin, Cucco, De Pascalis, Bellafiore, Ghezzo, and Bajo</label><?label Umgiesser20142212?><mixed-citation>Umgiesser, G., Ferrarin, C., Cucco, A., De Pascalis, F., Bellafiore, D., Ghezzo, M., and Bajo, M.:
Comparative hydrodynamics of 10 Mediterranean lagoons by means of numerical modeling, J. Geophys. Res.-Oceans, 119, 2212–2226, <ext-link xlink:href="https://doi.org/10.1002/2013JC009512" ext-link-type="DOI">10.1002/2013JC009512</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx58"><?xmltex \def\ref@label{{Walshaw and Cross(2007)}}?><label>Walshaw and Cross(2007)</label><?label walshaw2007jostle?><mixed-citation>Walshaw, C. and Cross, M.:
JOSTLE: parallel multilevel graph-partitioning software–an overview, Mesh partitioning techniques and domain decomposition techniques, Stirling, Scotland, UK, Saxe-Coburg Publications,  27–58, <ext-link xlink:href="https://doi.org/10.4203/csets.17.2" ext-link-type="DOI">10.4203/csets.17.2</ext-link>, 2007.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx59"><?xmltex \def\ref@label{{Wang and Ikeda(1995)}}?><label>Wang and Ikeda(1995)</label><?label wang1995?><mixed-citation>
Wang, J. and Ikeda, M.:
Stability Analysis Of Finite Difference Schemes For Inertial Oscillations In Ocean General Circulation Models, WIT Transactions on The Built Environment, 10, 9, 1995.</mixed-citation></ref>
      <ref id="bib1.bibx60"><?xmltex \def\ref@label{{Wang et~al.(2007)Wang, Wang, and Huang}}?><label>Wang et al.(2007)Wang, Wang, and Huang</label><?label 2007815?><mixed-citation>Wang, P.-F., Wang, Z.-Z., and Huang, G.:
The Influence of Round-off Error on the Atmospheric General Circulation Model, Chinese Journal of Atmospheric Sciences, 31, 815, <ext-link xlink:href="https://doi.org/10.3878/j.issn.1006-9895.2007.05.06" ext-link-type="DOI">10.3878/j.issn.1006-9895.2007.05.06</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx61"><?xmltex \def\ref@label{{Westerink et~al.(2008)Westerink, Luettich, Feyen, Atkinson, Dawson, Roberts, Powell, Dunion, Kubatko, and Pourtaheri}}?><label>Westerink et al.(2008)Westerink, Luettich, Feyen, Atkinson, Dawson, Roberts, Powell, Dunion, Kubatko, and Pourtaheri</label><?label westerink2008?><mixed-citation>Westerink, J., Luettich, Jr, R., Feyen, J., Atkinson, J., Dawson, C., Roberts, H., Powell, M., Dunion, J., Kubatko, E., and Pourtaheri, H.:
A Basin to Channel-Scale Unstructured Grid Hurricane Storm Surge Model Applied to Southern Louisiana, Mon. Weather Rev., 136, 833–864, <ext-link xlink:href="https://doi.org/10.1175/2007MWR1946.1" ext-link-type="DOI">10.1175/2007MWR1946.1</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx62"><?xmltex \def\ref@label{{Zhang et~al.(2020{\natexlab{a}})Zhang, Fu, Wu, Li, Wang, Zeng, Duan, Wan, Wang, Zhuang, Meng, Xu, Xu, Gan, Liu, Wu, Cheng, Yu, Shi, Wang, Xu, Xue, Liu, Guo, Zhang, Zhu, Tu, Edwards, Baker, Yong, Yuan, Yu, Zhang, Liu, Li, Jia, Yang, Wei, Pan, Chang, Danabasoglu, Yeager, Rosenbloom, and Guo}}?><label>Zhang et al.(2020a)Zhang, Fu, Wu, Li, Wang, Zeng, Duan, Wan, Wang, Zhuang, Meng, Xu, Xu, Gan, Liu, Wu, Cheng, Yu, Shi, Wang, Xu, Xue, Liu, Guo, Zhang, Zhu, Tu, Edwards, Baker, Yong, Yuan, Yu, Zhang, Liu, Li, Jia, Yang, Wei, Pan, Chang, Danabasoglu, Yeager, Rosenbloom, and Guo</label><?label gmd-2020-18?><mixed-citation>Zhang, S., Fu, H., Wu, L., Li, Y., Wang, H., Zeng, Y., Duan, X., Wan, W., Wang, L., Zhuang, Y., Meng, H., Xu, K., Xu, P., Gan, L., Liu, Z., Wu, S., Chen, Y., Yu, H., Shi, S., Wang, L., Xu, S., Xue, W., Liu, W., Guo, Q., Zhang, J., Zhu, G., Tu, Y., Edwards, J., Baker, A., Yong, J., Yuan, M., Yu, Y., Zhang, Q., Liu, Z., Li, M., Jia, D., Yang, G., Wei, Z., Pan, J., Chang, P., Danabasoglu, G., Yeager, S., Rosenbloom, N., and Guo, Y.:
Optimizing high-resolution Community Earth System Model on a heterogeneous many-core supercomputing platform, Geosci. Model Dev., 13, 4809–4829, <ext-link xlink:href="https://doi.org/10.5194/gmd-13-4809-2020" ext-link-type="DOI">10.5194/gmd-13-4809-2020</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx63"><?xmltex \def\ref@label{{Zhang et~al.(2016)Zhang, Ye, Stanev, and Grashorn}}?><label>Zhang et al.(2016)Zhang, Ye, Stanev, and Grashorn</label><?label Zhang201664?><mixed-citation>
Zhang, Y., Ye, F., Stanev, E., and Grashorn, S.:
Seamless cross-scale modeling with SCHISM, Ocean Model., 102, 64–81, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx64"><?xmltex \def\ref@label{{Zhang et~al.(2020)Zhang, Chen, Xue, Beardsley, and Franks}}?><label>Zhang et al.(2020)Zhang, Chen, Xue, Beardsley, and Franks</label><?label ZHANG2020111048?><mixed-citation>Zhang, Y., Chen, C., Xue, P., Beardsley, R. C., and Franks, P. J.:
A view of physical mechanisms for transporting harmful algal blooms to Massachusetts Bay, Mar. Pollut. Bull., 154, 111048, <ext-link xlink:href="https://doi.org/10.1016/j.marpolbul.2020.111048" ext-link-type="DOI">10.1016/j.marpolbul.2020.111048</ext-link>, 2020.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Parallel implementation of the SHYFEM (System of HydrodYnamic Finite Element Modules) model</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>Bajo et al.(2014)Bajo, Ferrarin, Dinu, Umgiesser, and Stanica</label><mixed-citation>
Bajo, M., Ferrarin, C., Dinu, I., Umgiesser, G., and Stanica, A.:
The water circulation near the danube delta and the romanian coast modelled with finite elements, Cont. Shelf Res., 78, 62–74, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Balay et al.(1997)Balay, Gropp, McInnes, and Smith</label><mixed-citation>
Balay, S., Gropp, W. D., McInnes, L. C., and Smith, B. F.:
Efficient Management of Parallelism in Object Oriented Numerical Software Libraries, in: Modern Software Tools in Scientific Computing, edited by: Arge, E., Bruaset, A. M., and Langtangen, H. P., Birkhäuser Press, 163–202, <a href="https://doi.org/10.1007/978-1-4612-1986-6_8" target="_blank">https://doi.org/10.1007/978-1-4612-1986-6_8</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Balay et al.(2020)Balay, Abhyankar, Adams, Brown, Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik, Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and Zhang</label><mixed-citation>
Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D., Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp, K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.:
PETSc Users Manual, Tech. Rep. ANL-95/11 – Revision 3.13, Argonne National Laboratory, <a href="https://www.mcs.anl.gov/petsc" target="_blank"/> (last access: June 2022), 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Balay et al.(2021)Balay, Abhyankar, Adams, Benson, Brown, Brune, Buschelman, Constantinescu, Dalcin, Dener, Eijkhout, Gropp, Hapla, Isaac, Jolivet, Karpeev, Kaushik, Knepley, Kong, Kruger, May, McInnes, Mills, Mitchell, Munson, Roman, Rupp, Sanan, Sarich, Smith, Zampini, Zhang, Zhang, and Zhang</label><mixed-citation>
Balay, S., Abhyankar, S., Adams, M. F., Benson, S., Brown, J., Brune, P., Buschelman, K., Constantinescu, E. M., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Hapla, V., Isaac, T., Jolivet, P., Karpeev, D., Kaushik, D., Knepley, M. G., Kong, F., Kruger, S., May, D. A., McInnes, L. C., Mills, R. T., Mitchell, L., Munson, T., Roman, J. E., Rupp, K., Sanan, P., Sarich, J., Smith, B. F., Zampini, S., Zhang, H., Zhang, H., and Zhang, J.:
PETSc Web page,  Argonne National Laboratory, <a href="https://petsc.org/" target="_blank"/> (last access: June 2022), 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Barletta et al.(2022)</label><mixed-citation>
Barletta, I., Federico, I., Verri, G., Coppini, G., and Pinardi, N.: Input dataset for SANIFS configuration, Zenodo [data set], <a href="https://doi.org/10.5281/zenodo.6907575" target="_blank">https://doi.org/10.5281/zenodo.6907575</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Bellafiore and Umgiesser(2010)</label><mixed-citation>
Bellafiore, D. and Umgiesser, G.:
Hydrodynamic coastal processes in the North Adriatic investigated with a 3D finite element model, Ocean Dynam., 60, 255–273, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Blumberg and Mellor(1987)</label><mixed-citation>
Blumberg, A. F. and Mellor, G. L.:
A Description of a Three-Dimensional Coastal Ocean Circulation Model, in: Three‐Dimensional Coastal Ocean Models, edited by: Heaps, N. S., American Geophysical Union (AGU),  1–16, 1987.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Burchard and Petersen(1999)</label><mixed-citation>
Burchard, H. and Petersen, O.:
Models of turbulence in the marine environment – A comparative study of two-equation turbulence models, J. Marine Syst., 21, 29–53, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Campin et al.(2004)Campin, Adcroft, Hill, and Marshall</label><mixed-citation>
Campin, J.-M., Adcroft, A., Hill, C., and Marshall, J.:
Conservation of properties in a free-surface model, Ocean Model., 6, 221–244, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Casulli and Walters(2000)</label><mixed-citation>
Casulli, V. and Walters, R. A.:
An unstructured grid, three-dimensional model based on the shallow water equations, Int. J. Numer. Meth. Fl., 32, 331–348, <a href="https://doi.org/10.1002/(SICI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C" target="_blank">https://doi.org/10.1002/(SI</a><a href="https://doi.org/10.1002/(SICI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C" target="_blank">CI)1097-0363(20000215)32:3&lt;331::AID-FLD941&gt;3.0.CO;2-C</a>, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Chen et al.(2003)Chen, Liu, and Beardsley</label><mixed-citation>
Chen, C., Liu, H., and Beardsley, R. C.:
An Unstructured Grid, Finite-Volume, Three-Dimensional, Primitive Equations Ocean Model: Application to Coastal Ocean and Estuaries, J. Atmos. Ocean. Tech., 20, 159–186, <a href="https://doi.org/10.1175/1520-0426(2003)020&lt;0159:AUGFVT&gt;2.0.CO;2" target="_blank">https://doi.org/10.1175/1520-0426(2003)020&lt;0159:AUGFVT&gt;2.0.CO;2</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Chevalier and Pellegrini(2008)</label><mixed-citation>
Chevalier, C. and Pellegrini, F.:
PT-Scotch: A tool for efficient parallel graph ordering, Parallel Comput., 34, 318–331, <a href="https://doi.org/10.1016/j.parco.2007.12.001" target="_blank">https://doi.org/10.1016/j.parco.2007.12.001</a>, Parallel Matrix Algorithms and Applications, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Clementi et al.(2019)Clementi, Pistoia, Escudier, Delrosso, Drudi, Grandi, R., S., S., G., S., and Pinardi</label><mixed-citation>
Clementi, E., Pistoia, J., Escudier, R., Delrosso, D., Drudi, M., Grandi, A., Lecci R., Creti' S., Ciliberti S., Coppini G., Masina S., and Pinardi, N.:
Mediterranean Sea Analysis and Forecast (CMEMS MED-Currents, EAS5 system) (Version 1) [data set], Copernicus Monitoring Environment Marine Service (CMEMS), <a href="https://doi.org/10.25423/CMCC/MEDSEA_ANALYSIS_FORECAST_PHY_006_013_EAS5" target="_blank"/>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Cousins and Xue(2001)</label><mixed-citation>
Cousins, S. and Xue, H.:
Running the POM on a Beowulf Cluster, in: Terrain-Following Coordinates User's Workshop, 20–22 August 2001, Boulder, Colorado, USA, <a href="http://www.myroms.org/Workshops/TOMS2001/presentations/Steve.Cousins.ppt" target="_blank"/> (last access: June 2022), 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Cowles(2008)</label><mixed-citation>
Cowles, G. W.:
Parallelization of the Fvcom Coastal Ocean Model, Int. J. High Perform. C., 22, 177–193, <a href="https://doi.org/10.1177/1094342007083804" target="_blank">https://doi.org/10.1177/1094342007083804</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Danilov et al.(2004)Danilov, Kivman, and Schröter</label><mixed-citation>
Danilov, S., Kivman, G., and Schröter, J.:
A finite-element ocean model: principles and evaluation, Ocean Model., 6, 125–150, <a href="https://doi.org/10.1016/S1463-5003(02)00063-X" target="_blank">https://doi.org/10.1016/S1463-5003(02)00063-X</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Danilov et al.(2017)Danilov, Sidorenko, Wang, and Jung</label><mixed-citation>
Danilov, S., Sidorenko, D., Wang, Q., and Jung, T.:
The Finite-volumE Sea ice–Ocean Model (FESOM2), Geosci. Model Dev., 10, 765–789, <a href="https://doi.org/10.5194/gmd-10-765-2017" target="_blank">https://doi.org/10.5194/gmd-10-765-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Federico et al.(2017)Federico, Pinardi, Coppini, Oddo, Lecci, and Mossa</label><mixed-citation>
Federico, I., Pinardi, N., Coppini, G., Oddo, P., Lecci, R., and Mossa, M.:
Coastal ocean forecasting with an unstructured grid model in the southern Adriatic and northern Ionian seas, Nat. Hazards Earth Syst. Sci., 17, 45–59, <a href="https://doi.org/10.5194/nhess-17-45-2017" target="_blank">https://doi.org/10.5194/nhess-17-45-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Felten and Lund(2006)</label><mixed-citation>
Felten, F. N. and Lund, T. S.:
Kinetic energy conservation issues associated with the collocated mesh scheme for incompressible flow, J. Comput. Phys., 215, 465–484, <a href="https://doi.org/10.1016/j.jcp.2005.11.009" target="_blank">https://doi.org/10.1016/j.jcp.2005.11.009</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Ferrarin et al.(2018)Ferrarin, Bellafiore, Sannino, Bajo, and Umgiesser</label><mixed-citation>
Ferrarin, C., Bellafiore, D., Sannino, G., Bajo, M., and Umgiesser, G.:
Tidal dynamics in the inter-connected Mediterranean, Marmara, Black and Azov seas, Prog. Oceanogr., 161, 102–115, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Ferrarin et al.(2019)Ferrarin, Davolio, Bellafiore, Ghezzo, Maicu, Mc Kiver, Drofa, Umgiesser, Bajo, De Pascalis, Malguzzi, Zaggia, Lorenzetti, and Manfè</label><mixed-citation>
Ferrarin, C., Davolio, S., Bellafiore, D., Ghezzo, M., Maicu, F., Mc Kiver, W., Drofa, O., Umgiesser, G., Bajo, M., De Pascalis, F., Malguzzi, P., Zaggia, L., Lorenzetti, G., and Manfè, G.:
Cross-scale operational oceanography in the Adriatic Sea, J. Oper. Oceanogr., 12, 86–103, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Fofonoff and Millard(1983)</label><mixed-citation>
Fofonoff, N. and Millard, R.:
Algorithms for Computation of Fundamental Properties of Seawater, UNESCO Tech. Pap. Mar. Sci., 44, UNESCO, 1983.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Fuhrer et al.(2014)Fuhrer, Osuna, Lapillonne, Gysi, Cumming, Bianco, Arteaga, and Schulthess</label><mixed-citation>
Fuhrer, O., Osuna, C., Lapillonne, X., Gysi, T., Cumming, B., Bianco, M., Arteaga, A., and Schulthess, T.:
Towards a Performance Portable, Architecture Agnostic Implementation Strategy for Weather and Climate Models, Supercomput. Front. Innov. Int. J., 1, 45–62, <a href="https://doi.org/10.14529/jsfi140103" target="_blank">https://doi.org/10.14529/jsfi140103</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Geyer et al.(2021)Geyer, Ludwig, and von Storch</label><mixed-citation>
Geyer, B., Ludwig, T., and von Storch, H.:
Limits of reproducibility and hydrodynamic noise in atmospheric regional modelling, Communications Earth &amp; Environment, 2, 17, <a href="https://doi.org/10.1038/s43247-020-00085-4" target="_blank">https://doi.org/10.1038/s43247-020-00085-4</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Goldberg(1991)</label><mixed-citation>
Goldberg, D.:
What Every Computer Scientist Should Know about Floating-Point Arithmetic, ACM Comput. Surv., 23, 5–48, <a href="https://doi.org/10.1145/103162.103163" target="_blank">https://doi.org/10.1145/103162.103163</a>, 1991.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Griffies et al.(2010)Griffies, Adcroft, Banks, Boning, Chassignet, Danabasoglu, Danilov, Deelersnijder, Drange, England, Fox-Kemper, Gerdes, Gnanadesikan, Greatbatch, Hallberge, Hanert, Harrison, Legg, Little, Madec, Marsland, Nikurashin, Pirani, Simmons, Schroter, Samuels, Treguier, Toggweiler, Tsujino, Vallis, and White</label><mixed-citation>
Griffies, S., Adcroft, A., Banks, H., Boning, C., Chassignet, E., Danabasoglu, G., Danilov, S., Deelersnijder, E., Drange, H., England, M., Fox-Kemper, B., Gerdes, R., Gnanadesikan, A., Greatbatch, R., Hallberge, R., Hanert, E., Harrison, M., Legg, S., Little, C., Madec, G., Marsland, S., Nikurashin, M., Pirani, A., Simmons, H., Schroter, J., Samuels, B., Treguier, A.-M., Toggweiler, J., Tsujino, H., Vallis, G., and White, L.:
Problems and prospects in large-scale ocean circulation models, in: Proceedings of OceanObs'09: Sustained Ocean Observations and Information for Society, 21–25 September 2009, Venice, Italy, Vol. 2, edited by: Hall, J., Harrison, D., and Stammer, D., WPP-306, pp. 437–458, European Space Agency, <a href="https://eprints.soton.ac.uk/340646/" target="_blank"/> (last access: June 2022), 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Guarino et al.(2020)Guarino, Sime, Schroeder, Lister, and Hatcher</label><mixed-citation>
Guarino, M.-V., Sime, L. C., Schroeder, D., Lister, G. M. S., and Hatcher, R.:
Machine dependence and reproducibility for coupled climate simulations: the HadGEM3-GC3.1 CMIP Preindustrial simulation, Geosci. Model Dev., 13, 139–154, <a href="https://doi.org/10.5194/gmd-13-139-2020" target="_blank">https://doi.org/10.5194/gmd-13-139-2020</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Hallberg(2013)</label><mixed-citation>
Hallberg, R.:
Using a resolution function to regulate parameterizations of oceanic mesoscale eddy effects, Ocean Model., 72, 92–103, <a href="https://doi.org/10.1016/j.ocemod.2013.08.007" target="_blank">https://doi.org/10.1016/j.ocemod.2013.08.007</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>Hendrickson and Kolda(2000)</label><mixed-citation>
Hendrickson, B. and Kolda, T. G.:
Graph partitioning models for parallel computing, Parallel Comput., 26, 1519–1534, <a href="https://doi.org/10.1016/S0167-8191(00)00048-X" target="_blank">https://doi.org/10.1016/S0167-8191(00)00048-X</a>, Graph Partitioning and Parallel Computing, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Ilicak et al.(2021)Ilicak, Federico, Barletta, Mutlu, Karan, Ciliberti, Clementi, Coppini, and Pinardi</label><mixed-citation>
Ilicak, M., Federico, I., Barletta, I., Mutlu, S., Karan, H., Ciliberti, S., Clementi, E., Coppini, G., and Pinardi, N.:
Modelling of the Turkish Strait System using a high resolution unstructured ocean circulation model, Journal of Marine Science and Engineering, 9, 769, <a href="https://doi.org/10.3390/jmse9070769" target="_blank">https://doi.org/10.3390/jmse9070769</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Jackett and McDougall(1997)</label><mixed-citation>
Jackett, D. and McDougall, T.:
A Neutral Density Variable for the World's Oceans, J. Phys. Oceanogr., 27, 237–263, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>Jofre et al.(2014)Jofre, Lehmkuhl, Ventosa, Trias, and Oliva</label><mixed-citation>
Jofre, L., Lehmkuhl, O., Ventosa, J., Trias, F. X., and Oliva, A.:
Conservation Properties of Unstructured Finite-Volume Mesh Schemes for the Navier–Stokes Equations, Numer. Heat Tr. B-Fund., 65, 53–79, <a href="https://doi.org/10.1080/10407790.2013.836335" target="_blank">https://doi.org/10.1080/10407790.2013.836335</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib33"><label>Kärnä et al.(2013)Kärnä, Legat, and Deleersnijder</label><mixed-citation>
Kärnä, T., Legat, V., and Deleersnijder, E.:
A baroclinic discontinuous Galerkin finite element model for coastal flows, Ocean Model., 61, 1–20, <a href="https://doi.org/10.1016/j.ocemod.2012.09.009" target="_blank">https://doi.org/10.1016/j.ocemod.2012.09.009</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib34"><label>Karypis and Kumar(1999)</label><mixed-citation>
Karypis, G. and  Kumar, V.:
METIS: A software package for partitioning unstructured graphs, partitioning meshes, and computing fill-reducing orderings of sparse matrices, version 4.0, University of Minnesota, Department of Computer Science and Engineering, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib35"><label>Karypis et al.(1997)</label><mixed-citation>
Karypis, G.,  Schloegel, K., and Kumar, V.:
PARMETIS: Parallel graph partitioning and sparse matrix ordering library, University of Minnesota, Department of Computer Science and Engineering, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib36"><label>Koldunov et al.(2019)Koldunov, Aizinger, Rakowsky, Scholz, Sidorenko, Danilov, and Jung</label><mixed-citation>
Koldunov, N. V., Aizinger, V., Rakowsky, N., Scholz, P., Sidorenko, D., Danilov, S., and Jung, T.:
Scalability and some optimization of the Finite-volumE Sea ice–Ocean Model, Version 2.0 (FESOM2), Geosci. Model Dev., 12, 3991–4012, <a href="https://doi.org/10.5194/gmd-12-3991-2019" target="_blank">https://doi.org/10.5194/gmd-12-3991-2019</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib37"><label>Lawrence et al.(2018)Lawrence, Rezny, Budich, Bauer, Behrens, Carter, Deconinck, Ford, Maynard, Mullerworth, Osuna, Porter, Serradell, Valcke, Wedi, and Wilson</label><mixed-citation>
Lawrence, B. N., Rezny, M., Budich, R., Bauer, P., Behrens, J., Carter, M., Deconinck, W., Ford, R., Maynard, C., Mullerworth, S., Osuna, C., Porter, A., Serradell, K., Valcke, S., Wedi, N., and Wilson, S.:
Crossing the chasm: how to develop weather and climate models for next generation computers?, Geosci. Model Dev., 11, 1799–1821, <a href="https://doi.org/10.5194/gmd-11-1799-2018" target="_blank">https://doi.org/10.5194/gmd-11-1799-2018</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib38"><label>Maicu et al.(2021)Maicu, Alessandri, Pinardi, Verri, Umgiesser, Lovo, Turolla, Paccagnella, and Valentini</label><mixed-citation>
Maicu, F., Alessandri, J., Pinardi, N., Verri, G., Umgiesser, G., Lovo, S., Turolla, S., Paccagnella, T., and Valentini, A.:
Downscaling With an Unstructured Coastal-Ocean Model to the Goro Lagoon and the Po River Delta Branches, Frontiers in Marine Science, 8, 647781, <a href="https://doi.org/10.3389/fmars.2021.647781" target="_blank">https://doi.org/10.3389/fmars.2021.647781</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib39"><label>Maltrud and McClean(2005)</label><mixed-citation>
Maltrud, M. E. and McClean, J. L.:
An eddy resolving global 1/10° ocean simulation, Ocean Model., 8, 31–54, <a href="https://doi.org/10.1016/j.ocemod.2003.12.001" target="_blank">https://doi.org/10.1016/j.ocemod.2003.12.001</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib40"><label>Marshall et al.(1997)Marshall, Hill, Perelman, and Adcroft</label><mixed-citation>
Marshall, J., Hill, C., Perelman, L., and Adcroft, A.:
Hydrostatic, quasi-hydrostatic, and nonhydrostatic ocean modeling, J. Geophys. Res.-Oceans, 102, 5733–5752, <a href="https://doi.org/10.1029/96JC02776" target="_blank">https://doi.org/10.1029/96JC02776</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib41"><label>Micaletto et al.(2021)</label><mixed-citation>
Micaletto, G., Barletta, I., Mocavero, S., Federico, I., Epicoco, I., Verri, G., Coppini, G., Schiano, P., Aloisio, G., and Pinardi, N.:  Parallel Implementation of the SHYFEM Model (sanifs_v1), Zenodo [code], <a href="https://doi.org/10.5281/zenodo.5596734" target="_blank">https://doi.org/10.5281/zenodo.5596734</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib42"><label>The MPI Forum(1993)</label><mixed-citation>
The MPI Forum, CORPORATE: MPI: A Message Passing Interface, in: Proceedings of the 1993 ACM/IEEE Conference on Supercomputing, Supercomputing '93,
19 November 1993,
Portland, OR, USA, Association for Computing Machinery, New York, NY, USA, <a href="https://doi.org/10.1145/169627.169855" target="_blank">https://doi.org/10.1145/169627.169855</a>, p. 878–883, 1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib43"><label>Park et al.(2022)Park, Federico, Di Lorenzo, Ezer, Cobb, Pinardi, and Coppini</label><mixed-citation>
Park, K., Federico, I., Di Lorenzo, E., Ezer, T., Cobb, K. M., Pinardi, N., and Coppini, G.:
The contribution of hurricane remote ocean forcing to storm surge along the Southeastern U. S. coast, Coast. Eng., 173, 104098, <a href="https://doi.org/10.1016/j.coastaleng.2022.104098" target="_blank">https://doi.org/10.1016/j.coastaleng.2022.104098</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib44"><label>Pascolo et al.(2016)Pascolo, Salon, Canu, Solidoro, Cavazzoni, and Umgiesser</label><mixed-citation>
Pascolo, E., Salon, S., Canu, D. M., Solidoro, C., Cavazzoni, C., and Umgiesser, G.:
OpenMP tasks: Asynchronous programming made easy, in: 2016 International Conference on High Performance Computing Simulation (HPCS), 18–22 July 2016,
Innsbruck, Austria, Institute of Electrical and Electronics Engineers Inc., <a href="https://doi.org/10.1109/HPCSim.2016.7568430" target="_blank">https://doi.org/10.1109/HPCSim.2016.7568430</a>, pp. 901–907, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib45"><label>Petersen et al.(2019)Petersen, Asay-Davis, Berres, Chen, Feige, Hoffman, Jacobsen, Jones, Maltrud, Price, Ringler, Streletz, Turner, Van Roekel, Veneziani, Wolfe, Wolfram, and Woodring</label><mixed-citation>
Petersen, M. R., Asay-Davis, X. S., Berres, A. S., Chen, Q., Feige, N., Hoffman, M. J., Jacobsen, D. W., Jones, P. W., Maltrud, M. E., Price, S. F., Ringler, T. D., Streletz, G. J., Turner, A. K., Van Roekel, L. P., Veneziani, M., Wolfe, J. D., Wolfram, P. J., and Woodring, J. L.:
An Evaluation of the Ocean and Sea Ice Climate of E3SM Using MPAS and Interannual CORE-II Forcing, J. Adv. Model. Earth Sy., 11, 1438–1458, <a href="https://doi.org/10.1029/2018MS001373" target="_blank">https://doi.org/10.1029/2018MS001373</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib46"><label>Pettenuzzo et al.(2010)Pettenuzzo, Large, and Pinardi</label><mixed-citation>
Pettenuzzo, D., Large, W., and Pinardi, N.:
On the corrections of ERA-40 surface flux products consistent with the Mediterranean heat and water budgets and the connection between basin surface total heat flux and NAO, J. Geophys. Res.-Oceans, 115, C06022, <a href="https://doi.org/10.1029/2009JC005631" target="_blank">https://doi.org/10.1029/2009JC005631</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib47"><label>Ringler et al.(2013)Ringler, Petersen, Higdon, Jacobsen, Jones, and Maltrud</label><mixed-citation>
Ringler, T., Petersen, M., Higdon, R. L., Jacobsen, D., Jones, P. W., and Maltrud, M.:
A multi-resolution approach to global ocean modeling, Ocean Model., 69, 211–232, <a href="https://doi.org/10.1016/j.ocemod.2013.04.010" target="_blank">https://doi.org/10.1016/j.ocemod.2013.04.010</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib48"><label>Sanderson(1998)</label><mixed-citation>
Sanderson, B. G.:
Order and Resolution for Computational Ocean Dynamics, J. Phys. Oceanogr., 28, 1271–1286, <a href="https://doi.org/10.1175/1520-0485(1998)028&lt;1271:OARFCO&gt;2.0.CO;2" target="_blank">https://doi.org/10.1175/1520-0485(1998)028&lt;1271:OARFCO&gt;2.0.CO;2</a>, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib49"><label>Sivasankaran Rajamanickam(2012)</label><mixed-citation>
Sivasankaran Rajamanickam, E. G. B.:
An evaluation of the zoltan parallel graphand hypergraph partitioners, Technical report, Sandia National Laboratories (SNL-NM), Albuquerque, NM, USA, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib50"><label>Smagorinsky(1963)</label><mixed-citation>
Smagorinsky, J.:
GENERAL CIRCULATION EXPERIMENTS WITH THE PRIMITIVE EQUATIONS, Mon. Weather Rev., 91, 99–164, <a href="https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2" target="_blank">https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2</a>, 1963.
</mixed-citation></ref-html>
<ref-html id="bib1.bib51"><label>Song et al.(2012)Song, Qiao, Lei, and Wang</label><mixed-citation>
Song, Z., Qiao, F., Lei, X., and Wang, C.:
Influence of parallel computational uncertainty on simulations of the Coupled General Climate Model, Geosci. Model Dev., 5, 313–319, <a href="https://doi.org/10.5194/gmd-5-313-2012" target="_blank">https://doi.org/10.5194/gmd-5-313-2012</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib52"><label>Stanev et al.(2018)Stanev, Pein, Grashorn, Zhang, and Schrum</label><mixed-citation>
Stanev, E., Pein, J., Grashorn, S., Zhang, Y., and Schrum, C.:
Dynamics of the Baltic Sea Straits via Numerical Simulation of Exchange Flows, Ocean Model., 131, 40–58, <a href="https://doi.org/10.1016/j.ocemod.2018.08.009" target="_blank">https://doi.org/10.1016/j.ocemod.2018.08.009</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib53"><label>Stanev et al.(2019)Stanev, Jacob, and Pein</label><mixed-citation>
Stanev, E. V., Jacob, B., and Pein, J.:
German Bight estuaries: An inter-comparison on the basis of numerical modeling, Cont. Shelf Res., 174, 48–65, <a href="https://doi.org/10.1016/j.csr.2019.01.001" target="_blank">https://doi.org/10.1016/j.csr.2019.01.001</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib54"><label>Torresan et al.(2019)Torresan, Gallina, Gualdi, Bellafiore, Umgiesser, Carniel, Sclavo, Benetazzo, Giubilato, and Critto</label><mixed-citation>
Torresan, S., Gallina, V., Gualdi, S., Bellafiore, D., Umgiesser, G., Carniel, S., Sclavo, M., Benetazzo, A., Giubilato, E., and Critto, A.:
Assessment of Climate Change Impacts in the North Adriatic Coastal Area. Part I: A Multi-Model Chain for the Definition of Climate Change Hazard Scenarios, Water, 11, 1157, <a href="https://doi.org/10.3390/w11061157" target="_blank">https://doi.org/10.3390/w11061157</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib55"><label>Trotta et al.(2021)Trotta, Federico, Pinardi, Coppini, Causio, Jansen, Iovino, and Masina</label><mixed-citation>
Trotta, F., Federico, I., Pinardi, N., Coppini, G., Causio, S., Jansen, E., Iovino, D., and Masina, S.:
A Relocatable Ocean Modeling Platform for Downscaling to Shelf-Coastal Areas to Support Disaster Risk Reduction, Frontiers in Marine Science, 8, 642815, <a href="https://doi.org/10.3389/fmars.2021.642815" target="_blank">https://doi.org/10.3389/fmars.2021.642815</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib56"><label>Umgiesser et al.(2004)Umgiesser, Canu, Cucco, and Solidoro</label><mixed-citation>
Umgiesser, G., Canu, D. M., Cucco, A., and Solidoro, C.:
A finite element model for the Venice Lagoon. Development, set up, calibration and validation, J. Marine Syst., 51, 123–145, <a href="https://doi.org/10.1016/j.jmarsys.2004.05.009" target="_blank">https://doi.org/10.1016/j.jmarsys.2004.05.009</a>, Lagoon of Venice. Circulation, Water Exchange and Ecosystem Functioning, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib57"><label>Umgiesser et al.(2014)Umgiesser, Ferrarin, Cucco, De Pascalis, Bellafiore, Ghezzo, and Bajo</label><mixed-citation>
Umgiesser, G., Ferrarin, C., Cucco, A., De Pascalis, F., Bellafiore, D., Ghezzo, M., and Bajo, M.:
Comparative hydrodynamics of 10 Mediterranean lagoons by means of numerical modeling, J. Geophys. Res.-Oceans, 119, 2212–2226, <a href="https://doi.org/10.1002/2013JC009512" target="_blank">https://doi.org/10.1002/2013JC009512</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib58"><label>Walshaw and Cross(2007)</label><mixed-citation>
Walshaw, C. and Cross, M.:
JOSTLE: parallel multilevel graph-partitioning software–an overview, Mesh partitioning techniques and domain decomposition techniques, Stirling, Scotland, UK, Saxe-Coburg Publications,  27–58, <a href="https://doi.org/10.4203/csets.17.2" target="_blank">https://doi.org/10.4203/csets.17.2</a>, 2007.

</mixed-citation></ref-html>
<ref-html id="bib1.bib59"><label>Wang and Ikeda(1995)</label><mixed-citation>
Wang, J. and Ikeda, M.:
Stability Analysis Of Finite Difference Schemes For Inertial Oscillations In Ocean General Circulation Models, WIT Transactions on The Built Environment, 10, 9, 1995.
</mixed-citation></ref-html>
<ref-html id="bib1.bib60"><label>Wang et al.(2007)Wang, Wang, and Huang</label><mixed-citation>
Wang, P.-F., Wang, Z.-Z., and Huang, G.:
The Influence of Round-off Error on the Atmospheric General Circulation Model, Chinese Journal of Atmospheric Sciences, 31, 815, <a href="https://doi.org/10.3878/j.issn.1006-9895.2007.05.06" target="_blank">https://doi.org/10.3878/j.issn.1006-9895.2007.05.06</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib61"><label>Westerink et al.(2008)Westerink, Luettich, Feyen, Atkinson, Dawson, Roberts, Powell, Dunion, Kubatko, and Pourtaheri</label><mixed-citation>
Westerink, J., Luettich, Jr, R., Feyen, J., Atkinson, J., Dawson, C., Roberts, H., Powell, M., Dunion, J., Kubatko, E., and Pourtaheri, H.:
A Basin to Channel-Scale Unstructured Grid Hurricane Storm Surge Model Applied to Southern Louisiana, Mon. Weather Rev., 136, 833–864, <a href="https://doi.org/10.1175/2007MWR1946.1" target="_blank">https://doi.org/10.1175/2007MWR1946.1</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib62"><label>Zhang et al.(2020a)Zhang, Fu, Wu, Li, Wang, Zeng, Duan, Wan, Wang, Zhuang, Meng, Xu, Xu, Gan, Liu, Wu, Cheng, Yu, Shi, Wang, Xu, Xue, Liu, Guo, Zhang, Zhu, Tu, Edwards, Baker, Yong, Yuan, Yu, Zhang, Liu, Li, Jia, Yang, Wei, Pan, Chang, Danabasoglu, Yeager, Rosenbloom, and Guo</label><mixed-citation>
Zhang, S., Fu, H., Wu, L., Li, Y., Wang, H., Zeng, Y., Duan, X., Wan, W., Wang, L., Zhuang, Y., Meng, H., Xu, K., Xu, P., Gan, L., Liu, Z., Wu, S., Chen, Y., Yu, H., Shi, S., Wang, L., Xu, S., Xue, W., Liu, W., Guo, Q., Zhang, J., Zhu, G., Tu, Y., Edwards, J., Baker, A., Yong, J., Yuan, M., Yu, Y., Zhang, Q., Liu, Z., Li, M., Jia, D., Yang, G., Wei, Z., Pan, J., Chang, P., Danabasoglu, G., Yeager, S., Rosenbloom, N., and Guo, Y.:
Optimizing high-resolution Community Earth System Model on a heterogeneous many-core supercomputing platform, Geosci. Model Dev., 13, 4809–4829, <a href="https://doi.org/10.5194/gmd-13-4809-2020" target="_blank">https://doi.org/10.5194/gmd-13-4809-2020</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib63"><label>Zhang et al.(2016)Zhang, Ye, Stanev, and Grashorn</label><mixed-citation>
Zhang, Y., Ye, F., Stanev, E., and Grashorn, S.:
Seamless cross-scale modeling with SCHISM, Ocean Model., 102, 64–81, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib64"><label>Zhang et al.(2020)Zhang, Chen, Xue, Beardsley, and Franks</label><mixed-citation>
Zhang, Y., Chen, C., Xue, P., Beardsley, R. C., and Franks, P. J.:
A view of physical mechanisms for transporting harmful algal blooms to Massachusetts Bay, Mar. Pollut. Bull., 154, 111048, <a href="https://doi.org/10.1016/j.marpolbul.2020.111048" target="_blank">https://doi.org/10.1016/j.marpolbul.2020.111048</a>, 2020.
</mixed-citation></ref-html>--></article>
