Skip to content

lobpcg/shallow-water

 
 

Repository files navigation

Shallow-water modelling in Python

This repository has been forked from the currently archived read-only project https://github.com/dionhaefner/shallow-water

It contains two implementations by Dion Häfner of the shallow-water equations that are suitable to study a wide range of wave and ocean circulation phenomena, including non-linear effects.

They are a product of the Bornö summer school 2018, led by Markus Jochum and Carsten Eden.

A preview of the non-linear setup:

Nonlinear model spin-up

Features

Simple (linear) implementation

  • Mass conserving on (Cartesian) Arakawa C-grid
  • Mixed-time discretization
  • Coriolis force on an f-plane
  • Conditionally stable for Δt <= √2 / f

Fully non-linear implementation

All features of the simple implementation, plus...

  • Adams-Bashforth time stepping scheme
  • Lateral friction
  • Varying Coriolis parameter (β-plane)
  • Fully non-linear momentum and continuity equations
  • Energy conserving scheme by Sadourny (1975)
  • Rigid or periodic boundary conditions

Shallow-water modelling in JAX

The new code by Andrew Knyazev is JAX versions of the two pure Python modules and pytest functions checking that the new JAX and original Python implementations result in the same for the linear model and approximately the same for the nonlinear model outputs.

The new JAX modules are naive line-by-line transtlations into JAX of the original pure Python modules.

About

Powerful shallow-water implementations in pure Python and JAX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%