This file was written at LIPC, IINGEN, UNAM,
in Sisal, Yucatan, Mexico,
on the 12th of June 2025.

C-Xool:

ERA5 Atmospheric Boundary Conditions Toolbox for Ocean Modelling with ROMS

Software Documentation

This software is called C-Xool and is distributed under the GNU GENERAL PUBLIC LICENSE.
This file is provided as-is, without any warranty.


Table of Contents

  1. Introduction
  2. Developers
  3. Installing C-Xool
  4. Architecture
  5. Execution
  6. Support
  7. Known problems
  8. Platforms
  9. Ready-to-use examples
  10. ROMS versions tested with an atmospheric forcing built with C-Xool
  11. Independent notes for the users to consider
  12. Bibliography
  13. Supplementary information
Introduction - C-Xool Documentation

Introduction

C-Xool is a Python toolbox designed to prepare atmospheric forcing files for ocean models such as ROMS (Regional Ocean Modelling System). It facilitates downloading, interpolating, plotting, and writing atmospheric data (ERA5) in ROMS-compatible formats.

The toolbox was designed and developed at the Coastal Engineering and Processes Laboratory (LIPC, from its Spanish acronym Laboratorio de Ingeniería y Procesos Costeros), at the Engineering Institute of the National Autonomous University of Mexico (UNAM, Universidad Nacional Autónoma de México), in an office that overlooks the Gulf of Mexico and its beautiful landscape.

C-Xool is open-source and encourages collaboration. If you use C-Xool or improve it, please cite the associated publication [1] and share your improvements.

This README.md file accompanies the code; for more explanations, please refer to [1].

If you have questions, comments, or feedback, contact cargaezg@iingen.unam.mx.


C-Xool – Developers & Installation

Developers


Installing C-Xool

mamba create -n cxool python
mamba activate cxool
pip install cxool

Once installed, you're ready to run C-Xool.

Required Python libraries

C-Xool relies on the following libraries:


Architecture

C-Xool is structured into the following modules:


C-Xool – Execution

Execution

Basic execution

Once installed, C-Xool is executed from a terminal.
An example of an execution line is the following:

cxool --grid_name your_grid.nc --initialdate YYYY-MM-DD --finaldate YYYY-MM-DD 
--vars_to_interp var1 var2 var3 --plot_interval int_val 
--final_interpolated_file "ERA5_interpolated_to_grid.nc" 
--output_folder "SoftwareXExample" -o "input"

Execution of the provided examples

Go into the examples folder. There you have three options:

Execution of the provided tests

We have provided a set of unit tests to assess:

To execute, go inside the folder tests. Then execute:

pytest . -v

Required arguments to run C-Xool

Optional arguments to run with C-Xool

Example of execution

A basic command line execution example is the following:

python cxool_cli.py --grid-name model_grid.nc \
  --initialdate 1983-10-25 --finaldate 1983-10-27 \
  --vars-to-interp wind t2m msl tcc \
  --plot msl wind t2m tcc --plot-interval 3 \
  --final-interpolated-file ERA5_interpolated-to-grid.nc \
  --output-folder SoftwareXExample -o input

Help and further capabilities

To see the full list of options, run:

cxool --help

Support

If you encounter issues, please email cargaezg@iingen.unam.mx. We support Spanish, English, Italian, and Yucatec Maya.


Known problems


Ready-to-use examples

Inside the installation folder of C-Xool, there is a folder called examples that contains two subfolders: GermanNorthernSea and MexicanCaribbean. Inside each of these subfolders, a model grid is provided along with a Python script that allows running.


examples/
├── GermanNorthernSea
│   ├── example_German_Northern_sea.py
│   └── nordseedeu10km_grid.nc
├── MexicanCaribbean
│   ├── caribemex10km_grid.nc
│   └── example_Mexican_caribbean.py
└── ROMS_example
    ├── cxool_instructions.txt
    ├── data
    │   ├── inluum_grid.nc
    │   └── run_cxool_example.py
    ├── External
    │   └── inluum.in
    ├── Include
    │   └── gulfofmexico.h
    ├── README.html    
    └── README.md    

