Changeset 5920b7f in flex_extract.git for Documentation/html/Installation/local.html
- Timestamp:
- May 30, 2020, 9:35:50 AM (4 years ago)
- Branches:
- master, ctbto, dev
- Children:
- a9d33f6
- Parents:
- 550435b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Documentation/html/Installation/local.html
rb1674ed r5920b7f 92 92 <li class="toctree-l1 current"><a class="reference internal" href="../installation.html">Installation</a><ul class="current"> 93 93 <li class="toctree-l2"><a class="reference internal" href="../installation.html#registration-at-ecmwf">Registration at ECMWF</a></li> 94 <li class="toctree-l2"><a class="reference internal" href="../installation.html# licence-agreement-for-public-datasets">Licence agreementfor public datasets</a></li>94 <li class="toctree-l2"><a class="reference internal" href="../installation.html#accept-licences-for-public-datasets">Accept licences for public datasets</a></li> 95 95 <li class="toctree-l2"><a class="reference internal" href="../installation.html#download-flex-extract">Download <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code></a></li> 96 96 <li class="toctree-l2"><a class="reference internal" href="../installation.html#dependencies">Dependencies</a></li> … … 100 100 <li class="toctree-l3 current"><a class="current reference internal" href="#">Local mode installation</a><ul> 101 101 <li class="toctree-l4"><a class="reference internal" href="#local-mode-dependencies">Local mode - dependencies</a></li> 102 <li class="toctree-l4"><a class="reference internal" href="#prepar e-local-environment">Prepare local environment</a></li>103 <li class="toctree-l4"><a class="reference internal" href="#test -local-environment">Testlocal environment</a></li>102 <li class="toctree-l4"><a class="reference internal" href="#preparing-the-local-environment">Preparing the local environment</a></li> 103 <li class="toctree-l4"><a class="reference internal" href="#testing-the-local-environment">Testing the local environment</a></li> 104 104 <li class="toctree-l4"><a class="reference internal" href="#local-installation">Local installation</a></li> 105 105 </ul> … … 193 193 <span id="ref-req-local"></span><span id="ref-local-mode"></span><h2>Local mode - dependencies<a class="headerlink" href="#local-mode-dependencies" title="Permalink to this headline">¶</a></h2> 194 194 <p>The installation is the same for the access modes <strong>member</strong> and <strong>public</strong>.</p> 195 <p>The environment on your local system has to provide the sesoftware packages195 <p>The environment on your local system has to provide the following software packages 196 196 and libraries, since the preparation of the extraction and the post-processing is done on the local machine:</p> 197 197 <table class="docutils align-default"> … … 204 204 <td><p>Fortran part</p></td> 205 205 </tr> 206 <tr class="row-even"><td>< ul class="simple">206 <tr class="row-even"><td><ol class="arabic simple"> 207 207 <li><p><a class="reference external" href="https://www.python.org/downloads/">Python3</a></p></li> 208 208 <li><p><a class="reference external" href="http://www.numpy.org/">numpy</a></p></li> … … 211 211 <li><p><a class="reference external" href="https://confluence.ecmwf.int/display/WEBAPI/ECMWF+Web+API+Home">ecmwf-api-client</a> (everything except ERA5)</p></li> 212 212 <li><p><a class="reference external" href="https://cds.climate.copernicus.eu/api-how-to">cdsapi</a> (just for ERA5 and member user)</p></li> 213 </ ul>213 </ol> 214 214 </td> 215 <td>< ul class="simple">215 <td><ol class="arabic simple"> 216 216 <li><p><a class="reference external" href="https://gcc.gnu.org/wiki/GFortran">gfortran</a></p></li> 217 217 <li><p><a class="reference external" href="http://www.fftw.org">fftw3</a></p></li> 218 218 <li><p><a class="reference external" href="https://software.ecmwf.int/wiki/display/ECC">eccodes</a></p></li> 219 219 <li><p><a class="reference external" href="https://software.ecmwf.int/wiki/display/EMOS/Emoslib">emoslib</a></p></li> 220 </ ul>220 </ol> 221 221 </td> 222 222 </tr> … … 224 224 </table> 225 225 </div> 226 <div class="section" id="prepar e-local-environment">227 <span id="ref-prep-local"></span><h2>Prepar e local environment<a class="headerlink" href="#prepare-local-environment" title="Permalink to this headline">¶</a></h2>228 <p>The easiest way to install all required packages is to use the package management system of your Linux distribution 226 <div class="section" id="preparing-the-local-environment"> 227 <span id="ref-prep-local"></span><h2>Preparing the local environment<a class="headerlink" href="#preparing-the-local-environment" title="Permalink to this headline">¶</a></h2> 228 <p>The easiest way to install all required packages is to use the package management system of your Linux distribution which requires admin rights. 229 229 The installation was tested on a <em>Debian GNU/Linux buster</em> and an <em>Ubuntu 18.04 Bionic Beaver</em> system.</p> 230 <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># On a Debian or Debian-derived sytem (e. g. Ubuntu) system you may use the following commands (or equivalent commands of your preferred package manager):</span> 231 <span class="c1"># (if not already available):</span> 230 <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># On a Debian or Debian-derived (e. g. Ubuntu) system,</span> 231 <span class="c1"># you may use the following commands (or equivalent commands of your preferred package manager):</span> 232 <span class="c1"># (if respective packages are not already available):</span> 232 233 apt-get install python3 <span class="o">(</span>usually already available on GNU/Linux systems<span class="o">)</span> 233 234 apt-get install python3-eccodes … … 238 239 apt-get install libeccodes-dev 239 240 apt-get install libemos-dev 240 <span class="c1"># Some of these packages will pull in further packages as dependencies. This is fine, and some are even needed by ``flex_extract''.</span> 241 242 243 <span class="c1"># As currently the CDS and ECMWF API packages are not available as Debian packages, they need to be installed outside of the Debian (Ubuntu etc.) package management system. The recommended way is:</span> 241 <span class="c1"># Some of these packages will pull in further packages as dependencies.</span> 242 <span class="c1"># This is fine, and some are even needed by ``flex_extract''.</span> 243 244 <span class="c1"># As currently the CDS and ECMWF API packages are not available as Debian packages,</span> 245 <span class="c1"># they need to be installed outside of the Debian (Ubuntu etc.) package management system.</span> 246 <span class="c1"># The recommended way is:</span> 244 247 apt-get install pip 245 248 pip install cdsapi … … 249 252 <div class="admonition note"> 250 253 <p class="admonition-title">Note</p> 251 <p>I n case you would like to use Anaconda Python we recommend youfollow the installation instructions of252 <a class="reference external" href="https://docs.anaconda.com/anaconda/install/linux/">Anaconda Python Installation for Linux</a> and then install the253 <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> package from <code class="docutils literal notranslate"><span class="pre">conda</span></code> with:</p>254 <p>If you are using Anaconda Python, we recommend to follow the installation instructions of 255 <a class="reference external" href="https://docs.anaconda.com/anaconda/install/linux/">Anaconda Python Installation for Linux</a> 256 and then install the <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> package from <code class="docutils literal notranslate"><span class="pre">conda</span></code> with:</p> 254 257 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>conda install conda-forge::python-eccodes 255 258 </pre></div> 256 259 </div> 257 260 </div> 258 <p>The CDS API ( cdsapi) is required for ERA5 data and the ECMWF Web API (ecmwf-api-client) for all other public datasets.</p>261 <p>The CDS API (<code class="docutils literal notranslate"><span class="pre">cdsapi</span></code>) is required for ERA5 data and the ECMWF Web API (ecmwf-api-client) for all other public datasets.</p> 259 262 <div class="admonition note"> 260 263 <p class="admonition-title">Note</p> 261 <p>Since <strong>public users</strong> currently don’t have access to the full <em>ERA5</em> dataset they can skip the installation of the <code class="docutils literal notranslate"><span class="pre">CDS</span> <span class="pre">API</span></code>.</p>262 </div> 263 <p>Both user groups have to provide keys with their credentials for the Web API ’s in their home directory. Therefore, followthese instructions:</p>264 <p>Since <strong>public users</strong> currently don’t have access to the full <em>ERA5</em> dataset, they can skip the installation of the CDS API.</p> 265 </div> 266 <p>Both user groups have to provide keys with their credentials for the Web APIs in their home directory, following these instructions:</p> 264 267 <dl class="simple"> 265 <dt>ECMWF Web API:</dt><dd><p>Go to <a class="reference external" href="https://confluence.ecmwf.int//display/WEBAPI/Access+MARS">MARS access</a> website and log in with your credentials. Afterwards, on this site in section “Install ECMWF KEY” the key for the ECMWF Web API should be listed. Please follow the instructions in this section under 1 (save the key in a file <cite>.ecmwfapirc</cite> in your home directory).</p>268 <dt>ECMWF Web API:</dt><dd><p>Go to the <a class="reference external" href="https://confluence.ecmwf.int//display/WEBAPI/Access+MARS">MARS access</a> website and log in with your credentials. Afterwards, go to the section “Install ECMWF KEY”, where the key for the ECMWF Web API should be listed. Please follow the instructions in this section under 1 (save the key in a file <code class="docutils literal notranslate"><span class="pre">.ecmwfapirc</span></code> in your home directory).</p> 266 269 </dd> 267 <dt>CDS API:</dt><dd><p>Go to <a class="reference external" href="https://cds.climate.copernicus.eu/user/register">CDS API registration</a> and register there too. Log in at the <a class="reference external" href="https://cds.climate.copernicus.eu/api-how-to">cdsapi</a> website and follow the instructions at section “Install the CDS API key” to save your credentials in a <cite>.cdsapirc</cite> file.</p>270 <dt>CDS API:</dt><dd><p>Go to <a class="reference external" href="https://cds.climate.copernicus.eu/user/register">CDS API registration</a> and register there, too. Log in on the <a class="reference external" href="https://cds.climate.copernicus.eu/api-how-to">cdsapi</a> website and follow the instructions in the section “Install the CDS API key” to save your credentials in file <code class="docutils literal notranslate"><span class="pre">.cdsapirc</span></code>.</p> 268 271 </dd> 269 272 </dl> 270 273 </div> 271 <div class="section" id="test-local-environment"> 272 <span id="ref-test-local"></span><h2>Test local environment<a class="headerlink" href="#test-local-environment" title="Permalink to this headline">¶</a></h2> 273 <p>Check the availability of the python packages by typing <code class="docutils literal notranslate"><span class="pre">python3</span></code> in a terminal window and run the <code class="docutils literal notranslate"><span class="pre">import</span></code> commands in the python shell. If there are no error messages, you succeeded in setting up the environment.</p> 274 <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># check in python3 console</span> 275 <span class="kn">import</span> <span class="nn">eccodes</span> 276 <span class="kn">import</span> <span class="nn">genshi</span> 277 <span class="kn">import</span> <span class="nn">numpy</span> 278 <span class="kn">import</span> <span class="nn">cdsapi</span> 279 <span class="kn">import</span> <span class="nn">ecmwfapi</span> 280 </pre></div> 281 </div> 282 <div class="section" id="test-the-web-api-s"> 283 <h3>Test the Web API’s<a class="headerlink" href="#test-the-web-api-s" title="Permalink to this headline">¶</a></h3> 274 <div class="section" id="testing-the-local-environment"> 275 <span id="ref-test-local"></span><h2>Testing the local environment<a class="headerlink" href="#testing-the-local-environment" title="Permalink to this headline">¶</a></h2> 276 <p>Check the availability of the python packages by typing <code class="docutils literal notranslate"><span class="pre">python3</span></code> in a terminal window and run the <code class="docutils literal notranslate"><span class="pre">import</span></code> commands in the python shell: 277 .. code-block:: python</p> 278 <blockquote> 279 <div><p># check in python3 console 280 import eccodes 281 import genshi 282 import numpy 283 import cdsapi 284 import ecmwfapi</p> 285 </div></blockquote> 286 <p>If there are no error messages, you succeeded in setting up the environment.</p> 287 <div class="section" id="testing-the-web-apis"> 288 <h3>Testing the Web APIs<a class="headerlink" href="#testing-the-web-apis" title="Permalink to this headline">¶</a></h3> 284 289 <p>You can start very simple test retrievals for both Web APIs to be sure that everything works. This is recommended to minimise the range of possible errors using <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code> later on.</p> 285 290 <div class="section" id="ecmwf-web-api"> … … 291 296 </colgroup> 292 297 <tbody> 293 <tr class="row-odd"><td><p>Please use this piece of Python code for<strong>Member user</strong>:</p></td>294 <td><p>Please use this piece of Python code for<strong>Public user</strong>:</p></td>298 <tr class="row-odd"><td><p>Please use this Python code snippet as a <strong>Member user</strong>:</p></td> 299 <td><p>Please use this Python code snippet as a <strong>Public user</strong>:</p></td> 295 300 </tr> 296 301 <tr class="row-even"><td><div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ecmwfapi</span> <span class="kn">import</span> <span class="n">ECMWFService</span> … … 341 346 <h4>CDS API<a class="headerlink" href="#cds-api" title="Permalink to this headline">¶</a></h4> 342 347 <p>Extraction of ERA5 data via CDS API might take time as currently there is a high demand for ERA5 data. Therefore, as a simple test for the API just retrieve pressure-level data (even if that is NOT what we need for FLEXPART), as they are stored on disk and don’t need to be retrieved from MARS (which is the time-consuming action):</p> 343 <p>Please use th is piece of Python code to retrieve a small sample of <em>ERA5</em> pressure levels:</p>348 <p>Please use the following Python code snippet to retrieve a small sample of <em>ERA5</em> pressure level data:</p> 344 349 <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cdsapi</span> 345 350 … … 361 366 </div> 362 367 <p>If you know that your CDS API works, you can try to extract some data from MARS.</p> 363 <p>Please use th is piece of Python codeto retrieve a small <em>ERA5</em> data sample as a <strong>member-state user</strong>! The <strong>Public user</strong> do not have access to the full <em>ERA5</em> dataset!</p>368 <p>Please use the following Python code snippet to retrieve a small <em>ERA5</em> data sample as a <strong>member-state user</strong>! The <strong>Public user</strong> do not have access to the full <em>ERA5</em> dataset!</p> 364 369 <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cdsapi</span> 365 370 … … 389 394 <div class="section" id="local-installation"> 390 395 <span id="ref-install-local"></span><h2>Local installation<a class="headerlink" href="#local-installation" title="Permalink to this headline">¶</a></h2> 391 <p>First prepare the Fortran <code class="docutils literal notranslate"><span class="pre">makefile</span></code> for your environment and set it in the <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code> script. (See section <a class="reference internal" href="../Documentation/Input/fortran_makefile.html#ref-convert"><span class="std std-ref">Fortran Makefile</span></a> for more information.) 392 <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code> comes with two <code class="docutils literal notranslate"><span class="pre">makefiles</span></code> prepared for the <code class="docutils literal notranslate"><span class="pre">gfortran</span></code> compiler. One for the normal use <code class="docutils literal notranslate"><span class="pre">makefile_fast</span></code> and one for debugging <code class="docutils literal notranslate"><span class="pre">makefile_debug</span></code> which is usually only resonable for developers.</p> 393 <p>They assume that <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> and <code class="docutils literal notranslate"><span class="pre">emoslib</span></code> are installed as distribution packages and can be found at <code class="docutils literal notranslate"><span class="pre">flex_extract_vX.X/Source/Fortran</span></code>, where <code class="docutils literal notranslate"><span class="pre">vX.X</span></code> should be substituted with the current version number.</p> 396 <p>First, adapt the Fortran <code class="docutils literal notranslate"><span class="pre">makefile</span></code> for your environment (if necessary) and insert it into <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code> script (see <a class="reference internal" href="../Documentation/Input/fortran_makefile.html#ref-convert"><span class="std std-ref">Fortran Makefile</span></a> for more information). 397 They can be found at <code class="docutils literal notranslate"><span class="pre">flex_extract_vX.X/Source/Fortran/</span></code>, where <code class="docutils literal notranslate"><span class="pre">vX.X</span></code> should be substituted by the current flex_extract version number.</p> 394 398 <div class="admonition caution"> 395 399 <p class="admonition-title">Caution</p> … … 397 401 <code class="docutils literal notranslate"><span class="pre">makefiles</span></code> if other than standard paths are used.</p> 398 402 </div> 399 <p>So starting from the root directory of <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code>, 400 go to the <code class="docutils literal notranslate"><span class="pre">Fortran</span></code> source directory and open the <code class="docutils literal notranslate"><span class="pre">makefile</span></code> of your 401 choice to modify with an editor of your choice. We use the <code class="docutils literal notranslate"><span class="pre">nedit</span></code> in this case.</p> 403 <p>Thus, go to the <code class="docutils literal notranslate"><span class="pre">Fortran</span></code> source directory and open the <code class="docutils literal notranslate"><span class="pre">makefile</span></code> of your 404 choice, and check / modify with an editor of your choice:</p> 402 405 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> flex_extract_vX.X/Source/Fortran 403 406 nedit makefile_fast 404 407 </pre></div> 405 408 </div> 406 <p> Edit the paths to the <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> library on your local machine.</p>409 <p>Set the paths to the <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> library on your local machine, if necessary.</p> 407 410 <div class="admonition caution"> 408 411 <p class="admonition-title">Caution</p> … … 417 420 <p>to find out the path to the <code class="docutils literal notranslate"><span class="pre">eccodes</span></code> library.</p> 418 421 </div> 419 <p> Substitute these paths in the <code class="docutils literal notranslate"><span class="pre">makefile</span></code> forparameters <strong>ECCODES_INCLUDE_DIR</strong>420 and <strong>ECCODES_LIB</strong> and save it.</p>421 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># these are the paths on a current Debian 10 Testing system (May 2019)</span>422 <p>Assign these paths to the parameters <strong>ECCODES_INCLUDE_DIR</strong> 423 and <strong>ECCODES_LIB</strong> in the makefile, and save it.</p> 424 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># these are the paths on Debian Buster:</span> 422 425 <span class="nv">ECCODES_INCLUDE_DIR</span><span class="o">=</span>/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/ 423 426 <span class="nv">ECCODES_LIB</span><span class="o">=</span> -L/usr/lib -leccodes_f90 -leccodes -lm … … 425 428 </div> 426 429 <p>The Fortran program called <code class="docutils literal notranslate"><span class="pre">calc_etadot</span></code> will be compiled during the 427 installation process. Thereforethe name of the <code class="docutils literal notranslate"><span class="pre">makefile</span></code> to be used needs to be given in <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code>.</p>430 installation process. Therefore, the name of the <code class="docutils literal notranslate"><span class="pre">makefile</span></code> to be used needs to be given in <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code>.</p> 428 431 <p>In the root directory of <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code>, open the <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code> script 429 and adapt the installation parameters in the section labelled with430 “AVAILABLE COMMANDLINE ARGUMENTS TO SET” like shown below.</p>432 with an editor and adapt the installation parameters in the section labelled with 433 “AVAILABLE COMMANDLINE ARGUMENTS TO SET” as shown below:</p> 431 434 <div class="literal-block-wrapper docutils container" id="setup-sh"> 432 435 <div class="code-block-caption"><span class="caption-text">‘Example settings for a local installation.’</span><a class="headerlink" href="#setup-sh" title="Permalink to this code">¶</a></div>
Note: See TracChangeset
for help on using the changeset viewer.