====== TELEMAC ======
TELEMAC is now available on Comet, but should be assumed to be in a //testing// state until this message is removed - please report all findings to [[hpc.researchcomputing@newcastle.ac.uk]]
> The TELEMAC system is an integrated suite of solvers used in the fields of free-surface flow, wave propagation and sediment transport. Having been used in the context of numerous studies throughout the world and the subject of several peer-reviewed publications, it has become one of the major standards in its field.
>
> The TELEMAC system is managed by a consortium of organisations: Artelia (France), BundesAnstalt für Wasserbau (BAW, Germany), Centre d'études et d'expertise sur les risques, l'environnement, la mobilité et l'aménagement (CEREMA, France), Électricité de France (EDF, France), HR Wallingford (United Kingdom) and International Marine and Dredging Consultants (IMDC, Belgium). It is further strengthened scientifically by Daresbury Laboratory (United Kingdom), the Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique (CERFACS, France) and the École nationale des ponts et chaussées (ENPC, France).
* For more information: https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/README.md
===== Running TELEMAC on Comet =====
The TELEMAC software is stored within a dedicated container in the ''/nobackup/shared/containers'' directory and is accessible to __all__ users of Comet. You do //not// need to take a copy of the container file; it should be left in its original location.
You can find the container files here:
* ''/nobackup/shared/containers/telemac.2026.09.sif''
We //normally// recommend using the latest (date) version of the container unless you have a specific need for an earlier version of software.
**Container Image Versions**
We //may// reference a specific container file, such as **telemac.2026.09.sif**, but you should always check whether this is the most recent version of the container available. Simply ''ls'' the ''/nobackup/shared/containers'' directory and you will be able to see if there are any newer versions listed.
We have provided a convenience script that will automate **all** of steps needed to run applications inside the container, and access your ''$HOME'', ''/scratch'' and ''/nobackup'' directories to just two simple commands.
* ''/nobackup/shared/containers/telemac.2026.09.sh''
There is a corresponding ''.sh'' script for //each version// of the container image we make available.
Just ''source'' this file and it will take care of loading ''apptainer'', setting up your ''bind'' directories and calling the ''exec'' command for you - and give you a single command called ''container.run'' (instead of the really long //apptainer exec// command) to then //run// anything you want inside the container, for example - to run the ''GOTM'' utility included as a dependency with TELEMAC:
$ source /nobackup/shared/containers/telemac.2026.09.sh
$ container.run gotm --help
Usage: gotm [OPTIONS]
Options:
-h, --help print usage information and exit
-v, --version print version information
-c, --compiler print compilation options
$
You can continue to use the ''container.run'' command //as many times as you need// in the same script or same bash session, so you could run subsequently ''telemac2d'' as well:
$ container.run telemac2d
DEFAULTS VALUES OF LU AND LNG: 6 AND 2
LISTING OF TELEMAC2D------------------------------------------------------------------------------
TTTTT EEEEE L EEEEE M M AAAAA CCCCC
T E L E MM MM A A C
T EEE L EEE M M M AAAAA C
T E L E M M A A C
T EEEEE LLLLL EEEEE M M A A CCCCC
2D VERSION 9.1 FORTRAN 2003
~^~^~^~^~^~^~^~^~^~^~^^~^~^~^~^~^~
~ ~
\ ' o '
/\ o \ o
>=)'> ' /\ '
\/ \ >=)'> ~
/ /\ \/
~ >=)'> / .
\/ )
/ (
~ ) )
} ~ ( ( (
{ ) ) )
} } . ( ( (
{ { /^^^^^^^^^^^^
^^^^^^^^^\ /
^^^^^^^^^
$
... and ''telemac3d'' works the same way:
lang=bash>
$ container.run telemac3d
INFO: gocryptfs not found, will not be able to use gocryptfs
MASTER PROCESSOR NUMBER 0 OF THE GROUP OF 1
READ_CONFIG: FILE CONFIG NOT FOUND: CONFIG
DEFAULTS VALUES OF LU AND LNG: 6 AND 2
LISTING OF TELEMAC3D------------------------------------------------------------------------------
TTTTT EEEEE L EEEEE M M AAAAA CCCCC
T E L E MM MM A A C
T EEE L EEE M M M AAAAA C
T E L E M M A A C
T EEEEE LLLLL EEEEE M M A A CCCCC
3D VERSION 9.1 FORTRAN 2003
~^~^~^~^~^~^~^~^~^~^~^^~^~^~^~^~^~
~ ~
\ ' o '
/\ o \ o
>=)'> ' /\ '
\/ \ >=)'> ~
/ /\ \/
~ >=)'> / .
\/ )
/ (
~ ) )
} ~ ( ( (
{ ) ) )
} } . ( ( (
{ { /^^^^^^^^^^^^
^^^^^^^^^\ /
^^^^^^^^^
********************************************
* LECDON: *
* BEFORE CALLING DAMOCLES *
********************************************
$
We **strongly** recommend that you use this helper script and the ''container.run'' command to run software from inside the container as it will always ensure that you have correctly set up the ''bind'' directories for you and you are using the correct container version.
----
===== Software Included =====
The following applications are installed in the TELEMAC container environment:
^ Name ^ Version ^ Commands ^ Link ^ Notes ^
| GOTM | 2019-06-14 | ''gotm'' | https://github.com/gotm-model/code | The version included in this container is downloaded from the Telemac project. Later versions of **GOTM** (e.g. 6.x.y) have diverged from the version Telemac is built with. |
| FABM | 0.95.0 | N/A | https://github.com/BoldingBruggeman/fabm | |
| MED (med-fichier) | 4.1.1 | N/A | | The version included in this container is downloaded from the Telemac project. |
| libaed2 | 1.1.0 | N/A | https://github.com/AquaticEcoDynamics/libaed2 | The version included in this container is downloaded from the Telemac project. |
| Telemac (2d/3d) | 9.1.1 | ''telemac2d''\\ ''telemac3d''\\ ''tomawac'' | https://gitlab.pam-retd.fr/otm/telemac-mascaret | |
| Python | 3.10.x | ''python''\\ ''python3''\\ ''pip''\\ ''pip3'' | | Many components of Telemac will not work with Python versions >= 3.12 at this time. |
In addition, the following Python modules are installed:
^ Name ^
| affine |
| anyio |
| argon2 |
| arrow |
| astroid |
| asttokens |
| async_lru |
| attr |
| attrs |
| babel |
| bleach |
| bs4 |
| certifi |
| cffi |
| chardet |
| charset_normalizer |
| click |
| click_plugins |
| cligj |
| comm |
| contourpy |
| cycler |
| dateutil |
| debugpy |
| decorator |
| defusedxml |
| dill |
| doxypypy |
| et_xmlfile |
| exceptiongroup |
| executing |
| fastjsonschema |
| fiona |
| fiona.libs |
| fontTools |
| fqdn |
| geopandas |
| h11 |
| httpcore |
| httpx |
| idna |
| ipykernel |
| ipywidgets |
| isoduration |
| isort |
| jedi |
| jinja2 |
| json5 |
| jsonschema |
| jsonschema_specifications |
| jupyter_builder |
| jupyter_client |
| jupyter_console |
| jupyter_core |
| jupyter_events |
| jupyter_lsp |
| jupyter_server |
| jupyter_server_terminals |
| jupyterlab |
| jupyterlab_pygments |
| jupyterlab_server |
| jupyterlab_widgets |
| kiwisolver |
| lark |
| lxml |
| markupsafe |
| matplotlib |
| matplotlib_inline |
| mistune |
| mpi4py |
| mpl_toolkits |
| nbclient |
| nbconvert |
| nbformat |
| notebook |
| notebook_shim |
| numpy |
| numpy.libs |
| openpyxl |
| overrides |
| owslib |
| packaging |
| pandas |
| parso |
| pexpect |
| pillow.libs |
| platformdirs |
| prometheus_client |
| prompt_toolkit |
| psutil |
| ptyprocess |
| pure_eval |
| pycparser |
| pygments |
| pylab.py |
| pylint |
| pyogrio |
| pyogrio.libs |
| pyparsing |
| pyproj |
| pyproj.libs |
| pythonjsonlogger |
| pytz |
| pyzmq.libs |
| rasterio |
| rasterio.libs |
| referencing |
| requests |
| rfc3987_syntax |
| rpds |
| rtree |
| rtree.libs |
| scipy |
| scipy.libs |
| seaborn |
| send2trash |
| shapely |
| shapely.libs |
| six.py |
| soupsieve |
| stack_data |
| terminado |
| tinycss2 |
| tomli |
| tomlkit |
| tornado |
| traitlets |
| tzdata |
| uri_template |
| urllib3 |
| wcwidth |
| webcolors |
| webencodings |
| websocket |
| widgetsnbextension |
| yaml |
| zmq |
----
===== Accessing Data =====
As long as you use the ''container.run'' method to launch the applications, you will automatically be able to read and write to files in your ''$HOME'', ''/scratch'' and ''/nobackup'' directories.
If you run any of the applications inside the container manually, without using the ''container.run'' helper you will need to use the ''--bind'' argument to ''apptainer'' to ensure that all relevant directories are exposed within the container.
Do remember that the container filesystem itself cannot be changed - so you won't be able to write or update to ''/usr/local'', ''/opt'', ''/etc'' or any other internal folders - keep output directories restricted to the three areas listed above.
----
===== Sample Slurm Job =====
Here is a very simple example of calling **TELEMAC** from the container within a Slurm batch job that assumes you are a member of the **comet_abc123** HPC project group and your input data lives in ''/nobackup/proj/comet_abc123/my_data.input'':
#!/bin/bash
#SBATCH --partition=default_free
#SBATCH --account=comet_abc123
#SBATCH -c 16
#SBATCH --mem=20G
source /nobackup/shared/containers/telemac.2026.09.sh
# Now change to your directory which has been prepared for a TELEMAC job and
# use "container.run" to run telemac2d or telemac3d as required
Submit as normal with ''sbatch telemac_job.sh''.
----
===== Installing TELEMAC on Comet =====
**Important!**
This section is only relevant for RSE HPC staff or those who want to understand how the TELEMAC container runtime has been built. If you are only interested in running the software, stop reading here!
Note that there are several hard dependencies in TELEMAC on non-current versions of software, or bugs in the install which require manual workarounds, this includes:
* Python < 3.12.x - **med-fichier** uses the //imp// module which is __removed__ in Python **3.12**
* Ubuntu <= 22 LTS - one of the Python modules **Rasterio** wants to remove the system-provided **numpy** in Ubuntu >= **24 LTS**, breaking the install
* MED - the version linked by TELEMAC breaks on modern versions of **HDF5** lib, and is unable to correctly extract the version number from ''H5public.h'' - our container definition includes a patch to mitigate this
* libaed - the build is not //parallel make// safe, so we need to restrict //make// to a single job
* GOTM - the build //only// works with the specific version linked from the TELEMAC repository; using a later version direct from GOTM themselves fails with an error during compile
This means that we are effectively 'stuck' on Ubuntu 22, with Python 3.10 until all dependencies are updated and the TELEMAC project updates to work with newer versions.
**Container definition file:**
Bootstrap: docker
####################################################################################################
# Jammy (22 LTS) must be used, as Noble (24 LTS) has Python 3.12 which is too new for some of the Python components
# e.g. med-fichier relies on the Python "imp" module which was *removed* in Python >= 3.12.x
####################################################################################################
From: ubuntu:jammy
##########################################################################
# TELEMAC container defintion file for Apptainer
# ==============================================
#
# See: https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/BUILDING.md
# And: https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/REQUIREMENTS.md
#
# Written for Newcastle University Comet HPC users
# Research Software Engineering team
# https://hpc.researchcomputing.ncl.ac.uk
#
###########################################################################
%post
# Prevent interactive prompts
export DEBIAN_FRONTEND=noninteractive
# Update & install only necessary packages
apt-get update
# Base stuff everything will need
apt-get install -y aptitude wget zip less vim git
# Things for Telemac
apt-get install -y \
build-essential \
ninja-build \
gcc \
g++ \
gfortran \
python3 \
python3-pip \
python-is-python3 \
openmpi-bin \
libopenmpi-dev \
libmetis-dev \
libgdal-dev \
gdal-bin \
cmake \
libopenblas-openmp-dev \
libopenblas64-dev \
libscalapack-openmpi-dev \
libmumps-dev \
libnetcdf-dev \
libnetcdff-dev \
hdf5-tools
# Remove any downloaded package files - so they dont remain in the built image
apt-get clean
##############################################################################
# Set Compiler flags to optimise for Comet CPU hardware and which extras
# we want to install.
##############################################################################
PRODUCTION=1
BUILD_PY=1
BUILD_MED=1
BUILD_LIBAED=1
BUILD_FABM=1
BUILD_GOTM=1
BUILD_TELEMAC=1
# Set compiler flags - dont optimise in testing mode, it just delays the build
if [ "$PRODUCTION" = 1 ]
then
export BASE_CFLAGS="-O3 -march=native -pipe"
export BASE_FCFLAGS="-march=native -pipe -mtune=native -funroll-loops --param max-unroll-times=4 -ffree-line-length-none -O3 -ffast-math"
else
export BASE_CFLAGS="-O"
export BASE_FCFLAGS="-O"
fi
export CPPFLAGS=""
export CFLAGS="$BASE_CFLAGS -I/usr/local/include"
export FCFLAGS="$BASE_FCFLAGS -I/usr/local/include"
export CXXFLAGS="$CFLAGS"
export MAKE_JOBS=16
export MPIFC=mpif90
###############################################################################
# Check versions of installed compilers
###############################################################################
gcc -v
g++ -v
gfortran -v
python3 -V
###############################################################################
# Common stuff...
###############################################################################
mkdir -p /opt
mkdir -p /src/zipped
##############################################################################
# Install Telemac Python dependencies
# See: https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/REQUIREMENTS.md
##############################################################################
if [ "$BUILD_PY" = 1 ]
then
pip3 install mpi4py
pip3 install Jupyter
pip3 install openpyxl
pip3 install OWSLib
pip3 install pandas
pip3 install pyproj
pip3 install Rtree
pip3 install Seaborn
pip3 install GDAL
pip3 install Fiona
pip3 install Rasterio #-- breaks numpy by trying to install a later version, if using Ubuntu 24/Noble LTS
pip3 install Shapely
pip3 install GeoPandas
pip3 install Pylint
pip3 install doxypypy
pip3 install matplotlib
pip3 install scipy
fi
###############################################################################
# Download and compile libaed
##############################################################################
if [ "$BUILD_LIBAED" = 1 ]
then
cd /src/zipped
wget https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/package_files/444/download -O libaed.tgz
cd /src
tar -zxf /src/zipped/libaed.tgz
cd libaed2-1.1.0
make all # Do not use -j, the libaed makefile is not parallel job aware, and it will break the compilation
make shared # As above
cp -v libaed2.a /usr/local/lib
cp -v libaed2.so /usr/local/lib
cp -v include/* /usr/local/include
cp -v *.mod /usr/local/include
fi
###############################################################################
# Download and compile FABM
###############################################################################
if [ "$BUILD_FABM" = 1 ]
then
cd /src/zipped
wget https://github.com/BoldingBruggeman/fabm/archive/refs/tags/v0.95.0.tar.gz -O fabm.tgz
cd /src
tar -zxf /src/zipped/fabm.tgz
cd fabm-0.95.0
cmake -G Ninja -B build -S src -DFABM_USE_DO_CONCURRENT=ON -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build
cmake --build build --target install
fi
###############################################################################
# Download and compile GOTM
###############################################################################
if [ "$BUILD_GOTM" = 1 ]
then
# BROKEN - This is GOTM 5.0.3 as distributed with TELEMAC - but only reports "branch" as the version
#wget https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/package_files/445/download -O gotm-telemac.tgz
# BROKEN - This is GOTM 5.2.1 - compile breaks on "Fatal Error: Cannot open module file 'yaml_types.mod' for reading at (1): No such file or directory"
#wget https://github.com/gotm-model/code/archive/refs/tags/v5.2.1.tar.gz -O gotm.tgz
# This is GOTM Linked from the TELEMAC install guide
cd /src/zipped
wget --no-check-certificate http://www.opentelemac.org/downloads/Installation%20files/Manual%20installation%20-%20Sources/gotm-2019-06-14-opentelemac.tar.gz -O gotm.tgz
cd /src
tar -zxf /src/zipped/gotm.tgz
cd gotm-2019-06-14-opentelemac/
mkdir build
cd build
cmake .. -DGOTM_USE_NetCDF:BOOL=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local
make -j $MAKE_JOBS
make install
#########################################################################
# For some reason libgotm.so does not get installed with "make install"
#########################################################################
cp -v gotmlib/libgotm.so /usr/local/lib
fi
###############################################################################
# Download and compile MED
###############################################################################
if [ "$BUILD_MED" = 1 ]
then
cd /src/zipped
wget https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/package_files/443/download -O med.tgz
cd /src
tar -zxf /src/zipped/med.tgz
cd med-4.1.1
#################################
# PATCH!!!
# The configure script is broken and does not correctly extract the HDF5 version string from H5public.h
# This leads to crazy errors such as:
# "This HDF5 version #define H5_VERS_MAJOR 1.#define H5_VERS_MINOR 10.#define H5_VERS_RELEASE 10 must not be used with med-fichier4.1.1."
# If you look at the H5public.h header, a simple awk would suffice instead.
################################
cp configure configure.orig
cat configure.orig | \
sed "s/H5_VER_MAJOR=/H5_VER_MAJOR=\`grep \'\#define \*H5_VERS_MAJOR\' \$HDF5_ABS_PATH | awk \'{print \$3}\' \` \#/" | \
sed "s/H5_VER_MINOR=/H5_VER_MINOR=\`grep \'\#define \*H5_VERS_MINOR\' \$HDF5_ABS_PATH | awk \'{print \$3}\' \` \#/" | \
sed "s/H5_VER_RELEASE=/H5_VER_RELEASE=\`grep \'\#define \*H5_VERS_RELEASE\' \$HDF5_ABS_PATH | awk \'{print \$3}\' \` \#/" > configure
chmod +x configure
./configure --enable-fortran --enable-api23 --enable-python
make -j $MAKE_JOBS
make install
fi
###############################################################################
# Download and compile Telemac
###############################################################################
if [ "$BUILD_TELEMAC" = 1 ]
then
cd /src
git clone https://gitlab.pam-retd.fr/otm/telemac-mascaret.git
cd telemac-mascaret
git checkout tags/v9.1.1
export PATH=$PWD/scripts/python3:$PATH
export GOTM_INCLUDE_DIR=/usr/local/include
####################################################################################
# PATCH!!!
# The cmake rule files included with TELEMAC do not appear to work with the version
# of GOTM they link to... it finds the library, but returns "" as the version!
# We will spoof the version to always be "5.3.0" instead ...
####################################################################################
cp cmake/FindGOTM.cmake cmake/FindGOTM.cmake.orig
cat cmake/FindGOTM.cmake.orig | \
sed 's/string(REPLACE "v" "" GOTM_VERSION "${GOTM_VERSION}")/set(GOTM_VERSION "5.3.0")/' > cmake/FindGOTM.cmake
cat cmake/FindGOTM.cmake
build_telemac.py \
-j $MAKE_JOBS \
--deps all \
--modules all
build_telemac.py --check
build_telemac.py --install /usr/local
fi
################################################################################
# ld.so.conf configuration
################################################################################
echo "/usr/local/lib" > /etc/ld.so.conf.d/telemac.conf
rm -f /etc/ld.so.cache
ldconfig -v
################################################################################
# We are finished here
################################################################################
cd /
rm -rf /src
pip3 cache purge
%environment
export HWLOC_COMPONENTS="-gl"
%runscript
**Build script:**
#!/bin/bash
echo "Loading modules..."
module load apptainer
echo ""
echo "Building container..."
export APPTAINER_TMPDIR=/scratch
echo ""
echo "Starting build of container ..."
apptainer build \
telemac.sif telemac.def 2>&1 | tee telemac.log
**Runtime wrapper:**
#!/bin/bash
module load apptainer
IMAGE_NAME=/nobackup/shared/containers/telemac.sif
container.run() {
# Run a command inside the container...
# automatically bind the /scratch and /nobackup dirs
# pass through any additional parameters given on the command line
apptainer exec --bind /scratch:/scratch \
--bind /nobackup:/nobackup \
${IMAGE_NAME} $@
}
----
[[:advanced:software|Back to Software]]