Skip to content

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.

  • GNU Fortran (gfortran) or Intel Fortran (ifort)
  • GNU Make
  • For MPI runs: an MPI implementation (e.g. OpenMPI, IntelMPI)

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

Tolosa-lct shares the base options with Tolosa-sw and adds several physics-specific flags.

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
REORDERnoMesh reordering via Scotch (always active when MPI=yes)
PERIOnoPeriodic boundary conditions — required whenever any BC is periodic
SORTindSort algorithm: ind (stdlib), std, cxx
VariableDefaultDescription
SURGEnoNH model variant: no; scalarw = scalar wave energy φ only (no explicit enstrophy); scalar = φ + ψ (required for wave_break_model=2); full = full tensors φ_ij, ψ_ij
DISPnoDispersive correction: yes enables alp-scaled divergence flux (USE_DISP)
BATHYnoBathymetry-dependent NH pressure terms (USE_BATHY)
COMPnoCompressible NH correction (USE_COMP)
ENSnoEnstrophy-based wave breaking (USE_ENS)
ALEnoActive wave generation — ALE method (USE_ALE)
CNOIDALnoL2 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:

Terminal window
make C=gnu SURGE=full ENS=yes MPI=yes NP=8 cmrun

MPI requires compiling the Scotch partitioning library once before first use:

Terminal window
make MPI=yes extlib
make C=gnu MPI=yes NP=4 mrun

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

DirectoryMeshDurationPhysicsDescription
soliton_GN_perioGmsh boxNHSolitary wave propagating periodically. Tests long-time accuracy and conservation.
soliton_GN_2_wallGmsh boxNHTwo solitary waves reflecting off walls. Tests head-on collision symmetry.
linear_waveGmsh boxNHSingle linear gravity wave. For dispersion-relation accuracy checks.
linear_waves_with_topoGmsh boxNHRandomised linear waves over rough bathymetry. For convergence studies.
cnoidal_waveGmsh domainNHCnoidal wave train propagation. Tests the nonlinear dispersive regime.
deformed_basinGmsh box20 sNHSoliton perturbations in a deformed basin. Tests NH robustness under complex geometry.
reflective_waveGmsh domainNHSinusoidal wave reflecting off a wall. Tests phase and amplitude.
ale_basin_33Gmsh domain5 minNHBasin oscillation at 33 cm depth. Validates seiche-like NH wave generation.
ale_basin_100Gmsh domainNHSame as ale_basin_33 at 100 cm depth.
ale_gen_solitonGmsh domain5 sNHSoliton at an active boundary. Tests directional wave generation.
ale_gen_by_fileGmsh boxNHWave field from an external file-based spectrum.
wave_forcingGmsh domain10 minNH + wave BCSpectral wave forcing at open boundaries.
wave_in_out_relaxGmsh domain40 minNH + relaxationWave input and absorption with sponge layers.
fake_coastCartesian10 minNH + friction + CoriolisSynthetic coastal configuration.
xp-Beji-BattjesGmsh domain2 minNHBeji & Battjes (1993) submerged bar. Benchmark for shoaling and nonlinear dispersion.
xp-BuckleyGmsh domain120 sNH + frictionBuckley runup on a rough slope. Tests wave runup with quadratic friction.
xp-Vincent-BriggsGmsh domain60 sNHVincent & Briggs (1989) circular shoal. Tests diffraction and refraction.
ireGmsh (stereographic)4 hNHIroise Sea. Tests NH solver on a realistic coastal geometry.
surge/grilliGmsh slopeNH + wave breakingGrilli et al. wave breaking on a slope. Validates breaking model against lab data.
surge/watanabe_perioGmsh domainNH + wave breakingWatanabe periodic wave breaking. Validates enstrophy dissipation.