Oceananigans.jl
AGENTS.md1.4k starsChanged 9 days agoMITView on GitHub
Oceananigans.jl is a Julia package for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs. It solves the incompressible (Boussinesq) Navier-Stokes equations with models including: nonhydrostatic (with free surfaces), hydrostatic free-surface, and shallow water — on RectilinearGrid, LatitudeLongitudeGrid, ConformalCubedSphereGrid, TripolarGrid, and ImmersedBoundaryGrid. - All structs must be concretely typed - Type annotations are for dispatch, not documentation - Minimize allocation; favor inline computation - Never hardcode Float64: no literal 0.0 or 1.0 in kernels or constructors. Use zero(grid), one(grid),…
Trending
More talk lately.about the whole repository
Who's talking about CliMA/Oceananigans.jl
- @navidcy.bsky.social“This 👇🏼 is open for another 6 days! 🌊 🌏 Not sure if this is for you? Want to find more about the …”Bluesky · Nov 20, 2024 · 21 likes
- @navidcy.bsky.social“Very excited to see our figure on the JFM cover!! large-eddy simulation run with @julialang.org software …”Bluesky · Oct 17, 2025 · 11 likes
- NumericalEarth/NumericalEarth.jl“Clean up `examples/` + create `validation/`”GitHub · Jul 29, 2026 · 3 reactions
- JuliaLang/julia“Package precompilation suddenly hangs on 1.5.4 without direct code changes”GitHub · Apr 13, 2021 · 3 reactions
- NumericalEarth/Breeze.jl“Implement checkpointing for `AtmosphereModel`”GitHub · Feb 27, 2026 · 2 reactions
The biggest 5 of 48 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 48
Talked about on GitHub, Bluesky and Hacker News (48 times).
On GitHub · 45
- Jul 29, 2026Clean up `examples/` + create `validation/` — NumericalEarth/NumericalEarth.jl3 reactions · 6 comments
- Apr 13, 2021Package precompilation suddenly hangs on 1.5.4 without direct code changes — JuliaLang/julia3 reactions · 3 comments
- Feb 27, 2026Implement checkpointing for `AtmosphereModel` — NumericalEarth/Breeze.jl2 reactions · 26 comments
- Nov 21, 2025Implement a buoyancy frequency (squared) functionality that is "cloudy-region-aware" — NumericalEarth/Breeze.jl2 reactions · 2 comments
- Sep 13, 2025OceananiganPythonInterface or ClimaOceanPythonInterface auxiliary package for collecting PythonCall utilities? — CliMA/ClimaOcean.jl2 reactions · 5 comments
40 more on GitHub
- Oct 29, 2026Implement and test checkpointing for biogeochemistry models — OceanBioME/OceanBioME.jl1 reaction
- Oct 20, 2026Test the impact of storing reciprocal metrics — NumericalEarth/Breeze.jl1 reaction · 12 comments
- Oct 16, 2026POCL: reduce launch memory allocations — JuliaGPU/KernelAbstractions.jl1 reaction · 2 comments
- Sep 24, 2026Use Julia 1.13 for Buildkite tests — OceanBioME/OceanBioME.jl1 reaction
- Aug 27, 2026Fix compatibility with Oceananigans v0.110.20 — NumericalEarth/Breeze.jl1 reaction · 3 comments
- Aug 3, 2026Remove dev'd Oceananigans.jl — NumericalEarth/Breeze.jl1 reaction · 1 comment
- Jun 3, 2026Antimeridian-aware `contour`/`contourf` on `GeoAxis` (incl. curvilinear/tripolar grids) — MakieOrg/GeoMakie.jl1 reaction · 1 comment
- Apr 9, 2026Documentation fixes and improvements — NumericalEarth/Terrarium.jl1 reaction · 6 comments
- Apr 2, 2026Implement fast_div using fast rcp — JuliaGPU/CUDA.jl1 reaction · 9 comments
- Jan 30, 2026Update Julia packages to latest version — tomchor/rough-seamounts1 reaction
- Nov 9, 2025Update Oceananigans requirement to 0.100.7 in /docs — NumericalEarth/Breeze.jl1 reaction · 5 comments
- Nov 3, 2025Aliasscope miss-compile for 1.11+ — JuliaGPU/KernelAbstractions.jl1 reaction · 3 comments
- Oct 2, 2025Changes `ExponentialCoordinate` to `ExponentialDiscretization` — CliMA/ClimaOcean.jl1 reaction · 11 comments
- Aug 28, 2025Invalid kernel config generated by `mapreducedim!` with `SubArray` input and output — JuliaGPU/CUDA.jl1 reaction · 3 comments
- Apr 14, 2025Register this package? — JuliaGeo/ConservativeRegridding.jl1 reaction · 5 comments
- Mar 15, 2025[CI] Some improvements to GitHub Actions setup — CliMA/ClimaOcean.jl1 reaction · 5 comments
- Nov 16, 2024Add small (molecular?) background diffusivity on top of Smag-Lilly eddy diffusivity — hdrake/internal-tide-mixing1 reaction · 2 comments
- Dec 8, 2022Check if NetCDF_jll `is_available` before loading code — JuliaGeo/NCDatasets.jl1 reaction · 3 comments
- Jul 8, 2021Detect common integer exponentiations and handle them directly. — JuliaGPU/CUDA.jl1 reaction · 3 comments
- May 21, 2021Error when computing reductions into a view with `reduce_blocks > 1` — JuliaGPU/CUDA.jl1 reaction · 6 comments
- Mar 5, 2021Using joblib to parallelize plotting — jbusecke/xmovie1 reaction · 8 comments
- Jul 2, 2020Make Ref pass by-reference — JuliaGPU/CUDA.jl1 reaction · 5 comments
- Oct 31, 2026Update Oceananigans requirement from 0.113, 0.114 to 0.113, 0.114, 0.116 — agate-model/Agate.jl0 reactions
- Oct 21, 2026Update Oceananigans requirement from 0.113 to 0.113, 0.114 in /test — aria-verify/Assimilate.jl0 reactions
- Oct 21, 2026Update Oceananigans requirement from 0.113 to 0.113, 0.114 in /docs — aria-verify/Assimilate.jl0 reactions
- Oct 21, 2026Update Oceananigans requirement from 0.113 to 0.113, 0.114 — aria-verify/Assimilate.jl0 reactions
- Mar 13, 2026Make docs build faster by running examples in parallel — CliMA/CloudMicrophysics.jl0 reactions
- Feb 19, 2026STATUS: Differentiating Breeze — NumericalEarth/Breeze.jl0 reactions
- Jan 16, 2026Overlay methods on top of CUDA.jl method table — EnzymeAD/Reactant.jl0 reactions · 1 comment
- Nov 10, 2025Open boundary conditions with boundary mass flux correction — NumericalEarth/Breeze.jl0 reactions · 1 comment
- Aug 6, 2025Support Julia LTS version — googlecolab/colabtools0 reactions · 2 comments
- Jul 15, 2025Version and thread check at init — fesmc/Pagos.jl0 reactions
- Jun 16, 2025Error in ECCO dataset download — CliMA/ClimaOcean.jl0 reactions · 30 comments
- Jun 8, 2025Package notation differs from Oceananigans — tomchor/Oceanostics.jl0 reactions · 9 comments
- Apr 23, 2025Test with new weno reconstruction — simone-silvestri/NVIDIA_benchmark_tests0 reactions · 1 comment
- Sep 27, 2023Have we tried using `Field` as boundary condition? — yuchenma23/RT_tracer0 reactions
- Jun 13, 2022Use `.dataset` rather than `.field_time_serieses`? — CliMA/ParameterEstimocean.jl0 reactions · 1 comment
- Mar 9, 2022Can saved output be improved? — navidcy/mesoscale-parametrization0 reactions · 5 comments
- Feb 7, 2022Oceananigans.jl ocean modeling example — ClimateMARGO/interactive0 reactions · 4 comments
- Sep 27, 2020Milestones until we can submit a JOSS paper? — ali-ramadhan/Atmosfoolery.jl0 reactions · 2 comments
On Bluesky · 2
- Nov 20, 2024This 👇🏼 is open for another 6 days! 🌊 🌏 Not sure if this is for you? Want to find more about the project? Are you on the fence? Do… — @navidcy.bsky.social21 likes and reposts
- Oct 17, 2025Very excited to see our figure on the JFM cover!! large-eddy simulation run with @julialang.org software Oceananigans.jl;… — @navidcy.bsky.social11 likes and reposts
On Hacker News · 1
- May 26, 2020Oceananigans.jl: fast and friendly fluid dynamics on CPUs and GPUs2 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- add-featureSkill
- babysit-ciSkill
- build-docsSkill
- new-simulationSkill
- run-testsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
23 rules. About 0 are common, 10 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Use @kernel / @index (KernelAbstractions.jl)
- Very specific: line 22
Use ifelse — never short-circuiting if/else in kernels
- Distinctive: line 23
No error messages, no Models inside kernels
- Distinctive: line 29
All structs must be concretely typed
- Very specific: line 32
Never hardcode Float64: no literal 0.0 or 1.0 in kernels or constructors.
- Very specific: line 33
Use zero(grid), one(grid), convert(FT, 1//2), or rational literals
- Very specific: line 42
Use DocStringExtensions.jl with $(TYPEDSIGNATURES) when the signature does not include default values for args and/or kwargs.
- Very specific: line 46
Use unicode for math (Δt, η, ρ), not LaTeX — LaTeX doesn't render in the REPL
- Distinctive: line 100
Overconstraining types: use annotations for dispatch, not documentation
- Very specific: line 102
Plain
juliablocks in docstrings: always use jldoctest - Distinctive: line 104
Expecting unexported names: consider exporting them rather than changing user scripts
- Distinctive: line 107
Quick fixes that break correctness: if a test fails after a change, revisit the original edit
- Distinctive: line 108
Commented-out code: delete it. Git is the journal — don't leave commented code, debugging artifacts, or stale copy-paste remnants
- Very specific: line 110
2D indexing on fields: always use 3D indexing (field[i, j, k]).
- Very specific: line 112
Hardcoded Float64: never use 0.0, 1.0 in kernels or constructors.
- Distinctive: line 113
Scope creep in PRs: keep changes focused on a single concern.
- Very specific: line 115
Modifying Project.toml dependencies: never add, remove, or change [deps] or [weakdeps] in the root Project.toml unless the task absolutely …
- Very specific: line 118
Only touch [compat] bounds when explicitly asked.
- Distinctive: line 122
Follow ColPrac. Feature branches, descriptive commits, update tests and docs with code changes, check CI before merging.
- Very specific: line 127
Dispatch over conditionals: use Julia's type system and multiple dispatch instead of if/else branching.
- Very specific: line 130
Defaults serve the common case: avoid nothing defaults when a concrete default (like CPU()) covers 80% of usage.
- Distinctive: line 139
Follow established patterns in existing code
- Distinctive: line 140
Add tests for new functionality.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Oceananigans.jl — Agent Rules
Project Overview
Oceananigans.jl is a Julia package for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs. It solves the incompressible (Boussinesq) Navier-Stokes equations with models including: nonhydrostatic (with free surfaces), hydrostatic free-surface, and shallow water — on RectilinearGrid, LatitudeLongitudeGrid, ConformalCubedSphereGrid, TripolarGrid, and ImmersedBoundaryGrid.
Language & Environment
- Julia 1.10+ | CPU and GPU (CUDA, AMD, Metal, OneAPI)
- Key packages: KernelAbstractions.jl, CUDA.jl, Enzyme.jl, Reactant.jl
- Style: ExplicitImports.jl for source code;
using Oceananigansfor examples/tests
Critical Rules
Kernel Functions (GPU compatibility)
- Use
@kernel/@index(KernelAbstractions.jl) - Kernels must be type-stable and allocation-free
- Use
ifelse— never short-circuitingif/elsein kernels - No error messages, no Models inside kernels
- Mark functions called inside kernels with
@inline - Never loop over grid points outside kernels — use
launch!
Type Stability & Memory
- All structs must be concretely typed
- Type annotations are for dispatch, not documentation
- Minimize allocation; favor inline computation
- Never hardcode Float64: no literal
0.0or1.0in kernels or constructors. Usezero(grid),one(grid),convert(FT, 1//2), or rational literals
Imports
- Source code: explicit imports (checked by tests)
- Examples/docs: rely on
using Oceananigans; never explicitly import exported names
Docstrings
- Use DocStringExtensions.jl with
$(TYPEDSIGNATURES)when the signature does not include default values for args and/or kwargs. - ALWAYS
jldoctestblocks, NEVER plainjuliablocks — doctests are tested; plain blocks rot - Include
# outputwith verifiable output; prefershowmethods over boolean comparisons - Use unicode for math (
Δt,η,ρ), not LaTeX — LaTeX doesn't render in the REPL
Model Constructors
gridis positional:NonhydrostaticModel(grid; closure=nothing)ShallowWaterModel(grid, gravitational_acceleration; ...)— both positional- Omit semicolon when there are no keyword arguments:
NonhydrostaticModel(grid)notNonhydrostaticModel(grid;)
Naming Conventions
- Files: snake_case matching the type they define —
nonhydrostatic_model.jl - Types/Constructors: PascalCase only for true constructors —
NonhydrostaticModel - Functions: snake_case —
time_step!; functions that return values are never PascalCase - Kernels: may prefix with underscore —
_compute_tendency_kernel - Variables: English long name or readable unicode math notation — never mix abbreviated and
full forms (e.g.,
condvscondition) to imply a difference; be specific
Module Structure
src/
├── Oceananigans.jl # Main module, exports
├── Architectures.jl # CPU/GPU architecture abstractions
├── Grids/ # Grid types and constructors
├── OrthogonalSphericalShellGrids/ # Tripolar and other curvilinear spherical-shell grids
├── ImmersedBoundaries/ # ImmersedBoundaryGrid and immersed boundary conditions
├── MultiRegion/ # Multi-region grids (ConformalCubedSphereGrid)
├── DistributedComputations/ # MPI-distributed architectures and halo communication
├── Fields/ # Field types and operations
├── AbstractOperations/ # Lazy operations on fields (KernelFunctionOperation, etc.)
├── Operators/ # Finite difference operators
├── BoundaryConditions/ # Boundary condition types
├── Forcings/ # Forcing functions
├── Coriolis/ # Coriolis formulations
├── BuoyancyFormulations/ # Buoyancy models
├── Advection/ # Advection schemes
├── TurbulenceClosures/ # LES and eddy viscosity models
├── Models/ # Model implementations
│ ├── NonhydrostaticModels/
│ ├── HydrostaticFreeSurfaceModels/
│ ├── ShallowWaterModels/
│ └── LagrangianParticleTracking/
├── TimeSteppers/ # Time stepping schemes
├── Solvers/ # Poisson and tridiagonal solvers
├── Simulations/ # High-level simulation interface
├── Diagnostics/ # Diagnostics and callbacks
├── OutputWriters/ # File I/O
├── OutputReaders/ # FieldTimeSeries and output loading
└── Utils/ # Utilities and helpersCommon Pitfalls
- Type instability in kernels ruins GPU performance
- Overconstraining types: use annotations for dispatch, not documentation
- Missing imports: tests will catch this — add to
usingstatements - Plain
juliablocks in docstrings: always usejldoctest - Subtle bugs from missing method imports, especially in extensions
- Expecting unexported names: consider exporting them rather than changing user scripts
- Extending
getpropertyto fix undefined property bugs: fix on the caller side instead - "Type is not callable" errors: variable name shadows a function — rename or qualify
- Quick fixes that break correctness: if a test fails after a change, revisit the original edit
- Commented-out code: delete it. Git is the journal — don't leave commented code, debugging artifacts, or stale copy-paste remnants
- 2D indexing on fields: always use 3D indexing (
field[i, j, k]). 2D indexing works by coincidence on some fields but is unsupported and will break - Hardcoded Float64: never use
0.0,1.0in kernels or constructors; usezero(grid)etc. - Scope creep in PRs: keep changes focused on a single concern. Unrelated cleanup goes in a separate PR
- Modifying Project.toml dependencies: never add, remove, or change
[deps]or[weakdeps]in the rootProject.tomlunless the task absolutely requires it. Dependency changes have wide-reaching consequences — they affect CI, load time, and downstream compatibility. Only touch[compat]bounds when explicitly asked.
Git Workflow
Follow ColPrac. Feature branches, descriptive commits, update tests and docs with code changes, check CI before merging.
Design Principles
- Dispatch over conditionals: use Julia's type system and multiple dispatch instead of
if/elsebranching. Backend-specific code goes inext/extensions, notifbranches insrc/ - Use
on_architecturefor data transfers — never manualArray()/CuArray()calls - Defaults serve the common case: avoid
nothingdefaults when a concrete default (likeCPU()) covers 80% of usage. Minimize boilerplate for the typical user. - Keyword argument names must be consistent across related types and constructors
- Always use explicit
returnin functions longer than one expression - One operation per line as default; break long expressions across lines
Agent Behavior
- Prioritize type stability and GPU compatibility
- Follow established patterns in existing code
- Add tests for new functionality; update exports when adding public API
- Reference physics equations in comments when implementing dynamics
Further Reading
Detailed reference docs are in .agents/ — read on demand:
| Document | Content |
.agents/testing.md | Full testing guidelines, running tests, debugging |
.agents/documentation.md | Building docs, fast builds, doctest details, writing examples |
.agents/validation.md | Reproducing paper results step-by-step |
Auto-loading Rules
Rules in .claude/rules/ load automatically when you touch matching files:
kernel-rules.md— GPU kernel requirements (src/)docstring-rules.md— docstring and jldoctest conventions (src/)testing-rules.md— test writing and running (test/)docs-rules.md— documentation building and style (docs/)examples-rules.md— Literate.jl example conventions (examples/)style-rules.md— naming, notation, and comment style (src/, test/, validation/, examples/)restriction-rules.md— small diffs, no scaffolding, scarce comments, and a self-review checklist (src/, test/, validation/, examples/)julia-repl-rules.md— prefer an MCP Julia REPL over Bash when available (always)
Skills (slash commands)
/run-tests— run targeted tests, prioritized by what's likely to break/build-docs— build documentation locally/add-feature— checklist for adding new physics/features/new-simulation— set up, run, and visualize a new simulation (with or without a reference paper)/babysit-ci— monitor CI, auto-fix small issues, pause on bigger problems, retrigger flaky runs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

