<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title type="text">Christopher Bull</title>
<generator uri="https://github.com/jekyll/jekyll">Jekyll</generator>
<link rel="self" type="application/atom+xml" href="https://cbull.info/feed.xml" />
<link rel="alternate" type="text/html" href="https://cbull.info" />
<updated>2023-11-30T12:55:58+00:00</updated>
<id>https://cbull.info/</id>
<author>
  <name>Christopher Bull</name>
  <uri>https://cbull.info/</uri>
  <email>christopher.bull@northumbria.ac.uk</email>
</author>


<entry>
  <title type="html"><![CDATA[Building and Running XIOS and NEMO4 on PSMN (ENS de Lyon HPC) with partition E5.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo4/nemo4-PSMN-E5-01/" />
  <id>https://cbull.info/nemo4/nemo4-PSMN-E5-01</id>
  <published>2023-11-23T00:30:00+00:00</published>
  <updated>2023-11-23T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;We take the first step of downloading, compiling and testing XIOS and NEMO4 code on &lt;strong&gt;PSMN (ENS de Lyon; Lyon, France)&lt;/strong&gt;. This is a post based on an installation made by Cerasela Calugaru. Thank you Cerasela ! This post is written by Louis Saddier (louis.saddier@ens-lyon.fr), thanks Louis!&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.ens-lyon.fr/PSMN/&quot;&gt;PSMN account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://www.ens-lyon.fr/PSMN/Documentation/&quot;&gt;PSMN documentation&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://forge.ipsl.jussieu.fr/ioserver/wiki/documentation&quot;&gt;XIOS documentation&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://sites.nemo-ocean.io/user-guide/&quot;&gt;NEMO4 short user guide&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-xios&quot;&gt;Installing XIOS&lt;/h2&gt;

&lt;p&gt;Log-into PSMN into a E5 partition node. Set-up your environment with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module use /applis/PSMN/debian11/E5/modules/all/
module load netCDF-Fortran/4.6.1-gompi-2023a&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Get XIOS :&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now we need to create &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arch&lt;/code&gt; files to indicate the options we want when we will compile XIOS. First we will create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.path&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;XIOS/arch/
vi arch-X64_PSMN_E5.path&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and write:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-I&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$NETCDFF_INCDIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; -I&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$NETCDF_INC_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NETCDF_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-L&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$NECDFF_LIBDIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; -L&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$NETCDF_LIB_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NETCDF_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-lnetcdff -lnetcdf&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;MPI_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MPI_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MPI_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;HDF5_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-I&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HDF5_INC_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;HDF5_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-L&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HDF5_LIB_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;HDF5_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-lhdf5_hl -lhdf5 -lhdf5 -lz&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;OASIS_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-I&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PWD&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/../../oasis3-mct/BLD/build/lib/psmile.MPI1&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;OASIS_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-L&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PWD&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/../../oasis3-mct/BLD/lib&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;OASIS_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-lpsmile.MPI1 -lscrip -lmct -lmpeu&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then, we will create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.fcm&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;vi arch-X64_PSMN_E5.fcm&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and write:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%CCOMPILER      mpicc
%FCOMPILER      mpif90
%LINKER         mpif90

%BASE_CFLAGS    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;c++11 &lt;span class=&quot;nt&quot;&gt;-D__XIOS_EXCEPTION&lt;/span&gt;
%PROD_CFLAGS    &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; BOOST_DISABLE_ASSERTS
%DEV_CFLAGS     &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traceback&lt;/span&gt;
%DEBUG_CFLAGS   &lt;span class=&quot;nt&quot;&gt;-DBZ_DEBUG&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traceback&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fno-inline&lt;/span&gt;

%BASE_FFLAGS    &lt;span class=&quot;nt&quot;&gt;-D__NONE__&lt;/span&gt;
%PROD_FFLAGS    &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt;
%DEV_FFLAGS     &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traceback&lt;/span&gt;
%DEBUG_FFLAGS   &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traceback&lt;/span&gt;

%BASE_INC       &lt;span class=&quot;nt&quot;&gt;-D__NONE__&lt;/span&gt;
%BASE_LD        &lt;span class=&quot;nt&quot;&gt;-lstdc&lt;/span&gt;++

%CPP            mpicc &lt;span class=&quot;nt&quot;&gt;-EP&lt;/span&gt;
%FPP            cpp &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt;
%MAKE           gmake&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Finally, we will create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.env&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;vi arch-X64_PSMN_E5.env&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and then write:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module purge
module use /applis/PSMN/debian11/E5/modules/all/
module load netCDF-Fortran/4.6.1-gompi-2023a
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_INC_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;/include
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_LIB_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;/lib
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDFF_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/applis/PSMN/debian11/E5/software/netCDF-Fortran/4.6.1-gompi-2023a/include
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDFF_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/applis/PSMN/debian11/E5/software/netCDF-Fortran/4.6.1-gompi-2023a/lib
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_INC_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/applis/PSMN/debian11/E5/software/netCDF/4.9.2-gompi-2023a/include
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_LIB_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/applis/PSMN/debian11/E5/software/netCDF/4.9.2-gompi-2023a/lib&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now we will compile XIOS with the options we just created:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
./make_xios &lt;span class=&quot;nt&quot;&gt;--arch&lt;/span&gt; X64_PSMN_E5&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To test XIOS:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;generic_testcase
mpirun &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; 4 ../bin/generic_testcase.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If no errors appear, XIOS should be well installed.&lt;/p&gt;

&lt;h2 id=&quot;installing-nemo&quot;&gt;Installing NEMO&lt;/h2&gt;

&lt;p&gt;Get NEMO4, in my case I’m using the 4.2.1 version:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone &lt;span class=&quot;nt&quot;&gt;--branch&lt;/span&gt; 4.2.1 https://forge.nemo-ocean.eu/nemo/nemo.git nemo_4.2.1
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;nemo_4.2.1/&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If not already done do:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module use /applis/PSMN/debian11/E5/modules/all/
module load netCDF-Fortran/4.6.1-gompi-2023a&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;source &lt;/span&gt;XIOS/bin/fcm_env.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;As in the installation of XIOS, we need to modifiate some &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arch&lt;/code&gt; files that contain Fortran options for the compilation of NEMO:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd arch
cp &lt;/span&gt;arch-linux_gfortran.fcm arch-PSMN_E5.fcm
vi arch-PSMN_E5.fcm&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Uncomment and modify these 4 lines:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Note that you need to specify in the last line the path where you installed XIOS. In my case it was in my home folder &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/lsaddier&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%HDF5_HOME           &lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;
%NCDF_C_HOME         /applis/PSMN/debian11/E5/software/netCDF/4.9.2-gompi-2023a
%NCDF_F_HOME         /applis/PSMN/debian11/E5/software/netCDF-Fortran/4.6.1-gompi-2023a
%XIOS_HOME           /home/lsaddier/XIOS&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;On the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%FCFLAGS&lt;/code&gt; line, add a last argument:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%FCFLAGS             &lt;span class=&quot;nt&quot;&gt;-fdefault-real-8&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-funroll-all-loops&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fcray-pointer&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ffree-line-length-none&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fallow-argument-mismatch&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then we are ready to compile NEMO. Let’s try with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GYRE_PISCES&lt;/code&gt; configuration:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
./makenemo &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'PSMN_E5'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'GYRE_PISCES'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'MY_GYRE_PISCES'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Finally you can test the execution of NEMO (here with 4 processors):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /nemo_4.2.1/cfgs/MY_GYRE_PISCES/EXP00
mpirun &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 4 ./nemo&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo4-PSMN-E5-01/&quot;&gt;Building and Running XIOS and NEMO4 on PSMN (ENS de Lyon HPC) with partition E5.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on November 23, 2023.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Building ROSS025 on NEMO4.2 on ARCHER2.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo4/nemo4-ross025/" />
  <id>https://cbull.info/nemo4/nemo4-ross025</id>
  <published>2023-09-14T00:30:00+00:00</published>
  <updated>2023-09-14T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;We take the steps of building a regional Ross Sea configuration using NEMO 4.2 on ARCHER2. This post is written by TiPACCs PDRA Alethea Mountford (alethea.mountford@northumbria.ac.uk), thanks Alethea!&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://www.archer2.ac.uk/support-access/access.html&quot;&gt;ARCHER account&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo42-arc2-01/&quot;&gt;Successful compile of NEMO4.2 on ARCHER2&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://forge.nemo-ocean.eu/nemo/nemo&quot;&gt;NEMO home page&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://nicojourdain.github.io/coding_dir/coding_nemo4_occigen/&quot;&gt;Preparing and running NEMO4 on occigen&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/pmathiot/NEMOCFG&quot;&gt;NEMO4 ice-shelf fork Pierre Mathiot&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://pmathiot.github.io/NEMOCFG/docs/build/html/simu_eORCA025.html#summary&quot;&gt;Pierre Mathiot NEMO4 docs&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;create-ross025-configuration&quot;&gt;Create ROSS025 configuration&lt;/h2&gt;

&lt;p&gt;We can make a new ROSS025 configuration using WED025 as a reference (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-r&lt;/code&gt;), as below&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./makenemo &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; ROSS025 &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; WED025 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 8&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;OR create and compile a new configuration from scratch&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ROSS025'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; “&lt;span class=&quot;nv&quot;&gt;$CONFIG&lt;/span&gt; OCE ICE” &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; cfgs/ref_cfgs.txt
&lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;cfgs/&lt;span class=&quot;nv&quot;&gt;$CONFIG&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; “bld::tool::fppkeys key_xios key_si3 key_qco key_isf key_nosignedzdero” &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; cfgs/&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/cpp_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.fcm
./makenemo &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 8&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And check compile was successful&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-al&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/BLD/bin/nemo.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;pre-processing-tools-nicos-regional-tools&quot;&gt;Pre-processing tools (Nico’s regional tools)&lt;/h2&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone https://github.com/nicojourdain/BUILD_CONFIG_NEMO.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;GDW-Fortran/test
vi makefile &lt;span class=&quot;c&quot;&gt;# check the FC and NETCDF_INC variables
&lt;/span&gt;
make
./gsw_check &lt;span class=&quot;c&quot;&gt;# no need to worry about *all* working
&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../..&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Back in the main &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BUILD_CONFIG_NEMO&lt;/code&gt; directory, compile all of the pre-processing tools&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;vi compile_ALL.sh &lt;span class=&quot;c&quot;&gt;# check the FC, NETCDF_INC and NETCDF_LIB variables
&lt;/span&gt;
./compile_ALL.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Create a new namelist for the regional configuration (e.g. namelist_ROSS025) and link it to the pre-processing namelist that is read by the processing tools&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;vi namelist_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; namelist_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; namelist_pre&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Make sure to adapt the regional namelist (i.e. specify the domain bounds in order to cover the desired region).&lt;/p&gt;

&lt;p&gt;The exact domain bounds for the ROSS025 configuration are specified as&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; Choose the domain bounds on global grid that is extracted &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;e.g. eORCA12&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; WARNING: will be rounded to closest point of the coarse grid &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;ln_coarse_bdy &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; :
nn_imin_extract       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  199
nn_imax_extract       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  821
nn_jmin_extract       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;    2
nn_jmax_extract       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  452&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;in the namelist_pre.&lt;/p&gt;

&lt;p&gt;It is worth noting that all parent files used for the creation of the regional configuration must be the same grid size. Parent files were provided by Pierre Mathiot (pierre.mathiot@univ-grenoble-alpes.fr – thanks Pierre!) either through personal communication (namely the BDY files) or sourced from his &lt;a href=&quot;https://pmathiot.github.io/NEMOCFG/docs/build/html/input_eORCA025.html&quot;&gt;global eORCA025 input files&lt;/a&gt;. Global files were cropped as follows&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;ncks &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;--cnk_dmn&lt;/span&gt; time_counter,1 &lt;span class=&quot;nt&quot;&gt;--cnk_dmn&lt;/span&gt; y,200 &lt;span class=&quot;nt&quot;&gt;--cnk_dmn&lt;/span&gt; x,200 &lt;span class=&quot;nt&quot;&gt;--cnk_dmn&lt;/span&gt; nav_lev,200 &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; y,0,500 source_file.nc output_file.nc&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;create-the-bathymetry-and-coordinates-files&quot;&gt;Create the bathymetry and coordinates files&lt;/h2&gt;

&lt;p&gt;This requires filling in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;general&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;griddata&lt;/code&gt; sections of your namelist_ROSS025 file with the parent bathymetry/coordinate files and specifying the domain bounds&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./extract_bathy_coord&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Which should create your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bathy_meter_${CONFIG}.nc&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coordinate_${CONFIG}.nc&lt;/code&gt; files&lt;/p&gt;

&lt;h2 id=&quot;create-the-domain_cfg-and-mesh_mask-files&quot;&gt;Create the domain_cfg and mesh_mask files&lt;/h2&gt;

&lt;p&gt;Compile the NEMO DOMAINcfg tool in NEMO/tools/DOMAINcfg and REBUILD_NEMO tool in NEMO/tools/REBUILD_NEMO, i.e.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./maketools &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; DOMAINcfg
./maketools &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; REBUILD_NEMO&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Note, that this needs to be done in the main NEMO directory (the same as when compiling NEMO itself using ./makenemo)&lt;/p&gt;

&lt;h2 id=&quot;create-the-initial-state-and-atmospheric-forcing-files&quot;&gt;Create the initial state and atmospheric forcing files&lt;/h2&gt;

&lt;p&gt;Refer to the detailed instructions written by &lt;a href=&quot;https://nicojourdain.github.io/students_dir/students_nemo4_occigen/&quot;&gt;Nico Jourdain&lt;/a&gt; and &lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-05/&quot;&gt;Chris Bull&lt;/a&gt; using the &lt;a href=&quot;https://github.com/chrisb13/BUILD_CONFIG_NEMO&quot;&gt;BUILD_CONFIG_NEMO pre-processing tools&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;run-nemo&quot;&gt;Run NEMO&lt;/h2&gt;

&lt;p&gt;With all of the files in place and the relevant .xml and namelist files, you should be ready to run NEMO. See &lt;a href=&quot;https://cbull.info/nemo4/nemo42-arc2-01/&quot;&gt;Building and Running NEMO4 on ARCHER2 full system&lt;/a&gt; for a refresher on run scripts (but remember to use X86_ARCHER-Cray_4.2 when compiling and xios_trunk)&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo4-ross025/&quot;&gt;Building ROSS025 on NEMO4.2 on ARCHER2.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on September 14, 2023.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Building WED025 on NEMO4.2 on ARCHER2.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo4/nemo42-arc2-01/" />
  <id>https://cbull.info/nemo4/nemo42-arc2-01</id>
  <published>2022-04-07T00:30:00+00:00</published>
  <updated>2022-04-07T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;!---
note the author is *not* chris_bull but Alethea Mountford!! 
--&gt;

&lt;p class=&quot;notice&quot;&gt;We take the steps of downloading and compiling NEMO4.2 code on ARCHER2. This post is written by TiPACCs PDRA Alethea Mountford (alethea.mountford@northumbria.ac.uk), thanks Alethea!&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.archer.ac.uk/access/&quot;&gt;ARCHER account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://forge.nemo-ocean.eu/nemo/nemo&quot;&gt;NEMO home page&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://nicojourdain.github.io/students_dir/students_nemo4_occigen/&quot;&gt;Preparing and running NEMO4 on occigen&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/pmathiot/NEMOCFG&quot;&gt;NEMO4 ice-shelf fork Pierre Mathiot&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://pmathiot.github.io/NEMOCFG/docs/build/html/simu_eORCA025.html#summary&quot;&gt;Pierre Mathiot NEMO4 docs&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-nemo&quot;&gt;Installing NEMO&lt;/h2&gt;

&lt;p&gt;Get NEMO4.2.0, note that as of the NEMO4.2.0 release, svn is no longer supported. Further reading on the &lt;a href=&quot;https://sites.nemo-ocean.io/user-guide/install.html#download-and-install-the-nemo-code&quot;&gt;NEMO site&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone &lt;span class=&quot;nt&quot;&gt;--branch&lt;/span&gt; 4.2.0 https://forge.nemo-ocean.eu/nemo/nemo.git NEMORC&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;build-nemo&quot;&gt;Build NEMO&lt;/h2&gt;
&lt;p&gt;Log-into ARCHER2. Based on &lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;. Set-up your environment with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; restore /work/n01/shared/acc/n01_modules/ucx_env&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;From: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n01/shared/nemo/ARCH/arch-X86_ARCHER2-Cray_4.2.fcm&lt;/code&gt;
put into your ARCH folder, i.e., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/asmou/NEMORC/arch/arch-X86_ARCHER2-Cray_4.2.fcm&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%NCDF_HOME           &lt;span class=&quot;nv&quot;&gt;$NETCDF_DIR&lt;/span&gt;
%HDF5_HOME           &lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;
%XIOS_HOME           /work/n01/shared/nemo/xios-trunk
&lt;span class=&quot;c&quot;&gt;#OASIS_HOME          &lt;/span&gt;

%NCDF_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%NCDF_HOME/include &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%HDF5_HOME/include
%NCDF_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%HDF5_HOME/lib &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%NCDF_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lnetcdff&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lnetcdf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5_hl&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lz&lt;/span&gt;
%XIOS_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%XIOS_HOME/inc
%XIOS_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%XIOS_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lxios&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip&lt;/span&gt;

%CPP                 cpp &lt;span class=&quot;nt&quot;&gt;-Dkey_nosignedzero&lt;/span&gt;
%FC                  ftn
%FCFLAGS             &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant &lt;span class=&quot;nt&quot;&gt;-N1023&lt;/span&gt;
%FFLAGS              &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant &lt;span class=&quot;nt&quot;&gt;-N1023&lt;/span&gt;
%LD                  CC
%FPPFLAGS            &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traditional&lt;/span&gt;
%LDFLAGS             &lt;span class=&quot;nt&quot;&gt;-lmpifort_cray&lt;/span&gt;
%AR                  ar
%ARFLAGS             &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
%MK                  gmake
%USER_INC            %XIOS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %NCDF_LIB
&lt;span class=&quot;c&quot;&gt;#USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB&lt;/span&gt;

%CC                  cc &lt;span class=&quot;nt&quot;&gt;-Wl&lt;/span&gt;,&lt;span class=&quot;s2&quot;&gt;&quot;--allow-multiple-definition&quot;&lt;/span&gt;
%CFLAGS              &lt;span class=&quot;nt&quot;&gt;-O1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Wl&lt;/span&gt;,&lt;span class=&quot;s2&quot;&gt;&quot;--allow-multiple-definition&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-J&lt;/code&gt; flag to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FC_MODSEARCH&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/asmou/NEMORC/ext/FCM/lib/Fcm/Config.pm&lt;/code&gt;, should look like&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;FC_MODSEARCH &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'-J'&lt;/span&gt;,                &lt;span class=&quot;c&quot;&gt;# FC flag, specify &quot;module&quot; path&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Test compile works, i.e.,&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#path to where you cloned NEMO&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /work/n02/n02/asmou/NEMORC
./makenemo &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; WED025 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 16
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lah&lt;/span&gt; cfgs/WED025/BLD/bin/nemo.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-Dkey_nosignedzero&lt;/code&gt; has been added to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arch-X86_ARCHER2-Cray_4.2.fcm&lt;/code&gt; then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key_nosignedzero&lt;/code&gt; should have been added to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cpp_WED025.fcm&lt;/code&gt;, i.e should have:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;bld::tool::fppkeys key_xios key_si3 key_qco key_isf key_nosignedzero&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key_nosignedzero&lt;/code&gt; is not present in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cpp_WED025.fcm&lt;/code&gt;, this can be added manually during compile:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./makenemo &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; WED025 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray_4.2 add_key “key_nosignedzero” &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 16&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Make sure to link the correct xios server (trunk, not 2.5) in your working directory:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /work/n01/shared/nemo/xios-trunk/bin/xios_server.exe xios_server.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Download the WED025 auxiliary input files&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;wget https://zenodo.org/record/6817000/files/WED025_demonstrator_forcings.tar.zip?download&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;nb&quot;&gt;mv &lt;/span&gt;WED025_demonstrator_forcings.tar.zip&lt;span class=&quot;se&quot;&gt;\?&lt;/span&gt;download&lt;span class=&quot;se&quot;&gt;\=&lt;/span&gt;1  WED025_demonstrator_forcings.tar.zip
unzip WED025_demonstrator_forcings.tar.zip
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-tvf&lt;/span&gt; WED025_demonstrator_forcings.tar&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;For further details, see: https://zenodo.org/record/6817000&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo42-arc2-01/&quot;&gt;Building WED025 on NEMO4.2 on ARCHER2.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on April 07, 2022.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Building and Running NEMO4 on ARCHER2 full system.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo4/nemo4-arc2-02/" />
  <id>https://cbull.info/nemo4/nemo4-arc2-02</id>
  <published>2021-12-01T00:30:00+00:00</published>
  <updated>2021-12-01T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;We take the first step of downloading, compiling and testing NEMO4 code on ARCHER2 on the full system (December 2021).&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.archer.ac.uk/access/&quot;&gt;ARCHER account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-nemo&quot;&gt;Installing NEMO&lt;/h2&gt;

&lt;p&gt;Get NEMO4, in my case I’m using a 4.0.4 branch..&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;svn &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; 15194 co https://forge.ipsl.jussieu.fr/nemo/svn/NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends NEMO404_MO&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;build-nemo&quot;&gt;Build NEMO&lt;/h2&gt;
&lt;p&gt;The following is based on &lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;. Log-into ARCHER2 (full system). Set-up your environment with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module restore
module load cray-hdf5-parallel
module load cray-netcdf-hdf5parallel
module load xpmem
module load perftools-base&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;Originally from ARCHER2 4c: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n01/shared/acc/arch-X86_ARCHER2-Cray.fcm&lt;/code&gt; put into your ARCH folder, i.e., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/chbull/temp/NEMO404_MO/arch/arch-X86_ARCHER2-Cray.fcm&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%NCDF_HOME           &lt;span class=&quot;nv&quot;&gt;$NETCDF_DIR&lt;/span&gt;
%HDF5_HOME           &lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;
%XIOS_HOME           /work/n02/shared/chbull/xios-2.5

%NCDF_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%NCDF_HOME/include &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%HDF5_HOME/include
%NCDF_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%HDF5_HOME/lib &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%NCDF_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lnetcdff&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lnetcdf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5_hl&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lz&lt;/span&gt;
%XIOS_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%XIOS_HOME/inc
%XIOS_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%XIOS_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lxios&lt;/span&gt;

%CPP	             cpp
%FC                  ftn
%FCFLAGS             &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant
%FFLAGS              &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant
%LD                  CC &lt;span class=&quot;nt&quot;&gt;-Wl&lt;/span&gt;,&lt;span class=&quot;s2&quot;&gt;&quot;--allow-multiple-definition&quot;&lt;/span&gt;
%FPPFLAGS            &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traditional&lt;/span&gt;
%LDFLAGS             &lt;span class=&quot;nt&quot;&gt;-lmpifort_cray&lt;/span&gt;
%AR                  ar
%ARFLAGS             &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
%MK                  gmake
%USER_INC            %XIOS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %NCDF_LIB

%CC                  cc
%CFLAGS              &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-J&lt;/code&gt; flag to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FC_MODSEARCH&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/chbull/temp/NEMO404_MO/ext/FCM/lib/Fcm/Config.pm&lt;/code&gt;, should look like&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;FC_MODSEARCH &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'-J'&lt;/span&gt;,                &lt;span class=&quot;c&quot;&gt;# FC flag, specify &quot;module&quot; path&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key_nosignedzero&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/chbull/temp/NEMO404_MO/tests/ISOMIPY/cpp_ISOMIPY.fcm&lt;/code&gt;, should have:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;chbull@uan01:/work/n02/n02/chbull/temp/NEMO404_MO/tests/ISOMIPY&amp;gt; &lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;cpp_ISOMIPY.fcm 
 bld::tool::fppkeys   key_iomput key_mpp_mpi key_nosignedzero&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Test compile works, i.e.,&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /work/n02/n02/chbull/temp/NEMO404_MO/
./makenemo &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'ISOMIPY'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'ISOMIP'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 16
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lah&lt;/span&gt; tests/ISOMIPY/BLD/bin/nemo.exe
&lt;span class=&quot;c&quot;&gt;# beer time ?&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;run-nemo&quot;&gt;Run NEMO&lt;/h2&gt;

&lt;p&gt;We use Andrew’s script to create a template for a run file (saving to something like /work/n02/n02/chbull/temp/NEMO404_MO/tests/ISOMIPY/EXP00/runnemo.sh; which will make sense in a moment)..&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --job-name=nemo_test&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --time=00:10:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --nodes=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --ntasks=24&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --account=n02-PROPHET&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --partition=standard&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --qos=short&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Created by: mkslurm -S 0 -s 0 -m 2 -C  24 -c  2 -t 00:10:00 -a n01 -j nemo_test&lt;/span&gt;

module restore
module load cray-hdf5-parallel
module load cray-netcdf-hdf5parallel
module load xpmem
module load perftools-base

&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; myscript_wrapper2.sh &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOFB&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
#!/bin/ksh
#
set -A map ./xios_server.exe ./nemo
exec_map=( 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
#
exec &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;{map[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;{exec_map[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;SLURM_PROCID]}]} 
##
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOFB
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;u+x ./myscript_wrapper2.sh
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
srun &lt;span class=&quot;nt&quot;&gt;--mem-bind&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cpu-bind&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;v,map_cpu:00,0x2,0x4,0x6,0x8,0xa,0xc,0xe,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e, ./myscript_wrapper2.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Submit with&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /work/n02/n02/chbull/temp/NEMO404_MO/tests/ISOMIPY/EXP00
&lt;span class=&quot;c&quot;&gt;# nb: https://docs.archer2.ac.uk/archer2-migration/archer2-differences/&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# no short flag required anymore..&lt;/span&gt;
sbatch /work/n02/n02/chbull/temp/NEMO404_MO/tests/ISOMIPY/EXP00/runnemo.sh
&lt;span class=&quot;c&quot;&gt;# keep an eye on it with&lt;/span&gt;
squeue &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; USERNAME
&lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; ocean.output
&lt;span class=&quot;c&quot;&gt;# second beer ?&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo4-arc2-02/&quot;&gt;Building and Running NEMO4 on ARCHER2 full system.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on December 01, 2021.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Building and Running NEMO4 on ARCHER2.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo4/nemo4-arc2-01/" />
  <id>https://cbull.info/nemo4/nemo4-arc2-01</id>
  <published>2021-02-08T00:30:00+00:00</published>
  <updated>2021-02-08T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;We take the first step of downloading, compiling and testing NEMO4 code on ARCHER2.&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.archer.ac.uk/access/&quot;&gt;ARCHER account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/pmathiot/NEMOCFG&quot;&gt;NEMO4 ice-shelf fork Pierre Mathiot&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://pmathiot.github.io/NEMOCFG/docs/build/html/simu_eORCA025.html#summary&quot;&gt;Pierre Mathiot NEMO4 docs&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-nemo&quot;&gt;Installing NEMO&lt;/h2&gt;

&lt;p&gt;Get NEMO4, in my case I’m using &lt;a href=&quot;https://github.com/chrisb13/NEMOCFG&quot;&gt;a fork&lt;/a&gt; of &lt;a href=&quot;https://github.com/pmathiot/NEMOCFG&quot;&gt;Pierre’s custom build&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This uses the latest stable version as it’s base, namely: NEMO4.0.4.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;svn co &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; 13653  https://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r4.0.4 NEMO4
&lt;span class=&quot;c&quot;&gt;#optional&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#copy code from Pierre into NEMO folder, something like:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#git clone git@github.com:chrisb13/NEMOCFG.git&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#cd NEMOCFG&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#git reset --hard 7695557b1a2f67bae2ae0ab1989d878a281c1bab&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#rm -r /path/to/NEMO4/src&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#cp -r /path/from/NEMOCFG/cfgs/eORCA025.L121-OPM006/src /path/to/NEMO4&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;build-nemo&quot;&gt;Build NEMO&lt;/h2&gt;
&lt;p&gt;Log-into ARCHER2. Based on &lt;a href=&quot;https://docs.archer2.ac.uk/research-software/nemo/nemo/&quot;&gt;NEMO4 ARCHER2 help page&lt;/a&gt;. Set-up your environment with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; restore /work/n01/shared/acc/n01_modules/ucx_env&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;From: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n01/shared/acc/arch-X86_ARCHER2-Cray.fcm&lt;/code&gt;
put into your ARCH folder, i.e., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/arch/arch-X86_ARCHER2-Cray.fcm&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%NCDF_HOME           &lt;span class=&quot;nv&quot;&gt;$NETCDF_DIR&lt;/span&gt;
%HDF5_HOME           &lt;span class=&quot;nv&quot;&gt;$HDF5_DIR&lt;/span&gt;
%XIOS_HOME           /work/n01/shared/acc/xios-2.5

%NCDF_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%NCDF_HOME/include &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%HDF5_HOME/include
%NCDF_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%HDF5_HOME/lib &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%NCDF_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lnetcdff&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lnetcdf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5_hl&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lhdf5&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lz&lt;/span&gt;
%XIOS_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%XIOS_HOME/inc
%XIOS_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%XIOS_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lxios&lt;/span&gt;

%CPP	             cpp
%FC                  ftn
%FCFLAGS             &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant
%FFLAGS              &lt;span class=&quot;nt&quot;&gt;-em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; integer32 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; real64 &lt;span class=&quot;nt&quot;&gt;-O1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hflex_mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;intolerant
%LD                  CC &lt;span class=&quot;nt&quot;&gt;-Wl&lt;/span&gt;,&lt;span class=&quot;s2&quot;&gt;&quot;--allow-multiple-definition&quot;&lt;/span&gt;
%FPPFLAGS            &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traditional&lt;/span&gt;
%LDFLAGS             &lt;span class=&quot;nt&quot;&gt;-lmpifort_cray&lt;/span&gt;
%AR                  ar
%ARFLAGS             &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
%MK                  gmake
%USER_INC            %XIOS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %NCDF_LIB

%CC                  cc
%CFLAGS              &lt;span class=&quot;nt&quot;&gt;-O0&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-J&lt;/code&gt; flag to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FC_MODSEARCH&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/ext/FCM/lib/Fcm/Config.pm&lt;/code&gt;, should look like&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;FC_MODSEARCH &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'-J'&lt;/span&gt;,                &lt;span class=&quot;c&quot;&gt;# FC flag, specify &quot;module&quot; path&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key_nosignedzero&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/tests/ISOMIPY/cpp_ISOMIPY.fcm&lt;/code&gt;, should have:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;chbull@uan01:/work/n02/n02/chbull/nemo/models/NEMO4/tests/ISOMIPY&amp;gt; &lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;cpp_ISOMIPY.fcm 
 bld::tool::fppkeys   key_iomput key_mpp_mpi key_nosignedzero&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Test compile works, i.e.,&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4
./makenemo &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'ISOMIPY'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'ISOMIP'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 16
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lah&lt;/span&gt; tests/ISOMIPY/BLD/bin/nemo.exe
&lt;span class=&quot;c&quot;&gt;# beer time ?&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;run-nemo&quot;&gt;Run NEMO&lt;/h2&gt;

&lt;p&gt;We use Andrew’s script to create a template for a run file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;chbull@uan01:/work/n01/shared/acc&amp;gt; ./mkslurm &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; 0 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 0 &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; 24
Running: mkslurm &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; 0 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 0 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;  2 &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt;  24 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;  2 &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 00:10:00 &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; n01 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; nemo_test
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;With a few trivial changes (saving to something like /lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/tests/ISOMIPY/EXP00/runnemo.sh; which will make sense in a moment)..&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --job-name=nemo_test&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --time=00:10:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --nodes=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --ntasks=24&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --account=n02&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --partition=standard&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#SBATCH --qos=short&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Created by: mkslurm -S 0 -s 0 -m 2 -C  24 -c  2 -t 00:10:00 -a n01 -j nemo_test&lt;/span&gt;
module &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; restore /work/n01/shared/acc/n01_modules/ucx_env
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; myscript_wrapper2.sh &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOFB&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
#!/bin/ksh
#
set -A map ./xios_server.exe ./nemo
exec_map=( 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
#
exec &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;{map[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;{exec_map[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;SLURM_PROCID]}]} 
##
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOFB
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;u+x ./myscript_wrapper2.sh
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
srun &lt;span class=&quot;nt&quot;&gt;--mem-bind&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cpu-bind&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;v,map_cpu:00,0x2,0x4,0x6,0x8,0xa,0xc,0xe,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e, ./myscript_wrapper2.sh&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Submit with&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/tests/ISOMIPY/EXP00
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /work/n01/shared/acc/xios-2.5 xios_server.exe
sbatch &lt;span class=&quot;nt&quot;&gt;--reservation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;shortqos /lus/cls01095/work/n02/n02/chbull/nemo/models/NEMO4/tests/ISOMIPY/EXP00/runnemo.sh
&lt;span class=&quot;c&quot;&gt;# second beer ?&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;build-nemo-tools&quot;&gt;Build NEMO tools&lt;/h2&gt;
&lt;p&gt;Compile REBUILD_NEMO (used to recombine outputs at the end of the jobs – see NEMO4/tools/REBUILD_NEMO/README.rst) and DOMAINcfg.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;NEMO4/tools/
./maketools &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; 
./maketools &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; REBUILD_NEMO &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray
./maketools &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; DOMAINcfg &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; X86_ARCHER2-Cray
&lt;span class=&quot;c&quot;&gt;# to check that everything went fine&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lah&lt;/span&gt; REBUILD_NEMO/BLD/bin/rebuild_nemo.exe
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lah&lt;/span&gt; DOMAINcfg/BLD/bin/make_domain_cfg.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo4/nemo4-arc2-01/&quot;&gt;Building and Running NEMO4 on ARCHER2.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on February 08, 2021.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Build the inital state and forcing fields for  WED12 (Step 5)]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo/nemo-wed12-05/" />
  <id>https://cbull.info/nemo/nemo-wed12-05</id>
  <published>2018-05-21T10:30:00+00:00</published>
  <updated>2018-05-21T10:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;Building the initial state and forcing fields for WED12.&lt;/p&gt;
&lt;!--bash_example--&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/chrisb13/BUILD_CONFIG_NEMO&quot;&gt;ARCHER fork of Nicolas Jourdain GitHub repository for WED12 configuration, this guide is based on these notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Build the bathymetry (and ice shelf draft if needed) and coordinates files for the regional domain.
Go to your repo, and update the following file for your machine: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vi BUILD_CONFIG_NEMO/submit.sh&lt;/code&gt; (in the ARCHER case this was unnecessary).&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./extract_bathy_coord   &lt;span class=&quot;c&quot;&gt;## -&amp;gt; should create the bathy and coordinate files,&lt;/span&gt;
                        &lt;span class=&quot;c&quot;&gt;##    e.g. bathy_meter_WED12.nc and coordinates_WED12.nc&lt;/span&gt;
                        &lt;span class=&quot;c&quot;&gt;##    (stored in directory defined as config_dir in the namelist)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;build-the-mesh-mask&quot;&gt;Build the mesh mask&lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;Prerequisite: successful compile of NEMO (see Step 3).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Create mesh_mask file.&lt;/p&gt;

&lt;p&gt;To do this, you need to run nemo.exe to calculate the exact mesh and mask. Run nemo with nn_msh = 1 in the namelist. No need to have all the input files here, just: xios_files, namelists, coordinates.nc, isf_draft_meter.nc and bathy_meter.nc. It will crash shortly after creating mesh_mask.nc. Details:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12/coordinates_WED12.nc coordinates.nc
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12/bathy_meter_WED12.nc bathy_meter.nc
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12/bathy_meter_WED12.nc isf_draft_meter.nc 
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/XIOS/bin/xios_server.exe xios_server.exe
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/WED12/BLD/bin/nemo.exe nemo.exe
&lt;span class=&quot;c&quot;&gt;#cp namelist_ref AND namelist_cfg into create_mesh_mask_wed12 folder&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#cp namelist_ice_ref AND namelist_ice_cfg into create_mesh_mask_wed12 folder&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#grab any xios2 files just so the model will start, e.g.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/iodef.xml /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12_two/
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/SHARED/field_def.xml /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12_two/
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/file_def.xml /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12_two/
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/domain_def.xml /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12_two/

&lt;span class=&quot;c&quot;&gt;## NB: set jpni=jpnj=jpnij=0 in the &amp;amp;nammpp section of NEMO's namelist.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##     and use the same &amp;amp;namdom parameters as in the simulation used as BDYs.&lt;/span&gt;
qsub run_nemo.sh    &lt;span class=&quot;c&quot;&gt;## this will create mesh_mask_${CONFIG}.nc before crashing&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In my ARCHER case the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;run_nemo.sh&lt;/code&gt; file looks like:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#!&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -N PC-eos80&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -l walltime=1:00:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -l select=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -j oe&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -A n02-bas&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PBS_O_WORKDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;readlink&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PBS_O_WORKDIR&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;               
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PBS_O_WORKDIR&lt;/span&gt;

aprun &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 2 ./nemo.exe
aprun &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 2 ./xios_server.exe&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This should result in mesh_mask_0000.nc and mesh_mask_0001.nc out of this (check that mbathy, misf, isfdraft look sensible). We now need to stick them back together…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /fs2/n02/n02/chbull/nemo/run/create_mesh_mask_wed12
&lt;span class=&quot;c&quot;&gt;#From BUILD_CONFIG_NEMO, make sure NEMOdir is correct&lt;/span&gt;
./rebuild_mesh_mask.sh 
&lt;span class=&quot;nb&quot;&gt;mv &lt;/span&gt;mesh_mask.nc &lt;span class=&quot;nv&quot;&gt;$WORKDIR&lt;/span&gt;/input/nemo_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/mesh_mask_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.nc &lt;span class=&quot;c&quot;&gt;## directory defined as config_dir&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;create-the-inital-state&quot;&gt;Create the inital state&lt;/h2&gt;

&lt;p&gt;Create the initial state (temperature and salinity)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./extract_istate            &lt;span class=&quot;c&quot;&gt;## -&amp;gt; should create the initial state for temperature and salinity&lt;/span&gt;
                            &lt;span class=&quot;c&quot;&gt;##    e.g. dta_temp_WED12.nc and dta_sal_WED12.nc&lt;/span&gt;
                            &lt;span class=&quot;c&quot;&gt;##    (stored in directory defined as config_dir in the namelist)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;ocean-forcing-files&quot;&gt;Ocean forcing files&lt;/h2&gt;
&lt;p&gt;Create the lateral boundary conditions (u, v, T, S, SSH, sea-ice thic, sea-ice frac)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./build_coordinates_bdy       &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates the coordinate file for lateral boundaries&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;##    e.g. coordinates_bdy_WED12.nc&lt;/span&gt;

./extract_bdy_gridT           &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates T,S bdy files and store them in a BDY folder&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;##    itself located in directory defined as config_dir&lt;/span&gt;

./extract_bdy_gridU           &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates U   bdy files and store them in a BDY folder&lt;/span&gt;
./extract_bdy_gridV           &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates V   bdy files and store them in a BDY folder&lt;/span&gt;
./extract_bdy_icemod          &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates ice bdy files and store them in a BDY folder&lt;/span&gt;
./extract_bdy_ssh             &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates SSH bdy files and store them in a BDY folder&lt;/span&gt;

./concatenate_yearly_BDY.sh   &lt;span class=&quot;c&quot;&gt;## Edit this file first.&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;## -&amp;gt; concatenate the bdy files into yearly files&lt;/span&gt;

./extract_bdy_tides           &lt;span class=&quot;c&quot;&gt;## if you want to put tidal signals along the BDYs&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;interpolate-cice-onto-nemo&quot;&gt;Interpolate CICE onto NEMO&lt;/h3&gt;
&lt;p&gt;If necessary, interpolate CICE onto NEMO grid before running ./extract_bdy_icemod (above). We use CDO to do a linear interpoation. Here’s an example:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#hack up a griddes file so the source file looks more like the target..&lt;/span&gt;
cdo griddes mi-an854o_1m_19960101_20050130_01_grid_T_toy.nc &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; new_grid.txt
cdo griddes mi-an854i.1m.1995-01_small_toy.nc &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; old_grid.txt

&lt;span class=&quot;c&quot;&gt;#xname/yname as nav_lon/nav_lat (the latter seems to be important to match the target x/y names)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/TLON/nav_lon/g'&lt;/span&gt; old_grid.txt
&lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/TLAT/nav_lat/g'&lt;/span&gt; old_grid.txt

&lt;span class=&quot;c&quot;&gt;#remove area from new_grid.txt, the following will help find it.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#grep –n “[a-d][f-z] new_grid.txt &lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#re-write with hacked grid defn&lt;/span&gt;
cdo setgrid,old_grid.txt &lt;span class=&quot;nt&quot;&gt;-select&lt;/span&gt;,name&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;aice,hi,hs ../mi-an854i.1m.1995-01.nc ./mi-an854i.1m.1995-01_small_newgriddefn.nc

&lt;span class=&quot;c&quot;&gt;#Re-mapping, creating the weights first.. &lt;/span&gt;
cdo gennn,new_grid.txt mi-an854i.1m.1995-01_small_newgriddefn.nc weights.nc
cdo remap,new_grid.txt,weights.nc mi-an854i.1m.1995-01_small_newgriddefn.nc mi-an854i.1m.1995-01_small_newgriddefn_remapnn_two.nc

&lt;span class=&quot;c&quot;&gt;#copy interpolated data to a G07 file and match LIM variable names according to BUILD_CONFIG_NEMO/src/extract_bdy_icemod.f90&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;!--See nemo_wed_analysis/configs/wed12/fix_lim_icemod.py for last step--&gt;

&lt;p&gt;Other files (SSS for restoring, runoff, chlorophyll)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./extract_SSS_restoring       &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates SSS files and store them in a SSS folder&lt;/span&gt;
./concatenate_yearly_SSS.sh   &lt;span class=&quot;c&quot;&gt;## Edit this file first.&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;## -&amp;gt; concatenate the bdy files into yearly files&lt;/span&gt;

./extract_runoff_icebergs     &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates iceberg runoff file&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;##    (stored in config_dir defined in the namelist)&lt;/span&gt;

./extract_chloro              &lt;span class=&quot;c&quot;&gt;## -&amp;gt; creates chlorophyll file&lt;/span&gt;
                              &lt;span class=&quot;c&quot;&gt;##    (stored in config_dir defined in the namelist)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;atmospheric-forcing-files&quot;&gt;Atmospheric forcing files&lt;/h2&gt;
&lt;p&gt;Weights for the interpolation of atmospheric forcing&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# here it is assumed that you have NEMO downloaded and installed as explained in step #1&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$WORKDIR&lt;/span&gt;/models/MY_NEMO/NEMOGCM/TOOLS
maketools &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; XC_ARCHER_INTEL &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; WEIGHTS           &lt;span class=&quot;c&quot;&gt;## Adapt for any machine different from ARCHER (try makenemo -h)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;WEIGHTS                                &lt;span class=&quot;c&quot;&gt;## See nice README file in this directoy.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; nocsutil/namelist_example_bilin namelist_WEIGHTS_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_bilin &lt;span class=&quot;c&quot;&gt;## Edit this namelist&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;NB: you may have to increase char_len in src/kinds_mod.f90 if you include long path for file names.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Below is an example for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;namelist_WEIGHTS_${CONFIG}_bilin&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;amp;grid_inputs
    input_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'drowned_precip_DFS5.2_y1993.nc'&lt;/span&gt;
    nemo_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'coordinates_WED12.nc'&lt;/span&gt;
    datagrid_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'remap_data_grid.nc'&lt;/span&gt;
    nemogrid_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'remap_nemo_grid.nc'&lt;/span&gt;
    method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'regular'&lt;/span&gt;
    input_lon &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'LON'&lt;/span&gt;
    input_lat &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'LAT'&lt;/span&gt;
    nemo_lon &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'glamt'&lt;/span&gt;
    nemo_lat &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'gphit'&lt;/span&gt;
    nemo_mask &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'none'&lt;/span&gt;
    nemo_mask_value &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 10
    input_mask &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'none'&lt;/span&gt;
    input_mask_value &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 10
/

&amp;amp;remap_inputs
    num_maps &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1
    grid1_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'remap_data_grid.nc'&lt;/span&gt;
    grid2_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'remap_nemo_grid.nc'&lt;/span&gt;
    interp_file1 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'data_nemo_bilin.nc'&lt;/span&gt;
    interp_file2 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'nemo_data_bilin.nc'&lt;/span&gt;
    map1_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'data to nemo bilin Mapping'&lt;/span&gt;
    map2_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'nemo to data bilin Mapping'&lt;/span&gt;
    map_method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'bilinear'&lt;/span&gt;
    normalize_opt &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'frac'&lt;/span&gt;
    output_opt &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'scrip'&lt;/span&gt;
    restrict_type &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'latitude'&lt;/span&gt;
    num_srch_bins &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 90
    luse_grid1_area &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; .false.
    luse_grid2_area &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; .false.
/

&amp;amp;interp_inputs
    input_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;drowned_precip_DFS5.2_y1993.nc&quot;&lt;/span&gt;
    interp_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;data_nemo_bilin.nc&quot;&lt;/span&gt;
    input_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;snow&quot;&lt;/span&gt;
    input_start &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1,1,1,1
    input_stride &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1,1,1,1
    input_stop &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0,0,0,1
    input_vars &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'initial_time0_hours'&lt;/span&gt;
/

&amp;amp;interp_outputs
    output_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;snow_orca.nc&quot;&lt;/span&gt;
    output_mode &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;create&quot;&lt;/span&gt;
    output_dims &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'x'&lt;/span&gt;, &lt;span class=&quot;s1&quot;&gt;'y'&lt;/span&gt;, &lt;span class=&quot;s1&quot;&gt;'time_counter'&lt;/span&gt;
    output_scaling &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;snow|1.0&quot;&lt;/span&gt;, &lt;span class=&quot;s2&quot;&gt;&quot;time_counter|86400.0&quot;&lt;/span&gt;
    output_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'snow'&lt;/span&gt;
    output_lon &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'x'&lt;/span&gt;
    output_lat &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'y'&lt;/span&gt;
    output_vars &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'time_counter'&lt;/span&gt;
    output_attributes &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'time_counter|units|seconds since 1995-00-00 00:00:00'&lt;/span&gt;,
                        &lt;span class=&quot;s1&quot;&gt;'time_counter|calendar|noleap'&lt;/span&gt;,
                        &lt;span class=&quot;s1&quot;&gt;'snow|units|mm/s'&lt;/span&gt;
/&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then, execute these things:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#create links to relevant input files&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#coordinates_WED12.nc -&amp;gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12/coordinates_WED12.nc&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#drowned_precip_DFS5.2_y1993.nc -&amp;gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12_mathiot_eORCA025-GO7/precip_core_y1978.nc&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#snow_orca.nc -&amp;gt; /fs2/n02/n02/chbull/nemo/bld_configs/input_WED12_mathiot_eORCA025-GO7/snow_core_y1970.nc&lt;/span&gt;

./scripgrid.exe   &lt;span class=&quot;c&quot;&gt;## namelist_${CONFIG}_bilin&lt;/span&gt;
./scrip.exe       &lt;span class=&quot;c&quot;&gt;## namelist_${CONFIG}_bilin&lt;/span&gt;
./scripshape.exe  &lt;span class=&quot;c&quot;&gt;## namelist_${CONFIG}_bilin&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then create another namelist:  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;namelist_${CONFIG}_bicub&lt;/code&gt; and just change these parameters:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;interp_file1 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'data_nemo_bicubic.nc'&lt;/span&gt;
interp_file2 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'nemo_data_bicubic.nc'&lt;/span&gt;
map1_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'data to nemo bicubic Mapping'&lt;/span&gt;
map2_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'nemo to data bicubic Mapping'&lt;/span&gt;
map_method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'bicubic'&lt;/span&gt;
interp_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'data_nemo_bicubic.nc'&lt;/span&gt;
output_file &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'weights_bicubic.nc'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then execute :&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./scrip.exe       &lt;span class=&quot;c&quot;&gt;## namelist_${CONFIG}_bicub&lt;/span&gt;
./scripshape.exe  &lt;span class=&quot;c&quot;&gt;## namelist_${CONFIG}_bicub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;At the end of this, you should have: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;weights_bicubic.nc&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;weights_bilin.nc&lt;/code&gt;.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-05/&quot;&gt;Build the inital state and forcing fields for  WED12 (Step 5)&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on May 21, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Pre-processing tools for WED12 (Step 4)]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo/nemo-wed12-04/" />
  <id>https://cbull.info/nemo/nemo-wed12-04</id>
  <published>2018-05-21T08:30:00+00:00</published>
  <updated>2018-05-21T08:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;Building the pre-processing tools&lt;/p&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/chrisb13/BUILD_CONFIG_NEMO&quot;&gt;ARCHER fork of Nicolas Jourdain GitHub repository for WED12 configuration, this guide is almost verbatim based on these notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;prepare-the-pre-processing-tools-gsw-toolbox-and-nicos-regional-tools&quot;&gt;Prepare the pre-processing tools (GSW TOOLBOX and Nico’s regional tools):&lt;/h2&gt;

&lt;p&gt;First you may need the TEOS10 toolbox to convert from EOS80 to TEOS10. To avoid issues with updates on the GSW-Fortran tools, Nico has cloned the 2016 GSW-Fortran in this repository:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone https://github.com/chrisb13/BUILD_CONFIG_NEMO.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;GSW-Fortran/test
vi makefile   &lt;span class=&quot;c&quot;&gt;#in particular fill the FC and NETCDF_INCDIR variables&lt;/span&gt;
make
./gsw_check   &lt;span class=&quot;c&quot;&gt;# to check (some have to work, maybe not all of them)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../..&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;NB: In case you want to check for updates (not recommended), you can still do:
 git clone https://github.com/TEOS-10/GSW-Fortran.git&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The gsw_data_v3_0.nc file provided in this repository should be fine, but in case you start again from the original file (i.e. from github.com/TEOS-10/GSW-Fortran.git), you will need to modify it
to avoid NaN in some places (otherwise, skip the next 4 lines):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./compile.sh remove_NaN_from_gsw_data_v3_0.f90
./remove_NaN_from_gsw_data_v3_0
ncks &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; ocean_ref,ndepth_ref,deltaSA_ref,SA_ref,SAAR_ref GSW-Fortran/test/gsw_data_v3_0.nc gsw_data_v3_0.nc
ncks &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; gsw_data_v3_0_to_be_ncks-A.nc gsw_data_v3_0.nc&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Back in root of BUILD_CONFIG_NEMO.git. Edit your own namelist, e.g. namelist_WED12, and link namelist_pre to it:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;vi namelist_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; namelist_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; namelist_pre  &lt;span class=&quot;c&quot;&gt;# in BUILD_CONFIG_NEMO dir&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compile_ALL.sh&lt;/code&gt;, adapt fortran compiler (and maybe netcdf path), then execute it: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./compile_ALL.sh&lt;/code&gt;. Create a directory where you will store all the netcdf files created along the following steps, e.g.:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$WORKDIR&lt;/span&gt;/input/nemo_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# WARNING: this must correspond to the namelist entry &quot;config_dir&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-04/&quot;&gt;Pre-processing tools for WED12 (Step 4)&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on May 21, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Building WED12 (Step 3)]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo/nemo-wed12-03/" />
  <id>https://cbull.info/nemo/nemo-wed12-03</id>
  <published>2018-05-18T08:30:00+00:00</published>
  <updated>2018-05-18T08:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;Starting the WED12 configuration (compiling NEMO and NEMO’s maketools)&lt;/p&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/chrisb13/BUILD_CONFIG_NEMO&quot;&gt;ARCHER fork of Nicolas Jourdain GitHub repository for WED12 configuration, this guide is based on these notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;create-wed12-configuration&quot;&gt;Create WED12 configuration&lt;/h2&gt;

&lt;p&gt;First of all, choose a configuration name, e.g. WED12, AMU12, PERIANT025, etc, and save it, i.e.: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export CONFIG='WED12'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Compile for a new configuration, e.g. the WED12 configuration (you can have several ones)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;MY_NEMO/NEMOGCM/CONFIG
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$CONFIG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; OPA_SRC LIM_SRC_3&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; cfg.txt  &lt;span class=&quot;c&quot;&gt;## here for OPA+LIM3 (see cfg.txt for other options)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$CONFIG&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Choose fppkeys prior to compilation (see NEMO documentations or examples in existing configurations, e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MY_NEMO/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm&lt;/code&gt;), and compile, e.g. :&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /NEMOGCM/CONFIG
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; bld::tool::fppkeys key_dynldf_c2d key_dynspg_flt key_iomput  key_ldfslp  key_tide key_lim3 key_mpp_mpi key_mpp_rep key_nosignedzero key_trabbl key_traldf_c2d key_vvl key_xios2  key_zdfddm key_zdftke key_zdftmx &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/cpp_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.fcm
&lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt; ./makenemo &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$CONFIG&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; XC_ARCHER_INTEL &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; 8 &amp;amp;&amp;gt; compile.log &amp;amp;
&lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; compile.log            &lt;span class=&quot;c&quot;&gt;## to follow the compilation&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-al&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CONFIG&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/BLD/bin/nemo.exe  &lt;span class=&quot;c&quot;&gt;## to check that everything went fine&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;NB: if you recompile, it is recommended to remove these directories: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rm -rf ${CONFIG}/WORK ${CONFIG}/BLD;cd ..&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;nemo-maketools&quot;&gt;NEMO maketools&lt;/h2&gt;

&lt;p&gt;Compile REBUILD_NEMO (used to recombine outputs at the end of the jobs):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;TOOLS
./maketools &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;## use same architecture as for NEMO's compilation (e.g. XC_ARCHER_INTEL)&lt;/span&gt;
./maketools &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; XC_ARCHER_INTEL &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; REBUILD_NEMO
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-al&lt;/span&gt; REBUILD_NEMO/BLD/bin/  &lt;span class=&quot;c&quot;&gt;## to check that everything went fine&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-03/&quot;&gt;Building WED12 (Step 3)&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on May 18, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Testing NEMO (Step 2)]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo/nemo-wed12-02/" />
  <id>https://cbull.info/nemo/nemo-wed12-02</id>
  <published>2018-05-18T00:30:00+00:00</published>
  <updated>2018-05-18T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;Running an idealised test case configuration with NEMO&lt;/p&gt;

&lt;h2 id=&quot;testing-nemo&quot;&gt;Testing NEMO&lt;/h2&gt;

&lt;p&gt;We will now test NEMO by running a double gyre test case. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd&lt;/code&gt; into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NEMOGCM/CONFIG&lt;/code&gt; and run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./makenemo -n GYRE_XIOS -m XC_ARCHER_INTEL -j 8&lt;/code&gt; (took 121 seconds).&lt;/p&gt;

&lt;p&gt;If you have loaded netCDF, HDF5 and installed XIOS correctly this should work. Go into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NEMOGCM/CONFIG/GYRE_XIOS/EXP00&lt;/code&gt;. Make a link to XIOS by:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ln -sf /path/to/xios/bin/xios_server.exe xios_server.exe&lt;/code&gt;&lt;/p&gt;

&lt;!--Then open the iodef.xml file and find the first line looking like--&gt;
&lt;!--`&lt;file_definition type=&quot;multiple_file&quot; name=&quot;@expname@_@freq@_@startdate@_@enddate@&quot; sync_freq=&quot;1ts&quot; min_digits=&quot;4&quot;&gt;`--&gt;
&lt;!--Change &quot;multiple_file&quot; to &quot;one_file&quot;. --&gt;

&lt;p&gt;This particular branch needs the following namelist tweak (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg&lt;/code&gt;):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;amp;nameos        &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;   ocean physical parameters
&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-----------------------------------------------------------------------&lt;/span&gt;
   nn_eos      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;   0       &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;of equation of state and Brunt-Vaisala frequency
   ln_useCT    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; .false.   &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; use of Conservative Temp. &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; surface CT converted &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;Pot. Temp. &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;sbcssm&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Make a runscript named “run_gyre.pbs” like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#!&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -N PC-eos80&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -l walltime=1:00:00&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -l select=7&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -j oe&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#PBS -A n02-bas&lt;/span&gt;

  &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PBS_O_WORKDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;readlink&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PBS_O_WORKDIR&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;               
  &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
  &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PBS_O_WORKDIR&lt;/span&gt;

  &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;OCEANCORES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;144
  &lt;span class=&quot;nv&quot;&gt;XIOCORES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3
&lt;span class=&quot;c&quot;&gt;###############################################################&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;ulimit&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; unlimited
&lt;span class=&quot;nb&quot;&gt;ulimit&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; unlimited
        aprun &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$XIOCORES&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 3 ./xios_server.exe : &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$OCEANCORES&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; 24 ./opa&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Run
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;qsub run_gyre.pbs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;NEMO will now run on 144 cores (6 nodes) and pass all output to XIOS on 3 cores (1 node) which will glue data from all processors into one file. You’re output should be in:
GYRE_5d_00010101&lt;em&gt;00011230_grid&lt;/em&gt;*.nc&lt;/p&gt;

&lt;p&gt;(&lt;em&gt;Hopefully&lt;/em&gt;!) congratulations, you’ve just run NEMO!&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-02/&quot;&gt;Testing NEMO (Step 2)&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on May 18, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Downloading NEMO and installing XIOS on ARCHER (Step 1)]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/nemo/nemo-wed12-01/" />
  <id>https://cbull.info/nemo/nemo-wed12-01</id>
  <published>2018-05-17T00:30:00+00:00</published>
  <updated>2018-05-17T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;We take the first step of downloading, compiling and testing NEMO code on ARCHER&lt;/p&gt;

&lt;p&gt;Pre-requisites:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.archer.ac.uk/access/&quot;&gt;ARCHER account&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://forge.ipsl.jussieu.fr/nemo/register&quot;&gt;NEMO repository account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggested reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInstall#DownloadNEMOreferencecodeandconfigurations&quot;&gt;NEMO reference code and configurations&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://wiki.nerc-bas.ac.uk/wiki/index.php/Piethi/NEMO/Install_NEMO&quot;&gt;BAS howto install NEMO guide (accessible to BAS staff only); this guide is based on these notes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/chrisb13/BUILD_CONFIG_NEMO&quot;&gt;ARCHER fork of Nicolas Jourdain GitHub repository for WED12 configuration&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://forge.ipsl.jussieu.fr/nemo/discussion/topic/8&quot;&gt;FAQ on getting started with NEMO&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;installing-nemo-and-xios&quot;&gt;Installing NEMO and XIOS&lt;/h2&gt;

&lt;p&gt;We will first install XIOS, and then NEMO. If you haven’t done so already, you’ll need to load netCDF and HDF5 libraries as well as Intel compilers. On ARCHER, run:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;module load cray-netcdf-hdf5parallel/4.4.1.1 
module load cray-hdf5-parallel/1.10.0.1
module swap PrgEnv-cray PrgEnv-intel&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This worked with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;cray-netcdf-hdf5parallel/4.4.1.1&lt;/li&gt;
  &lt;li&gt;cray-hdf5-parallel/1.10.0.1&lt;/li&gt;
  &lt;li&gt;PrgEnv-intel/5.2.82&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And doesn’t work if you do a module purge first, ARCHER on default currently loads:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;chbull@eslogin008:~&amp;gt; module list
Currently Loaded Modulefiles:
  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; modules/3.2.10.6                      12&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; gni-headers/4.0-1.0502.10859.7.8.ari  23&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; bolt/0.6
  2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; eswrap/1.3.3-1.020200.1280.0          13&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; xpmem/0.1-2.0502.64982.5.3.ari        24&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; nano/2.2.6
  3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; switch/1.0-1.0502.60522.1.61.ari      14&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; dvs/2.5_0.9.0-1.0502.2188.1.116.ari   25&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; leave_time/1.3.0
  4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; cce/8.5.8                             15&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; alps/5.2.4-2.0502.9774.31.11.ari      26&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; quickstart/1.0
  5&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; craype-network-aries                  16&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; rca/1.0.0-2.0502.60530.1.62.ari       27&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ack/2.14
  6&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; craype/2.5.10                         17&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; atp/2.1.0                             28&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; xalt/0.6.0
  7&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; cray-libsci/16.11.1                   18&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; PrgEnv-cray/5.2.82                    29&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; openssl/1.1.0g_build1
  8&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; udreg/2.3.2-1.0502.10518.2.17.ari     19&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; pbs/12.2.401.141761                   30&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; curl/7.58.0_build1
  9&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ugni/6.0-1.0502.10863.8.29.ari        20&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; craype-ivybridge                      31&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git/2.16.2_build1
 10&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; pmi/5.0.13                            21&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; cray-mpich/7.5.5                      32&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; epcc-tools/8.0
 11&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; dmapp/7.0.1-1.0502.11080.8.76.ari     22&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; packages-archer&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;xios&quot;&gt;XIOS&lt;/h3&gt;

&lt;p&gt;We’ll do XIOS first. The recommended compiler suite for ARCHER is Cray. But as Admiral Ackbar said: “It’s a trap!”. You will need to use Intel!&lt;/p&gt;

&lt;p&gt;Get the latest version of XIOS (currently &lt;a href=&quot;http://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#ExtractingandinstallingXIOS&quot;&gt;XIOS 2&lt;/a&gt;), which is an I/O server to handle reading and writing data in NEMO. Source code and instructions can be found &lt;a href=&quot;http://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#ExtractingandinstallingXIOS&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You will need the .fcm, .path, and .env files for XIOS. Get the “arch” files for XIOS at:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;/work/n02/n02/shared/baspog/arch-for-xios/&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put them in the “arch” directory in the XIOS folder. If they are not available, they are as follows. The env file, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/shared/baspog/arch-for-xios/arch-XC30_ARCHER.env&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_INC_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_LIB_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HDF5_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_INC_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_LIB_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The fcm file, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/shared/baspog/arch-for-xios/arch-XC30_ARCHER.fcm&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;################################################################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;###################        Projet xios - xmlioserver       #####################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;################################################################################&lt;/span&gt;

%CCOMPILER      cc
%FCOMPILER      ftn
%LINKER         CC

%BASE_CFLAGS    &lt;span class=&quot;nt&quot;&gt;-DMPICH_SKIP_MPICXX&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; msglevel_4 &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; zero &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; noparse_templates
%PROD_CFLAGS    &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-DBOOST_DISABLE_ASSERTS&lt;/span&gt;
%DEV_CFLAGS     &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O2&lt;/span&gt;
%DEBUG_CFLAGS   &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt;

%BASE_FFLAGS    &lt;span class=&quot;nt&quot;&gt;-warn&lt;/span&gt; all &lt;span class=&quot;nt&quot;&gt;-zero&lt;/span&gt;
%PROD_FFLAGS    &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fp-model&lt;/span&gt; precise &lt;span class=&quot;nt&quot;&gt;-warn&lt;/span&gt; all &lt;span class=&quot;nt&quot;&gt;-zero&lt;/span&gt;
%DEV_FFLAGS     &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O2&lt;/span&gt;
%DEBUG_FFLAGS   &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt;

%BASE_INC       &lt;span class=&quot;nt&quot;&gt;-D__NONE__&lt;/span&gt;
%BASE_LD        &lt;span class=&quot;nt&quot;&gt;-D__NONE__&lt;/span&gt;

%CPP            cpp
%FPP            cpp &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-CC&lt;/span&gt;
%MAKE           gmake&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The ‘path’ file: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/work/n02/n02/shared/baspog/arch-for-xios/arch-XC30_ARCHER.path&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;NETCDF_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-I &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$NETCDF_INC_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NETCDF_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'-Wl,&quot;--allow-multiple-definition&quot; -Wl,&quot;-Bstatic&quot; -L $NETCDF_LIB_DIR'&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NETCDF_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-lnetcdf -lnetcdff&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;MPI_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MPI_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;MPI_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#HDF5_INCDIR=&quot;-I $HDF5_INC_DIR&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;HDF5_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-L &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HDF5_LIB_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;HDF5_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-lhdf5_hl -lhdf5 -lz&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;OASIS_INCDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;OASIS_LIBDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;OASIS_LIB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#OASIS_INCDIR=&quot;-I$PWD/../../prism/X64/build/lib/psmile.MPI1&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#OASIS_LIBDIR=&quot;-L$PWD/../../prism/X64/lib&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#OASIS_LIB=&quot;-lpsmile.MPI1 -lmpp_io&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And then install XIOS by running the following command in the XIOS folder.&lt;/p&gt;

&lt;p&gt;In my case, all of the above was:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;svn co &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; 1011 http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS     &lt;span class=&quot;c&quot;&gt;#need to use a tested version of the xios 2&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /path/to/where/you/cloned/xios/arch
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; /work/n02/n02/shared/baspog/arch-for-xios/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#copy the arch files; the .fcm, .path and .env files are the same as before&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;chmod&lt;/span&gt; +x make_xios 
./make_xios &lt;span class=&quot;nt&quot;&gt;--prod&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--full&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--arch&lt;/span&gt; XC30_ARCHER  &lt;span class=&quot;nt&quot;&gt;--jobs&lt;/span&gt; 8&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The build took 1435 seconds (using the above module versions).&lt;/p&gt;

&lt;h3 id=&quot;nemo&quot;&gt;NEMO&lt;/h3&gt;

&lt;p&gt;We are using the G06 Met Office revision, clone it (put your NEMO repository username in):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /fs2/n02/n02/chbull/nemo/models
svn &lt;span class=&quot;nt&quot;&gt;--username&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'chrisbull'&lt;/span&gt; co http://forge.ipsl.jussieu.fr/nemo/svn/branches/UKMO/dev_r5518_GO6_package@9583&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Open NEMOGCM/ARCH/arch-XC_ARCHER_INTEL.fcm and make sure the variables “NDF_HOME”, “HDF5_HOME” and “XIOS_HOME” point to the netCDF, HDF, and XIOS directories. netCDF and HDF5 directories can be found by running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nc-config --all&lt;/code&gt;. XIOS_HOME should be where you installed XIOS.&lt;/p&gt;

&lt;p&gt;In my case, this looked like the following “arch” file (compiler settings):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;%NCDF_HOME           /opt/cray/netcdf-hdf5parallel/4.4.1.1/INTEL/15.0/
%NCDF_HOME_FORTRAN   /opt/cray/netcdf-hdf5parallel/4.4.1.1/INTEL/15.0/
%HDF5_HOME           /opt/cray/hdf5/1.10.0.1/INTEL/15.0/
%XIOS_HOME           /fs2/n02/n02/chbull/nemo/models/XIOS/

%NCDF_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%NCDF_HOME/include &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%NCDF_HOME_FORTRAN/include
%NCDF_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%NCDF_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lnetcdf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%NCDF_HOME_FORTRAN/lib &lt;span class=&quot;nt&quot;&gt;-lnetcdff&lt;/span&gt;
%XIOS_INC            &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;%XIOS_HOME/inc 
%XIOS_LIB            &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;%XIOS_HOME/lib &lt;span class=&quot;nt&quot;&gt;-lxios&lt;/span&gt;

%CPP                 cpp
%FC                  ftn
%FCFLAGS             &lt;span class=&quot;nt&quot;&gt;-integer-size&lt;/span&gt; 32 &lt;span class=&quot;nt&quot;&gt;-real-size&lt;/span&gt; 64 &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fp-model&lt;/span&gt; precise &lt;span class=&quot;nt&quot;&gt;-zero&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fpp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-warn&lt;/span&gt; all
%FFLAGS              &lt;span class=&quot;nt&quot;&gt;-integer-size&lt;/span&gt; 32 &lt;span class=&quot;nt&quot;&gt;-real-size&lt;/span&gt; 64 &lt;span class=&quot;nt&quot;&gt;-O3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fp-model&lt;/span&gt; precise &lt;span class=&quot;nt&quot;&gt;-zero&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fpp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-warn&lt;/span&gt; all
%LD                  CC &lt;span class=&quot;nt&quot;&gt;-Wl&lt;/span&gt;,&lt;span class=&quot;s2&quot;&gt;&quot;--allow-multiple-definition&quot;&lt;/span&gt;
%FPPFLAGS            &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-traditional&lt;/span&gt;
%LDFLAGS
%AR                  ar 
%ARFLAGS             &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
%MK                  gmake
%USER_INC            %XIOS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %NCDF_LIB&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Put here: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/fs2/n02/n02/chbull/nemo/models/dev_r5518_GO6_package/NEMOGCM/ARCH/arch-XC_ARCHER_INTEL.fcm&lt;/code&gt;.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/nemo/nemo-wed12-01/&quot;&gt;Downloading NEMO and installing XIOS on ARCHER (Step 1)&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on May 17, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Python package for gridding subplots, fast!]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/superfast-griddedsubplots/" />
  <id>https://cbull.info/python/superfast-griddedsubplots</id>
  <published>2016-03-14T00:30:00+00:00</published>
  <updated>2016-03-14T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;Plthacks is a Python package that wraps Matplotlib to make common (tedius) tasks faster, this post is about creating a grid of an arbitrary number of plots from an ordered dictionary.&lt;/p&gt;

&lt;p&gt;I reguarly find myself wanting to display multiple fields. I find it frustrating how many lines you need in Matplotlib to grid plots such that they have things like:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;when sharing an axis removing ticks and labels where appropriate;&lt;/li&gt;
  &lt;li&gt;displaying one colourbar for each subplot or a global colourbar for all plots;&lt;/li&gt;
  &lt;li&gt;adjusting subplot size according to the above.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/chrisb13/plthacks&quot;&gt;Plthacks&lt;/a&gt;.Grid Class is an attempt to make this much faster. Let’s see an example.&lt;/p&gt;

&lt;p&gt;This package is under development, this post refers to &lt;a href=&quot;https://github.com/chrisb13/plthacks/commit/5b193d89ae018aa8a0822c5d722f4dcad2f345c1&quot;&gt;this SHA of the code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;‘Install’ the package somewhere you’ll import it..&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone https://github.com/chrisb13/plthacks
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;plthacks
git reset &lt;span class=&quot;nt&quot;&gt;--hard&lt;/span&gt; 5b193d89ae018aa8a0822c5d722f4dcad2f345c1&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To start, we’ll just create some data and store it in an ordered dictionary called plotdict. We also optionally specify each subplot’s dimension labels and colorbars, called dimlab and colorbars respectively.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;plthacks&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt; 

&lt;span class=&quot;c1&quot;&gt;#this package requires numpy and matplotlib
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#these two are part of core python
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;itertools&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#place to put the plot, if an output is not specified (when calling Grid Class), then it will return the matplotlib figure object
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'/tmp/testplots/'&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#we will show how you can specify different colormaps in a minute
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colormaps&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;itertools&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cycle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'Accent'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Dark2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Paired'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Pastel1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;\
        &lt;span class=&quot;s&quot;&gt;'Pastel2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Set1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Set2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'Set3'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#The following three ordered dictionaries are ordered by each subplot where they contain:
#plotdict is the fields to contourf
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;collections&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;OrderedDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#(optional) dimlab is the labels for the x/y axis
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;collections&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;OrderedDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#(optional) colorbars are the colourmaps to use 
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colorbars&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;collections&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;OrderedDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#this will be the title in the box of each subplot, we are making 12 but you can try a different number if you like...
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cnts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cnts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#plotdict[cnt]=np.random.rand(200,150)
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'xlabel'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ylabel'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;colorbars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cnt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colormaps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We’ll now show 10 different usages of the Grid class so you get the idea of what it can do.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sepcbar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'001_GridEgDimLabSepcbar.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/001_GridEgDimLabSepcbar.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/001_GridEgDimLabSepcbar.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Neat right? So you’ll notice we’ve opted for 4 rows and 3 columns with 12 plots but the grid can be whatever we like (I hope!).&lt;/p&gt;

&lt;p&gt;We can do a few other things too, such as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;share x-axis/share y-axis&lt;/li&gt;
  &lt;li&gt;include/exclude dimension labels&lt;/li&gt;
  &lt;li&gt;include/exclude local or global colourbar(s)&lt;/li&gt;
  &lt;li&gt;have different colourmaps for each subplot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These options are described in the Grid docstring:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
Class to create a gridded set of subplots from a dictionary.

Parameters
----------
pdict: dictionary containing the arrays to plot, titles are taken from the key
pdims: tuple with (rowdim,coldim)
sharex (optional): share all the x axis in the grid
sharey (optional): share all the y axis in the grid
dimlabels (optional): dictionary containing tuples of xlabel and ylabels 
sepcbar (optional): separate colorbars for each subplot (True or False)
globalcbar (optional): a single colorbar for the whole plot (string where the options are: 'True' which will use default colormap or name of matplotlib colormap)
cbars (optional): dictionary containing matplotlib colourbars to use
clevels (optional): integer for the number of contour levels
outputpath (optional): full path of file to put plot in (if left out it won't be created)

Returns
-------

Notes
-------
* If you use sepcbar, then best not to use sharex or sharey.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;You’ll notice in the above example we used the optional dimlabels and sepcbar. Here’s some more examples.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cbars&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colorbars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'002_GridEgDimLabcbars.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/002_GridEgDimLabcbars.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/002_GridEgDimLabcbars.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cbars&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colorbars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;clevels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'003_GridEgDimLabclevelscbars.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/003_GridEgDimLabclevelscbars.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/003_GridEgDimLabclevelscbars.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;globalcbar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'True'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;clevels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'004_GridEgDimLabShareXShareYglobalcbarclevels.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/004_GridEgDimLabShareXShareYglobalcbarclevels.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/004_GridEgDimLabShareXShareYglobalcbarclevels.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;globalcbar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'Accent'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;clevels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'005_GridEgDimLabShareXShareYglobalcbarAccentclevels.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/005_GridEgDimLabShareXShareYglobalcbarAccentclevels.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/005_GridEgDimLabShareXShareYglobalcbarAccentclevels.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'006_GridEgShareX.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/006_GridEgShareX.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/006_GridEgShareX.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'007_GridEgSHareY.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/007_GridEgSHareY.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/007_GridEgSHareY.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'008_GridEgShareXShareY.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/008_GridEgShareXShareY.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/008_GridEgShareXShareY.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'009_GridEgDimLab.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/009_GridEgDimLab.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/009_GridEgDimLab.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;plth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sharey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlabels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dimlab&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outputpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plotoutputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'010_GridEgShareXShareYDimLab.png'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Results in:
&lt;a href=&quot;/images/plthacks_Grid/010_GridEgShareXShareYDimLab.png&quot;&gt;&lt;img src=&quot;/images/plthacks_Grid/010_GridEgShareXShareYDimLab.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of these examples are in &lt;a href=&quot;https://github.com/chrisb13/plthacks/blob/5b193d89ae018aa8a0822c5d722f4dcad2f345c1/tests.py&quot;&gt;tests.py here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Of course, it’s super hard to create a Class that will work in all instances. I’ve written it with the idea that one could just copy the whole Class in main.py and hack it, if the set up described here is inadequate. Similarly, the Class will return all the matplotlib axis (see self.paxis dictionary). Hopefully it’s a useful starting point though. Pull requests most welcome!&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/superfast-griddedsubplots/&quot;&gt;Python package for gridding subplots, fast!&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on March 14, 2016.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Python package for one-line creation of movies from netCDF files.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/oneline-movies-mkmov/" />
  <id>https://cbull.info/python/oneline-movies-mkmov</id>
  <published>2016-01-22T00:30:00+00:00</published>
  <updated>2016-01-22T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;&lt;strong&gt;Update 10.10.2016&lt;/strong&gt;. MkMov 0.4 now supports a bunch of other outputs, see &lt;a href=&quot;http://christopherbull.com.au/mkmov/usage.html&quot;&gt;usage&lt;/a&gt; for details.&lt;/p&gt;

&lt;p class=&quot;notice&quot;&gt;MkMov is a Python package that creates a movie from a netCDF file with a single line, interface is command line (no python knowledge needed)!&lt;/p&gt;

&lt;p&gt;I reguarly find myself making movies for sanity checks on model runs, other times I’ll want a movie for a talk or perhaps to look at how some diagnostic plot varies over time. Suffice to say a few people have asked me how I create movies from netCDF files, such questions spurred the development of…&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/chrisb13/mkmov&quot;&gt;MkMov&lt;/a&gt;, a python package for making movies. In can be used in two ways:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;from a netCDF file&lt;/li&gt;
  &lt;li&gt;from a list of png files (use –stitch option)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples tell a thousand words, &lt;a href=&quot;https://youtube.com/embed/JEMj05o-KA4&quot;&gt;here’s a movie (AVISO global allsat madt, output is daily and variable is adt)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Created with a single line command, namely&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;python mkmov.py 2d adt &lt;span class=&quot;nt&quot;&gt;--lmask&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-214748&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cmap&lt;/span&gt; Set3 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /srv/ccrc/data42/z3457920/mkmovmovies4/AVISOdt_global_allsat_madt_Set3.mov /srv/ccrc/data42/z3457920/RawData/AVISO/RawData/dt_global_allsat_madt/ftp.aviso.altimetry.fr/global/delayed-time/grids/madt/all-sat-merged/h/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.nc &amp;amp;&amp;gt;  /srv/ccrc/data42/z3457920/mkmovmovies4/15.log &amp;amp;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;More examples with their respective run commands &lt;a href=&quot;http://christopherbull.com.au/mkmov/examples.html&quot;&gt;here&lt;/a&gt;. Official &lt;a href=&quot;http://www.christopherbull.com.au/mkmov&quot;&gt;docs are here&lt;/a&gt;. &lt;a href=&quot;http://www.christopherbull.com.au/mkmov/contributing.html&quot;&gt;Contributions&lt;/a&gt; are most welcome.&lt;/p&gt;

&lt;p&gt;You might be wondering what this tool offers over something like ncview and a screen grabber program.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;bash scriptable&lt;/li&gt;
  &lt;li&gt;customisable output (e.g. –clev, –cmap &lt;a href=&quot;http://christopherbull.com.au/mkmov/usage.html&quot;&gt;etc&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;can take multiple files as input&lt;/li&gt;
  &lt;li&gt;can wrap ffmpeg to stitch together any png files&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;slow in comparison to ncview&lt;/li&gt;
  &lt;li&gt;need to install dependencies&lt;/li&gt;
&lt;/ol&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/oneline-movies-mkmov/&quot;&gt;Python package for one-line creation of movies from netCDF files.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on January 22, 2016.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Bash function for super fast loading of netCDF files in Python.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/lightning-netcdf/" />
  <id>https://cbull.info/python/lightning-netcdf</id>
  <published>2015-12-02T00:30:00+00:00</published>
  <updated>2015-12-02T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;I often finding myself wanting basic information about netCDF files and needing to inspect it in Python &lt;em&gt;quickly&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I’ve written a bash function that takes a passed path of a netCDF file, it then writes a short python script and loads it into a ipython console. The console then prints out basic information about the file and all the variable names, ready for you to hack away!&lt;/p&gt;

&lt;p&gt;For this bash function you’ll need:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;python 2.x&lt;/li&gt;
  &lt;li&gt;python netCDF4 library&lt;/li&gt;
  &lt;li&gt;ipython&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the function:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/62b159a374bb0763c569.js&quot;&gt; &lt;/script&gt;

&lt;p&gt;The above is a &lt;a href=&quot;https://help.github.com/articles/about-gists/&quot;&gt;GitHub gists&lt;/a&gt;, feel free to comment/fork/pull! If you’ve found this handy, you might also like my &lt;a href=&quot;http://christopherbull.com.au/hpc/vim-ncdump-shortcut/&quot;&gt;Vim and UltiSnip&lt;/a&gt; for similar stuff.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/lightning-netcdf/&quot;&gt;Bash function for super fast loading of netCDF files in Python.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on December 02, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Programmatic paper writing with MkPaper]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/python-package-mkpaper/" />
  <id>https://cbull.info/python/python-package-mkpaper</id>
  <published>2015-11-25T00:30:00+00:00</published>
  <updated>2015-11-25T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p class=&quot;notice&quot;&gt;MkPaper creates a figure document in 3 + n lines of code, where n is the number of figures you have!&lt;/p&gt;

&lt;p&gt;Have you ever wished a machine would write your paper for you?&lt;/p&gt;

&lt;p&gt;Wish no more, the future is here!* I’ve created a Python package that will compile a LaTeX or word document of figures. Basically, you feed the package a path to a figure and a caption and then it will create either:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;a PDFLaTeX document or a&lt;/li&gt;
  &lt;li&gt;Word Document&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;with those figures and captions inserted&lt;/em&gt;! I’ve tried to make it as simple and painless to install as possible (just clone the repo’); dependencies are kept to a minimum, specifically:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;python 2.x&lt;/li&gt;
  &lt;li&gt;pdflatex (optional)&lt;/li&gt;
  &lt;li&gt;python-docx (optional)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Without pdflatex, the package still works (you can create the tex file and not compile). To create a Word document you need python-docx (installable with Anaconda).&lt;/p&gt;

&lt;p&gt;To install the package:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;clone&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;https&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;github&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chrisb13&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mkpaper&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And then, suppose you want to create a word doc, usage looks like…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;mkpaper&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#get a list of your figures in PNG format...
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;glob&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;ifiles&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sorted&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;glob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;glob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path_to_pngplots&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'*.png'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ifiles&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]),&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;glob didn't find anything!&quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#alternatively, we could be more explicit
#ifile[0]=path_to_doc+'penguin1.png'
#ifile[1]=path_to_doc+'penguin2.png'
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#instantiate WordFigureDoc class:
#arguments are: path/to/put/figuredocs and name of figure doc..
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;figobj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WordFigureDoc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path_to_doc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'penguinfigs'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;figobj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_figure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ifiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'first penguin'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;figobj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_figure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ifiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'second penguin'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#etc
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#insert the tail of the doc
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;figobj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;end_doc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Want to get started? Head over to the &lt;a href=&quot;http://github.com/chrisb13/mkpaper&quot;&gt;GitHub project here.&lt;/a&gt;. Full working examples in &lt;a href=&quot;https://github.com/chrisb13/mkpaper/tree/master/examples&quot;&gt;here&lt;/a&gt;, so you should be up and running in no time!&lt;/p&gt;

&lt;p&gt;Feedback and pull requests welcome!&lt;/p&gt;

&lt;p&gt;*A touch of hyperbole here ;)&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/python-package-mkpaper/&quot;&gt;Programmatic paper writing with MkPaper&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on November 25, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Vim and netCDF files.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/hpc/vim-shortcut-ncdump/" />
  <id>https://cbull.info/hpc/vim-shortcut-ncdump</id>
  <published>2015-11-11T00:30:00+00:00</published>
  <updated>2015-11-11T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;I often finding myself wanting basic information about netCDF files when writing scripts that read/write netCDF files…&lt;/p&gt;

&lt;p&gt;The following ncdump command provides a useful overview. The mapping grabs the clipboard register and opens the corresponding netcdf header in a new vim vertical split..&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;nnoremap &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;leader&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;nc &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;vnew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;Bar&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;!&lt;/span&gt;ncdump &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;C&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;R&lt;span class=&quot;p&quot;&gt;&amp;gt;+&amp;lt;&lt;/span&gt;CR&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;What about if you want to have a quick look at a plot of one of the variables? Works with ncview too!&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;nnoremap &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;leader&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;ncv &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;exec &lt;span class=&quot;s1&quot;&gt;'!ncview &amp;lt;C-R&amp;gt;+'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;CR&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Speaking of working with netCDF files, here’s a handy &lt;a href=&quot;https://github.com/sirver/ultisnips&quot;&gt;snippet&lt;/a&gt; for the python library…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;snippet&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loadnetcdf&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;netCDF4&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Dataset&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;infile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'/path/to/netcdf4/file.nc'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;ifile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Dataset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;infile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'r'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;varone&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ifile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;endsnippet&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/hpc/vim-shortcut-ncdump/&quot;&gt;Vim and netCDF files.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on November 11, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Beautiful argument parsing with docopt and ultisnips.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/docopt-ultisnip/" />
  <id>https://cbull.info/python/docopt-ultisnip</id>
  <published>2015-10-01T00:30:00+00:00</published>
  <updated>2015-10-01T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;I recently discovered &lt;a href=&quot;https://github.com/docopt/docopt&quot;&gt;docopt&lt;/a&gt;, this super neat command line parser. I’ve used sys.argv and the argparse module but they’ve always felt too limited or overly complicated (respectively). What’s great about docopt is that it understands what to do based on the POSIX-style doc string you write! This has two advantages…&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;You’ve likely used enough *nix command-line tools to have a sense of what your doc string should look like (if you do get lost &lt;a href=&quot;https://github.com/docopt/docopt&quot;&gt;the docs&lt;/a&gt; are great).&lt;/li&gt;
  &lt;li&gt;It forces you to write documentation!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There’s a &lt;a href=&quot;http://docopt.org/&quot;&gt;video&lt;/a&gt; here if you want a demo. Whilst it’s not part of core python, one of the neat things is that it is fully self-contained within a single file. Thus, you can ‘install’ it with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;wget https://raw.githubusercontent.com/docopt/docopt/master/docopt.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Anyway, I’ve written a &lt;a href=&quot;http://vimcasts.org/episodes/ultisnips-python-interpolation/&quot;&gt;Vim Ultisnip&lt;/a&gt; to do all the work for you…
&lt;script src=&quot;https://gist.github.com/a1e813302a0c9fbd9759.js&quot;&gt; &lt;/script&gt;
This is one of the more useful Ultisnip interpolation uses I’ve found, you read correctly, it’ll ‘install’ docopt for you!&lt;/p&gt;

&lt;p&gt;The above is a gist, feel free to comment/fork/pull.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/docopt-ultisnip/&quot;&gt;Beautiful argument parsing with docopt and ultisnips.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on October 01, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Grabbing paths straight to the clipboard.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/hpc/bash-function-clipit/" />
  <id>https://cbull.info/hpc/bash-function-clipit</id>
  <published>2015-09-05T00:30:00+00:00</published>
  <updated>2015-09-05T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;Do you remember the moment when you realised in Linux that clicking the mouse wheel pasted selected text? I had a similar reveleation when I discovered xclip recently, a handy utility for pushing text into the clipboard. I’m forever copying and pasting paths from SSH sessions so here’s a bash function that does the work for you…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;clipit&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#clipit path &lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$# &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;--help&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;-h&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Usage: clipit FILENAME_PATHNAME&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Purpose: gets full path of file or path and places in clipboard.&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Requires: xclip&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Mandatory arguments: &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;FILENAME_PATHNAME: path to folder or file&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Example.&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;clipit filename.txt&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;becomes:       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;readlink -e filename.txt|tr -d '&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;'|xclip -selection c&quot;&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;return &lt;/span&gt;1
    &lt;span class=&quot;k&quot;&gt;fi
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;readlink&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;|tr &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\n'&lt;/span&gt;|xclip &lt;span class=&quot;nt&quot;&gt;-selection&lt;/span&gt; c
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you’re got apt-get and sudo rights, then you can install xclip with:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;xclip&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you don’t have either of the above, then you can compile from source with (defaults to the slow but likely available GNU compiler):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd 
&lt;/span&gt;wget wget http://downloads.sourceforge.net/project/xclip/xclip/0.12/xclip-0.12.tar.gz
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xvf&lt;/span&gt; xclip-0.12.tar.gz
&lt;span class=&quot;nb&quot;&gt;mv &lt;/span&gt;xclip-0.12 xclip
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;xclip
./configure &lt;span class=&quot;nt&quot;&gt;--prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/xclip
make&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Seems like a bit of work but it’s pretty quick. And then, once compiled, add the following to your ~/.bashrc…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#add xclip to the end of bash path&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:~/xclip/&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This assumes that you compiled in ~/xclip/ as above. Happy speedy copy/pasting!&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/hpc/bash-function-clipit/&quot;&gt;Grabbing paths straight to the clipboard.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on September 05, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Bash function for painless rsync.]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/hpc/bash-function-rsync/" />
  <id>https://cbull.info/hpc/bash-function-rsync</id>
  <published>2015-08-18T00:30:00+00:00</published>
  <updated>2015-08-18T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;My life consists of two problems…&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;I work on many different machines and the files I want are invariably on the wrong machine.&lt;/li&gt;
  &lt;li&gt;I can never remember the right rsync flags for the different machines I use and my fingers are lazy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The second problem means I never want to deal with the first two.. Sound familiar?&lt;/p&gt;

&lt;p&gt;Here’s some bash functions to help you push and pull files from a remote location.&lt;/p&gt;

&lt;p&gt;We have one bash function for pulling files….
&lt;script src=&quot;https://gist.github.com/7ea4e9620cbce4a80bfd.js&quot;&gt; &lt;/script&gt;&lt;/p&gt;

&lt;p&gt;And another (slightly more complicated) bash function for pushing files….&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/432eade90ec68629d03a.js&quot;&gt; &lt;/script&gt;

&lt;p&gt;So, if you put these in your &lt;a href=&quot;http://superuser.com/questions/49289/what-is-the-bashrc-file&quot;&gt;.bashrc&lt;/a&gt; with your relevant server details you should be good to go! Feel free to change the switches if you prefer something else, do get in touch if you improve these, it’s impractical to currently pass include/exclude statements at present for instance… The above are &lt;a href=&quot;https://help.github.com/articles/about-gists/&quot;&gt;GitHub gists&lt;/a&gt;, feel free to comment/fork/pull!&lt;/p&gt;

&lt;p&gt;Also, life is a lot more smooth if you’re using &lt;a href=&quot;https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2&quot;&gt;ssh keys&lt;/a&gt;.&lt;/p&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/hpc/bash-function-rsync/&quot;&gt;Bash function for painless rsync.&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on August 18, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Editing files remotely]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/hpc/vim-netrw/" />
  <id>https://cbull.info/hpc/vim-netrw</id>
  <published>2015-01-01T00:30:00+00:00</published>
  <updated>2015-01-01T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;I often find myself wanting to edit a file on a remote machine but ssh is too slow to be running a text editor on the remote machine.. Solution? Vim can use rsync to download a copy of the file and then when you save it, it saves it back to the remote location!&lt;/p&gt;

