# mesh2restart2d v3.2.3 **Mercurial revision 5786:5c8b45563631 | 2026-08-04** --- ## Description `mesh2restart2d` reformats **simulation output files** into **restart files** for further processing or analysis. It prepares the necessary data structures (mesh, bathymetry, and state variables) and saves them in the specified output format. --- ## Usage ```bash mesh2restart2d [OPTIONS] ``` --- ## Options | Option | Description | | -------------- | -------------------------------------------------------------------------- | | `-h`, `--help` | Display this help message and exit. | | `-m ` | **Mesh file**: Path to the input mesh file (required). | | `-b ` | **Bathymetry file**: Path to the input bathymetry file (required). | | `-t ` | **Restart time**: Time of the restart in seconds since **2004/12/01**. | | `-s ` | **Time shift**: Shift the restart time by the specified number of seconds. | | `-0` | **CLS format**: Activate the CLS output format. | | `-1` | **CDF format**: Activate the CDF output format. | > **Deprecated Options** > | `-o ` | **Deprecated**: Rootname for the output file. Use `` instead. | --- ## Examples ### **Basic Usage (CLS Format)** Reformat simulation outputs into a CLS restart file: ```bash mesh2restart2d -m mesh_file.nc -b bathymetry_file.nc -t 3600 -s 100 -0 /path/to/inputs ``` ### **Basic Usage (CDF Format)** Reformat simulation outputs into a CDF restart file: ```bash mesh2restart2d -m mesh_file.nc -b bathymetry_file.nc -t 7200 -1 /path/to/inputs ``` ### **With Time Shift** Apply a time shift of 500 seconds to the restart file: ```bash mesh2restart2d -m mesh_file.nc -b bathymetry_file.nc -t 3600 -s 500 -0 /path/to/inputs ``` --- ## Environment Variables None. --- ## Notes 1. **Required Files**: - A **mesh file** (`-m`) and a **bathymetry file** (`-b`) are **mandatory** for execution. - The `` argument is required to specify where the restart files will be saved. 2. **Time Reference**: - The restart time (`-t`) is specified in **seconds since 2004/12/01 00:00:00**. Ensure this aligns with your simulation's time reference. 3. **Output Formats**: - Use `-0` for **CLS format** or `-1` for **CDF format**. The default behavior depends on the implementation if neither is specified. 4. **Time Shift**: - The `-s` option allows you to adjust the restart time by a specified number of seconds. This is useful for synchronizing with other datasets or simulations. 5. **Error Handling**: - If the mesh or bathymetry file is missing, the program will **abort** with an error message. - The output directory must be **writable**; otherwise, the program will fail. --- ## See Also - [NetCDF CF Conventions](http://cfconventions.org/) (for compatible file formats) - [CLS Format Documentation](https://www.cls.fr/) (if applicable) - [CDF Format Documentation](https://www.unidata.ucar.edu/software/netcdf/) (if applicable)