<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" xml:lang="en" dtd-version="3.0"><?xmltex \makeatother\@nolinetrue\makeatletter?>
  <front>
    <journal-meta><journal-id journal-id-type="publisher">GMD</journal-id><journal-title-group>
    <journal-title>Geoscientific Model Development</journal-title>
    <abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title><abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
  </journal-title-group><issn pub-type="epub">1991-9603</issn><publisher>
    <publisher-name>Copernicus Publications</publisher-name>
    <publisher-loc>Göttingen, Germany</publisher-loc>
  </publisher></journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-14-843-2021</article-id><title-group><article-title>Advanced parallel implementation of the coupled ocean–ice model FEMAO (version 2.0) with load balancing</article-title><alt-title>Parallel implementation of the ocean–ice model FEMAO</alt-title>
      </title-group><?xmltex \runningtitle{Parallel implementation of the ocean--ice model FEMAO}?><?xmltex \runningauthor{P. Perezhogin et al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Perezhogin</surname><given-names>Pavel</given-names></name>
          <email>Pavel Perezhogin</email>
        <ext-link>https://orcid.org/0000-0003-2098-3457</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Chernov</surname><given-names>Ilya</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Iakovlev</surname><given-names>Nikolay</given-names></name>
          
        <ext-link>https://orcid.org/0000-0003-2573-728X</ext-link></contrib>
        <aff id="aff1"><label>1</label><institution>Marchuk Institute of Numerical Mathematics of the Russian Academy of Sciences, Moscow, Russia</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Institute of Applied Math Research, Karelian Research Centre of RAS, Petrozavodsk, Russia</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Pavel Perezhogin, pperezhogin@gmail.com</corresp></author-notes><pub-date><day>5</day><month>February</month><year>2021</year></pub-date>
      
      <volume>14</volume>
      <issue>2</issue>
      <fpage>843</fpage><lpage>857</lpage>
      <history>
        <date date-type="received"><day>2</day><month>June</month><year>2020</year></date>
           <date date-type="accepted"><day>23</day><month>December</month><year>2020</year></date>
           <date date-type="rev-recd"><day>13</day><month>December</month><year>2020</year></date>
           <date date-type="rev-request"><day>27</day><month>August</month><year>2020</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2021 Pavel Perezhogin et al.</copyright-statement>
        <copyright-year>2021</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/14/843/2021/gmd-14-843-2021.html">This article is available from https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021.pdf</self-uri>
      <abstract><title>Abstract</title>
    <p id="d1e105">In this paper, we present a parallel version of the finite-element model of the Arctic Ocean (FEMAO) configured for the White Sea and based on MPI technology.  This model consists of two main parts: an ocean dynamics model and a surface ice dynamics model. These parts are very different in terms of the number of computations because the complexity of the ocean part depends on the bottom depth, while that of the sea-ice component does not.  In the first step, we decided to locate both submodels on the same CPU cores with a common horizontal partition of the computational domain.  The model domain is divided into small blocks, which are distributed over the CPU cores using Hilbert-curve balancing.  Partitioning of the model domain is static (i.e., computed during the initialization stage).  There are three baseline options: a single block per core, balancing of 2D computations, and balancing of 3D computations.  After showing parallel acceleration for particular ocean and ice procedures, we construct the common partition, which minimizes joint imbalance in both submodels.  Our novelty is using arrays shared by all blocks that belong to a CPU core instead of allocating separate arrays for each block, as is usually done.  Computations on a CPU core are restricted by the masks of non-land grid nodes and block–core correspondence.  This approach allows us to implement parallel computations into the model that are as simple as when the usual decomposition to squares is used, though with advances in load balancing. We provide parallel acceleration of up to 996 cores for the model with a resolution of <inline-formula><mml:math id="M1" display="inline"><mml:mrow><mml:mn mathvariant="normal">500</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">500</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">39</mml:mn></mml:mrow></mml:math></inline-formula> in the ocean component and 43 sea-ice scalars, and we carry out a detailed analysis of different partitions on the model runtime.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e133">The increasing performance and availability of multiprocessor computing devices make it possible to simulate complex natural systems with high resolution, while taking into account important phenomena and coupling comprehensive models of various subsystems.  In particular, more precise, accurate, and full numerical descriptions of processes in seas and oceans have become possible.  There are now models of seas that can simulate currents, dynamics of thermohaline fields, sea ice, pelagic ecology, benthic processes, and so on; see, for example, the review by <xref ref-type="bibr" rid="bib1.bibx11" id="text.1"/>.</p>
      <p id="d1e139">The finite-element model of the Arctic Ocean <xref ref-type="bibr" rid="bib1.bibx14 bib1.bibx15" id="paren.2"><named-content content-type="pre">FEMAO;</named-content></xref> has been developed since the 1990s and it has been adjusted to the White Sea <xref ref-type="bibr" rid="bib1.bibx4 bib1.bibx6" id="paren.3"/>.  The model domain is a part of the cylinder over sphere (i.e., the Cartesian product of a region on the Earth's surface and a vertical segment).  The coordinates are orthogonal, with the axes directed to the east, to the south, and downwards.  The horizontal grid is structured and rectangular because finite elements are defined on triangles composing rectangles; see <xref ref-type="bibr" rid="bib1.bibx14" id="text.4"/>.  Points that correspond to the land are excluded from the computations using a mask of “wet” points.  The <inline-formula><mml:math id="M2" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> coordinate is used as the vertical axis. Therefore, for each 2D grid node, there are a number of actually used vertical layers.  In the case of significantly variable depth, the number of levels also varies; see Fig. <xref ref-type="fig" rid="Ch1.F1"/>. In contrast, sea-ice and sea-surface computations are depth-independent.  The presence of both 2D and 3D calculations complicates balancing of the computations for the full model.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e164">The number of depth layers in the White Sea model; the vertical grid step is 5 m up to 150 <inline-formula><mml:math id="M3" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula> deep and then 10 m up to 240 <inline-formula><mml:math id="M4" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula>.</p></caption>
        <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f01.png"/>

      </fig>

      <?pagebreak page844?><p id="d1e190"><?xmltex \hack{\newpage}?>The original code was written in Fortran 90/95, and it did not allow for computation in parallel.  Our goal is to develop a parallel version of the model based on MPI technology without the need to make significant changes in the program code (i.e., to preserve loop structure and the mask of wet points but benefit from load balancing).  Consequently, we developed a library that performs a partition of the 2D computational domain and organizes communication between the CPU cores.</p>
      <p id="d1e194">In numerical ocean models, the baseline strategy is to decompose the domain into squares <xref ref-type="bibr" rid="bib1.bibx19" id="paren.5"/> or into small blocks, with consequent distribution over the processor cores <xref ref-type="bibr" rid="bib1.bibx9 bib1.bibx8 bib1.bibx3" id="paren.6"/>.  Both approaches preserve the original structure of the loops and utilize the direct referencing of neighboring grid nodes on rectangular grids. Decomposition into small blocks is more attractive from the viewpoint of load balancing, especially for <inline-formula><mml:math id="M5" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula>-coordinate models.  Blocks can be distributed using the METIS <xref ref-type="bibr" rid="bib1.bibx16" id="paren.7"/> software or simpler algorithms, such as Hilbert curves <xref ref-type="bibr" rid="bib1.bibx9" id="paren.8"/>.  Note that some modern ocean models can also benefit from unstructured mesh usage, whereby there is no need for the mask of wet points; see, for example, <xref ref-type="bibr" rid="bib1.bibx17" id="text.9"/>.  In addition, some ocean models omit masking of wet points; see <xref ref-type="bibr" rid="bib1.bibx19" id="text.10"/>. This implies an increase in the number of computations, but it benefits from fewer control-flow interruptions and gives rise to better automatic vectorization of loops.</p>
      <p id="d1e223">In Sects. 2–4 we provide the model configuration and organization of the calculations in the non-parallel code on a structured rectangular grid. In Sect. 5 we describe the parallelization approach, which preserves the original structure of the loops. Domain decomposition is carried out in two steps: first, the model domain is divided into small blocks and then these blocks are distributed between CPU cores. For all blocks belonging to a given core a “shared” array is introduced, and a mask of computational points restricts calculations. Partitions could be of an arbitrary shape, but blocks allow us to reach the following benefits: a simple balancing algorithm (Hilbert curves) can be applied as the number of blocks along a given direction is chosen to be a power of 2, and boundary exchanges can be easily constructed for an arbitrary halo width smaller than the block size. In Sect. 6 we report parallel acceleration on different partitions for particular 2D and 3D subroutines and the whole model.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>The White Sea</title>
      <p id="d1e234">The White Sea is a relatively small (about <inline-formula><mml:math id="M6" display="inline"><mml:mrow><mml:mn mathvariant="normal">500</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>×</mml:mo><mml:mn mathvariant="normal">500</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula>) and shallow (67 <inline-formula><mml:math id="M7" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula> is the mean depth, with a maximal depth of no more than 340 <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>) semi-closed sea in the Arctic Ocean basin, located in the northwestern part of Russia and included in its territorial waters.  Its area is 90 000 <inline-formula><mml:math id="M9" display="inline"><mml:mrow class="unit"><mml:msup><mml:mi mathvariant="normal">km</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>. The White Sea plays an important role in the economy of the neighboring regions <xref ref-type="bibr" rid="bib1.bibx10" id="paren.11"/>.</p>
      <p id="d1e287">The White Sea consists of several parts, including four bays and a narrow shallow strait called Gorlo that separates one part of the sea from the other.  The coastline of the sea is quite complex, which means that the rectangle (almost a square) of the Earth's surface that contains the sea has only about one-third of the water area.</p>
      <p id="d1e290">The White Sea is a convenient model region to test the numerical algorithms, software, and mathematical models that are intended to be used for the Arctic Ocean.  First, a low spatial step and relatively high maximum velocities demand, due to the Courant stability condition, a rather small temporal step. This makes it difficult to develop efficient algorithms, implement stable numerical schemes, and ensure performance using the available computers.  Second, because this model is less dependent on the initial data, it makes the test simulations easier because only the liquid boundary is needed to set the initial and boundary data.  Finally, the White Sea's relatively small inertia enables us to check the correctness of the code with rather short simulations, which are able to demonstrate important features of the currents.</p>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>The model and the software</title>
      <?pagebreak page845?><p id="d1e301">A time step in the FEMAO model consists of several procedures; see Algorithm 1. The model uses the physical process splitting approach so that geophysical fields are changed by each procedure that simulates one of the geophysical processes. <?xmltex \hack{\\}?><?xmltex \hack{\newpage}?>
<?xmltex \igopts{width=227.622047pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-g01.png"/></p>
      <p id="d1e311">The matrix of the system of linear algebraic equations (SLAE) is sparse, and it contains 19 nonzero diagonals that correspond to adjacent mesh nodes within a finite element. The matrix does not vary in time, and it is precomputed before the time step loop.  The most time-consuming steps for the sequential code version were 3D advection of scalars, 2D advection of sea-ice fields, and solving the SLAE for the sea level. The simple characteristic Galerkin scheme <xref ref-type="bibr" rid="bib1.bibx28" id="paren.12"/> is used for the 3D and 2D advection terms.</p>
      <p id="d1e317">The local 1D sea-ice thermodynamics are based on the 0-layer model <xref ref-type="bibr" rid="bib1.bibx24 bib1.bibx20" id="paren.13"/> with some modifications in lateral melting and surface albedo <xref ref-type="bibr" rid="bib1.bibx27" id="paren.14"/>.  There are 14 categories of ice thickness (gradations); the mechanical redistribution and the ice strength are identical to the CICE <xref ref-type="bibr" rid="bib1.bibx13" id="paren.15"/>.  The elastic–viscous plastic scheme <xref ref-type="bibr" rid="bib1.bibx7" id="paren.16"><named-content content-type="pre">EVP;</named-content></xref> with a modification for the relaxation timescales <xref ref-type="bibr" rid="bib1.bibx25" id="paren.17"/> is used for the sea-ice dynamics <xref ref-type="bibr" rid="bib1.bibx18" id="paren.18"><named-content content-type="pre">see also Appendix 3 in</named-content></xref>.  Sea ice is described by the distribution of its compactness (concentration) and ice volume for each gradation.  In addition, the snow-on-ice volume for each gradation is evaluated.  Therefore, there are 43 2D sea-ice scalars: ice and snow volume for 14 gradations and sea-ice compactness for 15 gradations (including water).  Because there are 39 vertical layers in an ocean component, the set of all of the sea-ice data is comparable to a single 3D scalar.</p>
      <p id="d1e343">The tested version of the model has a spatial resolution of 0.036<inline-formula><mml:math id="M10" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> E, 0.011<inline-formula><mml:math id="M11" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> N, which is between 1.0 and 1.3 <inline-formula><mml:math id="M12" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> along parallels and 1.2 <inline-formula><mml:math id="M13" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> along a meridian.  The number of 2D grid nodes is <inline-formula><mml:math id="M14" display="inline"><mml:mrow><mml:mn mathvariant="normal">500</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">500</mml:mn></mml:mrow></mml:math></inline-formula>, and only 33 % of them are wet (84 542). The time step is 100 s. The vertical step is 5 m up to 150 <inline-formula><mml:math id="M15" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula> deep and then 10 m up to 300 <inline-formula><mml:math id="M16" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula>. In fact, in the bathymetry data <xref ref-type="bibr" rid="bib1.bibx1" id="paren.19"><named-content content-type="pre">ETOPO;</named-content></xref> the deepest point of the sea is shallower than it really is, which reduces the actual maximum depth to 240 <inline-formula><mml:math id="M17" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi></mml:mrow></mml:math></inline-formula>.  Comparison of available bathymetry data for the White Sea is given in <xref ref-type="bibr" rid="bib1.bibx5" id="text.20"/> in Table 1.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Table}?><label>Table 1</label><caption><p id="d1e429">The model with the 1block partition: <inline-formula><mml:math id="M18" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the grid of blocks, and LI 2D and LI 3D are load imbalances (Eq. <xref ref-type="disp-formula" rid="Ch1.E3"/>) for weights <inline-formula><mml:math id="M19" display="inline"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal">d</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mi mathvariant="normal">d</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.  “LI iceadvect” and “LI advect3D” are LIs computed based on the runtime of corresponding functions without exchanges, and d/24 h is the number of computed days for 1 astronomical day.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="9">
     <oasis:colspec colnum="1" colname="col1" align="justify" colwidth="15mm"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <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:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">CPU cores</oasis:entry>
         <oasis:entry colname="col2">1</oasis:entry>
         <oasis:entry colname="col3">32</oasis:entry>
         <oasis:entry colname="col4">78</oasis:entry>
         <oasis:entry colname="col5">149</oasis:entry>
         <oasis:entry colname="col6">306</oasis:entry>
         <oasis:entry colname="col7">595</oasis:entry>
         <oasis:entry colname="col8">993</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"><inline-formula><mml:math id="M21" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M22" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M23" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">7</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M24" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">12</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col5"><inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">17</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col6"><inline-formula><mml:math id="M26" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">26</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col7"><inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">38</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col8"><inline-formula><mml:math id="M28" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">50</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">LI 2D, %</oasis:entry>
         <oasis:entry colname="col2">0</oasis:entry>
         <oasis:entry colname="col3">93</oasis:entry>
         <oasis:entry colname="col4">62</oasis:entry>
         <oasis:entry colname="col5">53</oasis:entry>
         <oasis:entry colname="col6">37</oasis:entry>
         <oasis:entry colname="col7">28</oasis:entry>
         <oasis:entry colname="col8">17</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">LI <?xmltex \hack{\hfill\break}?>iceadvect, %</oasis:entry>
         <oasis:entry colname="col2">0</oasis:entry>
         <oasis:entry colname="col3">80</oasis:entry>
         <oasis:entry colname="col4">57</oasis:entry>
         <oasis:entry colname="col5">50</oasis:entry>
         <oasis:entry colname="col6">40</oasis:entry>
         <oasis:entry colname="col7">30</oasis:entry>
         <oasis:entry colname="col8">19</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">LI 3D, %</oasis:entry>
         <oasis:entry colname="col2">0</oasis:entry>
         <oasis:entry colname="col3">341</oasis:entry>
         <oasis:entry colname="col4">317</oasis:entry>
         <oasis:entry colname="col5">380</oasis:entry>
         <oasis:entry colname="col6">313</oasis:entry>
         <oasis:entry colname="col7">278</oasis:entry>
         <oasis:entry colname="col8">274</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">LI <?xmltex \hack{\hfill\break}?>advect3D, %</oasis:entry>
         <oasis:entry colname="col2">0</oasis:entry>
         <oasis:entry colname="col3">339</oasis:entry>
         <oasis:entry colname="col4">324</oasis:entry>
         <oasis:entry colname="col5">340</oasis:entry>
         <oasis:entry colname="col6">349</oasis:entry>
         <oasis:entry colname="col7">290</oasis:entry>
         <oasis:entry colname="col8">291</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">d/24 h</oasis:entry>
         <oasis:entry colname="col2">8</oasis:entry>
         <oasis:entry colname="col3">79</oasis:entry>
         <oasis:entry colname="col4">219</oasis:entry>
         <oasis:entry colname="col5">360</oasis:entry>
         <oasis:entry colname="col6">864</oasis:entry>
         <oasis:entry colname="col7">1763</oasis:entry>
         <oasis:entry colname="col8">2556</oasis:entry>
         <oasis:entry colname="col9"/>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

</sec>
<sec id="Ch1.S4">
  <label>4</label><title>Organization of the calculations in non-parallel code</title>
      <p id="d1e813">Computations in the ocean and sea-ice components are performed using three-dimensional arrays, such as <inline-formula><mml:math id="M29" display="inline"><mml:mrow><mml:mi>a</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> or <inline-formula><mml:math id="M30" display="inline"><mml:mrow><mml:mi>b</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M31" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M32" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> represent the horizontal grid indices, <inline-formula><mml:math id="M33" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> represents the depth layer, and <inline-formula><mml:math id="M34" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula> represents the ice gradation.  The differential operators are local: only neighboring grid nodes – that is, <inline-formula><mml:math id="M35" display="inline"><mml:mrow><mml:mi>a</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>±</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>±</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> – are used.</p>
      <p id="d1e920">Typical differential operators in the ocean component are organized as shown in Algorithm 2, where <inline-formula><mml:math id="M36" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">500</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">500</mml:mn></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M38" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> represents the number of depth layers.  For land points, <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">39</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, with an approximate mean value of 12 for the remaining wet points; see Fig. <xref ref-type="fig" rid="Ch1.F1"/>. <?xmltex \hack{\\}?></p>
      <p id="d1e1028"><?xmltex \igopts{width=236.157874pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-g02.png"/><?xmltex \hack{\\}?></p>
      <p id="d1e1035"><?xmltex \hack{\newpage}?>Differential operators in the ice component are sho<?pagebreak page846?>wn in Algorithm 3, where <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:mi>M</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">14</mml:mn><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>or</mml:mtext><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mn mathvariant="normal">15</mml:mn></mml:mrow></mml:math></inline-formula> is the number of ice gradations, and <inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:mtext>mask</mml:mtext><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the logical mask of wet points.  The percentage of wet points is 33 %. <?xmltex \hack{\\\\}?></p>
      <p id="d1e1077"><?xmltex \igopts{width=227.622047pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-g03.png"/></p>
      <p id="d1e1083">Note that arrays in Fortran are arranged in column major order, so the first index <inline-formula><mml:math id="M43" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> is linear in memory. The presented arrangement of indices is common for ocean models <xref ref-type="bibr" rid="bib1.bibx19" id="paren.21"><named-content content-type="pre">see, for example, NEMO documentation;</named-content></xref>. The loop arrangement is utilized from the original code. Although another arrangement may be more efficient, it does not affect the parallelization approach given later on.  In spite of the fact that the inner loop does not have stride-1 access, we can speculate that it allows for possible automatic vectorization over the <inline-formula><mml:math id="M44" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula> index and corresponds to minimal control-flow interruptions due to false <inline-formula><mml:math id="M45" display="inline"><mml:mrow><mml:mtext>mask</mml:mtext><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> values.</p>
</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Modifications of the non-parallel code</title>
      <p id="d1e1132">In this section we describe the partitioning algorithm of the model domain into subdomains, each corresponding to a CPU core, and subsequent modifications of the single-core calculations, which require only minor changes to Algorithms 2 and 3. Grid partition is performed in two steps: the model domain is decomposed into small blocks, and then these blocks are distributed over CPU cores in such a way that computational load imbalance is minimized. We utilize a common grid partition for both sea-ice and ocean submodels and provide theoretical estimates of the load imbalances resulting from the application of different weight functions in the balancing problem. The partition is calculated during the model initialization stage, as our balancing algorithm (Hilbert curves) is computationally inexpensive. Also, we guarantee that the partition is the same each time the model is run if the parameters of the partitioner were not modified.</p>
      <p id="d1e1135">Computational domain <inline-formula><mml:math id="M46" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>]</mml:mo><mml:mo>×</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is separated into <inline-formula><mml:math id="M47" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> blocks.  If integer division is impossible, then block sizes are <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mtext>div</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>div</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M50" display="inline"><mml:mrow><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> represents horizontal indices of the blocks.  The other points are distributed over the first blocks: <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><?xmltex \hack{\mathrel{{+}{=}}}?><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M52" display="inline"><mml:mrow><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>mod</mml:mtext><mml:mspace width="0.25em" linebreak="nobreak"/><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>; and <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><?xmltex \hack{\mathrel{{+}{=}}}?><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>mod</mml:mtext><mml:mspace width="0.25em" linebreak="nobreak"/><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.  The set of indices corresponding to a block is denoted by <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>[</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">e</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>×</mml:mo><mml:mo>[</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">e</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e1622">To formulate a balancing problem, we must assign weights of computational work to each block and then distribute them among <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> available CPU cores in such a way that all cores have the same amount of work to do, or we must come as close to this as possible provided that the “quality” of the partition is kept.  Connectivity of subdomains (by subdomain we refer to a set of blocks belonging to a CPU core) or the minimum length of the boundary can be chosen as possible criteria for the quality of a partition.  The weight for a block is the sum of weights corresponding to grid points in the range <inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.  The following weights are chosen for 2D and 3D computations, respectively:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M60" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E1"><mml:mtd><mml:mtext>1</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>w</mml:mi><mml:mtext>2d</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mtext>mask</mml:mtext><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E2"><mml:mtd><mml:mtext>2</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>w</mml:mi><mml:mtext>3d</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mtext>mean</mml:mtext><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          where the “mean” operation is applied over wet points.</p>
<sec id="Ch1.S5.SS1">
  <label>5.1</label><title>Trivial 1block partition</title>
      <p id="d1e1765">For a fixed <inline-formula><mml:math id="M61" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, one can find the number of wet blocks (i.e., blocks with at least one non-land point).  In this partition, the number of cores <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is equal to the number of wet blocks, and each CPU core gets exactly one block; see Fig. <xref ref-type="fig" rid="Ch1.F2"/>. By varying <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, possible values of <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> can be found.</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="d1e1816">Three types of partition. Different processor cores are separated by a black line. Hilbert partitions are based on a grid of <inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">128</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">128</mml:mn></mml:mrow></mml:math></inline-formula> blocks. Colors can repeat. The black rectangle in the figure for the hilbert3d partition corresponds to a “shared” array allocated for blocks belonging to a given CPU core.</p></caption>
          <?xmltex \igopts{width=426.791339pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f02.png"/>

        </fig>

</sec>
<sec id="Ch1.S5.SS2">
  <label>5.2</label><title>Hilbert-curve partition</title>
      <p id="d1e1860">For <inline-formula><mml:math id="M66" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being a power of <inline-formula><mml:math id="M67" display="inline"><mml:mn mathvariant="normal">2</mml:mn></mml:math></inline-formula>, the Hilbert curve connecting all the blocks can be constructed <xref ref-type="bibr" rid="bib1.bibx2" id="paren.22"/>. This gives a one-dimensional set of weights that is balanced using the simplest algorithm. The sum of the block weights on the <inline-formula><mml:math id="M68" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> core is denoted by <inline-formula><mml:math id="M69" display="inline"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.  In spite of the fact that the Hilbert curve possesses the locality property (i.e., close indices on the curve correspond to close indices on the grid), it may not provide a partition into connected subdomains if there are a lot of land blocks.  To overcome the problem of possible loss of connectivity, we perform the following optimization procedure; see Algorithm 4. <?xmltex \hack{\\}?></p>
      <p id="d1e1903"><?xmltex \igopts{width=236.157874pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-g04.png"/></p>
      <?pagebreak page847?><p id="d1e1909">Function <monospace>remove_not_connected_subdomains()</monospace> finds the connected subdomain with the maximum work for each CPU core and sends other blocks to neighboring cores. Function <monospace>balance_all_ranks()</monospace> tries to send bordering blocks for each core to neighboring cores to minimize the maximum work on both cores: <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:mo>max⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:msub><mml:mo>)</mml:mo><mml:mo>→</mml:mo><mml:mo>min⁡</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> are for the work on the current CPU core and on a neighboring core, respectively.  The number of iterations is user-defined, and we choose <inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mtext>iter</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">15</mml:mn></mml:mrow></mml:math></inline-formula>, which is usually enough to reach convergence. Note that optimization does not guarantee a global optimum, and function <monospace>remove_not_connected_subdomains()</monospace> may increase load imbalance. Thus, we choose the iteration with the best balancing.  The need for partitioning into connected subdomains comes from the intention to increase the percentage of wet points on CPU cores due to the data structure used; see the following section for a definition of the shared array.</p>
      <p id="d1e1995">The described algorithm performs partitioning into connected subdomains with load imbalance, which is
            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M74" display="block"><mml:mrow><mml:mtext>LI</mml:mtext><mml:mo>=</mml:mo><mml:mn mathvariant="normal">100</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="italic">%</mml:mi><mml:mo>⋅</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>max⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mtext>mean</mml:mtext><mml:mo>(</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mtext>mean</mml:mtext><mml:mo>(</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mi>p</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          representing no more than 10 % in most cases. This is an acceptable accuracy because partitioning itself is not the main objective of the article.</p>
      <p id="d1e2078">We have implemented two baseline partitions: hilbert2d (with weights <inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mtext>2d</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) and hilbert3d (with weights <inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mtext>3d</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>); see Fig. <xref ref-type="fig" rid="Ch1.F2"/>.  As one can see, hilbert2d divides the computational domain on quasi-uniform subdomains, while hilbert3d locates many CPU cores in high-depth regions and few cores in shallow water.  The minimum and maximum number of blocks on a core can be found in Tables <xref ref-type="table" rid="Ch1.T2"/> and <xref ref-type="table" rid="Ch1.T3"/>. When one of these partitions is applied to the whole coupled ocean–ice model, it balances one submodel and unbalances another.  Table <xref ref-type="table" rid="Ch1.T2"/> shows that balancing of 2D computations (<inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:mtext>LI 2D</mml:mtext><mml:mo>→</mml:mo><mml:mo>min⁡</mml:mo></mml:mrow></mml:math></inline-formula>) leads to an imbalance in 3D computations (<inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:mtext>LI 3D</mml:mtext><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">200</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi mathvariant="italic">%</mml:mi></mml:mrow></mml:math></inline-formula>), and Table <xref ref-type="table" rid="Ch1.T3"/> shows the opposite behavior with <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:mtext>LI 2D</mml:mtext><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">300</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi mathvariant="italic">%</mml:mi></mml:mrow></mml:math></inline-formula>. These values are close to the estimates given in Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/> and defined by the ratio between the minimum, maximum, and mean integer depth.  The presented LI values imply a slowdown of one of the submodels by 3 to 4 times because LI increases runtime (<inline-formula><mml:math id="M80" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>) compared to the optimal one (<inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>opt</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) in the following way:
            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M82" display="block"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mtext>LI</mml:mtext><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mtext>opt</mml:mtext></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Table}?><label>Table 2</label><caption><p id="d1e2206">Same as Table <xref ref-type="table" rid="Ch1.T1"/>, but for the hilbert2d partition; min and max operations are applied over CPU cores. The column “estimate” shows the theoretical LI values given in Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/>.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="9">
     <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:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1">CPU cores</oasis:entry>

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

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

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

         <oasis:entry colname="col5">149</oasis:entry>

         <oasis:entry colname="col6">306</oasis:entry>

         <oasis:entry colname="col7">595</oasis:entry>

         <oasis:entry colname="col8">993</oasis:entry>

         <oasis:entry colname="col9">estimate</oasis:entry>

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

         <oasis:entry colname="col1"><inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2"><inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">64</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col5"><inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col6"><inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col7"><inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col8"><inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">min blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">34</oasis:entry>

         <oasis:entry colname="col6">17</oasis:entry>

         <oasis:entry colname="col7">8</oasis:entry>

         <oasis:entry colname="col8">5</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">max blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">54</oasis:entry>

         <oasis:entry colname="col6">30</oasis:entry>

         <oasis:entry colname="col7">17</oasis:entry>

         <oasis:entry colname="col8">11</oasis:entry>

         <oasis:entry colname="col9"/>

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

         <oasis:entry colname="col1">min % of wet points</oasis:entry>

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

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

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

         <oasis:entry colname="col5">28</oasis:entry>

         <oasis:entry colname="col6">27</oasis:entry>

         <oasis:entry colname="col7">22</oasis:entry>

         <oasis:entry colname="col8">19</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 2D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">7</oasis:entry>

         <oasis:entry colname="col6">4</oasis:entry>

         <oasis:entry colname="col7">12</oasis:entry>

         <oasis:entry colname="col8">28</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">0</oasis:entry>

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

         <oasis:entry colname="col1">LI iceadvect, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">12</oasis:entry>

         <oasis:entry colname="col6">10</oasis:entry>

         <oasis:entry colname="col7">19</oasis:entry>

         <oasis:entry colname="col8">27</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 3D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">205</oasis:entry>

         <oasis:entry colname="col6">213</oasis:entry>

         <oasis:entry colname="col7">222</oasis:entry>

         <oasis:entry colname="col8">255</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">225</oasis:entry>

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

         <oasis:entry colname="col1">LI advect3D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">217</oasis:entry>

         <oasis:entry colname="col6">242</oasis:entry>

         <oasis:entry colname="col7">235</oasis:entry>

         <oasis:entry colname="col8">264</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">d/24 h</oasis:entry>

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

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

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

         <oasis:entry colname="col5">523</oasis:entry>

         <oasis:entry colname="col6">890</oasis:entry>

         <oasis:entry colname="col7">1826</oasis:entry>

         <oasis:entry colname="col8">2511</oasis:entry>

         <oasis:entry colname="col9"/>

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

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Table}?><label>Table 3</label><caption><p id="d1e2626">Same as Table <xref ref-type="table" rid="Ch1.T2"/>, but for the hilbert3d partition.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="9">
     <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:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1">CPU cores</oasis:entry>

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

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

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

         <oasis:entry colname="col5">149</oasis:entry>

         <oasis:entry colname="col6">306</oasis:entry>

         <oasis:entry colname="col7">595</oasis:entry>

         <oasis:entry colname="col8">993</oasis:entry>

         <oasis:entry colname="col9">estimate</oasis:entry>

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

         <oasis:entry colname="col1"><inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2"><inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M93" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">64</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">64</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col5"><inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col6"><inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col7"><inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col8"><inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">min blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">11</oasis:entry>

         <oasis:entry colname="col6">5</oasis:entry>

         <oasis:entry colname="col7">2</oasis:entry>

         <oasis:entry colname="col8">1</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">max blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">155</oasis:entry>

         <oasis:entry colname="col6">93</oasis:entry>

         <oasis:entry colname="col7">55</oasis:entry>

         <oasis:entry colname="col8">39</oasis:entry>

         <oasis:entry colname="col9"/>

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

         <oasis:entry colname="col1">min % of wet points</oasis:entry>

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

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

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

         <oasis:entry colname="col5">22</oasis:entry>

         <oasis:entry colname="col6">22</oasis:entry>

         <oasis:entry colname="col7">26</oasis:entry>

         <oasis:entry colname="col8">25</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 2D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">268</oasis:entry>

         <oasis:entry colname="col6">312</oasis:entry>

         <oasis:entry colname="col7">311</oasis:entry>

         <oasis:entry colname="col8">313</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">300</oasis:entry>

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

         <oasis:entry colname="col1">LI iceadvect,  %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">298</oasis:entry>

         <oasis:entry colname="col6">373</oasis:entry>

         <oasis:entry colname="col7">337</oasis:entry>

         <oasis:entry colname="col8">328</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 3D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">3</oasis:entry>

         <oasis:entry colname="col6">12</oasis:entry>

         <oasis:entry colname="col7">15</oasis:entry>

         <oasis:entry colname="col8">29</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">0</oasis:entry>

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

         <oasis:entry colname="col1">LI advect3D,  %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">18</oasis:entry>

         <oasis:entry colname="col6">16</oasis:entry>

         <oasis:entry colname="col7">23</oasis:entry>

         <oasis:entry colname="col8">36</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">d/24 h</oasis:entry>

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

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

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

         <oasis:entry colname="col5">691</oasis:entry>

         <oasis:entry colname="col6">1216</oasis:entry>

         <oasis:entry colname="col7">2232</oasis:entry>

         <oasis:entry colname="col8">3143</oasis:entry>

         <oasis:entry colname="col9"/>

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

      <p id="d1e3041">A compromise for both submodels can be found by considering a combination of weights:
            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M99" display="block"><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mtext>2d3d</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mtext>2d</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>w</mml:mi><mml:mtext>3d</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M100" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula> is a ratio of runtimes for ocean and ice submodels on one CPU core.  A partition of this type is denoted by hilbert2d3d.  While this weight is optimal for “overlapping” computations of two code sections with different complexity, it is also the optimal weight for “non-overlapping” code sections (i.e., separated by blocking MPI exchanges).  We show this in Appendix <xref ref-type="sec" rid="App1.Ch1.S2"/> with corresponding estimates of LI for 2D (130 %) and 3D (34 %) computations.</p>
</sec>
<sec id="Ch1.S5.SS3">
  <label>5.3</label><title>Data structure and MPI exchanges</title>
      <p id="d1e3101">After partitioning has been performed, we get a set of blocks for each CPU core <inline-formula><mml:math id="M101" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo mathvariant="italic">{</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo mathvariant="italic">}</mml:mo></mml:mrow></mml:math></inline-formula>.  Shared data arrays are allocated for all blocks belonging to a CPU core with the following range of indices (excluding halo):

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M103" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E6"><mml:mtd><mml:mtext>6</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:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo movablelimits="false">min⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>I</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo movablelimits="false">max⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>i</mml:mi><mml:mi mathvariant="normal">e</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>I</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E7"><mml:mtd><mml:mtext>7</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:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo movablelimits="false">min⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>I</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo movablelimits="false">max⁡</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi mathvariant="normal">e</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi>I</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E8"><mml:mtd><mml:mtext>8</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:mi>a</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>:</mml:mo><mml:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>:</mml:mo><mml:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:mo>:</mml:mo><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula></p>

      <?xmltex \floatpos{p}?><fig id="Ch1.F3"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e3351">Blocks belonging to a CPU core are in color, and borders of the allocated array are indicated by a thick line; <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:msub><mml:mtext>mask</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> in colored blocks and 0 elsewhere.</p></caption>
          <?xmltex \igopts{width=179.252362pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f03.png"/>

        </fig>

      <?pagebreak page848?><p id="d1e3385">An example of the shared array size is shown by the rectangle in Fig. <xref ref-type="fig" rid="Ch1.F2"/> for a particular CPU core.  We introduce a mask of grid points belonging to a CPU core (<inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:msub><mml:mtext>mask</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>).  Correspondence between blocks, the shared array, and the mask is clarified in Fig. <xref ref-type="fig" rid="Ch1.F3"/>.  Introducing this mask does not increase the complexity of the algorithms because the mask of the wet points already exists in the original code and is simply modified.  Finally, only minor modifications of the original loops are necessary:<?xmltex \hack{\newpage}?>

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M106" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E9"><mml:mtd><mml:mtext>9</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:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>→</mml:mo><mml:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>i</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E10"><mml:mtd><mml:mtext>10</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:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>→</mml:mo><mml:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>j</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi>p</mml:mi></mml:msubsup><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:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>→</mml:mo><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mtext>mask</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E12"><mml:mtd><mml:mtext>12</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mtext>mask</mml:mtext><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>→</mml:mo><mml:mtext>mask</mml:mtext><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mtext>mask</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula></p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T4" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Table}?><label>Table 4</label><caption><p id="d1e3610">Same as Table <xref ref-type="table" rid="Ch1.T2"/>, but for the hilbert2d3d partition; “estimate” is given in Appendix <xref ref-type="sec" rid="App1.Ch1.S2"/>.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="9">
     <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:colspec colnum="8" colname="col8" align="right"/>
     <oasis:colspec colnum="9" colname="col9" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">

         <oasis:entry colname="col1">CPU cores</oasis:entry>

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

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

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

         <oasis:entry colname="col5">149</oasis:entry>

         <oasis:entry colname="col6">306</oasis:entry>

         <oasis:entry colname="col7">595</oasis:entry>

         <oasis:entry colname="col8">993</oasis:entry>

         <oasis:entry colname="col9">estimate</oasis:entry>

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

         <oasis:entry colname="col1"><inline-formula><mml:math id="M107" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col2"><inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col3"><inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">64</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col4"><inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">64</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col5"><inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col6"><inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col7"><inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col8"><inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">128</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">min blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">14</oasis:entry>

         <oasis:entry colname="col6">6</oasis:entry>

         <oasis:entry colname="col7">3</oasis:entry>

         <oasis:entry colname="col8">2</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">max blocks</oasis:entry>

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

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

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

         <oasis:entry colname="col5">104</oasis:entry>

         <oasis:entry colname="col6">64</oasis:entry>

         <oasis:entry colname="col7">38</oasis:entry>

         <oasis:entry colname="col8">23</oasis:entry>

         <oasis:entry colname="col9"/>

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

         <oasis:entry colname="col1">min % of wet points</oasis:entry>

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

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

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

         <oasis:entry colname="col5">23</oasis:entry>

         <oasis:entry colname="col6">23</oasis:entry>

         <oasis:entry colname="col7">27</oasis:entry>

         <oasis:entry colname="col8">24</oasis:entry>

         <oasis:entry colname="col9"/>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 2D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">131</oasis:entry>

         <oasis:entry colname="col6">130</oasis:entry>

         <oasis:entry colname="col7">142</oasis:entry>

         <oasis:entry colname="col8">139</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">130</oasis:entry>

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

         <oasis:entry colname="col1">LI iceadvect, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">150</oasis:entry>

         <oasis:entry colname="col6">156</oasis:entry>

         <oasis:entry colname="col7">150</oasis:entry>

         <oasis:entry colname="col8">145</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">LI 3D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">26</oasis:entry>

         <oasis:entry colname="col6">27</oasis:entry>

         <oasis:entry colname="col7">41</oasis:entry>

         <oasis:entry colname="col8">66</oasis:entry>

         <oasis:entry rowsep="1" colname="col9" morerows="1">34</oasis:entry>

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

         <oasis:entry colname="col1">LI advect3D, %</oasis:entry>

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

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

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

         <oasis:entry colname="col5">32</oasis:entry>

         <oasis:entry colname="col6">29</oasis:entry>

         <oasis:entry colname="col7">48</oasis:entry>

         <oasis:entry colname="col8">72</oasis:entry>

       </oasis:row>
       <oasis:row>

         <oasis:entry colname="col1">d/24 h</oasis:entry>

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

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

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

         <oasis:entry colname="col5">811</oasis:entry>

         <oasis:entry colname="col6">1615</oasis:entry>

         <oasis:entry colname="col7">2718</oasis:entry>

         <oasis:entry colname="col8">3463</oasis:entry>

         <oasis:entry colname="col9"/>

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

      <?xmltex \floatpos{t}?><fig id="Ch1.F4" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e4029">Speedup compared to one core for two functions: <monospace>advect3D</monospace> and <monospace>iceadvect</monospace>.  Solid and dashed lines correspond to measurements with and without MPI exchanges, respectively.  Different partitions are shown in color (1block, hilbert2d, and hilbert3d).</p></caption>
          <?xmltex \igopts{width=426.791339pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f04.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e4046">Scatter plot: percentage of wet points on a core – <monospace>advect3D</monospace> runtime (without MPI exchanges for 1 model day).  Each point corresponds to one CPU core.  Figures correspond to the hilbert3d partition with different numbers of CPU cores.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-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="d1e4060">Scatter plot: number of computational points for 3D calculations on a core – <monospace>advect3D</monospace> runtime (without MPI exchanges for 1 model day). Each point corresponds to one CPU core. Solid lines show the average values along the <inline-formula><mml:math id="M115" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M116" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula> axes. Figures correspond to the hilbert3d partition with different numbers of CPU cores.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f06.png"/>

        </fig>

      <p id="d1e4087">Usually (see <xref ref-type="bibr" rid="bib1.bibx9 bib1.bibx8" id="altparen.23"/>), arrays are allocated for each block separately.  This has the following advantages.
<list list-type="bullet"><list-item>
      <p id="d1e4095">There is more efficient cache usage.</p></list-item><list-item>
      <p id="d1e4099">If the number of blocks is large enough to get proper balancing, then there is no need for <inline-formula><mml:math id="M117" display="inline"><mml:mrow><mml:msub><mml:mtext>mask</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, thus giving an advance in vectorization and so on.</p></list-item></list>
It also introduces some drawbacks.
<list list-type="bullet"><list-item>
      <p id="d1e4126">There are overheads for copying block boundaries (small blocks like <inline-formula><mml:math id="M118" display="inline"><mml:mrow><mml:mn mathvariant="normal">4</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula> are prohibited).</p></list-item><list-item>
      <p id="d1e4142">Many modifications of the original code are necessary, especially in service routines, I/O, and so on.</p></list-item></list>
Consequently, the main strength of our approach is the ability to incorporate balancing while keeping the original program code as simple as for the trivial 1block partition.  We expect that a shared array may be not optimal for near-land CPU cores with <inline-formula><mml:math id="M119" display="inline"><mml:mrow><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">20</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="italic">%</mml:mi></mml:mrow></mml:math></inline-formula>  wet points because of non-efficient cache usage.  An example of such a core is shown by the rectangle in Fig. <xref ref-type="fig" rid="Ch1.F2"/>.  An experimental study of runtime dependence on the percentage of wet points will be carried out.</p>
      <p id="d1e4161">Borders of blocks neighboring other CPU cores are sent using MPI.  The following optimizations are applied to reduce the exchange time.
<list list-type="bullet"><list-item>
      <p id="d1e4166">All block boundaries adjacent to a given CPU core are copied to a single buffer array, which is sent in one <monospace>MPI_Send</monospace> call.</p></list-item><list-item>
      <p id="d1e4173">If possible, a diagonal halo exchange is included in cross-exchanges with extra width.</p></list-item><list-item>
      <p id="d1e4177">There is an option to send borders of two or more model fields in one <monospace>MPI_Send</monospace> call.</p></list-item><list-item>
      <p id="d1e4184">Borders in the sea component are sent up to <inline-formula><mml:math id="M120" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> depth (i.e., only the actually used layers are transmitted).</p></list-item></list>
The first three points reduce the latency cost in many cores, and the final point reduces bandwidth limitations.</p>
</sec>
<?pagebreak page849?><sec id="Ch1.S5.SS4">
  <label>5.4</label><title>Parallel solver of the SLAE</title>
      <p id="d1e4214">As we have already mentioned, the time-implicit equation for the free surface is reduced to an SLAE with a sparse 19-diagonal matrix.  This is solved by a parallel implementation of the BICGSTAB  algorithm preconditioned by block ILU(0) with overlapping blocks; see <xref ref-type="bibr" rid="bib1.bibx23" id="text.24"/>. The ILU(0) preconditioner preserves the 19-diagonal matrix structure, wherein matrix blocks are defined for each CPU core and correspond to wet points plus a band of border points of width 2.  Because blocks are defined by the partition, the convergence rate depends on the number of CPU cores.  Nevertheless, we have found that in the range from 1<?pagebreak page850?> to 996 CPU cores, it is sufficient to perform 6 to 10 iterations in order to reach the relative residual <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mo>‖</mml:mo><mml:mi>A</mml:mi><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:mi>b</mml:mi><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:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">6</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.</p>
</sec>
</sec>
<sec id="Ch1.S6">
  <label>6</label><title>Numerical experiments</title>
      <p id="d1e4266">Our experiments were performed on the cluster at the Joint Supercomputer Center of the Russian Academy of Sciences (<uri>http://www.jscc.ru/</uri>, last access: 2 February 2021).  Each node includes two 16-core Intel Xeon E5-2697Av4 processors (Broadwell).  The software code was compiled by the Intel Fortran Compiler ifort 14.0.1 with the optimization option -O2.  Low-core simulations were performed for 3 model days (2592 time steps).  The model on 993 CPU cores is launched for 30 d, with subsequent rescaling of the results.  During the first day, we call an <monospace>MPI_Barrier</monospace> function to measure the performance of particular procedures with and without exchanges.  During the last 2 d, an <monospace>MPI_Barrier</monospace> is omitted and overall performance is assessed.  The number of cores for tests is guided by the 1block partition method, which is highly restricted in the allowable number of cores.  We first show how the most time-consuming functions corresponding to ocean and ice submodels accelerate for three partitions: 1block, hilbert2d, and hilbert3d (see Fig. <xref ref-type="fig" rid="Ch1.F2"/>). We then study the overall performance of the model using four partitions, including hilbert2d3d with combined weights (Eq. <xref ref-type="disp-formula" rid="Ch1.E5"/>).</p>
      <p id="d1e4282">The maximum grid size of blocks for our model is <inline-formula><mml:math id="M122" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">128</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">128</mml:mn></mml:mrow></mml:math></inline-formula> because the MPI exchange width is limited by the block size, while the SLAE solver requires an exchange of width 2.  Note that due to the data structure that we used, the performance of Hilbert-type partitions is almost insensitive to <inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> at a moderate number of CPU cores.  Nevertheless, <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">b</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> may be tuned by hand to decrease the complexity of the partition optimization procedure or to increase the percentage of wet points on a core. In runs with many CPU cores, we use the maximum available number of blocks to get better balancing.  The parameters that we used in the experiments are given in Tables <xref ref-type="table" rid="Ch1.T1"/>, <xref ref-type="table" rid="Ch1.T2"/>, <xref ref-type="table" rid="Ch1.T3"/>, and <xref ref-type="table" rid="Ch1.T4"/>.</p>
<?pagebreak page851?><sec id="Ch1.S6.SS1">
  <label>6.1</label><title>Speedup of scalar and ice advection</title>
      <p id="d1e4349">Advections of scalars (<monospace>advect3D</monospace>, depth-dependent) and ice (<monospace>iceadvect</monospace>, depth-independent) are the most time-consuming procedures in ocean and ice submodels, respectively. In the following, we will show that the hilbert3d partition is appropriate for <monospace>advect3D</monospace> and hilbert2d for <monospace>iceadvect</monospace>.</p>
      <p id="d1e4364">Speedup for the mentioned procedures is given in Fig. <xref ref-type="fig" rid="Ch1.F4"/>.  Dashed lines correspond to measurements of code sections between MPI exchanges and show how pure computations accelerate.  Pure computations in <monospace>advect3D</monospace> accelerate linearly for the hilbert3d partition, while pure computations in <monospace>iceadvect</monospace> accelerate superlinearly for the hilbert2d partition.  Superlinearity (parallel efficiency is greater than 100 % when “doubling” the number of cores) occurs in the range of cores 1–149, and we have investigated the possible reasons for this using the open-access Intel Advisor profiler. We have found that on 1 core the most time-demanding memory requests are the DRAM data upload, while on 149 cores most memory requests correspond to the L1 cache. Thus, superlinearity can be partially explained by better cache utilization when the number of cores increases. Note that more local memory access pattern (MAP) can decrease the limitations caused by the memory requests and can be achieved by incorporating stride-1 access for the inner loop indices, but we leave this point for optimizations in the future.</p>
      <p id="d1e4375">Speedup including MPI exchanges is shown in Fig. <xref ref-type="fig" rid="Ch1.F4"/> with solid lines. The function <monospace>advect3D</monospace> is only slightly limited by MPI exchanges on 993 cores: its speedup on the partition hilbert3d falls from 940 to 640 when exchanges are accounted for.  Meanwhile, <monospace>iceadvect</monospace> loses speedup from 1540 to 576 after accounting for exchanges on the hilbert2d partition.  Both functions have an identical number of exchanges, but <monospace>advect3D</monospace> is more computationally expensive. Consequently, we explain the worse performance of <monospace>iceadvect</monospace> by a lower ratio of the number of operations to the number of points to exchange.  A similar bottleneck due to exchanges in 2D dynamics is reported in <xref ref-type="bibr" rid="bib1.bibx17" id="text.25"/>.  The hilbert2d partition has a slight advantage (about 15 %–20 %) over the 1block partition for both functions (see solid lines).  In total, as we expected, the hilbert3d partition is suitable for the <monospace>advect3D</monospace> function, and its acceleration is 2 to 3 times more efficient than when the 1block and hilbert2d partitions are used.  Also, the hilbert2d and 1block partitions show the function <monospace>iceadvect</monospace> that is 2 to 4 times faster compared to the hilbert3d partition.  The different accelerations are strongly connected to balancing of computations.  To check partition-based (LI 3D and LI 2D) and runtime-based (LI advect3D and LI iceadvect, respectively) load imbalance for 3D and 2D computations, see Tables <xref ref-type="table" rid="Ch1.T1"/>–<xref ref-type="table" rid="Ch1.T3"/>.  Note that theoretical and practical LIs are moderately close to each other, which confirms our choice of weights (Eqs. <xref ref-type="disp-formula" rid="Ch1.E1"/> and <xref ref-type="disp-formula" rid="Ch1.E2"/>) for these functions. Also note that the data structure and organization of the calculations are appropriate for load balancing.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e4414">Speedup compared to one core for the full model.  Different partitions are shown in color (1block, hilbert2d, hilbert3d, hilbert2d3d).</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f07.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e4425">Relative contribution of different code sections to runtime; ocean – all procedures corresponding to ocean submodel including <monospace>advect3D</monospace>, ice – ice submodel including <monospace>iceadvect</monospace>, processing – computation of statistics, I/O – input/output with scatter–gather functions, SLAE – matrix inverse, other – simple service procedures.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f08.png"/>

        </fig>

      <?pagebreak page852?><p id="d1e4440">Further analysis reveals that the runtime-based LI could be 4 %–25 % more than the partition-based one; see Tables <xref ref-type="table" rid="Ch1.T2"/> and <xref ref-type="table" rid="Ch1.T3"/>.  This may be connected to overheads introduced by non-efficient organization of memory.  We allocate a shared array for all blocks belonging to a CPU core, and near-land cores may have only 20 % of the wet points (see Tables <xref ref-type="table" rid="Ch1.T2"/> and <xref ref-type="table" rid="Ch1.T3"/>), which can lead to an increase in cache misses.  Figure <xref ref-type="fig" rid="Ch1.F5"/> shows a scatter plot for the percent of wet points vs. <monospace>advect3D</monospace> runtime without exchanges (each point corresponds to some CPU core).  One can clearly see that on a moderate number of cores (149) the computations are limited by the core with the smallest percentage of wet points, which has the maximal runtime. Figure <xref ref-type="fig" rid="Ch1.F6"/> additionally shows that the spread in runtime cannot be explained by the difference in the number of computational points; i.e.,  the partitioning algorithm works well for 149 cores.  Although organization of the calculations may slightly limit model efficiency on a moderate number of cores, it does not limit the model efficiency on 993 cores, for which the major part of the <monospace>advect3D</monospace> runtime spread is explained by the imperfect balancing (see Fig. <xref ref-type="fig" rid="Ch1.F6"/>) but not the data structure (see Fig. <xref ref-type="fig" rid="Ch1.F5"/>).  Stagnation of the balancing procedure is evident from the fact that the minimum number of blocks located on a CPU core is 1 for 993 cores; see Table <xref ref-type="table" rid="Ch1.T3"/>. Note that the computational subdomain corresponding to one CPU core is small enough: on average, it has <inline-formula><mml:math id="M125" display="inline"><mml:mrow><mml:mn mathvariant="normal">9</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">9</mml:mn></mml:mrow></mml:math></inline-formula> horizontal points with 12 vertical levels for 993 cores.
<?xmltex \hack{\newpage}?></p>
</sec>
<sec id="Ch1.S6.SS2">
  <label>6.2</label><title>Speedup of the full model</title>
      <p id="d1e4490">The coupled ocean–ice model is launched on the same CPU cores for both submodels with a common horizontal partition.  Input/output functions are sequential and utilize gather–scatter operations, which are given by our library of parallel exchanges.  Speedup for the full model compared to one CPU core is given in Fig. <xref ref-type="fig" rid="Ch1.F7"/>.  Maximum speedup, approximately 430, corresponds to the partition with combined weights (hilbert2d3d) on 993 cores.  Compared to the simplest partition (1block), the hilbert2d3d model is 115 % faster on 149 cores and 40 % faster on 993 cores.  Partition hilbert2d3d also gives an advantage over partitions balancing purely 2D and 3D computations (hilbert2d, hilbert3d). On 993 CPU cores, the parallel exchanges in this model have the following contributions to the runtime: 20 % for boundary exchanges, 18 % for gather–scatter, and 6.5 % for Allreduce.</p>
      <p id="d1e4495">The relative contribution of different code sections to runtime is given in Fig. <xref ref-type="fig" rid="Ch1.F8"/>.  In the case of perfect scaling of all procedures, the relative contribution must be the same as the number of CPU core rises.  For partitions 1block and hilbert2d, we see a slowdown of the ocean component.  Partition hilbert3d suffers from a slowdown of the ice component.  Finally, the closest preservation of time distribution is found for the hilbert2d3d model.  We did not pay much attention to the processing code section because, although it accelerates, its computational cost could be reduced.  The section I/O gradually saturates due to gather–scatter operations, which consume 85 % of I/O runtime on 993 CPU cores.  The new parallel solver (SLAE) has fast convergence and low computational cost but suffers from Allreduce operations: in our implementation each iteration demands five <monospace>MPI_Allreduce</monospace> calls, which account for 60 % of SLAE code section runtime on 993 cores.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F9"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e4505">Absolute contribution of different code sections to runtime on 993 CPU cores.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f09.png"/>

        </fig>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T5" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Table}?><label>Table 5</label><caption><p id="d1e4518">Efficiency of the time step loop for the FEMAO model compared to global ocean–ice models.  Rescaled SYPD (rSYPD, Eq. <xref ref-type="disp-formula" rid="Ch1.E13"/>) accounts for the difference in time steps and the number of horizontal mesh points and CPU cores.  Original values are published in <xref ref-type="bibr" rid="bib1.bibx17" id="text.26"/>, <xref ref-type="bibr" rid="bib1.bibx12" id="text.27"/>, and <xref ref-type="bibr" rid="bib1.bibx26" id="text.28"/>, but we took our values directly from Table 3 in <xref ref-type="bibr" rid="bib1.bibx17" id="text.29"/>.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="6">
     <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:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Model</oasis:entry>
         <oasis:entry colname="col2">Mesh <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:mtext>points</mml:mtext><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Cores</oasis:entry>
         <oasis:entry colname="col4">Time step, s</oasis:entry>
         <oasis:entry colname="col5">SYPD</oasis:entry>
         <oasis:entry colname="col6">rSYPD</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">POP</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M127" display="inline"><mml:mn mathvariant="normal">5.8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">16 875</oasis:entry>
         <oasis:entry colname="col4">173</oasis:entry>
         <oasis:entry colname="col5">10.5</oasis:entry>
         <oasis:entry colname="col6">24.4</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">FESOM2/STORM</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M128" display="inline"><mml:mn mathvariant="normal">5.6</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">13 828</oasis:entry>
         <oasis:entry colname="col4">600</oasis:entry>
         <oasis:entry colname="col5">15.9</oasis:entry>
         <oasis:entry colname="col6">12.5</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">NEMO</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M129" display="inline"><mml:mn mathvariant="normal">0.9</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">3840</oasis:entry>
         <oasis:entry colname="col4">1440</oasis:entry>
         <oasis:entry colname="col5">25.3</oasis:entry>
         <oasis:entry colname="col6">4.8</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">MOM5.1</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M130" display="inline"><mml:mn mathvariant="normal">0.9</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">3840</oasis:entry>
         <oasis:entry colname="col4">1800</oasis:entry>
         <oasis:entry colname="col5">21.6</oasis:entry>
         <oasis:entry colname="col6">3.3</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">FESOM2/farc</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M131" display="inline"><mml:mn mathvariant="normal">0.6</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">2304</oasis:entry>
         <oasis:entry colname="col4">900</oasis:entry>
         <oasis:entry colname="col5">56.2</oasis:entry>
         <oasis:entry colname="col6">19</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">FEMAO</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M132" display="inline"><mml:mn mathvariant="normal">0.085</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">993</oasis:entry>
         <oasis:entry colname="col4">100</oasis:entry>
         <oasis:entry colname="col5">9.5</oasis:entry>
         <oasis:entry colname="col6">9.5</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e4758">Absolute values of code section runtimes for 1 model day are shown in Fig. <xref ref-type="fig" rid="Ch1.F9"/>.  In comparison to the hilbert3d partition, combining of weights (hilbert2d3d) reduces the cost of the ice component while keeping the ocean component almost without changes (see also Tables <xref ref-type="table" rid="Ch1.T3"/> and <xref ref-type="table" rid="Ch1.T4"/>  for load imbalance values).  In addition, the processing section reduces its runtime because it contains many service functions that are not fully optimized and that are sensitive to stretching of the horizontal area covered by a CPU core: such stretching is done by the hilbert3d partitioner.</p>
      <p id="d1e4767">Simulated years per wall-clock day (SYPD) for the best configuration (hilbert2d3d, 993 cores) are calculated as <inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:mn mathvariant="normal">3463</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">365</mml:mn><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">9.5</mml:mn></mml:mrow></mml:math></inline-formula>; see Table <xref ref-type="table" rid="Ch1.T4"/>. A direct comparison with other coupled ocean–ice models cannot be achieved because our configuration is rare. However, we can rescale the performance (rSYPD) of the time step efficiency of the global models in the following way:
            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M134" display="block"><mml:mrow><mml:mtext>rSYPD</mml:mtext><mml:mo>=</mml:mo><mml:mtext>SYPD</mml:mtext><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mtext>mesh</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msubsup><mml:mi>N</mml:mi><mml:mtext>mesh</mml:mtext><mml:mtext>FEMAO</mml:mtext></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msup><mml:mi>t</mml:mi><mml:mtext>FEMAO</mml:mtext></mml:msup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>N</mml:mi><mml:mi>p</mml:mi><mml:mtext>FEMAO</mml:mtext></mml:msubsup></mml:mrow><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where we take into consideration different numbers of horizontal mesh wet points (<inline-formula><mml:math id="M135" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mtext>mesh</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>), different numbers of CPU cores (<inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>), and different time steps (<inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>), but we neglect different numbers of vertical levels and differences in the formulation of the ice dynamics.  As follows from Table <xref ref-type="table" rid="Ch1.T5"/>, rSYPD is of the order of 10 for all of the ocean–ice models that we have presented, including FEMAO. While this characteristic cannot rate models by their efficiency, we argue that our parallel configuration is comparable to existing parallel ocean–ice models.</p><?xmltex \hack{\newpage}?>
</sec>
</sec>
<?pagebreak page853?><sec id="Ch1.S7" sec-type="conclusions">
  <label>7</label><title>Conclusions</title>
      <p id="d1e4894">In this paper, we present a relatively simple approach to accelerate the FEMAO ocean–ice model based on a rectangular structured grid with advances in load balancing. The modifications that had to be introduced into the program code are identical to those that were required by the simplest decomposition on squares.  The only demand on the model to be accelerated by this technique is marking computational points by a logical mask.  In the first step, we utilize the common partition for ocean and ice submodels.  For a relatively “small” model configuration of <inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:mn mathvariant="normal">500</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">500</mml:mn></mml:mrow></mml:math></inline-formula> horizontal points, we reach parallel efficiency of 60 % for particular functions (3D scalar advection using the 3D-balancing approach and 2D ice advection using the 2D-balancing approach) and 43 % for the full model (using the combined weight approach) on 993 CPU cores. We show that balancing the 3D computations leads to unbalanced 2D computations and vice versa. Consequently, further acceleration may be achieved by performing computations of 2D and 3D components on distinct groups of CPU cores with different partitions.  Nevertheless, high parallel efficiency of 3D scalar advection itself is a great advance for future applications of the model, especially for the version with a pelagic ecology submodel <xref ref-type="bibr" rid="bib1.bibx6" id="paren.30"/>, wherein more than 50 3D scalars (biogeochemical concentrations) are added to the thermohaline fields.</p>
      <p id="d1e4912">Note that while the parallel approach that we have presented here can be implemented into the model in a relatively simple way, the code of the library of parallel exchanges can be rather complex (see the “Code availability” section).</p><?xmltex \hack{\clearpage}?>
</sec>

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

<?pagebreak page854?><app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>Estimating the load imbalance for hilbert2d and hilbert3d partitions</title>
      <p id="d1e4927">Let us introduce two functions of bathymetry (defined by integer depth <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) with the corresponding values for our model:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M140" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E14"><mml:mtd><mml:mtext>A1</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:mo>max⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>max⁡</mml:mo><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mtext>mean</mml:mtext><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">39</mml:mn><mml:mn mathvariant="normal">12</mml:mn></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3.25</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E15"><mml:mtd><mml:mtext>A2</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:mo>min⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mtext>mean</mml:mtext><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>min⁡</mml:mo><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">12</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          here and below, “mean”, “min”, and “max” operations correspond only to wet points.  These values define how balancing of 2D computations affects 3D computation imbalance and vice versa.  Let <inline-formula><mml:math id="M141" display="inline"><mml:mi>S</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M142" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula> be sets of surface and ocean points, respectively, <inline-formula><mml:math id="M143" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> be sets of these points belonging to a CPU core <inline-formula><mml:math id="M145" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math id="M146" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mo>⋅</mml:mo><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula> be the number of points in a set.  The number of 3D points can be expressed via 2D points:
          <disp-formula id="App1.Ch1.S1.Ex1"><mml:math id="M147" display="block"><mml:mrow><mml:mo>|</mml:mo><mml:mi>V</mml:mi><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:munder><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e5211">When balancing of 2D computations is used (hilbert2d), surface points are distributed among processors in roughly equal amounts (<inline-formula><mml:math id="M148" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>).  Then, for 3D computations, the ratio of maximum work to mean work among cores is defined as

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M149" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E16"><mml:mtd><mml:mtext>A3</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mtext>max</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>≈</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

          and the corresponding load imbalance is
          <disp-formula id="App1.Ch1.S1.E17" content-type="numbered"><label>A4</label><mml:math id="M150" display="block"><mml:mrow><mml:mtext>LI</mml:mtext><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>=</mml:mo><mml:mn mathvariant="normal">225</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi mathvariant="italic">%</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <?pagebreak page855?><p id="d1e5481">When balancing of 3D computations is used (hilbert3d), ocean points are distributed among processors in roughly equal amounts (<inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:mo>|</mml:mo><mml:mi>V</mml:mi><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>).  Then, for 2D computations, the ratio of maximum work to mean work is defined as

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M152" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E18"><mml:mtd><mml:mtext>A5</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>|</mml:mo><mml:mi>V</mml:mi><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>min</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>≈</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>min⁡</mml:mo></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

          and the corresponding load imbalance is
          <disp-formula id="App1.Ch1.S1.E19" content-type="numbered"><label>A6</label><mml:math id="M153" display="block"><mml:mrow><mml:mtext>LI</mml:mtext><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>min⁡</mml:mo></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>=</mml:mo><mml:mn mathvariant="normal">300</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi mathvariant="italic">%</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        <?xmltex \hack{\clearpage}?></p>
</app>

<app id="App1.Ch1.S2">
  <?xmltex \currentcnt{B}?><label>Appendix B</label><title>Finding the optimal weight for non-overlapping 2D and 3D calculations</title>
      <p id="d1e5817">Let <inline-formula><mml:math id="M154" display="inline"><mml:mi>W</mml:mi></mml:math></inline-formula> be a full computational work, and let it be distributed between 3D (<inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:msup><mml:mi>W</mml:mi><mml:mtext>3d</mml:mtext></mml:msup></mml:mrow></mml:math></inline-formula>) and 2D (<inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:msup><mml:mi>W</mml:mi><mml:mtext>2d</mml:mtext></mml:msup></mml:mrow></mml:math></inline-formula>) computations with the ratio <inline-formula><mml:math id="M157" 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>: <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:mi>W</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi>W</mml:mi><mml:mtext>2d</mml:mtext></mml:msup><mml:mo>+</mml:mo><mml:msup><mml:mi>W</mml:mi><mml:mtext>3d</mml:mtext></mml:msup><mml:mo>∼</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</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:msup><mml:mi>W</mml:mi><mml:mtext>2d</mml:mtext></mml:msup></mml:mrow></mml:math></inline-formula>. Our goal is to find a weight function <inline-formula><mml:math id="M159" display="inline"><mml:mrow><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which corresponds to minimal joint (2D and 3D) load imbalance.  We use the notation presented in the previous Appendix, and we define the number of computational points corresponding to the weight <inline-formula><mml:math id="M160" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:msup><mml:mi>V</mml:mi><mml:mi mathvariant="normal">w</mml:mi></mml:msup><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5969">Assuming equipartition with respect to this weight (<inline-formula><mml:math id="M161" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:msubsup><mml:mi>V</mml:mi><mml:mi>p</mml:mi><mml:mi mathvariant="normal">w</mml:mi></mml:msubsup><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:mo>|</mml:mo><mml:msup><mml:mi>V</mml:mi><mml:mi mathvariant="normal">w</mml:mi></mml:msup><mml:mo>|</mml:mo><mml:mo>/</mml:mo><mml:msub><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>), we can derive LI for 2D calculations,
          <disp-formula id="App1.Ch1.S2.E20" content-type="numbered"><label>B1</label><mml:math id="M162" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo><mml:mtext>2d</mml:mtext></mml:msubsup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext><mml:mtext>2d</mml:mtext></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>≈</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>min⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        and for 3D calculations,

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M163" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S2.E21"><mml:mtd><mml:mtext>B2</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo><mml:mtext>3d</mml:mtext></mml:msubsup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext><mml:mtext>3d</mml:mtext></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mo>max⁡</mml:mo><mml:mi>p</mml:mi></mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mi>p</mml:mi></mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mtext>mean</mml:mtext><mml:mrow><mml:mo mathvariant="italic">{</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo mathvariant="italic">}</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>≈</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>/</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

          Finally, assuming that 2D and 3D computations are non-overlapping (i.e., the maximum work is under summation),
load imbalance for the full model is calculated as
          <disp-formula id="App1.Ch1.S2.E22" content-type="numbered"><label>B3</label><mml:math id="M164" display="block"><mml:mtable rowspacing="0.2ex" columnspacing="1em" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mtext>LI</mml:mtext><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>W</mml:mi><mml:mtext>mean</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mspace linebreak="nobreak" width="1em"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>min⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>max⁡</mml:mo></mml:msub><mml:mo>(</mml:mo><mml:mi>K</mml:mi><mml:mo>/</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e6560">For a given bathymetry <inline-formula><mml:math id="M165" display="inline"><mml:mrow><mml:mi>K</mml:mi><mml:mo>(</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the ratio <inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula>, and a special type of weight function <inline-formula><mml:math id="M167" display="inline"><mml:mrow><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mtext>2d</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:msub><mml:mi>w</mml:mi><mml:mtext>3d</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:mtext>LI</mml:mtext><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> can be plotted numerically for different values of <inline-formula><mml:math id="M169" display="inline"><mml:mi mathvariant="italic">γ</mml:mi></mml:math></inline-formula>; see Fig. <xref ref-type="fig" rid="App1.Ch1.S2.F10"/>.  The minimum of this function corresponds to the choice <inline-formula><mml:math id="M170" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><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:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula>, and LI values for 2D and 3D computations in this case are 130 % and 34 %, respectively.</p>

      <?xmltex \floatpos{t}?><fig id="App1.Ch1.S2.F10"><?xmltex \currentcnt{B1}?><?xmltex \def\figurename{Figure}?><label>Figure B1</label><caption><p id="d1e6678">Load imbalance for the full model LI<inline-formula><mml:math id="M171" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:mi>w</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal">d</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mi mathvariant="normal">d</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>; <inline-formula><mml:math id="M173" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
        <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/843/2021/gmd-14-843-2021-f10.png"/>

      </fig>

<?xmltex \hack{\clearpage}?>
</app>
  </app-group><notes notes-type="codeavailability"><title>Code availability</title>

      <p id="d1e6762">The version of the FEMAO model used to carry out simulations reported here can be accessed from <ext-link xlink:href="https://doi.org/10.5281/zenodo.3977346" ext-link-type="DOI">10.5281/zenodo.3977346</ext-link> <xref ref-type="bibr" rid="bib1.bibx21" id="paren.31"/>.  The parallel exchange library with a simple example computing the heat equation is archived on Zenodo (<ext-link xlink:href="https://doi.org/10.5281/zenodo.3873239" ext-link-type="DOI">10.5281/zenodo.3873239</ext-link>; <xref ref-type="bibr" rid="bib1.bibx22" id="altparen.32"/>).</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e6780">NI is the developer of the FEMAO model and conceived the research. PP developed the parallel exchange library and implemented it in the most computationally expensive parts of the model. IC completed the implementation and prepared the test configuration with high resolution.  PP performed the experiments and wrote the initial draft of the paper. All of the authors contributed to the final draft of the paper.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e6786">The authors declare that they have no conflict of interest.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e6792">Implementation of the parallel exchange library into the FEMAO model was carried out with the financial support of the Russian Foundation for Basic Research (projects 18-05-60184, 19-35-90023).  The development of the parallel exchange library was carried out with the financial support of the Moscow Center for Fundamental and Applied Mathematics (agreement no. 075-15-2019-1624 with the Ministry of Education and Science of the Russian Federation).</p><p id="d1e6794">We are grateful to Gordey Goyman (INM RAS) for helpful remarks on the final draft of the paper and assistance in code design. Computing resources of the Joint Supercomputer Center of the Russian Academy of Sciences (JSCC RAS) were used.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e6800">This research has been supported by the Russian Foundation for Basic Research (grant nos. 18-05-60184 and 19-35-90023) and the  Ministry of Education and Science of the Russian Federation (agreement no. 075-15-2019-1624).</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e6806">This paper was edited by Richard Mills and reviewed by Nikolay V. Koldunov and one anonymous referee.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Amante and Eakins(2009)}}?><label>Amante and Eakins(2009)</label><?label ETOPO?><mixed-citation>Amante, C. and Eakins, B. W.: ETOPO1 1 Arc-Minute Global Relief Model: procedures, data sources and analysis, Tech. rep., National Geophysical Data Center, <ext-link xlink:href="https://doi.org/10.7289/V5C8276M" ext-link-type="DOI">10.7289/V5C8276M</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Bader(2012)}}?><label>Bader(2012)</label><?label hilbertcurves?><mixed-citation> Bader, M.: Space-filling curves: an introduction with applications in scientific computing, vol. 9, Springer Science &amp; Business Media, New York, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Chaplygin et~al.(2019)Chaplygin, Dianskii, and Gusev}}?><label>Chaplygin et al.(2019)Chaplygin, Dianskii, and Gusev</label><?label chaplygin2019?><mixed-citation> Chaplygin, A. V., Dianskii, N. A., and Gusev, A. V.: Load balancing using Hilbert space-filling curves for parallel shallow water simulations, Vychislitel'nye Metody i Programmirovanie, 20, 75–87, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Chernov(2013)}}?><label>Chernov(2013)</label><?label R1?><mixed-citation> Chernov, I.: Numerical Modelling of large-scale Dynamics of the White Sea, Univ. J. Geosci., 1, 150–153, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{{Chernov and Tolstikov(2020)}}?><label>Chernov and Tolstikov(2020)</label><?label Chernov2020geosci?><mixed-citation>Chernov, I. and Tolstikov, A.: The White Sea: Available Data and Numerical Models, Geosciences, 10, 463, <ext-link xlink:href="https://doi.org/10.3390/geosciences10110463" ext-link-type="DOI">10.3390/geosciences10110463</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Chernov et~al.(2018)}}?><label>Chernov et al.(2018)</label><?label JMS19?><mixed-citation> Chernov, I., Lazzari, P., Tolstikov, A., Kravchishina, M., and Iakovlev, N.: Hydrodynamical and biogeochemical spatiotemporal variability in the White Sea: A modeling study, J. Marine Syst., 187, 23–35, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Danilov et~al.(2015)Danilov, Wang, Timmermann, Iakovlev, Sidorenko, Kimmritz, Jung, and Schr{\"{o}}ter}}?><label>Danilov et al.(2015)Danilov, Wang, Timmermann, Iakovlev, Sidorenko, Kimmritz, Jung, and Schröter</label><?label danilov2015finite?><mixed-citation> Danilov, S., Wang, Q., Timmermann, R., Iakovlev, N., Sidorenko, D., Kimmritz, M., Jung, T., and Schröter, J.: Finite-element sea ice model (FESIM), version 2, Geosci. Model Dev., 8, 1747–1761, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Dennis(2003)}}?><label>Dennis(2003)</label><?label R4?><mixed-citation> Dennis, J. M.: Partitioning with space-filling curves on the cubed-sphere, in: Proceedings International Parallel and Distributed Processing Symposium,   IEEE,  2003.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{Dennis(2007)}}?><label>Dennis(2007)</label><?label R3?><mixed-citation> Dennis, J. M.: Inverse space-filling curve partitioning of a global ocean model, in: 2007 IEEE International Parallel and Distributed Processing Symposium,  1–10,  IEEE,  2007.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Filatov et~al.(2005)}}?><label>Filatov et al.(2005)</label><?label WSea05?><mixed-citation> Filatov, N., Pozdnyakov, D., Johannessen, O. M., Pettersson, L. H., and Bobylev, L. P.: White Sea: its marine environment and ecosystem dynamics influenced by global change, Springer Science &amp; Business Media, Springer-Verlag Berlin Heidelberg, New-York, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Fox-Kemper et~al.(2019)Fox-Kemper, Alistair, and et. al.}}?><label>Fox-Kemper et al.(2019)Fox-Kemper, Alistair, and et. al.</label><?label survey19?><mixed-citation>Fox-Kemper, B., Adcroft, A., Böning, C. W., Chassignet, E. P., Curchitser, E., Danabasoglu, G., Eden, C., England, M. H., Gerdes, R., Greatbatch, R. J., Griffies, S. M.,  Hallberg, R. W.,  Hanert, E., Heimbach, P., Hewitt, H. T., Hill, C. N.,  Komuro, Y., Legg, S., Le Sommer, J., Masina, S., Marsland, S. J., Penny, S. G.,  Qiao, F., Ringler, T. D., Treguier, A. M., Tsujino, H., Uotila, P., and Yeager, S. G.: Challenges and Prospects in Ocean Circulation Models, Front. Mar. Sci., 6, 1–29, <ext-link xlink:href="https://doi.org/10.3389/fmars.2019.00065" ext-link-type="DOI">10.3389/fmars.2019.00065</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Huang et~al.(2016)Huang, Tang, Tseng, Hu, Baker, Bryan, Dennis, Fu, and Yang}}?><label>Huang et al.(2016)Huang, Tang, Tseng, Hu, Baker, Bryan, Dennis, Fu, and Yang</label><?label huang2016?><mixed-citation>Huang, X., Tang, Q., Tseng, Y., Hu, Y., Baker, A. H., Bryan, F. O., Dennis, J., Fu, H., and Yang, G.: P-CSI v1.0, an accelerated barotropic solver for the high-resolution ocean model component in the Community Earth System Model v2.0, Geosci. Model Dev., 9, 4209–4225, <ext-link xlink:href="https://doi.org/10.5194/gmd-9-4209-2016" ext-link-type="DOI">10.5194/gmd-9-4209-2016</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Hunke et~al.(2013)Hunke, Lipscomb, Turner, Jeffery, and Elliott}}?><label>Hunke et al.(2013)Hunke, Lipscomb, Turner, Jeffery, and Elliott</label><?label hunke2010cice?><mixed-citation> Hunke, E. C., Lipscomb, W. H., Turner, A. K., Jeffery, N., and Elliott, S.: CICE: the Los Alamos Sea Ice Model, Documentation and Software, Version 5.0, Los Alamos National Laboratory Tech. Rep. LA-CC-06-012, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Iakovlev(1996)}}?><label>Iakovlev(1996)</label><?label yang96?><mixed-citation> Iakovlev, N.: On the calculation of large-scale ocean currents in the “velocity-pressure” variables by the finite element method, Russ. J. Numer. Anal. Math. Model., 11, 383–392, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Iakovlev(2012)}}?><label>Iakovlev(2012)</label><?label yang12?><mixed-citation>Iakovlev, N.: On the Simulation of Temperature and Salinity Fields in the Arctic Ocean, Izv. Atmos. Ocean. Phys., 48, 86–101, <ext-link xlink:href="https://doi.org/10.1134/S0001433812010136" ext-link-type="DOI">10.1134/S0001433812010136</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Karypis and Kumar(1998)}}?><label>Karypis and Kumar(1998)</label><?label R2?><mixed-citation> Karypis, G. and Kumar, V.: A Fast and Highly Quality Multilevel Scheme for Partitioning Irregular Graph, SIAM J. Sci. Comput., 20, 359–392, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Koldunov et~al.(2019{\natexlab{a}})Koldunov, Aizinger, Rakowsky, Scholz, Sidorenko, Danilov, and Jung}}?><label>Koldunov et al.(2019a)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>, 2019a.</mixed-citation></ref>
      <?pagebreak page857?><ref id="bib1.bibx18"><?xmltex \def\ref@label{{Koldunov et~al.(2019{\natexlab{b}})Koldunov, Danilov, Sidorenko, Hutter, Losch, Goessling, Rakowsky, Scholz, Sein, Wang et~al.}}?><label>Koldunov et al.(2019b)Koldunov, Danilov, Sidorenko, Hutter, Losch, Goessling, Rakowsky, Scholz, Sein, Wang et al.</label><?label koldunov2019fast?><mixed-citation> Koldunov, N. V., Danilov, S., Sidorenko, D., Hutter, N., Losch, M., Goessling, H., Rakowsky, N., Scholz, P., Sein, D., Wang, Q., et al.: Fast EVP Solutions in a High-Resolution Sea Ice Model, J. Adv. Model. Earth Syst., 11, 1269–1284, 2019b.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{Madec et~al.(2008)}}?><label>Madec et al.(2008)</label><?label nemobook?><mixed-citation> Madec, G., and the NEMO team: NEMO ocean engine, Institut Pierre-Simon Laplace,  France, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx20"><?xmltex \def\ref@label{{Parkinson and Washington(1979)}}?><label>Parkinson and Washington(1979)</label><?label parkinson1979large?><mixed-citation> Parkinson, C. L. and Washington, W. M.: A large-scale numerical model of sea ice, J. Geophys. Res.-Oceans, 84, 311–337, 1979.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{Perezhogin et al.(2020a)}?><label>Perezhogin et al.(2020a)</label><?label Perezhogin?><mixed-citation>Perezhogin, P.,  Chernov,
I., and  Iakovlev, N.:  Supplement to paper “Advanced parallel implementation of the coupled ocean-ice model FEMAO with load balancing”, ocean-ice model code, Zenodo, <ext-link xlink:href="https://doi.org/10.5281/zenodo.3977346" ext-link-type="DOI">10.5281/zenodo.3977346</ext-link>, 2020a.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{Perezhogin et al.(2020b)}?><label>Perezhogin et al.(2020b)</label><?label Perezhogin2?><mixed-citation>Perezhogin, P., Chernov, I., and Iakovlev, N.:  Supplement to paper “Advanced parallel implementation of the coupled ocean-ice model FEMAO with load balancing”, Zenodo, <ext-link xlink:href="https://doi.org/10.5281/zenodo.3873239" ext-link-type="DOI">10.5281/zenodo.3873239</ext-link>, 2020b.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Saad(2003)}}?><label>Saad(2003)</label><?label R5?><mixed-citation>Saad, Y.: Iterative methods for sparse linear systems,   SIAM, Philadelphia, 2003.
 </mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Semtner(1976)}}?><label>Semtner(1976)</label><?label semtner1976model?><mixed-citation> Semtner, A. J.: A model for the thermodynamic growth of sea ice in numerical investigations of climate, J. Phys. Oceanogr., 6, 379–389, 1976.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Wang et~al.(2016)Wang, Danilov, Jung, Kaleschke, and Wernecke}}?><label>Wang et al.(2016)Wang, Danilov, Jung, Kaleschke, and Wernecke</label><?label wang2016sea?><mixed-citation> Wang, Q., Danilov, S., Jung, T., Kaleschke, L., and Wernecke, A.: Sea ice leads in the Arctic Ocean: Model assessment, interannual variability and trends, Geophys. Res. Lett., 43, 7019–7027, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Ward(2016)}}?><label>Ward(2016)</label><?label ward2016?><mixed-citation>Ward, M.: Scalability of MOM5, NEMO and MOM6 on NCI's Raijin supercomputer, <ext-link xlink:href="https://www.ecmwf.int/en/elibrary/16837-scalability-mom5-nemo-and-mom6-ncis-raijin-supercomputer">https://www.ecmwf.int/en/elibrary/16837-scalability-mom5-nemo-and-mom6-ncis-raijin-supercomputer</ext-link> (last access: 2 February 2021), 2016.</mixed-citation></ref>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Yakovlev(2009)}}?><label>Yakovlev(2009)</label><?label yakovlev2009reproduction?><mixed-citation> Yakovlev, N.: Reproduction of the large-scale state of water and sea ice in the Arctic Ocean from 1948 to 2002: Part II. The state of ice and snow cover, Izv. Atmos. Ocean. Phys., 45, 478–494, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Zienkiewicz and Taylor(2000)}}?><label>Zienkiewicz and Taylor(2000)</label><?label zienkiewicz2000?><mixed-citation> Zienkiewicz, O. and Taylor, R.: The Finite Element Method, 5th. Ed., Vol. 3: Fluid dynamics, Butterworth and Heinemann, Oxford, 2000.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Advanced parallel implementation of the coupled ocean–ice model FEMAO (version 2.0) with load balancing</article-title-html>
<abstract-html><p>In this paper, we present a parallel version of the finite-element model of the Arctic Ocean (FEMAO) configured for the White Sea and based on MPI technology.  This model consists of two main parts: an ocean dynamics model and a surface ice dynamics model. These parts are very different in terms of the number of computations because the complexity of the ocean part depends on the bottom depth, while that of the sea-ice component does not.  In the first step, we decided to locate both submodels on the same CPU cores with a common horizontal partition of the computational domain.  The model domain is divided into small blocks, which are distributed over the CPU cores using Hilbert-curve balancing.  Partitioning of the model domain is static (i.e., computed during the initialization stage).  There are three baseline options: a single block per core, balancing of 2D computations, and balancing of 3D computations.  After showing parallel acceleration for particular ocean and ice procedures, we construct the common partition, which minimizes joint imbalance in both submodels.  Our novelty is using arrays shared by all blocks that belong to a CPU core instead of allocating separate arrays for each block, as is usually done.  Computations on a CPU core are restricted by the masks of non-land grid nodes and block–core correspondence.  This approach allows us to implement parallel computations into the model that are as simple as when the usual decomposition to squares is used, though with advances in load balancing. We provide parallel acceleration of up to 996 cores for the model with a resolution of 500×500×39 in the ocean component and 43 sea-ice scalars, and we carry out a detailed analysis of different partitions on the model runtime.</p></abstract-html>
<ref-html id="bib1.bib1"><label>Amante and Eakins(2009)</label><mixed-citation> Amante, C. and Eakins, B. W.: ETOPO1 1 Arc-Minute Global Relief Model: procedures, data sources and analysis, Tech. rep., National Geophysical Data Center, <a href="https://doi.org/10.7289/V5C8276M" target="_blank">https://doi.org/10.7289/V5C8276M</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Bader(2012)</label><mixed-citation> Bader, M.: Space-filling curves: an introduction with applications in scientific computing, vol. 9, Springer Science &amp; Business Media, New York, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Chaplygin et al.(2019)Chaplygin, Dianskii, and Gusev</label><mixed-citation> Chaplygin, A. V., Dianskii, N. A., and Gusev, A. V.: Load balancing using Hilbert space-filling curves for parallel shallow water simulations, Vychislitel'nye Metody i Programmirovanie, 20, 75–87, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Chernov(2013)</label><mixed-citation> Chernov, I.: Numerical Modelling of large-scale Dynamics of the White Sea, Univ. J. Geosci., 1, 150–153, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Chernov and Tolstikov(2020)</label><mixed-citation> Chernov, I. and Tolstikov, A.: The White Sea: Available Data and Numerical Models, Geosciences, 10, 463, <a href="https://doi.org/10.3390/geosciences10110463" target="_blank">https://doi.org/10.3390/geosciences10110463</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Chernov et al.(2018)</label><mixed-citation> Chernov, I., Lazzari, P., Tolstikov, A., Kravchishina, M., and Iakovlev, N.: Hydrodynamical and biogeochemical spatiotemporal variability in the White Sea: A modeling study, J. Marine Syst., 187, 23–35, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Danilov et al.(2015)Danilov, Wang, Timmermann, Iakovlev, Sidorenko, Kimmritz, Jung, and Schröter</label><mixed-citation> Danilov, S., Wang, Q., Timmermann, R., Iakovlev, N., Sidorenko, D., Kimmritz, M., Jung, T., and Schröter, J.: Finite-element sea ice model (FESIM), version 2, Geosci. Model Dev., 8, 1747–1761, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Dennis(2003)</label><mixed-citation> Dennis, J. M.: Partitioning with space-filling curves on the cubed-sphere, in: Proceedings International Parallel and Distributed Processing Symposium,   IEEE,  2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Dennis(2007)</label><mixed-citation> Dennis, J. M.: Inverse space-filling curve partitioning of a global ocean model, in: 2007 IEEE International Parallel and Distributed Processing Symposium,  1–10,  IEEE,  2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Filatov et al.(2005)</label><mixed-citation> Filatov, N., Pozdnyakov, D., Johannessen, O. M., Pettersson, L. H., and Bobylev, L. P.: White Sea: its marine environment and ecosystem dynamics influenced by global change, Springer Science &amp; Business Media, Springer-Verlag Berlin Heidelberg, New-York, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Fox-Kemper et al.(2019)Fox-Kemper, Alistair, and et. al.</label><mixed-citation> Fox-Kemper, B., Adcroft, A., Böning, C. W., Chassignet, E. P., Curchitser, E., Danabasoglu, G., Eden, C., England, M. H., Gerdes, R., Greatbatch, R. J., Griffies, S. M.,  Hallberg, R. W.,  Hanert, E., Heimbach, P., Hewitt, H. T., Hill, C. N.,  Komuro, Y., Legg, S., Le Sommer, J., Masina, S., Marsland, S. J., Penny, S. G.,  Qiao, F., Ringler, T. D., Treguier, A. M., Tsujino, H., Uotila, P., and Yeager, S. G.: Challenges and Prospects in Ocean Circulation Models, Front. Mar. Sci., 6, 1–29, <a href="https://doi.org/10.3389/fmars.2019.00065" target="_blank">https://doi.org/10.3389/fmars.2019.00065</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Huang et al.(2016)Huang, Tang, Tseng, Hu, Baker, Bryan, Dennis, Fu, and Yang</label><mixed-citation> Huang, X., Tang, Q., Tseng, Y., Hu, Y., Baker, A. H., Bryan, F. O., Dennis, J., Fu, H., and Yang, G.: P-CSI v1.0, an accelerated barotropic solver for the high-resolution ocean model component in the Community Earth System Model v2.0, Geosci. Model Dev., 9, 4209–4225, <a href="https://doi.org/10.5194/gmd-9-4209-2016" target="_blank">https://doi.org/10.5194/gmd-9-4209-2016</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Hunke et al.(2013)Hunke, Lipscomb, Turner, Jeffery, and Elliott</label><mixed-citation> Hunke, E. C., Lipscomb, W. H., Turner, A. K., Jeffery, N., and Elliott, S.: CICE: the Los Alamos Sea Ice Model, Documentation and Software, Version 5.0, Los Alamos National Laboratory Tech. Rep. LA-CC-06-012, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Iakovlev(1996)</label><mixed-citation> Iakovlev, N.: On the calculation of large-scale ocean currents in the “velocity-pressure” variables by the finite element method, Russ. J. Numer. Anal. Math. Model., 11, 383–392, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Iakovlev(2012)</label><mixed-citation> Iakovlev, N.: On the Simulation of Temperature and Salinity Fields in the Arctic Ocean, Izv. Atmos. Ocean. Phys., 48, 86–101, <a href="https://doi.org/10.1134/S0001433812010136" target="_blank">https://doi.org/10.1134/S0001433812010136</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Karypis and Kumar(1998)</label><mixed-citation> Karypis, G. and Kumar, V.: A Fast and Highly Quality Multilevel Scheme for Partitioning Irregular Graph, SIAM J. Sci. Comput., 20, 359–392, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Koldunov et al.(2019a)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>, 2019a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Koldunov et al.(2019b)Koldunov, Danilov, Sidorenko, Hutter, Losch, Goessling, Rakowsky, Scholz, Sein, Wang et al.</label><mixed-citation> Koldunov, N. V., Danilov, S., Sidorenko, D., Hutter, N., Losch, M., Goessling, H., Rakowsky, N., Scholz, P., Sein, D., Wang, Q., et al.: Fast EVP Solutions in a High-Resolution Sea Ice Model, J. Adv. Model. Earth Syst., 11, 1269–1284, 2019b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Madec et al.(2008)</label><mixed-citation> Madec, G., and the NEMO team: NEMO ocean engine, Institut Pierre-Simon Laplace,  France, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Parkinson and Washington(1979)</label><mixed-citation> Parkinson, C. L. and Washington, W. M.: A large-scale numerical model of sea ice, J. Geophys. Res.-Oceans, 84, 311–337, 1979.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Perezhogin et al.(2020a)</label><mixed-citation>
Perezhogin, P.,  Chernov,
I., and  Iakovlev, N.:  Supplement to paper “Advanced parallel implementation of the coupled ocean-ice model FEMAO with load balancing”, ocean-ice model code, Zenodo, <a href="https://doi.org/10.5281/zenodo.3977346" target="_blank">https://doi.org/10.5281/zenodo.3977346</a>, 2020a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Perezhogin et al.(2020b)</label><mixed-citation>
Perezhogin, P., Chernov, I., and Iakovlev, N.:  Supplement to paper “Advanced parallel implementation of the coupled ocean-ice model FEMAO with load balancing”, Zenodo, <a href="https://doi.org/10.5281/zenodo.3873239" target="_blank">https://doi.org/10.5281/zenodo.3873239</a>, 2020b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Saad(2003)</label><mixed-citation> Saad, Y.: Iterative methods for sparse linear systems,   SIAM, Philadelphia, 2003.

</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Semtner(1976)</label><mixed-citation> Semtner, A. J.: A model for the thermodynamic growth of sea ice in numerical investigations of climate, J. Phys. Oceanogr., 6, 379–389, 1976.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Wang et al.(2016)Wang, Danilov, Jung, Kaleschke, and Wernecke</label><mixed-citation> Wang, Q., Danilov, S., Jung, T., Kaleschke, L., and Wernecke, A.: Sea ice leads in the Arctic Ocean: Model assessment, interannual variability and trends, Geophys. Res. Lett., 43, 7019–7027, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Ward(2016)</label><mixed-citation> Ward, M.: Scalability of MOM5, NEMO and MOM6 on NCI's Raijin supercomputer, <a href="https://www.ecmwf.int/en/elibrary/16837-scalability-mom5-nemo-and-mom6-ncis-raijin-supercomputer" target="_blank">https://www.ecmwf.int/en/elibrary/16837-scalability-mom5-nemo-and-mom6-ncis-raijin-supercomputer</a> (last access: 2 February 2021), 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Yakovlev(2009)</label><mixed-citation> Yakovlev, N.: Reproduction of the large-scale state of water and sea ice in the Arctic Ocean from 1948 to 2002: Part II. The state of ice and snow cover, Izv. Atmos. Ocean. Phys., 45, 478–494, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Zienkiewicz and Taylor(2000)</label><mixed-citation> Zienkiewicz, O. and Taylor, R.: The Finite Element Method, 5th. Ed., Vol. 3: Fluid dynamics, Butterworth and Heinemann, Oxford, 2000.
</mixed-citation></ref-html>--></article>
