Author tomchor
17 Stars
Updated Last
1 Year Ago
Started In
January 2021


Useful diagnostics to use with Oceananigans. Mostly AbstractOperationss and a few useful progress messengers.

To install the latest registered tagged version from Julia:

julia> ]
(@v1.8) pkg> add Oceanostics

If you want the latest developments (which may or may not be unstable) you can add the latest version from github in the main branch:

julia> using Pkg

julia> Pkg.add(url="https://github.com/tomchor/Oceanostics.jl.git", rev="main")

The keyword rev let's you pick which github branch you want.

Simple example

The example below is a simple illustration of how to use a few of Oceanostics features:

using Oceananigans
using Oceanostics

grid = RectilinearGrid(size=(4, 5, 6), extent=(1, 1, 1))
model = NonhydrostaticModel(grid=grid, closure=SmagorinskyLilly())
simulation = Simulation(model, Δt=1, stop_time=20)
simulation.callbacks[:progress] = Callback(TimedProgressMessenger(LES=false), IterationInterval(5))

ke = Field(KineticEnergy(model))
ε = Field(KineticEnergyDissipationRate(model))
simulation.output_writers[:netcdf_writer] = NetCDFOutputWriter(model, (; ke, ε), filename="out.nc", schedule=TimeInterval(2))

(Note that (; tke, ε) is a shorthand for (tke=tke, ε=ε).)


  • Not every diagnostic has been thoroughly tested (we're still working on testing everything with CI).
  • Most diagnostics are written very generally since most uses of averages, etc. Do not assume any specific kind of averaging procedure. Chances are it "wastes" computations for a given specific application.

Used By Packages

No packages found.