mesh-zmin v3.2.3

Mercurial revision 5786:5c8b45563631 | 2026-08-04


Description

mesh-zmin applies a minimal depth to the topographic file of a mesh. This tool ensures that shallow depths in the mesh are adjusted according to a specified minimum threshold, optionally using a bathymetry file or a polygon file to limit the working area.


Usage

mesh-zmin [OPTIONS] -m mesh_file topo_file

Options

Option

Description

-h, --help

Show this help and exit.

-m <file>

Required. Path to the mesh file (e.g., mesh.nei).

-o <rootname>

Output rootname. Default: topo.

-b <file>

Path to the bathymetry file. If provided, mesh depths shallower than zmin are replaced by this bathymetry if it is deeper than zmin. Outputs a <output>-zmin_bathy.s2r file.

-p <file>

Path to the polygon file to limit the working area. Outputs a <output>-zmin_polygon.s2r file.

-hmin <value>

Minimal depth in meters. Default: 2. Used only if -b or -p is specified.


Examples

Apply Minimal Depth Using Bathymetry

Apply a minimal depth of 0.5 meters using a bathymetry file:

mesh-zmin -m mesh.nei -b bathymetry.grd -hmin 0.5 topo-00.s2r

Apply Minimal Depth Using Polygon

Apply a minimal depth of 0.5 meters within a polygon-defined area:

mesh-zmin -m mesh.nei -p polygon.plg -hmin 0.5 topo-00.s2r

Default Minimal Depth

Apply the default minimal depth (2 meters) using a bathymetry file:

mesh-zmin -m mesh.nei -b bathymetry.grd topo-00.s2r

Environment Variables

This tool does not use any specific environment variables.


Notes

  1. Input Files:

  • The -m option is required to specify the mesh file.

  • The topo_file argument is mandatory and represents the input topographic file to process.

  1. Output Files:

  • If -b is used, the tool generates a <output>-zmin_bathy.s2r file.

  • If -p is used, the tool generates a <output>-zmin_polygon.s2r file.

  • If no -o is specified, the default output rootname is topo.

  1. Minimal Depth (-hmin):

  • Only applies if -b or -p is specified.

  • Default value: 2 meters.

  1. Error Handling:

  • If the mesh file is not specified, the tool will abort with an error.

  • If the bathymetry file cannot be loaded, the tool will exit with an error.


See Also