Created By: Nathanael Wong (nathanaelwong@fas.harvard.edu)
GillMatsuno.jl is a Julia package that:
- numerically solves the Shallow-Water Equations on a
$\beta$ -plane using finite-difference methods - allows the user to define custom heat-forcing
$Q$
GillMatsuno.jl can be installed via
] add GillMatsuno
Due to the recent improvements in memory allocations in Julia, GillMatsuno.jl v2 works best in Julia v1.5 and above, but can work from v1.3 onwards.
There are four components to running a model in GillMatsuno.jl. They are:
- Grid
G - Domain parameters
D - Heat Source
Q - Simulation Setup
S
GillMatsuno.jl uses a staggered Arakawa C-Grid. The Grid G is generated via the function GenerateGrid, as follows
G = GenerateGrid(size = (nx,ny), x = (xmin,xmax), y = (ymin,ymax))
It is to be noted that the shallow-water equations to be solved have been nondimensionalized. Typical values of xmin and xmax are O(25) (negative and positive respectively), and O(10) for ymin and ymax.
We define the domain parameters using the DomainProperties() function. The default values are:
αrepresents the damping coefficient on the winds induced by the heat-forcing (default:α = 0.1)βis the Coriolis Factor (nondimensionalized toβ = 0.5as the default)gandHrepresent gravity and the height of the domain (both nondimensionalized to 1 as default)
D = DomainParameters(α=0.2,β=0.5,g=1.0,H=1.0)
The heat source Q is analogous to a mass source/sink. As of now, Q can only be defined as a gaussian peak (or the cumulative sums of gaussian peaks), though we aim to extend this to equatorial bands.
Q can be defined via the function QfieldProperties
Q = QfieldProperties(A=1.0,Lx=2.0,Ly=2.0,Qx=0,Qy=0)
Where we have that
Ais the amplitude of the sourceLxandLyare the non-dimensionalized widths of theQin thex- andy-directions respectivelyQxandQydenote the location of the center ofQ
The simulation structure S is defined as follows:
S = CreateSimulation(δt=5e-4,tt=50,ft=0.5,fnc="test.nc")
Where we have that
δtis the model timestepttis the total model runtimeftis the output frequency in model runtime
So, using the parameters above, we see that the model is ran for 10^6 timesteps, with the fields output every 10000 steps to the netCDF file test.nc.
With the fields we have defined above, we put them into the function runGillMatsuno(S,G,[Q],D), and then we can extract the fields and do plotting/analysis, as you wish!