Skip to content

Compilation Guide

This page covers prerequisites, download, compilation options, and the catalogue of built-in test cases. Once compiled, see Simulation Setup to configure and run your first case.

  • GNU Fortran (gfortran) or Intel Fortran (ifort)
  • GNU Make
  • For MPI runs: an MPI implementation (e.g. OpenMPI, IntelMPI)
Terminal window
git clone --recursive https://github.com/TolosaProject/Tolosa-sw.git
cd Tolosa-sw
Terminal window
make C=gnu mrun

This compiles and immediately runs the default test case. The binary is created in bin/ and the simulation runs there.

Terminal window
make MPI=yes extlib # compile the Scotch partitioning library (once)
make C=gnu MPI=yes NP=4 mrun

CommandEffect
make C=gnu mruncompile + run
make C=gnu cmrunclean + compile + run
make C=gnucompile only
make cleanremove compiled objects
make cleanresremove result files
make cleanallclean + cleanres + remove external libs
make supercleancleanall + delete binaries
make helplist all available options

Each variable controls both the Make rule and the corresponding C preprocessor flag.

VariableDefaultDescription
CgnuCompiler: gnu (gfortran) or intel (ifort)
DEBnoDebug mode: yes enables -Wall -Wextra -fcheck=all -fbacktrace
OPTyesOptimization: no disables -O3 flags
MPInoMPI parallelism: yes
NP4Number of MPI processes
NETCDFnoNetCDF I/O support
OASISnoOASIS coupler support (implies MPI=yes and NETCDF=yes)
REORDERnoMesh reordering via Scotch (always active when MPI=yes)
PERIOnoPeriodic boundary conditions — required whenever any BC is periodic
SORTindSort algorithm: ind (stdlib), std, cxx (C++ std::sort)

Example — debug build with MPI and 8 processes:

Terminal window
make C=gnu DEB=yes MPI=yes NP=8 cmrun

Test cases live in tests/. Copy input.txt and m_user_data.f90 to bin/ and run make C=gnu mrun.

DirectoryMeshDurationPhysicsDescription
1d_dambreak_slope_wdCartesian 1D12 minDam-break on a sloped channel with sinusoidal bathymetry. Tests wet/dry front propagation.
2d_bowl_cyldGmsh disk10 sParabolic bowl (Thacker’s rotating solution). Tests conservation and symmetry on a circular mesh.
2d_fake_atlGmsh box4 hquadratic friction + z0, tidal SSH BCSynthetic ocean with randomised Gaussian bathymetry (~1000 m depth). Tests a realistic open-ocean setup.
2d_fake_atl_with_beachGmsh box4 hquadratic friction + z0, tidal SSH BCSame as above with a beach profile. Tests wet/dry fronts in a tide-forced setting.
2d_fake_girondeGmsh estuary24 hManning friction, tidal SSH BCIdealised estuary inspired by the Gironde. Tests river/estuary tidal dynamics.
2d_gaussian_forestGmsh box2 minPeriodic domain with randomised Gaussian SSH over randomised bathymetry.
2d_linear_wavesGmsh boxSuperposition of 100 randomised linear gravity waves. For convergence/accuracy studies.
2d_secheGmsh boxSmall-amplitude wave over rough Gaussian bathymetry. Tests near-linear long-wave propagation.