comodo-filter v3.2.3

Mercurial revision 5770:c90c3015e72d | 2026-05-22


Description

comodo-filter filters comodo-compliant NetCDF files at a given frequency and produces energy atlases. It performs DF-II IIR filtering on the input files and generates:

  • Filtered output data.

  • Energy atlases (if enabled).


Usage

comodo-filter file1 [file2 ...] [OPTIONS]

Options

General Options

Option

Description

-h, --help

Show help and exit.


Input/Output Options

Option

Description

-l <file>

Path to a file containing a list of input files (overrides command-line file list).

-g <file>

Path to the grid file.

-p <prefix>

Output prefix (can be a folder path followed by /). Recommended: Use a different hard drive for filtering to improve performance.

--output <path>

Output path for results.

--path <path>

Path to input data.

--mesh <file>

Path to the mesh file (for unstructured grids).


Filtering Options

Option

Description

-v <var1> [var2 ...]

List of variables to filter.

-w <frequency>

Frequency at which to filter (in deg/h).

-q <value>

Q factor for filtering.

--cut-off <frequency>

Cut-off frequency for filtering.

--frequencies <f1> [f2 ...]

List of frequencies to filter (space-separated).

--half-window <value>

Half-window size for filtering (default: 3.0).

--sampling <value>

Sampling rate for unstructured grids.


Atlas Options

Option

Description

-a

Produce energy atlases.

--only-atlases

Produce only atlases (no filtered output data).

-c <convention>

Convention for input files. Currently without effect.


Control and Grid Options

Option

Description

--control <file>

Path to a file containing control points (ASCII format: number of points followed by longitude latitude [layer]).

--unstructured

Use unstructured grid mode.


Date Options

Option

Description

-s <date>

Start date in dd/mm/yyyy format.

-f <date>

End date in dd/mm/yyyy format.

--time-origin <date>

Default date origin in dd/mm/yyyy format.


Miscellaneous Options

Option

Description

--persistence <value>

Persistence value for filtering.

--convention <name>

Convention name for input files.


Examples

Basic Filtering

Filter variables ssh and tem at frequency M2:

comodo-filter -v ssh tem -w M2 -p output/ file1.nc file2.nc

Filtering with Q Factor

Filter variable ssh at frequency M2 with a Q factor of 10:

comodo-filter -v ssh -w M2 -q 10 -p output/ file1.nc

Filtering with Cut-Off Frequency

Filter variable ssh with a cut-off frequency of 5 deg/h:

comodo-filter -v ssh --cut-off 5 -p output/ file1.nc

Filtering Multiple Frequencies

Filter variable ssh for frequencies M2 and S2:

comodo-filter -v ssh --frequencies M2 S2 -p output/ file1.nc

Generate Energy Atlases Only

Generate atlases without outputting filtered data:

comodo-filter -v ssh -w M2 --only-atlases -p output/ file1.nc

Filtering with Control Points

Filter variable ssh at frequency M2 using control points:

comodo-filter -v ssh -w M2 --control control.dat -p output/ file1.nc

Unstructured Grid Filtering

Filter variable ssh for unstructured grids:

comodo-filter -v ssh --unstructured --mesh mesh.nc --path input/ -p output/

Filtering with Date Range

Filter variable ssh between 01/01/2020 and 31/12/2020:

comodo-filter -v ssh -s 01/01/2020 -f 31/12/2020 -p output/ file1.nc

Environment Variables

comodo-filter uses OpenMP (version 201511) for parallelization. Key environment variables:

Variable

Description

OMP_NUM_THREADS

Number of threads to use.

OMP_SCHEDULE

Runtime schedule type and chunk size.

OMP_DYNAMIC

Enable/disable dynamic thread adjustment.

OMP_NESTED

Enable/disable nested parallelism.

Example:

OMP_NUM_THREADS=6 comodo-filter -v ssh -w M2 -p output/ file1.nc

Note: If running on a busy machine, limit threads to the number of free CPUs to avoid performance degradation.


Notes

  1. Input Files:

  • Must be comodo-compliant NetCDF files.

  • The time variable must follow CF conventions (if applicable).

  1. Output:

  • Filtered files are saved with the specified output prefix (-p).

  • Atlases are generated if -a or --only-atlases is used.

  1. Performance:

  • For large datasets, use -p to output to a different hard drive to avoid I/O bottlenecks.

  • Adjust OMP_NUM_THREADS based on available CPU resources.

  1. Bug:

  • When specifying more than one variable, atlases are not produced. This is a known issue.

  1. Unstructured Grids:

  • Use --unstructured for unstructured grid data. Requires --mesh and --path options.


See Also