1.1. Presentation#

croco_pytools are available on gitlab: https://gitlab.inria.fr/croco-ocean/croco_pytools

Warning

These tools bring together the methods of several users of the CROCO community but do not constitute a definitive toolbox. All the features present in croco_tools matlab are not available in this version.

A new, more complete toolbox is being created by the team development of the CROCO group.

croco_pytools/prepro remains in the footsteps of the matlab croco_tools by separating all the steps involveed in creating a simulation. To avoid having a long namelist file, and each routines being independant, parameters need to be specified in the header of each routine.

Steps for creating a configuration (with these routines) are:

  • Build the grid

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

  • Build the initial conditions

And eventually:

  • Build tidal forcing

  • Build river forcing

Contact

mathieu.le.corre@shom.fr

1.1.1. Structure of directories#

  • env

    Contains yml files to install python environment decidated to croco_pytools/prepro

  • Modules

    Contains all python routines to run the croco_pytools/prepro Fortran routines are in the sub-drectory tools_fort_routines

  • Readers

    This contains readers to decode the input datasets

1.1.2. Description of the routines#

The main directory contains the following files:

__init__.py

File containing informations to build python environment and compile fortran routines

install.py

Script to facilitate the installation of python environnement with conda and the compilation of fortran routines

make_grid.py

Script to build CROCO grid and associated nests

make_bry.py

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

make_ini.py

Script to build the initial 3D conditions

make_zoom_cond.py

Script to build initial and lateral boundary conditions for nested grid (offline nest or AGRIF nest)

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

1.2. Dependencies#

1.2.1. Python#

croco_pytools/prepro is using the following package:

matplotlib

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.

cartopy

Cartopy is a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses.

wxpython

wxPython is a cross-platform GUI toolkit for the Python programming language.

geopandas

GeoPandas is an open source project to make working with geospatial data in python easier.

regionmask

Create masks of geographical regions

pyinterp

Python library for optimized geo-referenced interpolation.

pandas

pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.

scipy

Scipy provides many user-friendly and efficient numerical routines, such as routines for numerical integration, interpolation, optimization, linear algebra, and statistics.

xarray

xarray is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun

1.2.2. Fortran#

The scripts used to build the CROCO grid and the initial/boundary conditions for nests are using fortran routines which have been interfaced with python through f2py and must therefore be compiled.

Before compiling make sure that you have the following:

  • Open MP-capable Fortran compiler, Ifort or Gfortran, may be others.

  • NetCDF library capable of handling netCDF-4/hdf5 format.