predictor v3.2.3¶
Mercurial revision 5770:c90c3015e72d | 2026-05-22
Description¶
predictor is a tool designed to interpolate tidal constants and predict tides at specified points using provided tidal atlases. It is used by CTOH (Centre de Topographie des Océans et de l’Hydrosphère).
If start and end dates are provided, it generates tidal predictions for the specified time range.
OpenMP parallelization is activated automatically if there are many points per time step.
Usage¶
predictor [-p lon_lat_list] -a atlas_convention [-s start -f end] -w wave1 [wave2 ...] [OPTIONS]
Options¶
General Options¶
Option |
Description |
|---|---|
|
Display help and exit. |
|
Force printing of constants when in altimetry mode (see |
|
Disable nodal corrections. |
|
Print spring/neap times for the first point. |
Input/Output Options¶
Option |
Description |
|---|---|
|
Path to a file containing control points. Can be: |
An ASCII file with the number of control points followed by their coordinates (
longitude latitude).A pattern of NetCDF files with
latitude,longitude, andtimevariables (see-ooption).If not provided, predictions are made for all points in the atlas. |
|-m <file>| Path to save/load extracted constants. |
|-a <convention>| Atlas file name convention. See Convention for details. |
|-g <file>| Path to the atlas grid or mesh file. |
|-o <file>| Path for the output file. The format depends on the input:NetCDF if:
-pis not provided, or-pspecifies a NetCDF file with atimevariable, or-oends with.nc.
ASCII otherwise.
Default:
predictions.dat,predictions.nc, or%s-predictions.nc(where%sis the input file path).If empty, predictions are added to the input file. |
Wave and Spectrum Options¶
Option |
Description |
|---|---|
|
List of waves to predict. For optimal speed, sort waves by atlas type (or size). See Wave Lists and Spectra |
|
Use a predefined spectrum. See Wave Lists and Spectra. |
|
Use if atlases are in centimeters (scales values by 0.01). |
Time Options¶
Option |
Description |
|---|---|
|
Start date for predictions. See Date Formats. |
|
End date for predictions. See Date Formats. |
|
Time increment for predictions. |
Output Customization¶
Option |
Description |
|---|---|
|
Variable names for amplitude and phase. Default: |
|
Name of the NetCDF output variable. Default: |
|
String for the |
|
Unit for the output variable. Default: |
|
Long name for the output variable. |
|
Standard name for the output variable. |
Advanced Options¶
Option |
Description |
|---|---|
|
Format of the time variable in ASCII files. Options: |
CNES: Days since 1950/01/01 00:00.ELAPSED: Days since the start date.CALENDAR: Human-readable dates (yyyy/mm/dd HH:MM:SS.S).Default:
ELAPSED CALENDAR. |
|--extrapolation-distance <value>| Extrapolation distance in meters. |
|--mass-conservation <0|1|2>| Mass conservation correction:0: No correction.1: Standard mass correction.2: Buggy CLS mass correction. |
|--astronomic-angles <method>| Method for astronomic angles:linearSchuremanorMeeus. |
|--prediction-standard <standard>| Prediction standard. If set toAVISO_LEGACY, implies:--admittance-target AVISO-FES-ADMITTANCE--equilibrium-target AVISO-FES-LP--astronomic-angles AVISO-FES-2.9.5|
|--admittance-target <target>| Target for admittance-derived waves. |
|--equilibrium-target <target>| Target for equilibrium-derived waves. |
|--with-statistics| Enable statistical computations. |
|--without-storage| Disable storing predictions. |
|--hint <variable>| Hint for parsing input NetCDF files (e.g., variable name for time/lat/lon). |
Date Formats¶
Supported formats:
yyyy/mm/dd HH:MM:SS.SSSdd/mm/yyyy HH:MM:SS.SSSmm/yyyy
Notes:
The least significant parts (seconds, minutes, hours, days, months) are optional.
The separator can be any non-numeric character (e.g.,
/,-, `` ).End dates are inclusive. Examples:
2000→2001/01/01 00:00:00
2000/01→2000/02/01 00:00:00
2000/01/01→2000/01/02 00:00:00
2000/01/01 00→2000/01/01 01:00:00
2000/01/01 00:00→2000/01/01 00:01:00
Wave Lists and Spectra¶
You can specify:
Individual waves (e.g.,
M2,S2,K1). Runshowargto see the full list of available waves.Predefined spectra:
ESTUARINEESTUARINE-HFCOMODOCOASTALCOASTAL-HFSHELFSHELF-HFDEEPDEEP-HFREDUCEDCURRENTS-HFFES2022cAVISO-FES-SPAVISO-FES-ADMITTANCEAVISO-FES-LPAVISO-FES-LP-PROXY
Convention¶
The atlas file name convention uses the following placeholders:
WAVE: Replaced by the uppercase wave name (e.g.,M2).wave: Replaced by the lowercase wave name (e.g.,m2).Wave: Replaced by the capitalized wave name (e.g.,M2).
Note: If the file exists without any replacements, no substitution is performed.
Examples¶
Basic Prediction¶
Predict tides for waves M2 and S2 at points listed in control.dat:
predictor -p control.dat -a WAVE.nc -g mesh.nc -w M2 S2
Prediction with Time Range¶
Predict tides from 2000/01/01 to 2000/01/10 with a 1-hour increment:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
-s 2000/01/01 -f 2000/01/10 -i 1h \
-w M2 S2 K1 O1
Using a Predefined Spectrum¶
Use the FES2022c spectrum for predictions:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
--spectrum FES2022c
Altimetry-Compatible Predictions¶
Generate predictions compatible with AVISO-FES-2.9.5:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
--prediction-standard AVISO_LEGACY \
-w MKS2 MSqm 2N2 La2 Mu2 Nu2 MN4 MS4 MSf_nL Mtm Ssa E2 J1 K1 K2 L2 M2 M4 N2 O1 P1 Q1 S2 M3 M6 M8 Mf Mm N4 R2 S1 S4 Sa T2
Predict for All Atlas Points¶
Predict tides for all points in the atlas (no -p option):
predictor -a WAVE.nc -g mesh.nc \
-s 2000/01/01 -f 2000/01/10 \
-w M2 S2
NetCDF Output with Custom Variables¶
Save predictions to a NetCDF file with custom variable names:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
-o predictions.nc \
-v amplitude phase \
--output-var tidal_prediction \
--unit meters \
--long_name "Tidal prediction" \
-w M2 S2
Using a Time Template¶
Specify the time format for ASCII output:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
--time "CNES CALENDAR" \
-s 2000/01/01 -f 2000/01/10 \
-w M2 S2
Extrapolation and Mass Conservation¶
Enable extrapolation and mass conservation:
predictor -p control.dat -a WAVE.nc -g mesh.nc \
--extrapolation-distance 1000 \
--mass-conservation 1 \
-w M2 S2
Environment Variables¶
predictor uses OpenMP (version 201511) for parallelization. Key environment variables:
Variable |
Description |
|---|---|
|
Number of threads to use. |
|
Runtime schedule type and chunk size. |
|
Enable/disable dynamic thread adjustment. |
|
Enable/disable nested parallelism. |
Example:
OMP_NUM_THREADS=6 predictor -p control.dat -a WAVE.nc -w M2 S2
Note: If running on a busy machine, limit threads to the number of free CPUs to avoid performance degradation.
Notes¶
Input Files:
Atlas files must follow the convention specified with
-a.If
-pis a NetCDF file, it must containlatitude,longitude, and optionallytimevariables.
Output:
By default, predictions are saved in ASCII (
predictions.dat) or NetCDF (predictions.nc).Use
-oto specify a custom output path.
Performance:
OpenMP parallelization is automatically activated for large datasets.
For best performance, sort waves by atlas type (or size) using
-w.
Time Handling:
If
-sand-fare not provided, predictions are made for the entire time range of the input files.Use
-ito specify a custom time increment (default: 1 hour).
Altimetry Mode:
Use
--prediction-standard AVISO_LEGACYfor compatibility with AVISO-FES standards.
See Also¶
showarg(for listing available waves)comodo-calculator(for converting ASCII files to NetCDF)