grid-config v3.2.3¶
Mercurial revision 5786:5c8b45563631 | 2026-08-04
Description¶
grid-config is a tool designed to set landmask and interpolate topography for a given grid. The processing order is as follows:
Grid building
Set landmask
Interpolate topography
Invert topography
Apply topography threshold
Usage¶
grid-config [OPTIONS] notebookFile
Options¶
General Options¶
Option |
Description |
|---|---|
|
Show help and exit. |
|
Enable debug verbose mode. |
Input/Output Options¶
Option |
Description |
|---|---|
|
Root name for output files. Default: |
|
Path to the notebook file. |
|
Path to the grid file. Disables |
|
|
Landmask Options¶
Option |
Description |
|---|---|
|
Landmask variable name. Disables landmask processing. |
|
Disable mask creation. Disables landmask processing. |
|
Path to a shorelines file. Default: |
|
Path to a landmask polygons file. Disables |
|
Smooth landmask polygons provided with |
|
Force isobath polygon from smoothed shoreline. Default: |
|
Resolution for the smoothing grid in meters. Default: 1/8 of the original grid. |
|
Multiplicative factor for the smoothing length scale. Default: |
|
Reference coordinates for landmask building. Template: |
|
Path to an optional exclusion polygon file. |
|
Ensure landmask polygon is safe. |
|
Keep created pools on landmask. |
|
Increment for grid frontier. Default: |
|
Save smoothed field as a NetCDF file. |
Topography Options¶
Option |
Description |
|---|---|
|
Topography variable name. Disables topography interpolation. |
|
Path to a bathymetry file. Multiple bathymetry files are allowed, ordered by increasing priority. |
|
Disable altitude-to-depth conversion. |
|
Topography values will be constrained above this minimum. Default: |
Interpolation Options¶
Option |
Description |
|---|---|
|
Use averaging interpolation for bathymetry. |
|
Use pointwise interpolation for bathymetry. Default. |
|
Grid variable name at T point. |
|
Grid variable name at F point. |
Examples¶
Basic Grid Configuration¶
Process a notebook file with default settings:
grid-config my_notebook.nc
Custom Output Root Name¶
Set a custom root name for output files:
grid-config -r my_output my_notebook.nc
Use a Grid File Instead of Notebook¶
Process a grid file directly:
grid-config -g my_grid.nc
Disable Landmask Processing¶
Skip landmask processing and use an existing landmask variable:
grid-config -g my_grid.nc -vmask landmask_var
Custom Shorelines File¶
Use a custom shorelines file:
grid-config -n my_notebook.nc -s /path/to/shorelines.cst
Smooth Landmask Polygons¶
Smooth landmask polygons from a polygons file:
grid-config -n my_notebook.nc -p polygons.plg --smooth
Custom Isobath Contour¶
Force an isobath polygon at -0.2 meters:
grid-config -n my_notebook.nc --isocontour -0.2
Custom Smoothing Resolution¶
Set a custom resolution for the smoothing grid:
grid-config -n my_notebook.nc -dx 1000
Exclude Specific Polygons¶
Exclude specific polygons from the landmask:
grid-config -n my_notebook.nc --exclude exclusion.plg
Use Averaging Interpolation¶
Use averaging interpolation for bathymetry:
grid-config -n my_notebook.nc -average
Multiple Bathymetry Files¶
Use multiple bathymetry files with priority ordering:
grid-config -n my_notebook.nc -b bathy1.nc -b bathy2.nc
Disable Altitude-to-Depth Conversion¶
Disable conversion of altitude to depth:
grid-config -n my_notebook.nc -inv
Set Minimum Topography Value¶
Constrain topography values above -5000 meters:
grid-config -n my_notebook.nc -zmin -5000
Reference Coordinates for Landmask¶
Set reference coordinates for landmask building:
grid-config -n my_notebook.nc --point "[2.5;48.0]"
Keep Pools on Landmask¶
Keep created pools on the landmask:
grid-config -n my_notebook.nc --keep-pools
Save Smoothed Field as NetCDF¶
Save the smoothed landmask field as a NetCDF file:
grid-config -n my_notebook.nc --show_map
Environment Variables¶
grid-config does not rely on specific environment variables. However, ensure that:
Input files (notebook, grid, shorelines, bathymetry) are accessible.
Output directories are writable.
Notes¶
Input Files:
The notebook file (
-n) or grid file (-g) is required.If
-gis provided,-nis disabled.If
-vmaskor--no_maskis provided, landmask processing is disabled.If
-vtopois provided, topography interpolation is disabled.
Landmask Processing:
If
-p(polygons file) is not provided, polygons are computed from the shorelines dataset (-s).The
--smoothoption only applies if-pis provided.The
--isocontouroption forces a specific isobath polygon from the smoothed shoreline.
Bathymetry Interpolation:
Multiple bathymetry files (
-b) can be provided. They are processed in reverse order of priority (last file has highest priority).Use
-averageor-pointwiseto switch between interpolation methods.
Topography Constraints:
The
-zminoption ensures topography values do not fall below the specified minimum.The
-invoption disables altitude-to-depth conversion (useful if input data is already in depth units).
Output Files:
Output files are named using the
-rroot name (default:symphonie).Files generated include:
NetCDF files for spherical and mercator coordinates (e.g.,
symphonie.chk.spherical.nc,symphonie.chk.mercator.nc).ASCII files for topography and mask (e.g.,
symphonie.chk.topo.asc,symphonie.chk.mask.asc).SYMPHONIE ASCII file (e.g.,
symphonie.bathycote_in.dat).
Grid Types:
The tool supports both T-grid and F-grid configurations.
Use
-variable_tand-variable_fto specify grid variables at T and F points, respectively.