2.6. Build tidal forcing#
Tidal forcing may be important in coastal configurations, and in certain locations of the word.
CROCO can propagate tides if those are provided at its boundaries.
In case where lateral boundary forcing do not include tides, barotropic tidal forcing can be added at CROCO boundaries from a tidal atlas. CROCO is therefore able to propagate the different tidal constituents from its lateral boundaries by forcing the tidal signal both in elevation and velocity, using the method described by Flather and Davies [1976].
make_tides creates a forcing file containing the amplitude and phase
of each of the desired tidal components for tide elevation and currents.
These values are interpolated over the entire CROCO grid, but the simulation
only uses the values at boundaries for forcing.
Note
To get a clean signal you need to provide harmonic components from both tide
elevation and tide velocity. In case you don’t have velocity harmonics
(undef UV_TIDES in cppdefs.h) a set of reduced equations is
available to compute velocity from SSH (cpp key : OBC_REDUCED_PHYSICS).
2.6.1. Edit the user-defined parameters#
All the requested user-defined parameters to build the tidal forcing are
gathered in a configuration file, here named tides.ini.
This file contains:
[Croco_Files]
croco_files_dir = ../results/CROCO_FILES
croco_grd_prefix = croco_grd
croco_tide_prefix = croco_frc
[Zoom_Options]
is_zoom = False
is_agrif = False
agrif_level = 0
[Times]
Ystart = 2013
Mstart = 1
Dstart = 1
Hstart = 12
Yend = 2013
Mend = 1
Dend = 31
Hend = 12
Yorig = 2000
Morig = 1
Dorig = 1
Horig = 0
use_calendar = False
[Tide_Options]
tide_waves = M2,S2,N2,K2,K1,O1,P1,Q1,Mf,Mm
is_tide_current = True
is_tide_potential = True
is_correction_ssh = True
is_correction_uv = True
[Tide_Input_Files]
tide_reader = tpxo7_croco
tide_type = Re_Im
tide_dir = ../data/DATASETS_CROCOTOOLS/TPXO7/
tide_single_file = TPXO7.nc
tide_multi_files = False
tide_multi_files_waves_separated = True
tide_multi_files_elev_file = h_<tide_wave>tpxo9_atlas_30_v5.nc
tide_multi_files_u_file = u<tide_wave>tpxo9_atlas_30_v5.nc
tide_multi_files_v_file = u<tide_wave>_tpxo9_atlas_30_v5.nc
The [Croco_Files] section defines the path and prefix for CROCO files:
|
Path of the CROCO files directory |
|
Prefix for the CROCO grid file |
|
Prefix for CROCO tidal forcing file (usually = croco_frc) |
The [Zoom_Options] section defines if the grid is the main grid (parent grid) or a nested grid (zoom or child grid):
|
True/False flag to define if the grid is a zoom or the main grid |
|
True/False flag to define if the grid is an agrif nested grid |
|
integer level of the agrif grid to consider (0 is parent, 1 is first child) |
The [Times] section defines the choice of dates, used for eventual corrections to apply:
|
year, month, day, hour of the chosen start date of the run at which the nodal correction is computed |
|
year, month, day, hour of the chosen time origin date. If using
|
|
if you will use |
The [Tide_Options] section defines the choice of tidal components, and the eventual corrections to apply:
|
Tidal components to use |
|
True/False flag to compute currents |
|
True/False flag to compute tidal generating potential |
|
True/False flag to apply nodal correction on elevation |
|
True/False flag to apply nodal correction on currents |
The [Tide_Input_Files] section defines several parameters regarding the input data:
|
keyword of the reader to use as defined in |
|
path of tidal atlas input data |
|
name of the input tidal atlas file |
|
format of the input data ‘Amp_phase’or ‘Re_Im’ |
|
True/False flag to indicate if the different variables are in separated files or in the same input file |
|
set to True if input file waves are separated |
|
elevation file names. if wave_separated put <tides> where wave name is found |
|
eastward currents file names. if wave_separated put <tides> where wave name is found |
|
northward currents file names. if wave_separated put <tides> where wave name is found |
In most cases, the simulations are only forced by the main tidal components. To take disturbance waves into account, a nodal correction is applied to these main waves. This nodal correction is of low amplitude and only slightly variable (considered constant over a year) but can have a significant impact on the tidal solution in coastal areas.
CROCO’s common practice is to set the nodal correction value at the simulation
start date and keep it constant thereafter. In this case, the correction is
directly included in the forcing file. However, CROCO also has the ability to
calculate these corrections at each time step in the simulation with the cppkey
TIDES_MAS. In this case, the nodal correction is not included in the
forcing file. In the current state, it is therefore necessary to keep the nodal
correction on currents in the forcing file.
Warning
When using TIDES_MAS (e.g. nodal correction on elevation computed during
the run), USE_CALENDAR is mandatory, thus you should set
use_calendar = True, and you must set is_correction_ssh = False,
and choose Yorig = 1900.
In the provided example of tides.ini, we use as initial and boundary
conditions the TPXO7 data provided within
DATASETS_CROCOTOOLS <https://data-croco.ifremer.fr/DATASETS/TPXO7.tar.gz>.
This dataset has the Real/Imaginary format, and is referred with the
tpxo7_croco keyword in readers.jsonc.
2.6.2. Check or add reader for tidal atlas data#
For TPXO7 data provided within
DATASETS_CROCOTOOLS <https://data-croco.ifremer.fr/DATASETS/TPXO7.tar.gz>,
the reader writes:
"tpxo7_croco": {
"lonr": "lon_r",
"lonu": "lon_u",
"lonv": "lon_r",
"latr": "lat_r",
"latu": "lat_r",
"latv": "lat_v",
"H_r": "ssh_r",
"H_i": "ssh_i",
"U_r": "u_r",
"U_i": "u_i",
"V_r": "v_r",
"V_i": "v_i",
"topor": "h",
"topou": "h",
"topov": "h",
"invert_phase": true
2.6.3. Build the tidal forcing conditions with make_tides.py#
Edit the
tides.iniconfiguration file.Eventually edit the
readers.jsoncreader dictionnaryLaunch the script:
python make_tides.py tides.ini
Check the generated file in the directory defined in
croco_dirwith a filename defined as``tides.ini`` to which the reader name will be added. In this example it will be:croco_frc_tpxo7_croco.nc