Oceanostics

Dev documentation

Stable documentation

Github repo

DOI

Oceanostics is a Julia package created to facilitate obtaining diagnostic quantities in Oceananigans simulations. It was created solely as a companion package to Oceananigans, so we refer users first to the Oceananigans documentation before getting started with Oceanostics.

GPU testing runs on hardware provided by atdepth.

Installation

To install the latest stable version from Julia:

julia> ](@v1.9) 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> ](@v1.9) pkg> add Oceanostics#main

Quick example

The example below illustrates a few of Oceanostics' features. Check the Examples for more detailed usage.

julia> using Oceananigansjulia> using Oceanosticsjulia> grid = RectilinearGrid(size=(4, 5, 6), extent=(1, 1, 1));julia> model = NonhydrostaticModel(grid, closure=SmagorinskyLilly());julia> simulation = Simulation(model, Δt=1, stop_time=10);julia> simulation.callbacks[:progress] = Callback(ProgressMessengers.TimedMessenger(), IterationInterval(5));julia> eₖ = KineticEnergyEquation.KineticEnergy(model)KineticEnergy KernelFunctionOperation at (Center, Center, Center)├── grid: 4×5×6 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo├── kernel_function: kinetic_energy_ccc (generic function with 1 method)└── arguments: ("Field", "Field", "Field")└── computes: kinetic energy  ½uᵢuᵢjulia> εₖ = KineticEnergyEquation.KineticEnergyDissipationRate(model)KineticEnergyDissipationRate KernelFunctionOperation at (Center, Center, Center)├── grid: 4×5×6 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo├── kernel_function: viscous_dissipation_rate_ccc (generic function with 1 method)└── arguments: ("NamedTuple", "NamedTuple", "NamedTuple")└── computes: kinetic energy dissipation rate  -∂ⱼuᵢ·τᵢⱼjulia> run!(simulation)[ Info: Initializing simulation...┌ Info: iter =      0,  [000.00%] time = 0 seconds,  Δt = 1 second,  walltime = 621.022 ms,  walltime / timestep = 0 seconds└           |u⃗|ₘₐₓ = [0.00e+00,  0.00e+00,  0.00e+00] m/s,  advective CFL = 0,  diffusive CFL = 0,  νₘₐₓ = 0 m²/s[ Info:     ... simulation initialization complete (8.970 seconds)[ Info: Executing initial time step...[ Info:     ... initial time step complete (3.415 ms).┌ Info: iter =      5,  [050.00%] time = 5 seconds,  Δt = 1 second,  walltime = 9.035 seconds,  walltime / timestep = 1.683 seconds└           |u⃗|ₘₐₓ = [0.00e+00,  0.00e+00,  0.00e+00] m/s,  advective CFL = 0,  diffusive CFL = 0,  νₘₐₓ = 0 m²/s[ Info: Simulation is stopping after running for 9.030 seconds.[ Info: Simulation time 10 seconds equals or exceeds stop time 10 seconds.┌ Info: iter =     10,  [100.00%] time = 10 seconds,  Δt = 1 second,  walltime = 9.052 seconds,  walltime / timestep = 3.340 ms└           |u⃗|ₘₐₓ = [0.00e+00,  0.00e+00,  0.00e+00] m/s,  advective CFL = 0,  diffusive CFL = 0,  νₘₐₓ = 0 m²/s