# 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 ```bash mesh-zmin [OPTIONS] -m mesh_file topo_file ``` --- ## Options | Option | Description | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `-h`, `--help` | Show this help and exit. | | `-m ` | **Required.** Path to the mesh file (e.g., `mesh.nei`). | | `-o ` | Output rootname. Default: `topo`. | | `-b ` | 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 `-zmin_bathy.s2r` file. | | `-p ` | Path to the polygon file to limit the working area. Outputs a `-zmin_polygon.s2r` file. | | `-hmin ` | 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: ```bash 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: ```bash 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: ```bash 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. 2. **Output Files:** - If `-b` is used, the tool generates a `-zmin_bathy.s2r` file. - If `-p` is used, the tool generates a `-zmin_polygon.s2r` file. - If no `-o` is specified, the default output rootname is `topo`. 3. **Minimal Depth (`-hmin`):** - Only applies if `-b` or `-p` is specified. - Default value: `2 meters`. 4. **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 - [Mesh File Formats](https://www.comodo-ocean.fr/) (for compatible mesh file formats) - [Bathymetry Data Standards](https://www.ngdc.noaa.gov/mgg/bathymetry/) (for bathymetry file requirements)