CliMA/Oceananigans.jl

🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs

Oceananigans.jl – Fast, flexible ocean‑scale fluid‑dynamics in Julia

What it is – Oceananigans is an open‑source Julia package for solving the incompressible Boussinesq equations (both non‑hydrostatic and hydrostatic) on Cartesian or spherical‑shell grids. It uses a finite‑volume discretisation and runs on CPUs and CUDA‑enabled GPUs, letting researchers prototype and run high‑resolution ocean simulations with just a few lines of code.

Key capabilities

  • Models: NonhydrostaticModel, HydrostaticFreeSurfaceModel, and related variants.
  • Grids: Rectilinear, curvilinear, and spherical‑shell grids with configurable topology (periodic, flat, etc.).
  • Numerics: A suite of advection schemes (e.g., WENO, WENOVectorInvariant), Runge‑Kutta time‑steppers, and turbulence closures such as CATKEVerticalDiffusivity and TKEDissipationVerticalDiffusivity.
  • GPU acceleration: Switch CPU() to GPU() (after loading CUDA.jl) to run the same code on an Nvidia GPU, achieving order‑of‑magnitude speed‑ups for large (~10 M cell) problems.
  • Differentiable workflows: Integration with Enzyme.jl and Reactant.jl enables automatic differentiation of model components for data‑assimilation or machine‑learning‑in‑the‑loop studies.
  • Performance tracking: Continuous benchmark suite with a public dashboard that records wall‑clock time per timestep for many model configurations.

Getting started

using Pkg; Pkg.add("Oceananigans")   # install
using Oceananigans

# a 2‑D periodic turbulence test on the CPU
grid = RectilinearGrid(CPU(), size=(128,128), x=(0,2π), y=(0,2π), topology=(Periodic,Periodic,Flat))
model = NonhydrostaticModel(grid; advection=WENO())
set!(model, u = x->2rand()-1, v = x->2rand()-1)
sim = Simulation(model; Δt=0.01, stop_time=4)
run!(sim)

Replace CPU() with GPU() (after using CUDA) to run the same experiment on a GPU.

Documentation & learning resources

  • Stable and development docs: https://clima.github.io/OceananigansDocumentation/stable
  • Example scripts, tutorials, and a full API reference are bundled in the docs.
  • Discussions, Q&A, and community tips live on the GitHub Discussions page and the NumericalEarth Slack.
  • A wiki contains practical guides for installation, GPU usage, and workflow best‑practices.

Who uses it Oceananigans is employed by academic and industry groups for research, teaching, and prototype climate‑system modeling. A curated list of papers that use the package is maintained in the documentation.

Citing If you publish work that relies on Oceananigans, cite the overview paper (Wagner et al., 2025, arXiv:2502.14148) and any specific model‑development papers relevant to the features you used (e.g., Silvestri 2026 on Runge‑Kutta, Moses 2026 on differentiable modeling, etc.).

Community & contribution

  • Open, community‑driven development under the Climate Modeling Alliance (CliMA).
  • Contributor guide, code‑of‑conduct, and ColPrac best‑practice badge are provided.
  • Contributions are welcomed via pull requests; discussions about new features or bugs can be started on GitHub.

License – MIT (permissive, commercial‑friendly).

Bottom line – Oceananigans gives oceanographers and fluid‑dynamics researchers a high‑performance, easy‑to‑use Julia environment for building and running both simple test cases and large‑scale, GPU‑accelerated ocean simulations.

Related

  • Project
  • Project
  • Project
  • Project
  • Project