<?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">
  <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-91-2021</article-id><title-group><article-title>An <inline-formula><mml:math id="M1" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>-dimensional Fortran interpolation programme (NterGeo.v2020a) for geophysics sciences – application<?xmltex \hack{\break}?> to a back-trajectory programme (Backplumes.v2020r1)<?xmltex \hack{\break}?> using CHIMERE or WRF outputs</article-title><alt-title><inline-formula><mml:math id="M2" display="inline"><mml:mi mathvariant="bold-italic">N</mml:mi></mml:math></inline-formula>-dimensional interpolator</alt-title>
      </title-group><?xmltex \runningtitle{$\vec{N}$-dimensional interpolator}?><?xmltex \runningauthor{B. Bessagnet et al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1 aff2">
          <name><surname>Bessagnet</surname><given-names>Bertrand</given-names></name>
          <email>bertrand.bessagnet@lmd.polytechnique.fr</email>
        <ext-link>https://orcid.org/0000-0003-2062-4681</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Menut</surname><given-names>Laurent</given-names></name>
          
        <ext-link>https://orcid.org/0000-0001-9776-0812</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff3">
          <name><surname>Beauchamp</surname><given-names>Maxime</given-names></name>
          
        </contrib>
        <aff id="aff1"><label>1</label><institution>LMD/IPSL, École Polytechnique, Institut Polytechnique de Paris, ENS, PSL Université, Sorbonne Université, <?xmltex \hack{\break}?>CNRS, 91128 Palaiseau, France</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Citepa, Technical Reference Center for Air Pollution and Climate Change, 42, rue de Paradis 75010 Paris, France</institution>
        </aff>
        <aff id="aff3"><label>3</label><institution>IMT Atlantique, Lab-STICC UMR CNRS, 655 Avenue du Technopôle, 29280 Plouzané, France</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Bertrand Bessagnet (bertrand.bessagnet@lmd.polytechnique.fr)</corresp></author-notes><pub-date><day>7</day><month>January</month><year>2021</year></pub-date>
      
      <volume>14</volume>
      <issue>1</issue>
      <fpage>91</fpage><lpage>106</lpage>
      <history>
        <date date-type="received"><day>31</day><month>March</month><year>2020</year></date>
           <date date-type="rev-request"><day>5</day><month>May</month><year>2020</year></date>
           <date date-type="rev-recd"><day>24</day><month>July</month><year>2020</year></date>
           <date date-type="accepted"><day>5</day><month>November</month><year>2020</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2021 Bertrand Bessagnet 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/91/2021/gmd-14-91-2021.html">This article is available from https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021.pdf</self-uri>
      <abstract><title>Abstract</title>
    <p id="d1e130">An interpolation programme coded in Fortran for irregular <inline-formula><mml:math id="M3" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>-dimensional cases is presented and freely available. The need for interpolation procedures over irregular meshes or matrixes with interdependent input data dimensions is frequent in geophysical models. Also, these models often embed look-up tables of physics or chemistry modules. Fortran is a fast and powerful language and is highly portable. It is easy to interface models written in Fortran with each other. Our programme does not need any libraries; it is written in standard Fortran and tested with two usual compilers. The programme is fast and competitive compared to current Python libraries. A normalization option parameter is provided when considering different types of units on each dimension. Some tests and examples are provided and available in the code package. Moreover, a geophysical application embedding this interpolation programme is provided and discussed; it consists in determining back trajectories using chemistry-transport or mesoscale meteorological model outputs, respectively, from the widely used  CHIMERE and Weather Research and Forecasting (WRF) models.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e149">Interpolation is commonly used in geophysical sciences for post-treatment processing to evaluate model performance against ground station observations. The NetCDF Operators (NCO) library <xref ref-type="bibr" rid="bib1.bibx28" id="paren.1"/> is commonly used in its recent version (v4.9.2) for horizontal and vertical interpolations to manage climate model outputs. The most frequent need is to interpolate in 3-D spatial dimension and time, and therefore in four dimensions. Fortran is extensively used for atmosphere modelling software (<xref ref-type="bibr" rid="bib1.bibx25" id="altparen.2"/>; e.g. the Weather Research and Forecasting model – WRF, <xref ref-type="bibr" rid="bib1.bibx22" id="altparen.3"/>; the Geophysical Fluid Dynamics Laboratory atmospheric component version 3 – GFDL AM3, <xref ref-type="bibr" rid="bib1.bibx2" id="altparen.4"/>). More generally, geophysical models can use look-up tables of complex modules instead of a full coupling strategy between these modules, which is the case of the CHIMERE model <xref ref-type="bibr" rid="bib1.bibx11" id="paren.5"/> with the embedded ISORROPIA module dealing with chemistry and thermodynamics <xref ref-type="bibr" rid="bib1.bibx15 bib1.bibx16" id="paren.6"/>.
In such a case, the look-up table can easily exceed five dimensions to approximate the model. In parallel, artificial intelligence methods are developed and can explore the behaviour of complex model outputs that requires fast interpolation methods. While more recent modern languages like Python are used in the scientific community, Fortran remains widely used in the geophysics and engineering community and is known as one of the faster languages in time execution, performing well on array handling, parallelization and, above all, portability. Some benchmarks are available on website to evaluate the<?pagebreak page92?> performance of languages on simple to complex operations <xref ref-type="bibr" rid="bib1.bibx8" id="paren.7"/>.</p>
      <p id="d1e174">The parameterization techniques proposed to manage aerosol–droplet microphysical schemes <xref ref-type="bibr" rid="bib1.bibx19" id="paren.8"/> can employ either the modified Shepard interpolation method <xref ref-type="bibr" rid="bib1.bibx21" id="paren.9"/> or the Hardy multiquadric interpolation method <xref ref-type="bibr" rid="bib1.bibx4 bib1.bibx5" id="paren.10"/>, and the numerical results obtained show that both methods provide realistic results for a wide range of aerosol mass loadings. For the climate community, a comparison of six methods for the interpolation of daily European climate data is proposed by <xref ref-type="bibr" rid="bib1.bibx6" id="text.11"/>; some of these methods use kriging-like methods with the capability to use co-predictors like the topography.</p>
      <p id="d1e189">A Python procedure called <italic>scipy.interpolate.griddata</italic> is freely available <xref ref-type="bibr" rid="bib1.bibx20" id="paren.12"/>. Unfortunately, this programme is not really adapted to our problem; it could be not enough optimized for our objective as it can manage fully unstructured datasets. The goal of this paper is to present a programme to interpolate in a grid or a matrix which can be irregular (varying intervals) but structured, with the possibility to have interdependent dimensions (e.g. longitude interval edges which depend on longitude, latitude, altitude and time). We think this type of programme can be easily implemented within models or to manage model outputs for post-treatment issues. In short, the novelty of this programme is to fill the gap of interpolation issues between the treatment of very complex unstructured meshes and simple regular grids for a general dimension <inline-formula><mml:math id="M4" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>.</p>
      <p id="d1e205">In order to quantify the impact of such a new interpolation programme and show examples of its use, it is implemented in the  Backplumes back-trajectory model, developed by the same team as the CHIMERE model <xref ref-type="bibr" rid="bib1.bibx11" id="paren.13"/>. This host model is well fit for this implementation, because the most important part of its calculation is an interpolation of a point in a model grid box. This paper describes (i) the methodology and the content of the interpolation programme package <preformat preformat-type="code"><![CDATA[NterGeo]]></preformat> and (ii) an application of this programme embedded in the new back-trajectory programme, <preformat preformat-type="code"><![CDATA[Backplumes]]></preformat>. These two codes are freely available (see code availability section).</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Development of the interpolation programme</title>
      <p id="d1e225">The  NterGeo programme is fit for exploring irregular but structured grids or look-up tables defined by a unique size for each dimension, which  of course  can be different from one to another dimension. The space intervals can vary along a dimension and the grid interval edges in each dimension can depend on other dimensions. Two versions have been developed: (i) a version for “regular” arrays with independent dimensions and (ii) a “general” version for possible interdependent dimensions, e.g. to handle 3-D meshes which have time-varying spatial coordinates. The code does not need any libraries and is written in standard Fortran.
Our interpolation code was tested with <preformat preformat-type="code"><![CDATA[gfortran]]></preformat> (GNU Fortran project) and <preformat preformat-type="code"><![CDATA[ifort]]></preformat> (Intel). Since our programme does not include specific options and is not function compiler dependent, there is no reason to have limitations or errors with other compilers. The top shell calling script in the package provides two sets of options for “production” and “debugging” modes.
Assuming the <inline-formula><mml:math id="M5" display="inline"><mml:mi>X</mml:mi></mml:math></inline-formula> array, the result of the function <inline-formula><mml:math id="M6" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> transforming <inline-formula><mml:math id="M7" display="inline"><mml:mi>X</mml:mi></mml:math></inline-formula> to <inline-formula><mml:math id="M8" display="inline"><mml:mi>Y</mml:mi></mml:math></inline-formula> array in <inline-formula><mml:math id="M9" display="inline"><mml:mi mathvariant="double-struck">R</mml:mi></mml:math></inline-formula> can be expressed as
          <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M10" display="block"><mml:mrow><mml:mi>Y</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>X</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        <inline-formula><mml:math id="M11" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> is the dimension of the array, and
<inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the coordinates at dimension <inline-formula><mml:math id="M13" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>N</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> of the point <inline-formula><mml:math id="M14" display="inline"><mml:mi>X</mml:mi></mml:math></inline-formula> that we want to interpolate.</p>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>The programme for regular grids</title>
      <p id="d1e384">A programme (<preformat preformat-type="code"><![CDATA[interpolation_regular.F90]]></preformat>) for regular grids (i.e. with independent dimensions) is available. To handle this type of grid, a classical multilinear interpolation is performed. Figure <xref ref-type="fig" rid="Ch1.F1"/> shows the variables for <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula> defined hereafter in the section.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1"><?xmltex \currentcnt{1}?><label>Figure 1</label><caption><p id="d1e406">Description of variables for <inline-formula><mml:math id="M16" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula> with a regular grid case.</p></caption>
          <?xmltex \igopts{width=241.848425pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f01.png"/>

        </fig>

      <?pagebreak page93?><p id="d1e427">For the particular case of a regular grid with independent dimensions, the result <inline-formula><mml:math id="M17" display="inline"><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo stretchy="false" mathvariant="normal">̃</mml:mo></mml:mover></mml:math></inline-formula> of the multilinear interpolation of the <inline-formula><mml:math id="M18" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> identified neighbours can be expressed as
            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M19" display="block"><mml:mtable columnspacing="1em" class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo stretchy="false" mathvariant="normal">̃</mml:mo></mml:mover><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msubsup><mml:mi>w</mml:mi><mml:mi>N</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mo>×</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>N</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>×</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi mathvariant="normal">…</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>N</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:msubsup><mml:mo>×</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi mathvariant="normal">…</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>N</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>×</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          with <inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> the binary digit equal to 0 or 1, and the weights <inline-formula><mml:math id="M21" display="inline"><mml:mrow><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> for <inline-formula><mml:math id="M22" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>N</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> defined as
            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M23" display="block"><mml:mrow><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e842">Variable <inline-formula><mml:math id="M24" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Θ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the list of interval edges on each dimension <inline-formula><mml:math id="M25" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> and does not depend on other dimensions. <inline-formula><mml:math id="M26" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> indicates the bottom (<inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>) and top (<inline-formula><mml:math id="M28" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) edges on each dimension <inline-formula><mml:math id="M29" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mi>N</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> so that <inline-formula><mml:math id="M30" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mo>]</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.
<inline-formula><mml:math id="M31" display="inline"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is a one-dimensional array with <inline-formula><mml:math id="M32" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> elements storing the value <inline-formula><mml:math id="M33" display="inline"><mml:mi>Y</mml:mi></mml:math></inline-formula> of the function at the identified neighbours <inline-formula><mml:math id="M34" display="inline"><mml:mi mathvariant="normal">Ψ</mml:mi></mml:math></inline-formula> on each dimension:
            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M35" display="block"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">Ψ</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>N</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>i</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          with
<inline-formula><mml:math id="M36" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e1123">The tuple <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="normal">…</mml:mi><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the binary transformation of integer <inline-formula><mml:math id="M38" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> defined as <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>i</mml:mi></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
The coefficients <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Γ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mi>w</mml:mi><mml:mi>N</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>N</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msubsup><mml:mi mathvariant="normal">…</mml:mi><mml:msubsup><mml:mi>w</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> as a product of weighting factors on each direction can be seen as a binary suite that is convenient to handle in a compacted and optimized Fortran programming strategy for the regular grid version of the code (Appendix <xref ref-type="sec" rid="App1.Ch1.S2"/>).</p>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>The general programme</title>
      <p id="d1e1261">Considering the general programme called <preformat preformat-type="code"><![CDATA[interpolation_general.F90]]></preformat>, the coordinates of edge points are stored in a one-dimensional array of <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:msubsup><mml:mo>∏</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:msubsup><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> elements with <inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> the number of edges on each dimension <inline-formula><mml:math id="M43" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>.
The tuple of coordinates <inline-formula><mml:math id="M44" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>j</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> of an interval edge <inline-formula><mml:math id="M45" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>k</mml:mi><mml:mi>i</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M46" display="inline"><mml:mrow><mml:msub><mml:mi>j</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> the indexed coordinate on dimension <inline-formula><mml:math id="M47" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>, is transformed in a one-dimensional array indexed on <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>n</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> by
            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M49" display="block"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:munderover><mml:mfenced open="(" close=")"><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mfenced><mml:munderover><mml:mo movablelimits="false">∏</mml:mo><mml:mrow><mml:mi>l</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:munderover><mml:msub><mml:mi>I</mml:mi><mml:mi>l</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          with <inline-formula><mml:math id="M50" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> for initialization.</p>
      <p id="d1e1468">Once the nearest neighbour is found, the result <inline-formula><mml:math id="M51" display="inline"><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo mathvariant="normal" stretchy="false">̃</mml:mo></mml:mover></mml:math></inline-formula> of the interpolation is a weighting procedure of the <inline-formula><mml:math id="M52" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> closest vertex using a Shepard interpolation <xref ref-type="bibr" rid="bib1.bibx21" id="paren.14"/> based on the inverse distance calculations:
            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M53" display="block"><mml:mrow><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo stretchy="false" mathvariant="normal">̃</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:munderover><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="normal">Γ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>×</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          with <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="normal">Υ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> the value of the function <inline-formula><mml:math id="M55" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> at neighbour <inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Υ</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of coordinates <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msubsup><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>k</mml:mi><mml:mi>N</mml:mi></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and
            <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M58" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Γ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          The distance <inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> between the point of interest of coordinates <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">…</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>N</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> to the neighbour <inline-formula><mml:math id="M61" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>n</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is calculated as
            <disp-formula id="Ch1.E8" content-type="numbered"><label>8</label><mml:math id="M62" display="block"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:munderover><mml:mo>∣</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>k</mml:mi><mml:mi>i</mml:mi></mml:msubsup><mml:msup><mml:mo>∣</mml:mo><mml:mi>p</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mstyle scriptlevel="+1"><mml:mfrac><mml:mn mathvariant="normal">1</mml:mn><mml:mi>p</mml:mi></mml:mfrac></mml:mstyle></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          The previous formulas are valid for <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>≠</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>; in the case of <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, the procedure stops and exits, returning the exact value of the corresponding data of the nearest neighbour. For a distorted mesh or matrix, or dimensions with different units (e.g. mixing time with length), a hard-coded option (<italic>norm=.true.</italic> or <italic>.false.</italic>) is also available to normalize the intervals with an average interval <inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> value for the calculation of distances, so that
            <disp-formula id="Ch1.E9" content-type="numbered"><label>9</label><mml:math id="M66" display="block"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:munderover><mml:msup><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∣</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="italic">θ</mml:mi><mml:mi>k</mml:mi><mml:mi>i</mml:mi></mml:msubsup><mml:mo>∣</mml:mo></mml:mrow><mml:mrow><mml:mo>∣</mml:mo><mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∣</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>p</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mstyle scriptlevel="+1"><mml:mfrac><mml:mn mathvariant="normal">1</mml:mn><mml:mi>p</mml:mi></mml:mfrac></mml:mstyle></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Computation strategy for the general programme</title>
      <p id="d1e1922">The list of input/output arguments is provided in Appendix <xref ref-type="sec" rid="App1.Ch1.S3"/>. In the main programme, calling the subroutine the key point is to transform first the <inline-formula><mml:math id="M67" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>-dimension matrix into a 1-D array. An example of a main programme calling the subroutine is provided in the code package. The computation strategy in the subroutine can be broken down into the sequential steps as follows:
<list list-type="custom"><list-item><label>i.</label>
      <p id="d1e1936">Find the nearest neighbour of the input data by minimizing a distance with a simple incremental method stepping every <inline-formula><mml:math id="M68" display="inline"><mml:mo>±</mml:mo></mml:math></inline-formula>1 coordinates on each dimension (detailed later in this section).</p></list-item><list-item><label>ii.</label>
      <p id="d1e1947">Scan the surroundings of the nearest point within the matrix on <inline-formula><mml:math id="M69" display="inline"><mml:mo>±</mml:mo></mml:math></inline-formula>1 step on each dimension and store the corresponding block of input data to be tested. The size of the block is therefore <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:msup><mml:mo>)</mml:mo><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> but can be extended to <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msup><mml:mo>)</mml:mo><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> if we increase the scanning process to <inline-formula><mml:math id="M72" display="inline"><mml:mo>±</mml:mo></mml:math></inline-formula>2 on each dimension (hard-coded option <italic>iconf</italic> of 1 or 2 in the declaration block).</p></list-item><list-item><label>iii.</label>
      <p id="d1e2014">Calculate the distance to the previously selected input data. A <inline-formula><mml:math id="M73" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>-distance concept is adopted (hard-coded option <italic>pnum</italic> in the declaration block). The <italic>pnum</italic> value <inline-formula><mml:math id="M74" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> should be greater than or equal to 1 to verify the Minkowski inequality and be considered as a metric.</p></list-item><list-item><label>iv.</label>
      <p id="d1e2038">Sort the previous block of data in ascending order and stop the sorting process when the first <inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> point is selected. The code offers the possibility to use only the first <inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> neighbour (hard-coded option <italic>neighb</italic> in the declaration block) that is sufficient and faster in most cases.</p></list-item><list-item><label>v.</label>
      <p id="d1e2068">Calculate the weights and then the final result.</p></list-item></list>
