comodo-compliance v3.2.3

Mercurial revision 5770:c90c3015e72d | 2026-05-22


Description

comodo-compliance is a tool to test the compliance of NetCDF files with the COMODO standards (based on CF Conventions).

It checks whether a given NetCDF file and its specified variables adhere to the expected grid and metadata structure. If the input file is a .grd file, the variable names are automatically prepended with z.


Usage

comodo-compliance [OPTIONS] file1 var11 [var12 ...] [file2 var21 [var22 ...] ...]

Options

Option

Description

-h, --help

Display this help message and exit.

-v

Enable verbose mode for detailed output.


Examples

Basic Compliance Check

Check compliance for a single file and variable:

comodo-compliance file.nc ssh

Check Multiple Variables in One File

Check compliance for multiple variables in a single file:

comodo-compliance file.nc ssh tem sal

Check Multiple Files with Variables

Check compliance for multiple files, each with its own variables:

comodo-compliance file1.nc ssh tem file2.nc sal

Check a .grd File

For .grd files, the variable names are automatically prepended with z:

comodo-compliance grid.grd elevation

Note: The tool internally processes this as z_elevation.

Verbose Mode

Enable verbose mode for detailed compliance reports:

comodo-compliance -v file.nc ssh

Environment Variables

comodo-compliance does not use any specific environment variables. However, it relies on standard system libraries for NetCDF file handling.


Notes

  1. Input Files:

  • Must be NetCDF files (.nc or .grd).

  • For .grd files, variable names are automatically prepended with z.

  1. Variable Specification:

  • Variables must be specified after their respective file.

  • Example: comodo-compliance file1.nc var1 file2.nc var2.

  1. Error Handling:

  • If no file is provided, the tool displays the help message and exits.

  • If a variable is specified without a preceding file, the tool aborts with an error.

  1. Correcting Files:

  • Use NCO (NetCDF Operators) to correct non-compliant files. For example:

  • Options for ncatted:

    • att: Attribute name.

    • var: Variable name (use global for global attributes).

    • mode: One of a (append), c (create), d (delete), m (modify), or o (overwrite).

    • type: One of f (float), d (double), l (long), s (short), c (char), or b (byte).

    • -O: Overwrite the input file.


See Also