&lt;p&gt;Here’s a bash function I wrote to make it all easy….&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;vim_servername&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; 
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$# &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;--help&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;-h&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Usage:   vim_servername [path_to].&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Purpose: Allows remote editing of files on servers...&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Mandatory arguments: &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;path or file: vim will either edit or open path passed&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Example.&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;This:&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vim_servername /server/path/or/file/&quot;&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;       &quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Becomes:&quot;&lt;/span&gt; 
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vim scp://username@server.address.edu.au//server/path/or/file/&quot;&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;return &lt;/span&gt;1
    &lt;span class=&quot;k&quot;&gt;fi

    &lt;/span&gt;vim scp://username@server.address.edu.au/&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; 

&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;So, just put these in your &lt;a href=&quot;http://superuser.com/questions/49289/what-is-the-bashrc-file&quot;&gt;.bashrc&lt;/a&gt; with your relevant server details and you should be good to go! Best to be using &lt;a href=&quot;https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2&quot;&gt;ssh keys&lt;/a&gt;, that way you’re not typing in your password everytime you save..&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;https://cbull.info/hpc/vim-netrw/&quot;&gt;Editing files remotely&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on January 01, 2015.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Gotcha in Pandas using HDFStore frame_tables]]></title>
  <link rel="alternate" type="text/html" href="https://cbull.info/python/gotcha-in-pandas-using-hdfstore-frame_tables/" />
  <id>https://cbull.info/python/gotcha-in-pandas-using-hdfstore-frame_tables</id>
  <published>2014-01-08T00:30:00+00:00</published>
  <updated>2014-01-08T00:30:00+00:00</updated>
  <author>
    <name></name>
    <uri>https://cbull.info</uri>
    
  </author>
  <content type="html">
    &lt;p&gt;Recently, I changed from using regular &lt;a href=&quot;http://pandas.pydata.org/pandas-docs/dev/io.html#io-hdf5&quot;&gt;pytable HDFStores to fancy frame_tables&lt;/a&gt;. The move was mostly for the better as my HDFStores were big. Of course, my old code modifying the dataframes broke because of this little bit of syntax…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;HDFStore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'/path/to/some/hdfstore.h5'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'latitude'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'latitude'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;25.0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'DF'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'latitude'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'latitude'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;20.0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;                                                                                                                            
&lt;span class=&quot;n&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt;                                                                                                                              
                                                                                               
&lt;span class=&quot;n&quot;&gt;File&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;some&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hdfstore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h5&lt;/span&gt;                              
&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DF&lt;/span&gt;                &lt;span class=&quot;n&quot;&gt;frame_table&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;typ&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;appendable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nrows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;24165608&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ncols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;indexers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;longitude&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;latitude&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;depth_m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;abstime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PARLOC&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;frame_table&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;typ&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;appendable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nrows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;17913&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ncols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;indexers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;In&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__version__&lt;/span&gt;                                                                                                              
&lt;span class=&quot;n&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'0.12.0'&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Of course, the annoying part is that line four doesn’t throw an error message!&lt;/p&gt;


    &lt;p&gt;&lt;a href=&quot;https://cbull.info/python/gotcha-in-pandas-using-hdfstore-frame_tables/&quot;&gt;Gotcha in Pandas using HDFStore frame_tables&lt;/a&gt; was originally published by Christopher Bull at &lt;a href=&quot;https://cbull.info&quot;&gt;Christopher Bull&lt;/a&gt; on January 08, 2014.&lt;/p&gt;
  </content>
</entry>

</feed>
