Content and architecture

2.1. Content and architecture#

croco_pytools/prepro remains in the footsteps of the matlab croco_tools by separating all the steps involved in preparing input files for a given configuration:

  • Build the grid, interpolate and smooth the bathymetry, build the mask

  • Build the lateral boundary conditions (3D currents, temperature and salinity, barotropic currents, surface elevation)

  • Build the initial conditions (3D currents, temperature and salinity, barotropic currents, surface elevation)

And eventually:

  • Build tidal forcing

  • Build river forcing

The repository contains:

  • The files containing user parameters to be edited, as well as readers for input datasets. These files will be read and used by the main scripts.

grid.ini

File with useful parameters to build the grid

grid_zoom_agrif.ini

File with useful parameters to build an AGRIF child grid

grid_zoom_offline.ini

File with useful parameters to build an offline child grid

ibc.ini

File with useful parameters to build initial and boundary conditions (IBC)

ibc_zoom_agrif.ini

File with useful parameters to build initial conditions for Agrif zoom

ibc_zoom_offline.ini

File with useful parameters to build initial and boundary conditions (IBC) for offline zoom

tides.ini

File with useful parameters to build tidal forcing

tides_zoom_offline.ini

File with useful parameters to build tidal forcing for offline zoom

rivers.ini

File with useful parameters to build rivers forcing

rivers_zoom_agrif.ini

File with useful parameters to build rivers forcing for agrif zoom

rivers_zoom_offline.ini

File with useful parameters to build rivers forcing for offlinze zoom

readers.jsonc

Dictionnary to associate and decode the variable names from input datasets (topo, initial and boundary conditions, rivers, tides) with those used in the scripts

Tip

You can also use a merged version all.ini and use the same .ini file for all the scripts

  • The main python scripts or notebooks to perform the different steps of the preprocessing.

make_grid.py

Script to build CROCO grid and associated nests

nb_make_grid.ipynb

Notebook version of the script to build CROCO grid, it allows visualizing the grid, and edit its mask and bathymetry

nb_make_grid_zoom.ipynb

Notebook version of the script to build CROCO child grids (zooms), it allows visualizing the nested grid, and edit its mask and bathymetry

make_bry.py

Script to build the lateral boundary conditions (surface elevation, 3D currents, barotropic currents, temperature and salinity, other tracers) for CROCO grid and associated nests

make_ini.py

Script to build the initial 3D conditions (surface elevation, 3D currents, barotropic currents, temperature and salinity, other tracers) for CROCO grid and associated nests

make_tides.py

Script to build the tidal forcing (amplitude and phase) for elevation and barotropic current

make_rivers.py

Script to create netcdf file containing runoff flows

nb_make_rivers.ipynb

Notebook version of the script to build runoff flows, it allows edit the location of each river.

  • Some scripts to download datasets that can be used to prepare initial and boundary conditions for CROCO, as well as forcings (e.g. atmospheric forcing, rivers), as well as the associated configuration …ini files:

download_mercator.py

Script to download Mercator GLORYS products using the Copernicus Marine API

download_hycom.py

Script to download HYCOM products using the HYCOM OpenDAP server

download_era5.py

Script to download ERA5 reanalysis using the Climate Data Store API

download_glofas_river.py

Script to download river discharges from Global Flood Awareness System (GloFAS) using the Climate Data Store API

  • The sub-directories with all sub-routines.

Modules

Directory containing all python sub-routines to run the croco_pytools/prepro. Fortran routines are in the sub-directory tools_fort_routines