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.
Prerequisites
Section titled “Prerequisites”- GNU Fortran (
gfortran) or Intel Fortran (ifort) - GNU Make
- For MPI runs: an MPI implementation (e.g. OpenMPI, IntelMPI)
Download
Section titled “Download”git clone --recursive https://github.com/TolosaProject/Tolosa-sw.gitcd Tolosa-swFirst Run (sequential)
Section titled “First Run (sequential)”make C=gnu mrunThis compiles and immediately runs the default test case. The binary is created in bin/ and the simulation runs there.
First Run (MPI, 4 processes)
Section titled “First Run (MPI, 4 processes)”make MPI=yes extlib # compile the Scotch partitioning library (once)make C=gnu MPI=yes NP=4 mrunMake Shortcuts
Section titled “Make Shortcuts”| Command | Effect |
|---|---|
make C=gnu mrun | compile + run |
make C=gnu cmrun | clean + compile + run |
make C=gnu | compile only |
make clean | remove compiled objects |
make cleanres | remove result files |
make cleanall | clean + cleanres + remove external libs |
make superclean | cleanall + delete binaries |
make help | list all available options |
Compilation Options
Section titled “Compilation Options”Each variable controls both the Make rule and the corresponding C preprocessor flag.
| Variable | Default | Description |
|---|---|---|
C | gnu | Compiler: gnu (gfortran) or intel (ifort) |
DEB | no | Debug mode: yes enables -Wall -Wextra -fcheck=all -fbacktrace |
OPT | yes | Optimization: no disables -O3 flags |
MPI | no | MPI parallelism: yes |
NP | 4 | Number of MPI processes |
NETCDF | no | NetCDF I/O support |
OASIS | no | OASIS coupler support (implies MPI=yes and NETCDF=yes) |
REORDER | no | Mesh reordering via Scotch (always active when MPI=yes) |
PERIO | no | Periodic boundary conditions — required whenever any BC is periodic |
SORT | ind | Sort algorithm: ind (stdlib), std, cxx (C++ std::sort) |
Example — debug build with MPI and 8 processes:
make C=gnu DEB=yes MPI=yes NP=8 cmrunAvailable Test Cases
Section titled “Available Test Cases”Test cases live in tests/. Copy input.txt and m_user_data.f90 to bin/ and run make C=gnu mrun.
| Directory | Mesh | Duration | Physics | Description |
|---|---|---|---|---|
1d_dambreak_slope_wd | Cartesian 1D | 12 min | — | Dam-break on a sloped channel with sinusoidal bathymetry. Tests wet/dry front propagation. |
2d_bowl_cyld | Gmsh disk | 10 s | — | Parabolic bowl (Thacker’s rotating solution). Tests conservation and symmetry on a circular mesh. |
2d_fake_atl | Gmsh box | 4 h | quadratic friction + z0, tidal SSH BC | Synthetic ocean with randomised Gaussian bathymetry (~1000 m depth). Tests a realistic open-ocean setup. |
2d_fake_atl_with_beach | Gmsh box | 4 h | quadratic friction + z0, tidal SSH BC | Same as above with a beach profile. Tests wet/dry fronts in a tide-forced setting. |
2d_fake_gironde | Gmsh estuary | 24 h | Manning friction, tidal SSH BC | Idealised estuary inspired by the Gironde. Tests river/estuary tidal dynamics. |
2d_gaussian_forest | Gmsh box | 2 min | — | Periodic domain with randomised Gaussian SSH over randomised bathymetry. |
2d_linear_waves | Gmsh box | — | — | Superposition of 100 randomised linear gravity waves. For convergence/accuracy studies. |
2d_seche | Gmsh box | — | — | Small-amplitude wave over rough Gaussian bathymetry. Tests near-linear long-wave propagation. |