🌊 A fast and friendly non-hydrostatic ocean model in Julia that can be run in 1-3 dimensions on CPUs and GPUs.



Project Status: Active – The project has reached a stable, usable state and is being actively developed. MIT license Ask us anything

Documentation Build Status (CPU, GPU, Windows) Code coverage
docs travis gitlab appveyor coveralls codecov

A fast non-hydrostatic ocean model in Julia that can be run in 2 or 3 dimensions on CPUs and GPUs. The plan is to develop it as a stand-alone large eddy simulation (LES) model which can be used as a source of training data for statistical learning algorithms and/or embedded within a global ocean model as a super-parameterization of small-scale processes, as in Campin et al., 2011.

Our goal is to develop friendly and intuitive code allowing users to focus on the science and not on fixing compiler errors. Thanks to high-level, zero-cost abstractions that the Julia programming language makes possible, the model can have the same look and feel no matter the dimension or grid of the underlying simulation, or whether running on CPUs or GPUs.

Installation instructions

Oceananigans is still not an official Julia package. But you can install it using the built-in package manager (accessed by pressing ] in the Julia command prompt)

(v1.1) pkg> add https://github.com/climate-machine/Oceananigans.jl.git

Note: We recommend using Julia 1.1 with Oceananigans.

Running your first model

Let's initialize a 3D ocean with 100×100×50 grid points on a 2×2×1 km domain and simulate it for 10 time steps using steps of 60 seconds each (for a total of 10 minutes of simulation time).

using Oceananigans
Nx, Ny, Nz = 100, 100, 50      # Number of grid points in each dimension.
Lx, Ly, Lz = 2000, 2000, 1000  # Domain size (meters).
Nt, Δt = 10, 60                # Number of time steps, time step size (seconds).

model = Model(N=(Nx, Ny, Nz), L=(Lx, Ly, Lz))
time_step!(model, Nt, Δt)

You just simulated a 3D patch of ocean, it's that easy! It was a still lifeless ocean so nothing interesting happened but now you can add interesting dynamics and plot the output.

CPU example

Let's add something to make the ocean dynamics a bit more interesting.

GPU example

If you have access to an Nvidia CUDA-enabled graphics processing unit (GPU) you can run ocean models on it.

Getting help

If you are interested in using Oceananigans.jl or are trying to figure out how to use it, please feel free to ask us questions and get in touch! Check out the examples and open an issue if you have any questions, comments, suggestions, etc.


Deep convection

Watch deep convection in action

Free convection

Watch free convection in action

Performance benchmarks

We've performed some preliminary performance benchmarks (see the benchmarks.jl file) by initializing models of various sizes and measuring the wall clock time taken per model iteration (or time step). The CPU used was a single core of an Intel Xeon CPU E5-2680 v4 @ 2.40GHz while the GPU used was an Nvidia Tesla V100-SXM2-16GB. This isn't really a fair comparison as we haven't parallelized across all the CPU's cores so we will revisit these benchmarks once Oceananigans.jl can run on multiple CPUs and GPUs. Performance benchmark plots

First Commit


Last Touched

1 day ago


908 commits