The first step consisting in finding the first neighbour is the trickiest and is broken down into several steps. Figure <xref ref-type="fig" rid="Ch1.F2"/> displays an example in 2-D of the step-by-step procedure to find the nearest neighbour.</p>
      <p id="d1e2074"><list list-type="custom">
          <list-item><label>i.</label>

      <p id="d1e2079">The procedure initializes the process starting from the first point of the input data grid or taken from the last closest point if given in an argument as a non-null value.</p>
          </list-item>
          <list-item><label>ii.</label>

      <p id="d1e2085">A delta of coordinates is applied based on an average delta on each dimension to improve the initialization. This computation step of delta is externalized as it can be time consuming and should be done once for all target points at which we want to interpolate.</p>
          </list-item>
          <list-item><label>iii.</label>

      <p id="d1e2091">A test between the target value and the input data grid point coordinates determines the <inline-formula><mml:math id="M77" display="inline"><mml:mo>±</mml:mo></mml:math></inline-formula>1 steps to add on each dimension (see Fig. <xref ref-type="fig" rid="Ch1.F2"/> for an example in 2-D).</p>
          </list-item>
          <list-item><label>iv.</label>

      <p id="d1e2106">If the grid point falls on the edges or outside the borders, the closest coordinates within the matrix are selected.</p>
          </list-item>
          <list-item><label>v.</label>

      <p id="d1e2112">A test on the <inline-formula><mml:math id="M78" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>-distance computation between the running point and the target is performed so that if the distance calculated at iteration <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is equal to the distance at iteration <inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:msub><mml:mi>N</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> the closest point is found.</p>
          </list-item>
          <list-item><label>vi.</label>

      <p id="d1e2158">If the distance is larger than the characteristic distance of the cell, the point is considered to be outside the borders of the input data grid. Therefore, the code allows a slight extrapolation if the target point is not too far from the borders.</p>
          </list-item>
          <list-item><label>vii.</label>

      <p id="d1e2164">At this stage, the procedure can stop if the distance to the closest vertex is 0, returning to the main programme with the exact value of the input data grid.</p>
          </list-item>
        </list></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2" specific-use="star"><?xmltex \currentcnt{2}?><label>Figure 2</label><caption><p id="d1e2171">Real example in 2-D of the step-by-step procedure to find the nearest neighbour of a target point for an irregular but structured <inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> grid <bold>(a)</bold> when starting the process from the first point of the grid on the lowest left corner and <bold>(b)</bold> when starting with a first guess based on an average delta computed for each dimension.</p></caption>
        <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f02.png"/>

      </fig>

</sec>
<?pagebreak page94?><sec id="Ch1.S4">
  <label>4</label><title>Visual example in 2-D for a regular grid</title>
      <p id="d1e2206">As an example to visualize the capacity of the general programme, the 2-D function used in <xref ref-type="bibr" rid="bib1.bibx20" id="text.15"/> is used to test our procedure. The function is
          <disp-formula id="Ch1.E10" content-type="numbered"><label>10</label><mml:math id="M82" display="block"><mml:mrow><mml:mi>Y</mml:mi><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>X</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>×</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msubsup><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        with <inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e2325">Our input  data grid is a regular grid with regular intervals of 0.02 from 0 to 1 for <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> with therefore 51 points on each dimension. We propose to interpolate on a finer regular grid with <inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">100</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">100</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:mn mathvariant="normal">200</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">200</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:mn mathvariant="normal">300</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">300</mml:mn></mml:mrow></mml:math></inline-formula> points on each dimension. For these three interpolation cases, a normalized mean square error (NMSE) of the result <inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msub><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo mathvariant="normal" stretchy="false">̃</mml:mo></mml:mover><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> for the full grid point number <inline-formula><mml:math id="M90" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> can be calculated against the true value <inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of the function as
          <disp-formula id="Ch1.E11" content-type="numbered"><label>11</label><mml:math id="M92" display="block"><mml:mrow><mml:mtext>NMSE</mml:mtext><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi>n</mml:mi></mml:mfrac></mml:mstyle><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:munderover><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mover accent="true"><mml:mi>Y</mml:mi><mml:mo stretchy="false" mathvariant="normal">̃</mml:mo></mml:mover><mml:mi>j</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi>n</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mfrac></mml:mstyle><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:munderover><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        with <inline-formula><mml:math id="M93" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> the mean value <inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> as <inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi>n</mml:mi></mml:mfrac></mml:mstyle><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:msub><mml:mi>Y</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e2576">For the three cases, the CPU time for the interpolation is evaluated and displayed in Table <xref ref-type="table" rid="Ch1.T1"/> for Machine 1 (Appendix <xref ref-type="sec" rid="App1.Ch1.S5"/>). As expected, the time consumption is obviously proportional to the number of points in which to interpolate.
