# mesh-upgrade v3.2.3 **Mercurial revision 5786:5c8b45563631 | 2026-08-04** --- ## Description The `mesh-upgrade` tool refines, resamples, or subdivides edges of an existing mesh based on user-defined criteria. It is designed to improve mesh quality, handle polar regions, and ensure connectivity for unstructured ocean grids. --- ## Usage ```bash mesh-upgrade [OPTIONS] [-o ] [-p ] [-c ] [-m ] [-d ] [-e ] [-z ] ``` --- ## Options | Option | Description | |--------|-------------| | `-h, --help` | Display this help message and exit. | | `-m ` | Mesh file (.nei format). Use mesh-format to convert other grid format. | | `-p ` | Polygon file use to limit the woking area (--subdivide) or rework the mesh edge (--exact, --limited) . | | `-c ` | Criteria file for meshing rules. | | `-o ` | Final output mesh file. Default: `mesh-upgrade.nei` | | `--subdivide` | Subdivide rigid boundaries based on criteria. | | `--resample` | Enable boundary resampling. | | `--exact` | Deform original mesh to excatly fit the polygon in mesh splitting. | | `--limited` | Limit the merge of splitted meshes to the boundary of the main one. | | `--polar` | Enandle specific routines to handle polar grid. | | `--debug` | Enable debug verbose mode.| --- ## Examples 1. **Basic mesh refinement**: ```bash mesh-upgrade input_mesh.nei -o refined_mesh.nei ``` 2. **Refine with custom criteria**: ```bash mesh-upgrade input_mesh.nei -c criteria.crt -o refined_mesh.nei ``` 3. **Enable polar handling and debug mode**: ```bash mesh-upgrade input_mesh.nei --polar --debug -o polar_refined_mesh.nei ``` 4. **Subdivide rigid boundaries**: ```bash mesh-upgrade input_mesh.nei --subdivide -p boundaries.plg -o subdivided_mesh.nei ``` --- ## Environment Variables None. --- ## Notes - The tool requires a valid **mesh file** (``) as input. - If no output file is specified, the default output filename is `mesh-upgrade.nei`. - The `--polar` option is essential for handling meshes in polar regions (e.g., Antarctic or Arctic). - Debug mode (`--debug`) provides detailed logs for troubleshooting. --- ## See Also - [T-UGOm Documentation](https://t-ugom.example.com) - [SIROCCO National Service](https://sirocco.example.com) - [Mesh Generation Criteria](https://mesh-criteria.example.com) ```