Code and tools to edit and manipulate ocean model grids and topographies.
Below is a list of included tools and short documentation for each.
Note: these tools support two types of vertical grids: MOM5 grids (with
usage: topogtools [--help] <command> [<args>]
Collection of tools to edit and manipulate ocean model topographies.
See topogtools --help <command>
to read about a specific subcommand.
Available commands:
gen_topo
- Generate a new topography file from a bathymetrydeseas
- Remove enclosed seasmin_max_depth
- Set minimum and maximum depthcheck_nonadvective
- Check for non-advective cellsfix_nonadvective
- Fix non-advective cellsmask
- Generate mask
usage: topogtools gen_topo --input <input_file> --output <output_file>
--hgrid <grid> [<options>]
Generate a new topography from <input_file>
on the tracer points of <grid>
and
writes the result to <output_file>
. Note that <grid>
must be a super-grid.
Options
--tripolar
set this option if the horizontal grid is a tripolar grid--longitude-offset <value>
offset (in degrees) between the central longitude of the ocean horizontal grid and of the bathymetry grid (default '0.0')
usage: topogtools deseas --input <input_file> --output <output_file>
Remove enclosed seas from <input_file> and writes the result to <output_file>.
usage: topogtools min_max_depth --input <input_file> --output <output_file>
--level <level>
[--vgrid <vgrid> --vgrid_type <type>]
Set minimum depth to the depth at a specified level and set maximum depth to
deepest in <vgrid>
. <level>
is the minimum number of depth levels (e.g. 4).
Can produce non-advective cells.
Options
--vgrid <vgrid>
vertical grid (default 'ocean_vgrid.nc')--vgrid_type <type>
can be mom5 or mom6 (default 'mom5')
usage: topogtools fill_fraction --input <input_file> --output <output_file>
--fraction <frac>
Cells with a fraction of sea area smaller than will have their depth set to zero. Can produce non-advective cells and/or new seas.
usage: topogtools check_nonadvective --input <input_file>
[--vgrid <vgrid> --vgrid_type <type>
--potholes --coastal-cells]
Check for non-advective cells. There are two types of checks available: potholes and non-advective coastal cells. Checking for non-advective coastal cells should only be needed when using a B-grid.
Options
--vgrid <vgrid>
vertical grid (default 'ocean_vgrid.nc')--vgrid_type <type>
can be mom5 or mom6 (default 'mom5')--potholes
check for potholes--coastal-cells
check for non-advective coastal cells
usage: topogtools fix_nonadvective --input <input_file> --output <output_file>
[--vgrid <vgrid> --vgrid_type <type>
--potholes --coastal-cells]
Fix non-advective cells. There are two types of fixes available: potholes and non-advective coastal cells. Fixes to non-advective coastal cells should only be needed when using a B-grid.
Options
--vgrid <vgrid>
vertical grid (default 'ocean_vgrid.nc')--vgrid_type <type>
can be mom5 or mom6 (default 'mom5')--potholes
fix potholes--coastal-cells
fix non-advective coastal cells
usage: topogtools mask --input <input_file> --output <output_file>
[--fraction <frac>]
Creates a land mask from a topography.
Options
--fraction <frac>
cells with a fraction of sea area smaller than<frac>
will be set as land (default '0.0')
usage: float_vgrid [--vgrid <vgrid>]
Alter values in ocean vertical grid so they can be used with both single- and double-precision topography file.
Options
--vgrid <vgrid>
vertical grid (default 'ocean_vgrid.nc')
To compile these tools one needs:
- Fortran compiler
- netCDF-Fortran
- CMake
domain-tools
uses CMake for building and installation. Therefore the procedure
to build the sources and install the executables is fairly standard:
git clone https://github.com/COSIMA/domain-tools.git
cd domain-tools
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build --prefix=<directory where to install the tools>
An installation of these tools is available on Gadi. To use it, you need to be a
member of group ik11
and load the corresponding module:
module use /g/data/ik11/spack/modules
module load domain-tools
If instead you wish to build and install the tools from the sources, you can follow a slighly modified version of above step-be-step instructions:
module load intel-compiler netcdf
export NetCDF_ROOT=$(nc-config --prefix)
git clone https://github.com/COSIMA/domain-tools.git
cd domain-tools
cmake -B build -DCMAKE_BUILD_TYPE=Release -DNetCDF_Fortran_LIBRARY=$NetCDF_ROOT/lib/Intel/libnetcdff.so -DNetCDF_C_LIBRARY=$NetCDF_ROOT/lib/libnetcdf.so -DNetCDF_Fortran_INCLUDE_DIRS=$NetCDF_ROOT/include/Intel
cmake --build build
cmake --install build --prefix=<directory where to install the tools>