Figure <xref ref-type="fig" rid="Ch1.F3"/> displays the evolution of the NMSE with the parameter <inline-formula><mml:math id="M96" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> of the <inline-formula><mml:math id="M97" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>-distance definition. There is a discontinuity of the NMSE from <inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> to <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> with a slight increase with <inline-formula><mml:math id="M100" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> in an asymptotic way (Fig. <xref ref-type="fig" rid="Ch1.F4"/>). The NMSE decreases with the number of points but a slight increase is observed from <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:mn mathvariant="normal">200</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">200</mml:mn></mml:mrow></mml:math></inline-formula> to <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:mn mathvariant="normal">300</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">300</mml:mn></mml:mrow></mml:math></inline-formula>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{3}?><label>Figure 3</label><caption><p id="d1e2663">Interpolation results for the three cases. Figures were generated with the Generic Mapping Tools <xref ref-type="bibr" rid="bib1.bibx27" id="paren.16"/>.</p></caption>
        <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f03.png"/>

      </fig>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e2678">Performance for each case with <inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Case</oasis:entry>
         <oasis:entry colname="col2">100 <inline-formula><mml:math id="M104" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 100</oasis:entry>
         <oasis:entry colname="col3">200 <inline-formula><mml:math id="M105" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 200</oasis:entry>
         <oasis:entry colname="col4">300 <inline-formula><mml:math id="M106" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 300</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">NMSE (%)</oasis:entry>
         <oasis:entry colname="col2">0.324</oasis:entry>
         <oasis:entry colname="col3">0.319</oasis:entry>
         <oasis:entry colname="col4">0.319</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CPU time (s)</oasis:entry>
         <oasis:entry colname="col2">0.45</oasis:entry>
         <oasis:entry colname="col3">1.84</oasis:entry>
         <oasis:entry colname="col4">4.1</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4"><?xmltex \currentcnt{4}?><label>Figure 4</label><caption><p id="d1e2781">Evolution of performance based on the NMSE for the three cases as a function of the parameter <inline-formula><mml:math id="M107" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> of the <inline-formula><mml:math id="M108" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>-distance computation.</p></caption>
        <?xmltex \igopts{width=241.848425pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f04.png"/>

      </fig>

</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Example in 5-D for a regular grid</title>
      <p id="d1e2813">Still using the general programme, an example in 5-D (<inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula>) is proposed using the function
          <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M110" display="block"><mml:mtable class="split" columnspacing="1em" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi>Y</mml:mi><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>X</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></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>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">5</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        with <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">5</mml:mn></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.
The input data grid is a regular grid of <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">35</mml:mn></mml:mrow></mml:math></inline-formula> interval edges on each dimension <inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> with <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">35</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">52</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mn mathvariant="normal">521</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">875</mml:mn></mml:mrow></mml:math></inline-formula> grid points. The goal is to find the results on a coarse grid of nine elements on each dimension with <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">9</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">59</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">049</mml:mn></mml:mrow></mml:math></inline-formula> grid points. This case is an opportunity to test the influence of the number of neighbours in calculating the result. In our case, the parameter <inline-formula><mml:math id="M116" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> of the <inline-formula><mml:math id="M117" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> distance is set to <inline-formula><mml:math id="M118" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>.
The interpolation seems to provide better performance of the NMSE for our function with less neighbours (case <inline-formula><mml:math id="M119" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) and obviously with a lower CPU time (Table <xref ref-type="table" rid="Ch1.T2"/>). This could certainly depend on the type of function to interpolate.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2"><?xmltex \currentcnt{2}?><label>Table 2</label><caption><p id="d1e3137">Performance for the 5-D (<inline-formula><mml:math id="M120" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula>) case with <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="3">
     <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:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Number of neighbours</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M122" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">NMSE (%)</oasis:entry>
         <oasis:entry colname="col2">1.570</oasis:entry>
         <oasis:entry colname="col3">0.870</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CPU time (s)</oasis:entry>
         <oasis:entry colname="col2">17.32</oasis:entry>
         <oasis:entry colname="col3">6.00</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e3236">Another test with the 5-D case is performed to test the influence of the normalization as defined in Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>) (flag <italic>norm</italic>) by defining an irregular grid still  with <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">35</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">52</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">521</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">875</mml:mn></mml:mrow></mml:math></inline-formula> input data points but with (i) random intervals values and (ii) one dimension depending on another. The definition of the input grid is defined in Appendix <xref ref-type="sec" rid="App1.Ch1.S4"/> and provided in the code package. With a similar order of magnitude of consumed CPU time, the normalization <italic>norm=.True.</italic> produces a NMSE of 0.499 % compared to the NMSE of 0.822 % for <italic>norm=.False</italic>.<?pagebreak page95?> There is then an added value of using such a normalization with comparable CPU time consumption (rising from 2.68 to 3.44 s for our case).</p>
</sec>
<sec id="Ch1.S6">
  <label>6</label><title>Comparison with Python for a regular grid</title>
      <p id="d1e3282">The code has been tested against the Python procedure <italic>scipy.interpolate.griddata</italic>, freely available from <xref ref-type="bibr" rid="bib1.bibx20" id="text.17"/>, for the following function:
          <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M125" display="block"><mml:mtable rowspacing="0.2ex" class="split" columnspacing="1em" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi>Y</mml:mi><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>X</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mspace width="0.25em" linebreak="nobreak"/><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></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>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>×</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        with <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3433">The input data grid is a regular grid of <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">35</mml:mn></mml:mrow></mml:math></inline-formula> interval edges on each dimension <inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> with <inline-formula><mml:math id="M129" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">35</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">42</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mn mathvariant="normal">875</mml:mn></mml:mrow></mml:math></inline-formula> grid points. The goal is to find the results on a coarse grid of nine elements on each dimension with <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">9</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">729</mml:mn></mml:mrow></mml:math></inline-formula> grid points. A case in 3-D has been used for this test because the Python library was not able to work with very large datasets (<italic>overflow error</italic>), while our programme could work perfectly.
Here, <italic>scipy.interpolate.griddata</italic> is used with the bilinear interpolation option, while our method is configured with <inline-formula><mml:math id="M131" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3523">Table <xref ref-type="table" rid="Ch1.T3"/> clearly shows how the Fortran code is faster compared to the Python library. However, the bilinear interpolation method seems to provide a higher accuracy than the inverse distance method embedded in our programme. Nevertheless, the error produced by our method looks acceptable.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3"><?xmltex \currentcnt{3}?><label>Table 3</label><caption><p id="d1e3532">Comparison of performance between our code for a 3-D case with the grid data Python library. Machine 2 is used (Appendix <xref ref-type="sec" rid="App1.Ch1.S6"/>).</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:thead>
       <oasis:row>
         <oasis:entry colname="col1"/>
         <oasis:entry colname="col2">Our code with</oasis:entry>
         <oasis:entry colname="col3">Our code with</oasis:entry>
         <oasis:entry colname="col4"/>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"/>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> neighbours</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> neighbours</oasis:entry>
         <oasis:entry colname="col4">Python</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">NMSE (%)</oasis:entry>
         <oasis:entry colname="col2">0.627</oasis:entry>
         <oasis:entry colname="col3">1.03</oasis:entry>
         <oasis:entry colname="col4">0.326</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CPU time (s)</oasis:entry>
         <oasis:entry colname="col2">0.04</oasis:entry>
         <oasis:entry colname="col3">0.04</oasis:entry>
         <oasis:entry colname="col4">19.49</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

</sec>
<sec id="Ch1.S7">
  <label>7</label><title>Geophysics application</title>
<sec id="Ch1.S7.SS1">
  <label>7.1</label><title>The Backplumes model</title>
      <p id="d1e3650">In order to test this new interpolation programme, it is implemented in a back-trajectory model called Backplumes. This model was already used in some studies such as <xref ref-type="bibr" rid="bib1.bibx10" id="text.18"/> and <xref ref-type="bibr" rid="bib1.bibx3" id="text.19"/>. Backplumes is open source and is available on the CHIMERE website. Backplumes calculates back trajectories from a starting point and a starting date. It is different from other back-trajectory models, such as the Hybrid Single-Particle Lagrangian Integrated Trajectory (HYSPLIT) <xref ref-type="bibr" rid="bib1.bibx23" id="paren.20"/>, Stochastic Time-Inverted Lagrangian Transport (STILT) <xref ref-type="bibr" rid="bib1.bibx9 bib1.bibx14" id="paren.21"/> and  FLEXible PARTicle dispersion model (FLEXPART) <xref ref-type="bibr" rid="bib1.bibx18" id="paren.22"/>, because it launches hundreds of particles and plots all trajectories as outputs. Thus, the answer is complementary compared to the other models: the output result is all possible trajectories and not only the most likely.</p>
      <?pagebreak page96?><p id="d1e3668">An advantage of Backplumes for the WRF and CHIMERE users is that the code is dedicated to directly read output results of these models. Being developed by the CHIMERE developer teams, the code is completely homogeneous with CHIMERE in terms of numerical libraries. Another advantage is that the code is very fast and calculates hundreds of trajectories in a few minutes. Using the wind fields of WRF or CHIMERE, and running on the same grid, the results of back trajectories are fully consistent with the simulations done by the models.</p>
      <p id="d1e3671">Backplumes is dedicated to calculate transport but not chemistry: only passive air particles (or tracers) are released. But a distinction could be made between gaseous or particulate tracers: for the latter, a settling velocity is calculated to have a more realistic trajectory. The model is easy to use and light because a small set of meteorological parameters is required. These meteorological parameters are described in Table <xref ref-type="table" rid="App1.Ch1.S7.T5"/> for WRF and CHIMERE.</p>
      <p id="d1e3676">The first step of the calculation is to choose a target location as a starting point. The user must select a date, longitude, latitude and altitude, obviously included in the modelled domain and during the modelled period. From this starting point, the model will calculate trajectories back in time. The number of trajectories is up to the user and may vary from one to several hundreds of tracers.</p>
      <p id="d1e3680">At each time step and for each trajectory, the position of the air mass is estimated by subtracting its pathway travelled as longitude <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">λ</mml:mi></mml:mrow></mml:math></inline-formula>, latitude <inline-formula><mml:math id="M135" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">ϕ</mml:mi></mml:mrow></mml:math></inline-formula> and altitude <inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula> to the current position. To do so, all necessary variables are interpolated with the NterGeo.v2020a interpolation programme described in the previous section. The calculation is described in Appendix <xref ref-type="sec" rid="App1.Ch1.S7"/>.</p>
      <p id="d1e3715">In order to respect the Courant–Friedrichs–Lewy (CFL) number, a sub-time step may be calculated. If the input data are provided hourly  (as in many regional models), the meteorological variables are interpolated between the two consecutive hours to obtain refined input data.</p>
      <p id="d1e3718">The goal of Backplumes is to estimate all possible back trajectories. Then, starting from one unique point, it is necessary to add a pseudo-turbulence in the calculation of the altitude. Depending on the vertical position of the tracer, several hypotheses are made. Two parameters are checked for<?pagebreak page97?> each tracer and each time step: (i) the boundary layer height enables us to know if the tracer is in the boundary layer or above in the free troposphere, (ii) the surface sensible heat fluxes enable to know if the atmosphere is stable or unstable.</p>
      <p id="d1e3721">When the tracer is diagnosed in the boundary layer, there are two cases: the boundary layer is stable or unstable.
If the boundary layer is stable, <inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, the tracer stays in the boundary layer at the same altitude. The new vertical position of the tracer is
            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M138" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e3763">If the boundary layer is unstable, <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, the tracer is considered in the convective boundary layer and may be located at every level in this boundary layer for the time before this. Therefore, a random function is applied to reproduce a potential vertical mixing.</p>
      <p id="d1e3781"><disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M140" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mtext>Rand</mml:mtext><mml:mo>×</mml:mo><mml:mover accent="true"><mml:mi>h</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e3810">The random function “Rand” calculates a coefficient between 0 and 1 to represent stochastic vertical transport of the tracer.</p>
      <p id="d1e3813">It is considered that 15 mn is representative of a well-mixed convective layer <xref ref-type="bibr" rid="bib1.bibx24" id="paren.23"/>. If the time step is larger than 15 mn, the random function is applied. But if the time step is less than 15 mn, the vertical mixing is reduced to the vicinity of the current position of the tracer. In this case, we have
            <disp-formula id="Ch1.E16" content-type="numbered"><label>16</label><mml:math id="M141" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mtext>Rand</mml:mtext><mml:mo>×</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi><mml:mo>×</mml:mo><mml:mo>[</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M142" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mi>z</mml:mi><mml:mi>t</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>+</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mi>t</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M143" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> is the vertical model level corresponding to <inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>t</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3922">In the free troposphere, the evolution of the tracer is considered to be influenced by the vertical wind component. A random function is applied to estimate its possible vertical motion with values between 0 and <inline-formula><mml:math id="M145" display="inline"><mml:mrow><mml:mi>w</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> m s<inline-formula><mml:math id="M146" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, representative of all possible values of vertical wind speed in the troposphere, <xref ref-type="bibr" rid="bib1.bibx24" id="text.24"/>. The vertical variability of the tracer's position in the free troposphere is calculated by diagnosing the vertical velocity as
            <disp-formula id="Ch1.E17" content-type="numbered"><label>17</label><mml:math id="M147" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn><mml:mo>+</mml:mo><mml:mtext>Rand</mml:mtext><mml:mo>)</mml:mo><mml:mi>w</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3600</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5"><?xmltex \currentcnt{5}?><label>Figure 5</label><caption><p id="d1e4002">Back trajectories calculated using CHIMERE and WRF modelled meteorological fields. The starting point is at longitude 10<inline-formula><mml:math id="M148" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> E and latitude 25<inline-formula><mml:math id="M149" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> N, with an altitude of 0 m a.g.l. on 10 August 2013 at 12:00 UTC. It corresponds to a case studied during the Chemistry-Aerosol Mediterranean Experiment (ChArMEx) campaign <xref ref-type="bibr" rid="bib1.bibx13" id="paren.25"/>.</p></caption>
          <?xmltex \igopts{width=241.848425pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f05.png"/>

        </fig>

</sec>
<sec id="Ch1.S7.SS2">
  <label>7.2</label><title>Examples of back-trajectory computations</title>
      <p id="d1e4040">An example is presented for the same case and the WRF and CHIMERE models. The difference between the two models is the number of vertical levels (35 for WRF and 20 for CHIMERE, from the surface to 200 hPa). The online modelling system WRF-CHIMERE is used, meaning that the horizontal grid is the same (a large domain including Europe and Africa and with <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">60</mml:mn></mml:mrow></mml:math></inline-formula> km). The wind field is the same for both models: CHIMERE  directly uses  the wind field calculated by WRF. The boundary layer height is different between the two models, with WRF using the <xref ref-type="bibr" rid="bib1.bibx7" id="text.26"/> schemes and CHIMERE using the <xref ref-type="bibr" rid="bib1.bibx26" id="text.27"/> scheme. The surface sensible heat flux is the same between the two models, with CHIMERE using the flux calculated by WRF. WRF has more vertical model levels than CHIMERE; thus, meteorological fields are interpolated from WRF to CHIMERE. It impacts the horizontal and vertical wind fields.</p>
      <p id="d1e4069">Figure <xref ref-type="fig" rid="Ch1.F5"/> presents the results of back trajectories launched on 10 August 2013 at 12:00 UTC. The location is at longitude 10<inline-formula><mml:math id="M151" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> E and latitude 25<inline-formula><mml:math id="M152" display="inline"><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:math></inline-formula> N, with an altitude of 0 m a.g.l. This location is of no scientific interest but is in the middle of the domain, in order to have the longer trajectories. The complete duration of trajectories represents 10 d back in time. Overall, 120 trajectories are launched at the same position and time. They are randomly mixed when they are in the boundary layer to represent the mixing and the diffusion.</p>
      <p id="d1e4092">The most important part of the plume comes from the north of the starting point. For this main plume, the calculation is similar between the two models. Another large part of Backplumes is modelled at the east of the starting point. However, this fraction is mainly modelled with WRF but not with CHIMERE, where only a few trajectories are diagnosed. One possible explanation may be found by analysing the vertical transport of the trajectories.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6"><?xmltex \currentcnt{6}?><label>Figure 6</label><caption><p id="d1e4098">Projection of all back trajectories on a single time–altitude axis.</p></caption>
          <?xmltex \igopts{width=241.848425pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-f06.png"/>

        </fig>

      <?pagebreak page98?><p id="d1e4107">Figure <xref ref-type="fig" rid="Ch1.F6"/> presents all plumes displayed in the previous figure but projected along the same time–altitude axis. The differences between the two Backplumes results are mainly due to the calculation of the boundary layer height. When WRF diagnoses an altitude of <inline-formula><mml:math id="M153" display="inline"><mml:mo>≈</mml:mo></mml:math></inline-formula> 3000 m, CHIMERE diagnoses <inline-formula><mml:math id="M154" display="inline"><mml:mo>≈</mml:mo></mml:math></inline-formula> 2000 m, leading to different direction and wind speed. Then, this implies a split of the plumes with WRF but not with CHIMERE. This illustrates the sensitivity of the result to the driver model. But, in both cases, the answer in our case is clearly that the main contributions of the air masses located at the starting point are mainly coming from the north-east, crossing Tunisia and then the Mediterranean Sea and Europe. The main difference between the two calculations is the eastern part of the plume, which is more intense with WRF than CHIMERE.</p>
</sec>
</sec>
<sec id="Ch1.S8" sec-type="conclusions">
  <label>8</label><title>Conclusions</title>
      <p id="d1e4135">A new interpolation programme written in Fortran has been developed to interpolate on <inline-formula><mml:math id="M155" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>-dimensional matrices. It has been evaluated for several dimension cases up to <inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula>. The code is fast compared to similar Python routines and highly portable in existing geophysical codes. The interpolation programme works for any dimension <inline-formula><mml:math id="M157" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> above 2 and is designed to work with irregular but structured grids (characterized by a size for each dimension) or look-up tables. Already used in its “regular” version in CHIMERE, the “general” programme has been tested on a new real application which calculates air mass back trajectories from two widely used atmospheric models: CHIMERE and WRF. This interpolation programme can be used for any application in geophysics and engineering sciences and also to explore large structured matrices.</p><?xmltex \hack{\clearpage}?>
</sec>

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

<?pagebreak page99?><app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>List of frequently used abbreviations</title>
      <p id="d1e4176"><table-wrap id="Taba" position="anchor"><oasis:table><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">AGL</oasis:entry>
         <oasis:entry colname="col2">Above ground level</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CFL</oasis:entry>
         <oasis:entry colname="col2">Courant–Friedrichs–Lewy number</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CHIMERE</oasis:entry>
         <oasis:entry colname="col2">National French CTM</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CTM</oasis:entry>
         <oasis:entry colname="col2">Chemistry-transport model</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">CPU</oasis:entry>
         <oasis:entry colname="col2">Central processing unit</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">NMSE</oasis:entry>
         <oasis:entry colname="col2">Normalized mean square error</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">PBL</oasis:entry>
         <oasis:entry colname="col2">Planetary boundary layer</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">PSFC</oasis:entry>
         <oasis:entry colname="col2">Surface pressure</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">WRF</oasis:entry>
         <oasis:entry colname="col2">Weather Research and Forecasting model</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap></p>
</app>

<app id="App1.Ch1.S2">
  <?xmltex \currentcnt{B}?><label>Appendix B</label><title>Binary strategy</title>
      <p id="d1e4279">This piece of code shows the strategy to optimize the computation of weights for the “regular case”. The idea is to minimize the number of operations to benefit from the calculation at each dimension.
A non-optimized loop would require <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> multiplications, while the optimized loop requires only <inline-formula><mml:math id="M159" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mrow><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula> multiplications for the weight calculations. Then, for large values of <inline-formula><mml:math id="M160" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>≫</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>, the ratio of required operations between the non-optimized and the optimized loop is <inline-formula><mml:math id="M161" display="inline"><mml:mrow><mml:mo>≈</mml:mo><mml:mo>(</mml:mo><mml:mi>N</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>.<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
<?xmltex \igopts{width=369.885827pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-g01.png"/></p><?xmltex \hack{\clearpage}?>
</app>

<?pagebreak page100?><app id="App1.Ch1.S3">
  <?xmltex \currentcnt{C}?><label>Appendix C</label><title>Code design</title>
      <p id="d1e4368">Note that <italic>avedelta</italic> and <italic>maxdelta</italic> arrays have been externalized to optimize the calculations. In the code package, an independent programme is available to calculate these arrays to be implemented in the user's main programme.
The programme is written in Fortran <italic>double precision</italic> ingesting the following arguments:<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
<?xmltex \igopts{width=170.716535pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-g02.png"/></p>

<?xmltex \floatpos{t}?><table-wrap id="App1.Ch1.S3.T4" specific-use="star"><?xmltex \currentcnt{C1}?><label>Table C1</label><caption><p id="d1e4390">Description of subroutine arguments.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="justify" colwidth="8.5cm"/>
     <oasis:colspec colnum="4" colname="col4" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Variable</oasis:entry>
         <oasis:entry colname="col2">Type</oasis:entry>
         <oasis:entry colname="col3">Description</oasis:entry>
         <oasis:entry colname="col4">Array dimension</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><italic>ndim</italic></oasis:entry>
         <oasis:entry colname="col2">Integer</oasis:entry>
         <oasis:entry colname="col3">Dimension <inline-formula><mml:math id="M162" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">nd</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>maxdim</italic></oasis:entry>
         <oasis:entry colname="col2">Integer</oasis:entry>
         <oasis:entry colname="col3">Total number of elements of the input table <inline-formula><mml:math id="M163" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:msubsup><mml:mo>∏</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mi>N</mml:mi></mml:msubsup><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> with <inline-formula><mml:math id="M164" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> the number of elements in each dimension <inline-formula><mml:math id="M165" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">nd</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>kdim</italic></oasis:entry>
         <oasis:entry colname="col2">Integer 1-D array</oasis:entry>
         <oasis:entry colname="col3">Array of the number of elements <inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> on each dimension <inline-formula><mml:math id="M167" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>:</mml:mo><mml:mi>N</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>vect</italic></oasis:entry>
         <oasis:entry colname="col2">Real 2-D array</oasis:entry>
         <oasis:entry colname="col3">Array storing  the list of edges on each dimension in a one-dimensional array</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mi>N</mml:mi><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>vtable</italic></oasis:entry>
         <oasis:entry colname="col2">Real 1-D array</oasis:entry>
         <oasis:entry colname="col3">Coordinate values of the point at which to interpolate data</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M170" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mi>N</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>table</italic></oasis:entry>
         <oasis:entry colname="col2">Real 1-D array</oasis:entry>
         <oasis:entry colname="col3">Values for the list of known points <inline-formula><mml:math id="M171" display="inline"><mml:mrow><mml:mi>v</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> (input grid data)</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>avedelta</italic></oasis:entry>
         <oasis:entry colname="col2">Real 1-D array</oasis:entry>
         <oasis:entry colname="col3">Inverse of average intervals on each dimension <inline-formula><mml:math id="M173" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M174" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>N</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>maxdelta</italic></oasis:entry>
         <oasis:entry colname="col2">Real 1-D array</oasis:entry>
         <oasis:entry colname="col3">Maximum intervals on each dimension <inline-formula><mml:math id="M175" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M176" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>N</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>resu</italic></oasis:entry>
         <oasis:entry colname="col2">Real</oasis:entry>
         <oasis:entry colname="col3">Result of interpolation for <italic>vtable</italic></oasis:entry>
         <oasis:entry colname="col4">nd</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>inei</italic></oasis:entry>
         <oasis:entry colname="col2">Integer</oasis:entry>
         <oasis:entry colname="col3">Number of neighbours</oasis:entry>
         <oasis:entry colname="col4">nd</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>neighbours</italic></oasis:entry>
         <oasis:entry colname="col2">Real 2-D array</oasis:entry>
         <oasis:entry colname="col3">Array of neighbour coordinates</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M177" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>weights</italic></oasis:entry>
         <oasis:entry colname="col2">Real 1-D array</oasis:entry>
         <oasis:entry colname="col3">Weight for each neighbour</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:msup><mml:mn mathvariant="normal">2</mml:mn><mml:mi>N</mml:mi></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><italic>found</italic></oasis:entry>
         <oasis:entry colname="col2">Logical</oasis:entry>
         <oasis:entry colname="col3">Returns <italic>true</italic> or <italic>false</italic>, respectively, if the result is found or not found if the point is outside the bounds</oasis:entry>
         <oasis:entry colname="col4">nd</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e4870">Some hard-coded variables can be tested by the user to improve the results. They have been tested and some results are described in this paper. A recompilation is necessary if the user changes these values.<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
<?xmltex \igopts{width=369.885827pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-g03.png"/></p><?xmltex \hack{\clearpage}?>
</app>

<?pagebreak page102?><app id="App1.Ch1.S4">
  <?xmltex \currentcnt{D}?><label>Appendix D</label><title>Irregular structured grid example in 5-D</title>
      <p id="d1e4889">Below is an example of a 5-D array input grid data with irregular intervals with the last dimension (5) depending on dimension (1).<?xmltex \hack{\newline}?><?xmltex \hack{\newline}?>
<?xmltex \igopts{width=369.885827pt}?><inline-graphic xlink:href="https://gmd.copernicus.org/articles/14/91/2021/gmd-14-91-2021-g04.png"/></p><?xmltex \hack{\clearpage}?>
</app>

<?pagebreak page103?><app id="App1.Ch1.S5">
  <?xmltex \currentcnt{E}?><label>Appendix E</label><title>Characteristics of Machine 1</title>
      <p id="d1e4908"><list list-type="bullet">
          <list-item>

      <p id="d1e4913">Architecture:          x86_64</p>
          </list-item>
          <list-item>

      <p id="d1e4919">CPU op-mode(s):        32-bit, 64-bit</p>
          </list-item>
          <list-item>

      <p id="d1e4925">Byte order:            Little Endian</p>
          </list-item>
          <list-item>

      <p id="d1e4931">CPU(s):                64</p>
          </list-item>
          <list-item>

      <p id="d1e4937">Online CPU(s) list:    0–63</p>
          </list-item>
          <list-item>

      <p id="d1e4944">Thread(s) per core:    2</p>
          </list-item>
          <list-item>

      <p id="d1e4950">Core(s) per socket:    8</p>
          </list-item>
          <list-item>

      <p id="d1e4956">Socket(s):             4</p>
          </list-item>
          <list-item>

      <p id="d1e4962">NUMA node(s):          8</p>
          </list-item>
          <list-item>

      <p id="d1e4968">Vendor ID:             AuthenticAMD</p>
          </list-item>
          <list-item>

      <p id="d1e4974">CPU family:            21</p>
          </list-item>
          <list-item>

      <p id="d1e4981">Model:                 1</p>
          </list-item>
          <list-item>

      <p id="d1e4987">Model name:            AMD Opteron Processor 6276</p>
          </list-item>
          <list-item>

      <p id="d1e4993">Stepping:              2</p>
          </list-item>
          <list-item>

      <p id="d1e4999">CPU MHz:               2300.000</p>
          </list-item>
          <list-item>

      <p id="d1e5005">CPU max MHz:           2300.0000</p>
          </list-item>
          <list-item>

      <p id="d1e5011">CPU min MHz:           1400.0000</p>
          </list-item>
          <list-item>

      <p id="d1e5018">BogoMIPS:              4599.83</p>
          </list-item>
          <list-item>

      <p id="d1e5024">Virtualization:        AMD-V</p>
          </list-item>
          <list-item>

      <p id="d1e5030">L1d cache:             16 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5036">L1i cache:             64 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5042">L2 cache:              2048 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5048">L3 cache:              6144 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5055">Memory block size:     128 MB</p>
          </list-item>
          <list-item>

      <p id="d1e5061">Total online memory:   128 GB</p>
          </list-item>
          <list-item>

      <p id="d1e5067">Total offline memory:  0 B</p>
          </list-item>
          <list-item>

      <p id="d1e5073">Linux version 3.10.0-1062.12.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39)</p>
          </list-item>
        </list></p>
</app>

<app id="App1.Ch1.S6">
  <?xmltex \currentcnt{F}?><label>Appendix F</label><title>Characteristics of Machine 2</title>
      <p id="d1e5087"><list list-type="bullet">
          <list-item>

      <p id="d1e5092">Architecture:          x86_64</p>
          </list-item>
          <list-item>

      <p id="d1e5098">CPU op-mode(s):        32-bit, 64-bit</p>
          </list-item>
          <list-item>

      <p id="d1e5104">Byte order:            Little Endian</p>
          </list-item>
          <list-item>

      <p id="d1e5110">CPU(s):                96</p>
          </list-item>
          <list-item>

      <p id="d1e5116">Online CPU(s) list:   0–47</p>
          </list-item>
          <list-item>

      <p id="d1e5123">Offline CPU(s) list:  48–95</p>
          </list-item>
          <list-item>

      <p id="d1e5129">Thread(s) per core:    1</p>
          </list-item>
          <list-item>

      <p id="d1e5135">Core(s) per socket:    24</p>
          </list-item>
          <list-item>

      <p id="d1e5141">Socket(s):             2</p>
          </list-item>
          <list-item>

      <p id="d1e5147">NUMA node(s):          2</p>
          </list-item>
          <list-item>

      <p id="d1e5153">Vendor ID:             GenuineIntel</p>
          </list-item>
          <list-item>

      <p id="d1e5160">CPU family:            6</p>
          </list-item>
          <list-item>

      <p id="d1e5166">Model:                 85</p>
          </list-item>
          <list-item>

      <p id="d1e5172">Model name:            Intel Xeon Platinum 8168 CPU at 2.70 GHz</p>
          </list-item>
          <list-item>

      <p id="d1e5178">Stepping:              4</p>
          </list-item>
          <list-item>

      <p id="d1e5184">CPU MHz:               2701.000</p>
          </list-item>
          <list-item>

      <p id="d1e5190">CPU max MHz:           2701.0000</p>
          </list-item>
          <list-item>

      <p id="d1e5197">CPU min MHz:           1200.0000</p>
          </list-item>
          <list-item>

      <p id="d1e5203">BogoMIPS:              5400.00</p>
          </list-item>
          <list-item>

      <p id="d1e5209">Virtualization:        VT-x</p>
          </list-item>
          <list-item>

      <p id="d1e5215">L1d cache:             32 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5221">L1i cache:             32 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5227">L2 cache:              1024 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5234">L3 cache:              33 792 KB</p>
          </list-item>
          <list-item>

      <p id="d1e5240">NUMA node0 CPU(s):     0–23</p>
          </list-item>
          <list-item>

      <p id="d1e5246">NUMA node1 CPU(s):     24–47</p>
          </list-item>
          <list-item>

      <p id="d1e5252">Memory block size:     128 MB</p>
          </list-item>
          <list-item>

      <p id="d1e5258">Total online memory:   190.8 GB</p>
          </list-item>
          <list-item>

      <p id="d1e5264">Linux version 3.10.0-957.41.1.el7.x86_64 (mockbuild@x86-vm-26.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36)</p>
          </list-item>
        </list></p>
</app>

<?pagebreak page104?><app id="App1.Ch1.S7">
  <?xmltex \currentcnt{G}?><label>Appendix G</label><title>The WRF and CHIMERE model parameters used</title>
      <p id="d1e5277">Parameters are the three-dimensional wind components, the boundary layer height <inline-formula><mml:math id="M179" display="inline"><mml:mover accent="true"><mml:mi>h</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, the surface sensible heat flux <inline-formula><mml:math id="M180" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and the altitude of each model layer. The wind components are used for the horizontal and vertical transport. The boundary layer height is used to define the vertical extent of the possible mixing, and the surface sensible heat flux is used to know if the current modelled hour corresponds to a stable or unstable surface layer (for when the tracer is close to the surface).</p>
      <p id="d1e5301">Backplumes calculates the back trajectories using longitude, latitude and altitude in metres. In the case of input data with vertical levels in pressure coordinates, the altitude is calculated from pressure levels <xref ref-type="bibr" rid="bib1.bibx17" id="paren.28"/>. This is the case of the WRF model and the calculation is done as follows.</p>
      <p id="d1e5307">The altitude is computed as</p>
      <p id="d1e5310"><disp-formula id="App1.Ch1.S7.E18" content-type="numbered"><label>G1</label><mml:math id="M181" display="block"><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>surf</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M182" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> (PSFC) is the surface pressure and <inline-formula><mml:math id="M183" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is the top pressure of the model domain. If <inline-formula><mml:math id="M184" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is constant over the whole domain, <inline-formula><mml:math id="M185" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and thus <inline-formula><mml:math id="M186" display="inline"><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> are dependent on the first level grid.</p>
      <p id="d1e5395"><disp-formula id="App1.Ch1.S7.E19" content-type="numbered"><label>G2</label><mml:math id="M187" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mi>g</mml:mi></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M188" display="inline"><mml:mi mathvariant="normal">Φ</mml:mi></mml:math></inline-formula> is the geopotential (PHB) and <inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> (PH) its perturbation at vertical level <inline-formula><mml:math id="M190" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>. <inline-formula><mml:math id="M191" display="inline"><mml:mi>g</mml:mi></mml:math></inline-formula> is the acceleration of gravity, <inline-formula><mml:math id="M192" display="inline"><mml:mrow><mml:mi>g</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">9.81</mml:mn></mml:mrow></mml:math></inline-formula> m s<inline-formula><mml:math id="M193" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>.
For each vertical level <inline-formula><mml:math id="M194" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>, the layer thickness <inline-formula><mml:math id="M195" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula> and the cell top altitude <inline-formula><mml:math id="M196" display="inline"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> are estimated as</p>
      <p id="d1e5523"><disp-formula id="App1.Ch1.S7.E20" content-type="numbered"><label>G3</label><mml:math id="M197" display="block"><mml:mtable columnspacing="1em" class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>m</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>log⁡</mml:mi><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>M</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>M</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>log⁡</mml:mi><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>M</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msup><mml:mi>p</mml:mi><mml:mo>*</mml:mo></mml:msup><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>F</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>top</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mi>g</mml:mi></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mi>g</mml:mi></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>m</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi>z</mml:mi><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        where <inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>M</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is its value on full (<inline-formula><mml:math id="M199" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula>) levels (ZNW) and <inline-formula><mml:math id="M200" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mi>F</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the <inline-formula><mml:math id="M201" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> value on half (mass) levels (ZNU). The layer thicknesses are space and time dependent; this calculation is performed for all trajectories and all time steps.</p>

<?xmltex \floatpos{t}?><table-wrap id="App1.Ch1.S7.T5"><?xmltex \currentcnt{G1}?><label>Table G1</label><caption><p id="d1e5832">List of parameters read by the Backplumes programme to calculate trajectories.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Parameter</oasis:entry>
         <oasis:entry colname="col2">Model variable name</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row rowsep="1">
         <oasis:entry namest="col1" nameend="col2">WRF model </oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Longitude, latitude</oasis:entry>
         <oasis:entry colname="col2">XLONG, XLAT</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Parameters for altitude</oasis:entry>
         <oasis:entry colname="col2">P<inline-formula><mml:math id="M202" display="inline"><mml:mi mathvariant="italic">_</mml:mi></mml:math></inline-formula>TOP, ZNU, ZNW, P, PB</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"/>
         <oasis:entry colname="col2">PH, PHB, PSFC</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Wind components</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M203" display="inline"><mml:mi>U</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M204" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M205" display="inline"><mml:mi>W</mml:mi></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M206" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">HFX</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"><inline-formula><mml:math id="M207" display="inline"><mml:mover accent="true"><mml:mi>h</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">PBLH</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry namest="col1" nameend="col2">CHIMERE model </oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Longitude, latitude</oasis:entry>
         <oasis:entry colname="col2">lon, lat</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Altitude</oasis:entry>
         <oasis:entry colname="col2">hlay</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Wind</oasis:entry>
         <oasis:entry colname="col2">winz, winm, winw</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Q<inline-formula><mml:math id="M208" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">sshf</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M209" display="inline"><mml:mover accent="true"><mml:mi>h</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">hght</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e6030">The new position of a tracer back in time is calculated as follows:
          <disp-formula id="App1.Ch1.S7.E21" content-type="numbered"><label>G4</label><mml:math id="M210" display="block"><mml:mtable rowspacing="0.2ex" class="split" columnspacing="1em" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mtext>rad</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mi mathvariant="italic">π</mml:mi><mml:mn mathvariant="normal">180</mml:mn></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mi>u</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3600</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mi>v</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3600</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">λ</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>R</mml:mi><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mtext>rad</mml:mtext></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">180</mml:mn><mml:mi mathvariant="italic">π</mml:mi></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi></mml:mrow><mml:mi>R</mml:mi></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">180</mml:mn><mml:mi mathvariant="italic">π</mml:mi></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        with the wind speed is provided in m s<inline-formula><mml:math id="M211" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> on an hourly basis, and <inline-formula><mml:math id="M212" display="inline"><mml:mi>R</mml:mi></mml:math></inline-formula> is the Earth's radius as <inline-formula><mml:math id="M213" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">6371</mml:mn></mml:mrow></mml:math></inline-formula> km. The new position for one tracer is thus
          <disp-formula id="App1.Ch1.S7.E22" content-type="numbered"><label>G5</label><mml:math id="M214" display="block"><mml:mtable rowspacing="0.2ex" class="split" columnspacing="1em" displaystyle="true" columnalign="right left right"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">λ</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">λ</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p><?xmltex \hack{\clearpage}?>
</app>
  </app-group><notes notes-type="codeavailability"><title>Code availability</title>

      <p id="d1e6267">The current versions of the models are freely available. The exact version of the model used to produce the results used in this paper is archived on Zenodo for NterGeo at <ext-link xlink:href="https://doi.org/10.5281/zenodo.3733278" ext-link-type="DOI">10.5281/zenodo.3733278</ext-link> <xref ref-type="bibr" rid="bib1.bibx1" id="paren.29"/> under the GNU General Public License v3.0 or later, as are input data and scripts to run the model and produce the plots for all the simulations presented in this paper. The Backplumes model is an open-source code and is available on the CHIMERE model website: <uri>https://www.lmd.polytechnique.fr/~menut/backplumes.php</uri> (last access: 21 December 2020, <xref ref-type="bibr" rid="bib1.bibx12" id="altparen.30"/>).</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e6285">BB developed the code. LM and BB co-developed and implemented the code in the Backplumes.v2020r1 model. MB supported BB for the developments.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e6292">The authors declare that they have no conflict of interest.</p>
  </notes><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e6298">This research was funded by the DGA (French Directorate General of Armaments; grant no. 2018 60 0074) in the framework of the NETDESA project.</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e6304">This paper was edited by Juan Antonio Añel and reviewed by two anonymous referees.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><label>Bessagnet(2020)</label><?label BessagnetB?><mixed-citation>Bessagnet, B.: A N-dimensional Fortran Interpolation Program (NterGeo) for Geophysics Sciences (Version 2020v1), Zenodo, <ext-link xlink:href="https://doi.org/10.5281/zenodo.3733278" ext-link-type="DOI">10.5281/zenodo.3733278</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx2"><label>Donner et al.(2011)</label><?label donner2011?><mixed-citation>Donner, L. J., Wyman, B. L., Hemler, R. S., Horowitz, L. W., Ming, Y., Zhao,
M., Golaz, J.-C., Ginoux, P., Lin, S.-J., Schwarzkopf, M. D., Austin, J.,
Alaka, G., Cooke, W. F., Delworth, T. L., Freidenreich, S. M., Gordon, C. T.,
Griffies, S. M., Held, I. M., Hurlin, W. J., Klein, S. A., Knutson, T. R.,
Langenhorst, A. R., Lee, H.-C., Lin, Y., Magi, B. I., Malyshev, S. L., Milly,
P. C. D., Naik, V., Nath, M. J., Pincus, R., Ploshay, J. J., Ramaswamy, V.,
Seman, C. J., Shevliakova, E., Sirutis, J. J., Stern, W. F., Stouffer, R. J.,
Wilson, R. J., Winton, M., Wittenberg, A. T., and Zeng, F.: The Dynamical
Core, Physical Parameterizations, and Basic Simulation Characteristics of the
Atmospheric Component AM3 of the GFDL Global Coupled Model CM3, J.
Climate, 24, 3484–3519, <ext-link xlink:href="https://doi.org/10.1175/2011JCLI3955.1" ext-link-type="DOI">10.1175/2011JCLI3955.1</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx3"><label>Flamant et al.(2018)</label><?label flamant2018b?><mixed-citation>Flamant, C., Deroubaix, A., Chazette, P., Brito, J., Gaetani, M., Knippertz, P., Fink, A. H., de Coetlogon, G., Menut, L., Colomb, A., Denjean, C., Meynadier, R., Rosenberg, P., Dupuy, R., Dominutti, P., Duplissy, J., Bourrianne, T., Schwarzenboeck, A., Ramonet, M., and Totems, J.: Aerosol distribution in the northern Gulf of Guinea: local anthropogenic sources, long-range transport, and the role of coastal shallow circulations, Atmos. Chem. Phys., 18, 12363–12389, <ext-link xlink:href="https://doi.org/10.5194/acp-18-12363-2018" ext-link-type="DOI">10.5194/acp-18-12363-2018</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx4"><label>Hardy(1971)</label><?label hardy1971?><mixed-citation>
Hardy, R.: Multivariate equations of topography and other irregular surfaces,
J. Geophys. Res., 71, 1905–1915, 1971.</mixed-citation></ref>
      <ref id="bib1.bibx5"><label>Hardy(1990)</label><?label hardy1990?><mixed-citation>Hardy, R.: Theory and applications of the multiquadric-biharmonic method 20 years of discovery 1968–1988, Computers and Mathematics with Applications,
19, 163–208, <ext-link xlink:href="https://doi.org/10.1016/0898-1221(90)90272-L" ext-link-type="DOI">10.1016/0898-1221(90)90272-L</ext-link>,
1990.</mixed-citation></ref>
      <ref id="bib1.bibx6"><label>Hofstra et al.(2008)</label><?label hofstra2008?><mixed-citation>Hofstra, N., Haylock, M., New, M., Jones, P., and Frei, C.: Comparison of six
methods for the interpolation of daily, European climate data, J.
Geophys. Res.-Atmos., 113, D21110, <ext-link xlink:href="https://doi.org/10.1029/2008JD010100" ext-link-type="DOI">10.1029/2008JD010100</ext-link>,
2008.</mixed-citation></ref>
      <ref id="bib1.bibx7"><label>Hong et al.(2006)</label><?label hong2006?><mixed-citation>Hong, S. Y., Noh, Y., and Dudhia, J.: A new vertical diffusion package with an explicit treatment of entrainment processes, Mon. Weather Rev., 134,
2318–2341, <ext-link xlink:href="https://doi.org/10.1175/MWR3199.1" ext-link-type="DOI">10.1175/MWR3199.1</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx8"><label>Kouatchou(2018)</label><?label kouatchou2018?><mixed-citation>Kouatchou, J.: NASA Modeling Guru: Basic Comparison of Python, Julia, Matlab,
IDL and Java (2018 Edition), available at:
<uri>https://modelingguru.nasa.gov/docs/DOC-2676</uri> (last access: 11 March 2020),
2018.</mixed-citation></ref>
      <ref id="bib1.bibx9"><label>Lin et al.(2003)</label><?label lin2003?><mixed-citation>Lin, J. C., Gerbig, C., Wofsy, S. C., Andrews, A. E., Daube, B. C., Davis,
K. J., and Grainger, C. A.: A near-field tool for simulating the upstream
influence of atmospheric observations: The Stochastic Time-Inverted
Lagrangian Transport (STILT) model, J. Geophys. Res.-Atmos., 108, 4493, <ext-link xlink:href="https://doi.org/10.1029/2002JD003161" ext-link-type="DOI">10.1029/2002JD003161</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx10"><label>Mailler et al.(2016)</label><?label mailler2016a?><mixed-citation>Mailler, S., Menut, L., di Sarra, A. G., Becagli, S., Di Iorio, T., Bessagnet, B., Briant, R., Formenti, P., Doussin, J.-F., Gómez-Amo, J. L., Mallet, M., Rea, G., Siour, G., Sferlazzo, D. M., Traversi, R., Udisti, R., and Turquety, S.: On the radiative impact of aerosols on photolysis rates: comparison of simulations and observations in the Lampedusa island during the ChArMEx/ADRIMED campaign, Atmos. Chem. Phys., 16, 1219–1244, <ext-link xlink:href="https://doi.org/10.5194/acp-16-1219-2016" ext-link-type="DOI">10.5194/acp-16-1219-2016</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx11"><label>Mailler et al.(2017)</label><?label mailler2017?><mixed-citation>Mailler, S., Menut, L., Khvorostyanov, D., Valari, M., Couvidat, F., Siour, G., Turquety, S., Briant, R., Tuccella, P., Bessagnet, B., Colette, A., Létinois, L., Markakis, K., and Meleux, F.: CHIMERE-2017: from urban to hemispheric chemistry-transport modeling, Geosci. Model Dev., 10, 2397–2423, <ext-link xlink:href="https://doi.org/10.5194/gmd-10-2397-2017" ext-link-type="DOI">10.5194/gmd-10-2397-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx12"><label>Menut(2020)</label><?label menut_backplumes_2020?><mixed-citation>Menut, L.: BACKPLUMES program v2020r1 April 2020, IPSL-LMD-CNRS, available at: <uri>https://www.lmd.polytechnique.fr/~menut/backplumes.php</uri>, last access: 21 December 2020.</mixed-citation></ref>
      <ref id="bib1.bibx13"><label>Menut et al.(2015)</label><?label menut2015b?><mixed-citation>Menut, L., Rea, G., Mailler, S., Khvorostyanov, D., and Turquety, S.: Aerosol forecast over the Mediterranean area during July 2013 (ADRIMED/CHARMEX), Atmos. Chem. Phys., 15, 7897–7911, <ext-link xlink:href="https://doi.org/10.5194/acp-15-7897-2015" ext-link-type="DOI">10.5194/acp-15-7897-2015</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx14"><label>Nehrkorn et al.(2010)</label><?label nehrkorn2010?><mixed-citation>Nehrkorn, T., Eluszkiewicz, J., Wofsy, S., Lin, J., Gerbig, C., Longo, M., and Freitas, S.: Coupled weather research and forecasting-stochastic
time-inverted lagrangian transport (WRF-STILT) model, Meteorol.
Atmos. Phys., 107, 51–64, <ext-link xlink:href="https://doi.org/10.1007/s00703-010-0068-x" ext-link-type="DOI">10.1007/s00703-010-0068-x</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx15"><label>Nenes et al.(1998)</label><?label nenes1998?><mixed-citation>
Nenes, A., Pilinis, C., and Pandis, S.: ISORROPIA: A new thermodynamic model
for inorganic multicomponent atmospheric aerosols, Aquatic Geochem., 4,
123–152, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx16"><label>Nenes et al.(1999)</label><?label nenes1999?><mixed-citation>
Nenes, A., Pandis, S. N., and Pilinis, C.: Continued development and testing of
a new thermodynamic aerosol module for urban and regional air quality models,
Atmos. Environ., 33, 1553–1560, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx17"><label>Pielke(1984)</label><?label pielke1984?><mixed-citation>
Pielke Sr., R. A.: Mesoscale Meteorological Modeling, Academic Press, 1984.</mixed-citation></ref>
      <?pagebreak page106?><ref id="bib1.bibx18"><label>Pisso et al.(2019)</label><?label pisso2019?><mixed-citation>Pisso, I., Sollum, E., Grythe, H., Kristiansen, N. I., Cassiani, M., Eckhardt, S., Arnold, D., Morton, D., Thompson, R. L., Groot Zwaaftink, C. D., Evangeliou, N., Sodemann, H., Haimberger, L., Henne, S., Brunner, D., Burkhart, J. F., Fouilloux, A., Brioude, J., Philipp, A., Seibert, P., and Stohl, A.: The Lagrangian particle dispersion model FLEXPART version 10.4, Geosci. Model Dev., 12, 4955–4997, <ext-link xlink:href="https://doi.org/10.5194/gmd-12-4955-2019" ext-link-type="DOI">10.5194/gmd-12-4955-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx19"><label>Rap et al.(2009)</label><?label rap2009?><mixed-citation>Rap, A., Ghosh, S., and Smith, M. H.: Shepard and Hardy Multiquadric
Interpolation Methods for Multicomponent Aerosol–Cloud Parameterization,
J. Atmos. Sci., 66, 105–115,
<ext-link xlink:href="https://doi.org/10.1175/2008JAS2626.1" ext-link-type="DOI">10.1175/2008JAS2626.1</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx20"><label>Scipy(2014)</label><?label scipy2014?><mixed-citation>Scipy, C.: Interpolate unstructured D-dimensional data, available at:
<uri>https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.griddata.html</uri> (last access: 21 December 2020), 2014.</mixed-citation></ref>
      <ref id="bib1.bibx21"><label>Shepard(1968)</label><?label shepard1968?><mixed-citation>Shepard, D.: A Two-Dimensional Interpolation Function for Irregularly-Spaced
Data, in: Proceedings of the 1968 23rd ACM National Conference, Association for Computing Machinery, New York, NY, USA, 517–524,
<ext-link xlink:href="https://doi.org/10.1145/800186.810616" ext-link-type="DOI">10.1145/800186.810616</ext-link>, 1968.</mixed-citation></ref>
      <ref id="bib1.bibx22"><label>Skamarock et al.(2008)</label><?label skamarock2008?><mixed-citation>Skamarock, W. C., Klemp, J. B., Dudhia, J., Gill, D. O., Barker, D. M., Duda,
M., Huang, X., Wang, W., and Powers, J. G.: A description of the Advanced
Research WRF Version 3, NCAR Tech. Note, 1–125, 2008.
 </mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx23"><label>Stein et al.(2015)</label><?label stein2015?><mixed-citation>Stein, A. F., Draxler, R. R., Rolph, G. D., Stunder, B. J. B., Cohen, M. D.,
and Ngan, F.: NOAA's HYSPLIT Atmospheric Transport and Dispersion Modeling
System, B. Am. Meteorol. Soc., 96, 2059–2077,
<ext-link xlink:href="https://doi.org/10.1175/BAMS-D-14-00110.1" ext-link-type="DOI">10.1175/BAMS-D-14-00110.1</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx24"><label>Stull(1988)</label><?label stull1988?><mixed-citation>
Stull, R.: an introduction to boundary layer meteorology, Kluwer Academic
Publishers Group, 1988.</mixed-citation></ref>
      <ref id="bib1.bibx25"><label>Sun and Grimmond(2019)</label><?label sun2019?><mixed-citation>Sun, T. and Grimmond, S.: A Python-enhanced urban land surface model SuPy (SUEWS in Python, v2019.2): development, deployment and demonstration, Geosci. Model Dev., 12, 2781–2795, <ext-link xlink:href="https://doi.org/10.5194/gmd-12-2781-2019" ext-link-type="DOI">10.5194/gmd-12-2781-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx26"><label>Troen and Mahrt(1986)</label><?label troen1986?><mixed-citation>
Troen, I. and Mahrt, L.: A simple model of the atmospheric boundary layer:
Sensitivity to surface evaporation, Bound.-Lay. Meteorol., 37,
129–148, 1986.</mixed-citation></ref>
      <ref id="bib1.bibx27"><label>Wessel et al.(2019)</label><?label wessel2019?><mixed-citation>Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F.,
and Tian, D.: The Generic Mapping Tools Version 6, Geochem. Geophys.
Geosy., 20, 5556–5564, <ext-link xlink:href="https://doi.org/10.1029/2019GC008515" ext-link-type="DOI">10.1029/2019GC008515</ext-link>,
2019.</mixed-citation></ref>
      <ref id="bib1.bibx28"><label>Zender(2008)</label><?label zender2008?><mixed-citation>Zender, C. S.: Analysis of self-describing gridded geoscience data with netCDF Operators (NCO), Environ. Model. Softw., 23, 1338–1342, <ext-link xlink:href="https://doi.org/10.1016/j.envsoft.2008.03.004" ext-link-type="DOI">10.1016/j.envsoft.2008.03.004</ext-link>,
2008.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>An <i>N</i>-dimensional Fortran interpolation programme (NterGeo.v2020a) for geophysics sciences – application to a back-trajectory programme (Backplumes.v2020r1) using CHIMERE or WRF outputs</article-title-html>
<abstract-html><p>An interpolation programme coded in Fortran for irregular <i>N</i>-dimensional cases is presented and freely available. The need for interpolation procedures over irregular meshes or matrixes with interdependent input data dimensions is frequent in geophysical models. Also, these models often embed look-up tables of physics or chemistry modules. Fortran is a fast and powerful language and is highly portable. It is easy to interface models written in Fortran with each other. Our programme does not need any libraries; it is written in standard Fortran and tested with two usual compilers. The programme is fast and competitive compared to current Python libraries. A normalization option parameter is provided when considering different types of units on each dimension. Some tests and examples are provided and available in the code package. Moreover, a geophysical application embedding this interpolation programme is provided and discussed; it consists in determining back trajectories using chemistry-transport or mesoscale meteorological model outputs, respectively, from the widely used  CHIMERE and Weather Research and Forecasting (WRF) models.</p></abstract-html>
<ref-html id="bib1.bib1"><label>Bessagnet(2020)</label><mixed-citation>
Bessagnet, B.: A N-dimensional Fortran Interpolation Program (NterGeo) for Geophysics Sciences (Version 2020v1), Zenodo, <a href="https://doi.org/10.5281/zenodo.3733278" target="_blank">https://doi.org/10.5281/zenodo.3733278</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Donner et al.(2011)</label><mixed-citation>
Donner, L. J., Wyman, B. L., Hemler, R. S., Horowitz, L. W., Ming, Y., Zhao,
M., Golaz, J.-C., Ginoux, P., Lin, S.-J., Schwarzkopf, M. D., Austin, J.,
Alaka, G., Cooke, W. F., Delworth, T. L., Freidenreich, S. M., Gordon, C. T.,
Griffies, S. M., Held, I. M., Hurlin, W. J., Klein, S. A., Knutson, T. R.,
Langenhorst, A. R., Lee, H.-C., Lin, Y., Magi, B. I., Malyshev, S. L., Milly,
P. C. D., Naik, V., Nath, M. J., Pincus, R., Ploshay, J. J., Ramaswamy, V.,
Seman, C. J., Shevliakova, E., Sirutis, J. J., Stern, W. F., Stouffer, R. J.,
Wilson, R. J., Winton, M., Wittenberg, A. T., and Zeng, F.: The Dynamical
Core, Physical Parameterizations, and Basic Simulation Characteristics of the
Atmospheric Component AM3 of the GFDL Global Coupled Model CM3, J.
Climate, 24, 3484–3519, <a href="https://doi.org/10.1175/2011JCLI3955.1" target="_blank">https://doi.org/10.1175/2011JCLI3955.1</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Flamant et al.(2018)</label><mixed-citation>
Flamant, C., Deroubaix, A., Chazette, P., Brito, J., Gaetani, M., Knippertz, P., Fink, A. H., de Coetlogon, G., Menut, L., Colomb, A., Denjean, C., Meynadier, R., Rosenberg, P., Dupuy, R., Dominutti, P., Duplissy, J., Bourrianne, T., Schwarzenboeck, A., Ramonet, M., and Totems, J.: Aerosol distribution in the northern Gulf of Guinea: local anthropogenic sources, long-range transport, and the role of coastal shallow circulations, Atmos. Chem. Phys., 18, 12363–12389, <a href="https://doi.org/10.5194/acp-18-12363-2018" target="_blank">https://doi.org/10.5194/acp-18-12363-2018</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Hardy(1971)</label><mixed-citation>
Hardy, R.: Multivariate equations of topography and other irregular surfaces,
J. Geophys. Res., 71, 1905–1915, 1971.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Hardy(1990)</label><mixed-citation>
Hardy, R.: Theory and applications of the multiquadric-biharmonic method 20 years of discovery 1968–1988, Computers and Mathematics with Applications,
19, 163–208, <a href="https://doi.org/10.1016/0898-1221(90)90272-L" target="_blank">https://doi.org/10.1016/0898-1221(90)90272-L</a>,
1990.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Hofstra et al.(2008)</label><mixed-citation>
Hofstra, N., Haylock, M., New, M., Jones, P., and Frei, C.: Comparison of six
methods for the interpolation of daily, European climate data, J.
Geophys. Res.-Atmos., 113, D21110, <a href="https://doi.org/10.1029/2008JD010100" target="_blank">https://doi.org/10.1029/2008JD010100</a>,
2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Hong et al.(2006)</label><mixed-citation>
Hong, S. Y., Noh, Y., and Dudhia, J.: A new vertical diffusion package with an explicit treatment of entrainment processes, Mon. Weather Rev., 134,
2318–2341, <a href="https://doi.org/10.1175/MWR3199.1" target="_blank">https://doi.org/10.1175/MWR3199.1</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Kouatchou(2018)</label><mixed-citation>
Kouatchou, J.: NASA Modeling Guru: Basic Comparison of Python, Julia, Matlab,
IDL and Java (2018 Edition), available at:
<a href="https://modelingguru.nasa.gov/docs/DOC-2676" target="_blank"/> (last access: 11 March 2020),
2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Lin et al.(2003)</label><mixed-citation>
Lin, J. C., Gerbig, C., Wofsy, S. C., Andrews, A. E., Daube, B. C., Davis,
K. J., and Grainger, C. A.: A near-field tool for simulating the upstream
influence of atmospheric observations: The Stochastic Time-Inverted
Lagrangian Transport (STILT) model, J. Geophys. Res.-Atmos., 108, 4493, <a href="https://doi.org/10.1029/2002JD003161" target="_blank">https://doi.org/10.1029/2002JD003161</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Mailler et al.(2016)</label><mixed-citation>
Mailler, S., Menut, L., di Sarra, A. G., Becagli, S., Di Iorio, T., Bessagnet, B., Briant, R., Formenti, P., Doussin, J.-F., Gómez-Amo, J. L., Mallet, M., Rea, G., Siour, G., Sferlazzo, D. M., Traversi, R., Udisti, R., and Turquety, S.: On the radiative impact of aerosols on photolysis rates: comparison of simulations and observations in the Lampedusa island during the ChArMEx/ADRIMED campaign, Atmos. Chem. Phys., 16, 1219–1244, <a href="https://doi.org/10.5194/acp-16-1219-2016" target="_blank">https://doi.org/10.5194/acp-16-1219-2016</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Mailler et al.(2017)</label><mixed-citation>
Mailler, S., Menut, L., Khvorostyanov, D., Valari, M., Couvidat, F., Siour, G., Turquety, S., Briant, R., Tuccella, P., Bessagnet, B., Colette, A., Létinois, L., Markakis, K., and Meleux, F.: CHIMERE-2017: from urban to hemispheric chemistry-transport modeling, Geosci. Model Dev., 10, 2397–2423, <a href="https://doi.org/10.5194/gmd-10-2397-2017" target="_blank">https://doi.org/10.5194/gmd-10-2397-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Menut(2020)</label><mixed-citation>
Menut, L.: BACKPLUMES program v2020r1 April 2020, IPSL-LMD-CNRS, available at: <a href="https://www.lmd.polytechnique.fr/~menut/backplumes.php" target="_blank"/>, last access: 21 December 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Menut et al.(2015)</label><mixed-citation>
Menut, L., Rea, G., Mailler, S., Khvorostyanov, D., and Turquety, S.: Aerosol forecast over the Mediterranean area during July 2013 (ADRIMED/CHARMEX), Atmos. Chem. Phys., 15, 7897–7911, <a href="https://doi.org/10.5194/acp-15-7897-2015" target="_blank">https://doi.org/10.5194/acp-15-7897-2015</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Nehrkorn et al.(2010)</label><mixed-citation>
Nehrkorn, T., Eluszkiewicz, J., Wofsy, S., Lin, J., Gerbig, C., Longo, M., and Freitas, S.: Coupled weather research and forecasting-stochastic
time-inverted lagrangian transport (WRF-STILT) model, Meteorol.
Atmos. Phys., 107, 51–64, <a href="https://doi.org/10.1007/s00703-010-0068-x" target="_blank">https://doi.org/10.1007/s00703-010-0068-x</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Nenes et al.(1998)</label><mixed-citation>
Nenes, A., Pilinis, C., and Pandis, S.: ISORROPIA: A new thermodynamic model
for inorganic multicomponent atmospheric aerosols, Aquatic Geochem., 4,
123–152, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Nenes et al.(1999)</label><mixed-citation>
Nenes, A., Pandis, S. N., and Pilinis, C.: Continued development and testing of
a new thermodynamic aerosol module for urban and regional air quality models,
Atmos. Environ., 33, 1553–1560, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Pielke(1984)</label><mixed-citation>
Pielke Sr., R. A.: Mesoscale Meteorological Modeling, Academic Press, 1984.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Pisso et al.(2019)</label><mixed-citation>
Pisso, I., Sollum, E., Grythe, H., Kristiansen, N. I., Cassiani, M., Eckhardt, S., Arnold, D., Morton, D., Thompson, R. L., Groot Zwaaftink, C. D., Evangeliou, N., Sodemann, H., Haimberger, L., Henne, S., Brunner, D., Burkhart, J. F., Fouilloux, A., Brioude, J., Philipp, A., Seibert, P., and Stohl, A.: The Lagrangian particle dispersion model FLEXPART version 10.4, Geosci. Model Dev., 12, 4955–4997, <a href="https://doi.org/10.5194/gmd-12-4955-2019" target="_blank">https://doi.org/10.5194/gmd-12-4955-2019</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Rap et al.(2009)</label><mixed-citation>
Rap, A., Ghosh, S., and Smith, M. H.: Shepard and Hardy Multiquadric
Interpolation Methods for Multicomponent Aerosol–Cloud Parameterization,
J. Atmos. Sci., 66, 105–115,
<a href="https://doi.org/10.1175/2008JAS2626.1" target="_blank">https://doi.org/10.1175/2008JAS2626.1</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Scipy(2014)</label><mixed-citation>
Scipy, C.: Interpolate unstructured D-dimensional data, available at:
<a href="https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.griddata.html" target="_blank"/> (last access: 21 December 2020), 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Shepard(1968)</label><mixed-citation>
Shepard, D.: A Two-Dimensional Interpolation Function for Irregularly-Spaced
Data, in: Proceedings of the 1968 23rd ACM National Conference, Association for Computing Machinery, New York, NY, USA, 517–524,
<a href="https://doi.org/10.1145/800186.810616" target="_blank">https://doi.org/10.1145/800186.810616</a>, 1968.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Skamarock et al.(2008)</label><mixed-citation>
Skamarock, W. C., Klemp, J. B., Dudhia, J., Gill, D. O., Barker, D. M., Duda,
M., Huang, X., Wang, W., and Powers, J. G.: A description of the Advanced
Research WRF Version 3, NCAR Tech. Note, 1–125, 2008.

</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Stein et al.(2015)</label><mixed-citation>
Stein, A. F., Draxler, R. R., Rolph, G. D., Stunder, B. J. B., Cohen, M. D.,
and Ngan, F.: NOAA's HYSPLIT Atmospheric Transport and Dispersion Modeling
System, B. Am. Meteorol. Soc., 96, 2059–2077,
<a href="https://doi.org/10.1175/BAMS-D-14-00110.1" target="_blank">https://doi.org/10.1175/BAMS-D-14-00110.1</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Stull(1988)</label><mixed-citation>
Stull, R.: an introduction to boundary layer meteorology, Kluwer Academic
Publishers Group, 1988.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Sun and Grimmond(2019)</label><mixed-citation>
Sun, T. and Grimmond, S.: A Python-enhanced urban land surface model SuPy (SUEWS in Python, v2019.2): development, deployment and demonstration, Geosci. Model Dev., 12, 2781–2795, <a href="https://doi.org/10.5194/gmd-12-2781-2019" target="_blank">https://doi.org/10.5194/gmd-12-2781-2019</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Troen and Mahrt(1986)</label><mixed-citation>
Troen, I. and Mahrt, L.: A simple model of the atmospheric boundary layer:
Sensitivity to surface evaporation, Bound.-Lay. Meteorol., 37,
129–148, 1986.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Wessel et al.(2019)</label><mixed-citation>
Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F.,
and Tian, D.: The Generic Mapping Tools Version 6, Geochem. Geophys.
Geosy., 20, 5556–5564, <a href="https://doi.org/10.1029/2019GC008515" target="_blank">https://doi.org/10.1029/2019GC008515</a>,
2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Zender(2008)</label><mixed-citation>
Zender, C. S.: Analysis of self-describing gridded geoscience data with netCDF Operators (NCO), Environ. Model. Softw., 23, 1338–1342, <a href="https://doi.org/10.1016/j.envsoft.2008.03.004" target="_blank">https://doi.org/10.1016/j.envsoft.2008.03.004</a>,
2008.
</mixed-citation></ref-html>--></article>
