Skip to content

Commit c1b3133

Browse files
authored
WIth double-gyre example
1 parent 45bda15 commit c1b3133

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Please feel free to raise an [issue](https://github.com/milankl/ShallowWaters.jl
1717

1818
Requires: Julia 1.2
1919

20-
### How to use
20+
## How to use
2121

2222
`RunModel` initialises the model, preallocates memory and starts the time integration. You find the options and default parameters in `src/DefaultParameters.jl` (or by typing `?Parameter`).
2323
```julia
@@ -50,7 +50,33 @@ julia> Prog = RunModel(P);
5050
```
5151
The number formats can be different (aka mixed-precision) for different parts of the model. `Tprog` is the number type for the prognostic variables, `Tcomm` is used for communication of boundary values.
5252

53-
### (Some) Features
53+
## Double-gyre example
54+
55+
You can for example run a double gyre simulation like this
56+
```julia
57+
julia> using ShallowWaters
58+
julia> P = RunModel(Ndays=100,nx=100,L_ratio=1,bc="nonperiodic",wind_forcing_x="double_gyre",topography="seamount");
59+
Starting ShallowWaters on Sat, 15 Aug 2020 11:59:21 without output.
60+
100% Integration done in 13.7s.
61+
```
62+
Sea surface height can be visualised via
63+
```julia
64+
julia> using PyPlot
65+
julia> pcolormesh(P.η')
66+
```
67+
![Figure_1](https://user-images.githubusercontent.com/25530332/90311163-1ee40a00-def0-11ea-8911-810d7762cd3f.png)
68+
Or let's calculate the speed of the currents
69+
```julia
70+
julia> speed = sqrt.(Ix(P.u.^2)[:,2:end-1] + Iy(P.v.^2)[2:end-1,:])
71+
```
72+
`P.u` and `P.v` are the u,v velocity components on the Arakawa C-grid. To add them, we need to interpolate them with `Ix,Iy` (which are exported by `ShallowWaters.jl` too), then chopping off the edges to get two arrays of the same size.
73+
```julia
74+
julia> pcolormesh(speed')
75+
```
76+
![Figure_2](https://user-images.githubusercontent.com/25530332/90311211-88fcaf00-def0-11ea-8308-b4f438495152.png)
77+
Such that the currents are strongest around the two eddies, as expected in this quasi-geostrophic setup.
78+
79+
## (Some) Features
5480

5581
- Interpolation of initial conditions from low resolution / high resolution runs.
5682
- Output of relative vorticity, potential vorticity and tendencies du,dv,deta
@@ -60,7 +86,7 @@ The number formats can be different (aka mixed-precision) for different parts of
6086
- Solving the tracer advection comes at basically no cost, thanks to semi-Lagrangian advection scheme
6187
- Also outputs the gradient operators ∂/∂x,∂/∂y and interpolations Ix, Iy for easier post-processing.
6288

63-
### Installation
89+
## Installation
6490

6591
ShallowWaters.jl is a registered package, so simply do
6692

0 commit comments

Comments
 (0)