Compilation Guide
This page covers all compilation options and the catalogue of built-in test cases. For a first working simulation, start with the Quick Start.
Prerequisites
Section titled “Prerequisites”- GNU Fortran (
gfortran) or Intel Fortran (ifort) - GNU Make
- For MPI runs: an MPI implementation (e.g. OpenMPI, IntelMPI)
Make 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”Tolosa-lct shares the base options with Tolosa-sw and adds several physics-specific flags.
Base options (shared with Tolosa-sw)
Section titled “Base options (shared with Tolosa-sw)”| 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 |
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 |
Tolosa-lct specific flags
Section titled “Tolosa-lct specific flags”| Variable | Default | Description |
|---|---|---|
SURGE | no | NH model variant: no; scalarw = scalar wave energy φ only (no explicit enstrophy); scalar = φ + ψ (required for wave_break_model=2); full = full tensors φ_ij, ψ_ij |
DISP | no | Dispersive correction: yes enables alp-scaled divergence flux (USE_DISP) |
BATHY | no | Bathymetry-dependent NH pressure terms (USE_BATHY) |
COMP | no | Compressible NH correction (USE_COMP) |
ENS | no | Enstrophy-based wave breaking (USE_ENS) |
ALE | no | Active wave generation — ALE method (USE_ALE) |
CNOIDAL | no | L2 error norms against cnoidal reference solution (USE_CNOIDAL) — used only by tests/cnoidal_wave/ |
Example — full NH build with enstrophy wave breaking, MPI and 8 processes:
make C=gnu SURGE=full ENS=yes MPI=yes NP=8 cmrunMPI requires compiling the Scotch partitioning library once before first use:
make MPI=yes extlibmake C=gnu MPI=yes NP=4 mrunAvailable 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 |
|---|---|---|---|---|
soliton_GN_perio | Gmsh box | — | NH | Solitary wave propagating periodically. Tests long-time accuracy and conservation. |
soliton_GN_2_wall | Gmsh box | — | NH | Two solitary waves reflecting off walls. Tests head-on collision symmetry. |
linear_wave | Gmsh box | — | NH | Single linear gravity wave. For dispersion-relation accuracy checks. |
linear_waves_with_topo | Gmsh box | — | NH | Randomised linear waves over rough bathymetry. For convergence studies. |
cnoidal_wave | Gmsh domain | — | NH | Cnoidal wave train propagation. Tests the nonlinear dispersive regime. |
deformed_basin | Gmsh box | 20 s | NH | Soliton perturbations in a deformed basin. Tests NH robustness under complex geometry. |
reflective_wave | Gmsh domain | — | NH | Sinusoidal wave reflecting off a wall. Tests phase and amplitude. |
ale_basin_33 | Gmsh domain | 5 min | NH | Basin oscillation at 33 cm depth. Validates seiche-like NH wave generation. |
ale_basin_100 | Gmsh domain | — | NH | Same as ale_basin_33 at 100 cm depth. |
ale_gen_soliton | Gmsh domain | 5 s | NH | Soliton at an active boundary. Tests directional wave generation. |
ale_gen_by_file | Gmsh box | — | NH | Wave field from an external file-based spectrum. |
wave_forcing | Gmsh domain | 10 min | NH + wave BC | Spectral wave forcing at open boundaries. |
wave_in_out_relax | Gmsh domain | 40 min | NH + relaxation | Wave input and absorption with sponge layers. |
fake_coast | Cartesian | 10 min | NH + friction + Coriolis | Synthetic coastal configuration. |
xp-Beji-Battjes | Gmsh domain | 2 min | NH | Beji & Battjes (1993) submerged bar. Benchmark for shoaling and nonlinear dispersion. |
xp-Buckley | Gmsh domain | 120 s | NH + friction | Buckley runup on a rough slope. Tests wave runup with quadratic friction. |
xp-Vincent-Briggs | Gmsh domain | 60 s | NH | Vincent & Briggs (1989) circular shoal. Tests diffraction and refraction. |
ire | Gmsh (stereographic) | 4 h | NH | Iroise Sea. Tests NH solver on a realistic coastal geometry. |
surge/grilli | Gmsh slope | — | NH + wave breaking | Grilli et al. wave breaking on a slope. Validates breaking model against lab data. |
surge/watanabe_perio | Gmsh domain | — | NH + wave breaking | Watanabe periodic wave breaking. Validates enstrophy dissipation. |