Platforms

Note for Linux Users

C-Xool has been tested on:

  1. Fedora Linux 35 Workstation, 64-bit.
  2. Rocky Linux 8.6, 64-bit.
  3. Fedora Linux 41 Workstation, 64-bit.

Note for macOS Users

C-Xool has been tested on macOS. Please report any compatibility issues to the developer.

Note for Windows Users

C-Xool can be used under Windows via a properly configured Python environment.
It has been tested on:

  1. Microsoft Windows 11, Pro, 64 bits.

ROMS versions tested with an atmospheric forcing built with C-Xool

We have tested the forcing file compatibility with different ROMS versions. The oldest version successfully used was the 2011 release (makefile 1417 2011-05-13 16:51:50Z kate), which is indeed quite dated. We also verified functionality with the latest ROMS version available on GitHub at the time of writing. All worked.

In accordance with the ROMS documentation [2] and recent ROMS-Tools guidelines [3], we know the NetCDF structure for atmospheric forcing variables is:

ATMOS_VAR(time, eta_rho, xi_rho)

Given the consistency across ROMS documentation, and based on our own testing, we do not anticipate any compatibility issues. The expected format for atmospheric forcing variables is well established as:

ATMOS_VAR(time, eta_rho, xi_rho)

and has remained stable across ROMS versions [2,3].


Independent notes for the users to consider

Producing a bathymetric grid for a ROMS model is a hard task that usually requires both good knowledge in coding and ocean-sciences. This is out of the scope of C-Xool. However, user may want to consider:

  1. James, C., Gridbuilder, Austides Consulting, accessed: 10 June 2025.
  2. Ådlandsvik, B., GridMap – Python toolbox for ROMS grid files based on explicit map projections, https://github.com/bjornaa/gridmap.

Bibliography

[1] C-Xool, ERA5 Atmospheric Boundary Conditions Toolbox for Ocean Modelling with ROMS, Argáez, C., Klüpfel, S., Allende Arandía, M. E., Appendini, C. M. Submitted to SoftwareX, under review.

[2] ROMS Forcing Package Documentation. Available at: https://www.myroms.org/index.php?page=forcing

[3] ROMS-Tools Documentation – Surface Forcing. Available at: https://roms-tools.readthedocs.io/en/latest/surface_forcing.html


Supplementary information

Modern package managers such as mamba and pip generally ensure a clean installation of the needed dependencies. However, we provide here the specific versions and distribution channels of the key Python libraries we used during our testing and development.

We do so in the hope that this information serves other users with two purposes:

Nevertheless, we recommend installing the latest compatible versions in a clean environment.

Fedora Linux 35 Workstation, 64-bit

In this case, Python version was 3.13.5 and the libraries distributions were as follows:

PackageVersionChannel
cartopy0.22.0conda-forge
cmocean3.1.3conda-forge
copernicusmarine2.0.1conda-forge
dask2024.1.0conda-forge
dask-core2024.1.0conda-forge
matplotlib3.8.2conda-forge
matplotlib-base3.8.2conda-forge
matplotlib-inline0.1.7conda-forge
netcdf41.6.5conda-forge
numpy1.26.4conda-forge
cf_xarray0.10.5conda-forge
xarray2024.1.1conda-forge

macOS Big Sur, Version 11.7.10

In this case, Python version was 3.12.2 and the libraries distributions were as follows:

PackageVersionChannel
cartopy0.24.1pypi
cmocean4.0.3pypi
copernicusmarine2.0.1pypi
dask2025.5.1pypi
dask-core
matplotlib3.10.3pypi
matplotlib-base
matplotlib-inline
netcdf41.7.2pypi
numpy2.3.0pypi
cf_xarray
xarray2025.6.1pypi