# 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 ```bash comodo-filter file1 [file2 ...] [OPTIONS] ``` --- ## Options ### **General Options** | Option | Description | | -------------- | ------------------- | | `-h`, `--help` | Show help and exit. | --- ### **Input/Output Options** | Option | Description | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `-l ` | Path to a file containing a list of input files (overrides command-line file list). | | `-g ` | Path to the grid file. | | `-p ` | Output prefix (can be a folder path followed by `/`). **Recommended:** Use a different hard drive for filtering to improve performance. | | `--output ` | Output path for results. | | `--path ` | Path to input data. | | `--mesh ` | Path to the mesh file (for unstructured grids). | --- ### **Filtering Options** | Option | Description | | ----------------------------- | ------------------------------------------------ | | `-v [var2 ...]` | List of variables to filter. | | `-w ` | Frequency at which to filter (in deg/h). | | `-q ` | Q factor for filtering. | | `--cut-off ` | Cut-off frequency for filtering. | | `--frequencies [f2 ...]` | List of frequencies to filter (space-separated). | | `--half-window ` | Half-window size for filtering (default: `3.0`). | | `--sampling ` | Sampling rate for unstructured grids. | --- ### **Atlas Options** | Option | Description | | ----------------- | --------------------------------------------------------- | | `-a` | Produce energy atlases. | | `--only-atlases` | Produce **only** atlases (no filtered output data). | | `-c ` | Convention for input files. **Currently without effect.** | --- ### **Control and Grid Options** | Option | Description | | ------------------ | ------------------------------------------------------------------------------------------------------------------- | | `--control ` | 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 ` | Start date in `dd/mm/yyyy` format. | | `-f ` | End date in `dd/mm/yyyy` format. | | `--time-origin ` | Default date origin in `dd/mm/yyyy` format. | --- ### **Miscellaneous Options** | Option | Description | | ----------------------- | -------------------------------- | | `--persistence ` | Persistence value for filtering. | | `--convention ` | Convention name for input files. | --- ## Examples ### **Basic Filtering** Filter variables `ssh` and `tem` at frequency `M2`: ```bash 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`: ```bash 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`: ```bash comodo-filter -v ssh --cut-off 5 -p output/ file1.nc ``` ### **Filtering Multiple Frequencies** Filter variable `ssh` for frequencies `M2` and `S2`: ```bash comodo-filter -v ssh --frequencies M2 S2 -p output/ file1.nc ``` ### **Generate Energy Atlases Only** Generate atlases without outputting filtered data: ```bash 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: ```bash comodo-filter -v ssh -w M2 --control control.dat -p output/ file1.nc ``` ### **Unstructured Grid Filtering** Filter variable `ssh` for unstructured grids: ```bash 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`: ```bash 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:** ```bash 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). 2. **Output:** - Filtered files are saved with the specified output prefix (`-p`). - Atlases are generated if `-a` or `--only-atlases` is used. 3. **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. 4. **Bug:** - When specifying **more than one variable**, atlases are **not produced**. This is a known issue. 5. **Unstructured Grids:** - Use `--unstructured` for unstructured grid data. Requires `--mesh` and `--path` options. --- ## See Also - [CF Conventions](http://cfconventions.org/cf-conventions/cf-conventions.html) (for time coordinates) - [OpenMP Documentation](https://www.openmp.org/) (for parallelization options)