Skip to content

External Input Files

This page documents every external file that Tolosa-sw reads at runtime, beyond input.txt and m_user_data.f90. All files are resolved relative to the run directory (bin/) via pathto().


Tolosa-sw uses paired .a / .b files for structured binary data:

  • .a — binary data file. Typically direct-access Fortran unformatted, 4-byte (single-precision) real values unless noted.
  • .b — text index file. Contains metadata: number of records, dates, field names, dimensions.
  • Endianness — big-endian by default for most ocean-origin files (e.g. tidal constituents, grid files); little-endian for atmospheric forcing. Controlled by endian_forcing, endian_ssht in input.txt.

FileRequired whenFormatEndian
regional.grid-node.aoptional — lon/lat per cellbinary indexed, 4-byte floatsbig (hardcoded)
regional.depth-ele.abathy_in = 2binary indexed, 4-byte floatsauto
bc_<name>.txtBC type q/q(t), ssh/ssh(t), h/h(t)formatted text, time-value pairs
tide.listtidal BC or tbf_forcing > 0formatted text, one constituent per line
forcing.<name>tide.a / .bconstituent in tide.listbinary direct-access, 4-byte floats / text indexbig
ssht_edge_at_bc.a / .bssht BC or ssht/tidebinary stream / text index (CNES Julian days)endian_ssht
forcing.msl / .bpatm_forcing > 0binary indexed, 4-byte floats / text indexendian_forcing
prmsl_ref.apatm_ref_var = 1binary indexed, 4-byte floatsauto
forcing.usst / .bwind_forcing > 0binary indexed, 4-byte floats / text indexendian_forcing
forcing.vsst / .bwind_forcing > 0binary indexed, 4-byte floats / text indexendian_forcing
bottom_fric_qua.afriction_model = 1 or 2 (optional)binary indexed, 4-byte floatsauto
bottom_fric_z0.afriction_model = 2 (optional)binary indexed, 4-byte floatsauto
bottom_fric_lin.afriction_model > 0 (optional)binary indexed, 4-byte floatsauto
bottom_fric_manning.afriction_model = 3 (optional)binary indexed, 4-byte floatsauto
restart.binrestart = 1binary stream, native endiannative

bc_<name>.txt — time series for q(t), ssh(t), h(t)

Section titled “bc_<name>.txt — time series for q(t), ssh(t), h(t)”

Plain text, two columns: time (seconds) and BC value. Linear interpolation applied between records.

$ q(t)
0. 100.
3600. 200.
7200. 250.
10800. 300.

The <name> matches the Gmsh physical group name (Gmsh mesh) or the tag set in bc_N/S/W/E (Cartesian mesh).


One constituent per line after a --- separator:

---
M2 255555 28.98410420 0.9081 0.037 349.0 0.000 0.0
S2 273555 30.00000000 0.4227 0.000 0.0 0.000 0.0
K1 165555 15.04106864 0.5305 0.115 45.0 -0.115 -45.0

Columns: name doodson vit_ang(°/h) coef_pot c1 k1 c2 k2

For each constituent <name> listed, the pair forcing.<name>tide.a / forcing.<name>tide.b must be present in bin/. Constituents are loaded individually — only those found on disk are activated.


forcing.<name>tide.a / .b — tidal harmonic amplitudes

Section titled “forcing.<name>tide.a / .b — tidal harmonic amplitudes”

Binary direct-access, big-endian, 4-byte floats. The .b text index specifies the number of boundary edges and the harmonic coefficients (amplitude and phase per edge). Used for both open boundary tidal forcing (tide BC) and tidal body forces (tbf_forcing).


ssht_edge_at_bc.a / .b — spatially-varying SSH time series

Section titled “ssht_edge_at_bc.a / .b — spatially-varying SSH time series”
  • .b — text file listing CNES Julian day dates, one per line
  • .a — binary stream, endian_ssht (default little). Stores one record per date: SSH value per open boundary edge (4-byte floats)

Two consecutive records are held in memory and linearly interpolated at each time step. Can be combined with tidal BCs (ssht/tide) — contributions are summed.


forcing.msl / .b — atmospheric mean sea level pressure

Section titled “forcing.msl / .b — atmospheric mean sea level pressure”

Binary direct-access, 4-byte floats, endianness set by endian_forcing (default little). Required when patm_forcing > 0. The .b index provides record dates and grid dimensions.

prmsl_ref.a — spatially variable reference pressure

Section titled “prmsl_ref.a — spatially variable reference pressure”

Required when patm_ref_var = 1. Same format as forcing.msl, auto-detected endianness. Provides the spatially variable background pressure subtracted from forcing.msl before computing the pressure gradient.

forcing.usst / .b and forcing.vsst / .b — wind stress

Section titled “forcing.usst / .b and forcing.vsst / .b — wind stress”

Binary direct-access, 4-byte floats, endianness from endian_forcing. Required when wind_forcing > 0. Stores the x and y components of the surface wind stress (Pa) at each cell, per time record.


regional.grid-node.a — longitude / latitude per cell

Section titled “regional.grid-node.a — longitude / latitude per cell”

Optional. Big-endian (hardcoded), binary indexed, 4-byte floats. When present, enables Coriolis with spatially variable f (coriolis = 1) and activates lon/lat output fields in VTK/Tecplot.

Layout: one record per cell, storing (longitude, latitude) in degrees.

regional.depth-ele.a — external bathymetry

Section titled “regional.depth-ele.a — external bathymetry”

Required when bathy_in = 2. Auto-detected endianness, binary indexed, 4-byte floats. Provides seafloor elevation (positive upward) per mesh node, bypassing bathy_user() in m_user_data.f90.


All friction files are optional. If absent, the uniform values from input.txt (cb, cl, z0, n) are used instead. Files must be binary indexed, 4-byte floats, auto-detected endianness.

FileFriction modelQuantity stored
bottom_fric_qua.afriction_model = 1 or 2Spatially variable cb (quadratic coefficient)
bottom_fric_z0.afriction_model = 2Spatially variable z0 (roughness length, m)
bottom_fric_lin.afriction_model > 0Spatially variable cl (linear coefficient)
bottom_fric_manning.afriction_model = 3Spatially variable Manning n

One value per mesh cell, stored as a single direct-access record.


Fortran unformatted binary stream, native endianness. Written at intervals set by dt_restart in input.txt. To restart from it, set restart = 1.

Contains the full model state (h, hu, hv) per cell at the saved time, plus simulation metadata (time, step number).