1.A Setting up SRIL34 - NOC-MSM/SRIL34 GitHub Wiki

Set paths

To build the NEMO, XIOS, and Tool needed to run the SRIL34 model, navigate to the SRIL34_physics/SCRIPTS/ in the bash terminal (see files here) and edit make_paths.sh as necessary ((likely only the $CONFIG and $WORK paths, and the path to the $EXTRA containing the EXTRA_TOOLS files if you want to compile the nemo tools). Then, run the following scripts in order. Note that these routines have been used on Archer2.

cd SRIL34_physics/SCRIPTS/
. ./make_paths.sh
. ./make_directories.sh
. ./make_xios.sh
. ./make_nemo.sh 

These are made before the domain file so some of the tooling and directory structures can be reused.

Compile XIOS

After running make_paths.sh and make_directories.sh, view the make_xios.sh script. Navigate to your $WDIR and load the necessary modules (they might change to depending on your HPC):

cd $WDIR
module swap craype-network-ofi craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load cray-hdf5-parallel/1.12.0.7
module load cray-netcdf-hdf5parallel/4.7.4.7

Download XIOS:

svn checkout http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 $XIOS_DIR
cd $XIOS_DIR

Copy over the necessary arch files and compile:

cp /work/n01/shared/nemo/xios-2.5/arch/arch-X86_ARCHER2-Cray.* arch/.
./make_xios --prod --arch X86_ARCHER2-Cray --netcdf_lib netcdf4_par --full --job 4

Note, the first time will fail. You will have to change the FC flag in $XIOS_DIR/tools/FCM/lib/Fcm/Config.pm and recompile:

sed -i "s/FC_MODSEARCH => ''/FC_MODSEARCH => '-J'/g" tools/FCM/lib/Fcm/Config.pm

./make_xios --prod --arch X86_ARCHER2-Cray --netcdf_lib netcdf4_par --full --job 4
cd $SCRIPTS

Compile NEMO

The script to compile NEMO is similar to the one used for building XIOS. Open the make_nemo.sh script and download NEMO:

cd $WDIR
svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/branches/UKMO/NEMO_4.0.4_mirror NEMO_4.0.4

Comment out this download line after it has been download (to avoid overwriting files).

Load modules (these may change depending on your HPC):

module load craype-network-ucx
module load cray-mpich-ucx
module load cray-hdf5-parallel/1.12.0.7
module load cray-netcdf-hdf5parallel/4.7.4.7

Then copy over the arch file for your HPC and edit some of the configuration parameters:

cp $GITCLONE/arch-X86_ARCHER2-Cray.fcm $NEMO/arch/arch-X86_ARCHER2-Cray.fcm

cd $NEMO
sed -i "s/FC_MODSEARCH => ''/FC_MODSEARCH => '-J'/g" ext/FCM/lib/Fcm/Config.pm

Compile NEMO:

cd $NEMO
./makenemo -n $CONFIG -r AMM12  -m X86_ARCHER2-Cray -j 16

Copy over the keys and the MY_SRC directory (These are configured for the SANH model configuration, they are identical to those used for the physics only SRIL34 model):

cd $CDIR/$CONFIG
cp $GITCLONE/cpp_SANH.fcm cpp_$CONFIG.fcm
cp -r -f $GITCLONE/MY_SRC ./

Finally, clean and recompile NEMO with the updates included:

cd $NEMO
./makenemo -r $CONFIG -m X86_ARCHER2-Cray -j 16 clean
./makenemo -r $CONFIG -m X86_ARCHER2-Cray -j 16
cd $SCRIPTS

Install miniconda

Miniconda is needed for python preprocessing, specifically for using PyNEMO (for generation of the boundary conditions).

cd /work/n01/n01/<user>
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod u+x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh

Install in /work/n01/n01/$USER/miniconda3 when prompted.

Allow it to modify PYTHONPATH in .bashrc Close and open shell

Compiling the NEMO tools

To compile the NEMO tools, use the script: make_tools.sh.

First, load the modules (these will vary depending on your machine), and copy over an edited DOMAINzgr source code file (adjusted to include more varied vertical coordinates) into the NEMO tools directory:

  module swap craype-network-ofi craype-network-ucx
  module swap cray-mpich cray-mpich-ucx
  module load cray-hdf5-parallel/1.12.0.7
  module load cray-netcdf-hdf5parallel/4.7.4.7

  # Make an adjustment to the DOMAINcfg source code to accomodate more varied vertical coords
  cp $EXTRA/DOMAIN/domzgr.f90.melange $TDIR/DOMAINcfg/src/domzgr.f90

Then, apply the necessary patches to the weight file code:

cd $NEMO/tools/WEIGHTS/src
patch -b < $EXTRA/patch_files/scripinterp_mod.patch
patch -b < $EXTRA/patch_files/scripinterp.patch
patch -b < $EXTRA/patch_files/scrip.patch
patch -b < $EXTRA/patch_files/scripshape.patch
patch -b < $EXTRA/patch_files/scripgrid.patch

And finally compile the NEMO tools:

cd $NEMO/tools
./maketools -m X86_ARCHER2-Cray -n NESTING
./maketools -m X86_ARCHER2-Cray -n REBUILD_NEMO
./maketools -m X86_ARCHER2-Cray -n WEIGHTS
./maketools -m X86_ARCHER2-Cray -n DOMAINcfg

cd $WORK
⚠️ **GitHub.com Fallback** ⚠️