reduce-v2 v3.2.3

Mercurial revision 5786:5c8b45563631 | 2026-08-04


Description

reduce-v2 is a tool used to filter Mog2D archives using a Lanczos time filter. It is developed and used by CTOH (Centre de Topographie des Océans et de l’Hydrosphère). The tool computes and writes clx-formatted filtered Mog2D archives.


Usage

reduce-v2 [OPTIONS]

Options

Note: If a default is not specified, the option is mandatory.

Input/Output Options

Option

Description

-h <name>

Root name for elevation archives. Default: analysis.

-p <name>

Root name for pressure archives. Default: forcing.

-iF <format>, -f <format>

Input archive format: clx or cdf.

-oF <format>

Output archive format: clx or cdf.

-i <path>

Path for input archives. Default: ./.

-o <path>

Path for output filtered archives. Default: ./.


Filtering Options

Option

Description

-w <days>

Filtering window in days. Default: 20.0.

-start <MM/YYYY>

Starting month for filtering request.

-end <MM/YYYY>

Ending month for filtering request.

-r <int>

Ratio factor for archive reduction. Default: 1.

-m <method>

Detiding method to remove S2 signal: analysis, climatology, or none. Default: analysis.

--pressure-only

Skip elevation processing.

--ssh-only

Skip pressure processing.

-hf

Also remove high-frequency signals with a 12.5-hour filter.


Advanced Options

Option

Description

-no_default

Disable default values for -h and -p.

-pressure_factor <factor>

Pressure factor. Default: 1.0.

-mesh <file>

Path to the mesh file.

-ssh <varname>

Variable name for elevation (default: elevation).

-pressure <varname>

Variable name for pressure (default: p).


Deprecated Options

Option

Replacement

-d

Use -m instead.


Examples

Basic Filtering

Filter elevation and pressure archives from January 2000 to December 2000:

reduce-v2 -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data \
  -iF cdf -oF cdf

Filter with Custom Root Names

Use custom root names for elevation and pressure archives:

reduce-v2 -h custom_elevation -p custom_pressure \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

Detide with Climatology Method

Remove S2 signal using the climatology method:

reduce-v2 -m climatology \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

High-Frequency Filtering

Remove high-frequency signals (12.5-hour filter):

reduce-v2 -hf \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

Pressure-Only Filtering

Skip elevation and filter only pressure archives:

reduce-v2 --pressure-only \
  -p custom_pressure \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

Custom Filtering Window

Use a custom filtering window of 30 days:

reduce-v2 -w 30.0 \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

Resampling

Reduce archive size with a resampling factor of 2:

reduce-v2 -r 2 \
  -start 01/2000 -end 12/2000 \
  -i ./input_data \
  -o ./output_data

Environment Variables

reduce-v2 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 reduce-v2 -start 01/2000 -end 12/2000 -i ./input_data -o ./output_data

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


Notes

  1. Input Formats:

  • Supported formats: clx (binary, deprecated) and cdf (NetCDF).

  • NetCDF (cdf) is the recommended format.

  1. Detiding Methods:

  • analysis: Uses harmonic analysis to remove S2 signal.

  • climatology: Uses precomputed climatology (requires S2-elevation-atlas.nc or S2.ele.s2c).

  • none: No detiding is applied.

  1. High-Frequency Filtering:

  • The -hf option applies an additional 12.5-hour filter to remove high-frequency signals.

  1. Resampling:

  • The -r option reduces the number of frames in the output archives by the specified factor.

  1. Output:

  • Filtered archives are saved in the specified output directory (-o).

  • Output filenames include the root name, year, and month (e.g., analysis-filtered-2000.01.nc).

  1. Performance:

  • For large datasets, ensure the output directory (-o) is on a fast storage device (e.g., SSD).

  • Adjust OMP_NUM_THREADS based on available CPU resources.


See Also