Skip to content

Commit 808d090

Browse files
author
Milan K
authored
Merge pull request #120 from milankl/rename
Rename to ShallowWaters
2 parents f7690d1 + 0f27b9d commit 808d090

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name = "Juls"
1+
name = "ShallowWaters"
22
uuid = "56019723-2d87-4a65-81ff-59d5d8913e3c"
33
authors = ["Milan Kloewer"]
4-
version = "0.5.0"
4+
version = "0.1.0"
55

66
[compat]
77
julia = "1"

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
[![Cirrus CI](https://img.shields.io/cirrus/github/milankl/Juls.jl?label=FreeBSD&logo=cirrus-ci&logoColor=white&style=flat-square)](https://cirrus-ci.com/github/milankl/Juls.jl)
55

66

7-
# Juls.jl - A type-flexible 16bit shallow water model
7+
# ShallowWaters.jl - A type-flexible 16bit shallow water model
88
![sst](figs/sst_posit16.png?raw=true "SST")
99

10-
A shallow water model with a focus on type-flexibility and 16bit number formats. Juls allows for Float64/32/16, BigFloat/[ArbFloat](https://github.com/JeffreySarnoff/ArbNumerics.jl), [Posit32/16](https://github.com/milankl/SoftPosit.jl), [BFloat16](https://github.com/JuliaComputing/BFloat16s.jl), [Sonum16](https://github.com/milankl/Sonums.jl) and in general every number format with arithmetics and conversions implemented.
10+
A shallow water model with a focus on type-flexibility and 16bit number formats. ShallowWaters allows for Float64/32/16, BigFloat/[ArbFloat](https://github.com/JeffreySarnoff/ArbNumerics.jl), [Posit32/16](https://github.com/milankl/SoftPosit.jl), [BFloat16](https://github.com/JuliaComputing/BFloat16s.jl), [Sonum16](https://github.com/milankl/Sonums.jl) and in general every number format with arithmetics and conversions implemented.
1111

12-
Juls is fully-explicit with an energy and enstrophy conserving advection scheme and a Smagorinsky-like biharmonic diffusion operator. Tracer advection is implemented with a semi-Lagrangian advection scheme. Runge-Kutta 4th-order is used for pressure, advective and Coriolis terms and the continuity equation. Semi-implicit time stepping for diffusion and bottom friction. Boundary conditions are either periodic (only in x direction) or non-periodic super-slip, free-slip, partial-slip, or no-slip. Output via NetCDF.
12+
ShallowWaters is fully-explicit with an energy and enstrophy conserving advection scheme and a Smagorinsky-like biharmonic diffusion operator. Tracer advection is implemented with a semi-Lagrangian advection scheme. Runge-Kutta 4th-order is used for pressure, advective and Coriolis terms and the continuity equation. Semi-implicit time stepping for diffusion and bottom friction. Boundary conditions are either periodic (only in x direction) or non-periodic super-slip, free-slip, partial-slip, or no-slip. Output via NetCDF.
1313

1414
## How to use
1515

16-
You find the default parameters in `src/DefaultParameters.jl`. They can be changed with keyword arguments. Optionally, the number format `T` is defined as the first argument of `RunJuls(T,...)`
16+
You find the default parameters in `src/DefaultParameters.jl`. They can be changed with keyword arguments. Optionally, the number format `T` is defined as the first argument of `RunModel(T,...)`
1717
```julia
18-
julia> Prog = RunJuls(Float32,Ndays=10,g=10,H=500,Fx0=0.12);
19-
Starting Juls on Sun, 20 Oct 2019 19:58:25 without output.
18+
julia> Prog = RunModel(Float32,Ndays=10,g=10,H=500,Fx0=0.12);
19+
Starting ShallowWaters on Sun, 20 Oct 2019 19:58:25 without output.
2020
100% Integration done in 4.65s.
2121
```
2222
or by creating a Parameter struct
2323
```julia
2424
julia> P = Parameter(bc="nonperiodic",wind_forcing_x="double_gyre",L_ratio=1,nx=128);
25-
julia> Prog = RunJuls(P);
25+
julia> Prog = RunModel(P);
2626
```
2727

2828
## Installation
2929
```julia
30-
julia> ] add https://github.com/milankl/Juls.jl
30+
julia> ] add https://github.com/milankl/ShallowWaters.jl
3131
```
3232

3333
## The equations
@@ -48,6 +48,6 @@ The linear shallow water model equivalent is
4848
∂η/∂t = -H*∇⋅u⃗ + γ*(η_ref - η) + Fηt(t)*Fη(x,y) (3)
4949
∂ϕ/∂t = -u⃗⋅∇ϕ (4)
5050

51-
Juls discretises the equation on an equi-distant Arakawa C-grid, with 2nd order finite-difference operators. Boundary conditions are implemented via a ghost-point copy and each variable has a halo of variable size to account for different stencil sizes of various operators.
51+
ShallowWaters.jl discretises the equation on an equi-distant Arakawa C-grid, with 2nd order finite-difference operators. Boundary conditions are implemented via a ghost-point copy and each variable has a halo of variable size to account for different stencil sizes of various operators.
5252

53-
Juls splits the time steps for various terms: Runge Kutta 4th order scheme for the fast varying terms. The diffusive terms (bottom friction and diffusion) are solved semi-implicitly every n-th time step. The tracer equation is solved with a semi-Lagrangian scheme that uses usually much larger time steps.
53+
ShallowWaters.jl splits the time steps for various terms: Runge Kutta 4th order scheme for the fast varying terms. The diffusive terms (bottom friction and diffusion) are solved semi-implicitly every n-th time step. The tracer equation is solved with a semi-Lagrangian scheme that uses much larger time steps.

src/Feedback.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ function feedback_init(S::ModelSetup)
8484
run_id,runpath = get_run_id_path(S)
8585

8686
txt = open(joinpath(runpath,"progress.txt"),"w")
87-
s = "Starting Juls run $run_id on "*Dates.format(now(),Dates.RFC1123Format)
87+
s = "Starting ShallowWaters run $run_id on "*Dates.format(now(),Dates.RFC1123Format)
8888
println(s)
8989
write(txt,s*"\n")
90-
write(txt,"Juls will integrate $(Ndays)days at a resolution of $(nx)x$(ny) with Δ=$(Δ/1e3)km\n")
90+
write(txt,"Model will integrate $(Ndays)days at a resolution of $(nx)x$(ny) with Δ=$(Δ/1e3)km\n")
9191
write(txt,"Initial conditions are ")
9292
if initial_cond == "rest"
9393
write(txt,"rest.\n")
@@ -107,7 +107,7 @@ function feedback_init(S::ModelSetup)
107107
print(ptxt,S.parameters)
108108
close(ptxt)
109109
else
110-
println("Starting Juls on "*Dates.format(now(),Dates.RFC1123Format)*" without output.")
110+
println("Starting ShallowWaters on "*Dates.format(now(),Dates.RFC1123Format)*" without output.")
111111
txt = nothing
112112
run_id = -1
113113
runpath = ""

src/RunJuls.jl renamed to src/RunModel.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
"""
22
3-
u,v,η,sst = RunJuls()
3+
u,v,η,sst = RunModel()
44
5-
runs Juls with default parameters as defined in src/DefaultParameters.jl
5+
runs ShallowWaters with default parameters as defined in src/DefaultParameters.jl
66
77
# Examples
88
```jldoc
9-
julia> u,v,η,sst = RunJuls(Float64,nx=200,output=true)
9+
julia> u,v,η,sst = RunModel(Float64,nx=200,output=true)
1010
```
1111
"""
12-
function RunJuls(::Type{T}=Float32; # number format
12+
function RunModel(::Type{T}=Float32; # number format
1313
kwargs... # all additional parameters
1414
) where {T<:AbstractFloat}
1515

1616
P = Parameter(T=T;kwargs...)
17-
return RunJuls(T,P)
17+
return RunModel(T,P)
1818
end
1919

20-
function RunJuls(P::Parameter)
20+
function RunModel(P::Parameter)
2121
@unpack T = P
22-
return RunJuls(T,P)
22+
return RunModel(T,P)
2323
end
2424

25-
function RunJuls(::Type{T},P::Parameter) where {T<:AbstractFloat}
25+
function RunModel(::Type{T},P::Parameter) where {T<:AbstractFloat}
2626

2727
@unpack Tprog = P
2828

src/Juls.jl renamed to src/ShallowWaters.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module Juls
1+
module ShallowWaters
22

3-
export RunJuls, Parameter
3+
export RunModel, Parameter
44

55
using NetCDF, Parameters, Printf, Dates
66

@@ -25,6 +25,6 @@ include("TracerAdvection.jl")
2525

2626
include("Feedback.jl")
2727
include("Output.jl")
28-
include("RunJuls.jl")
28+
include("RunModel.jl")
2929

3030
end

src/TimeIntegration.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Integrates Juls forward in time."""
1+
"""Integrates ShallowWaters forward in time."""
22
function time_integration( Prog::PrognosticVars{Tprog},
33
Diag::DiagnosticVars{T,Tprog},
44
S::ModelSetup{T,Tprog}) where {T<:AbstractFloat,Tprog<:AbstractFloat}

test/runtests.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
using Juls
1+
using ShallowWaters
22
using Test
33

44
@testset "No Forcing" begin
5-
Prog = RunJuls(Ndays=1,Fx0=0)
5+
Prog = RunModel(Ndays=1,Fx0=0)
66
@test all(Prog.u .== 0.0f0)
77
@test all(Prog.v .== 0.0f0)
88
@test all(Prog.η .== 0.0f0)
99
end
1010

1111
@testset "Boundary Conditions" begin
12-
Prog = RunJuls(Ndays=1,bc="periodic")
12+
Prog = RunModel(Ndays=1,bc="periodic")
1313
@test all(abs.(Prog.η) .< 10) # sea surface height shouldn't exceed +-10m
1414

15-
Prog = RunJuls(Ndays=1,bc="nonperiodic")
15+
Prog = RunModel(Ndays=1,bc="nonperiodic")
1616
@test all(abs.(Prog.η) .< 10)
1717

18-
Prog = RunJuls(Ndays=1=0) # free-slip
18+
Prog = RunModel(Ndays=1=0) # free-slip
1919
@test all(abs.(Prog.η) .< 10)
2020
end
2121

2222
@testset "Continuity Forcing" begin
23-
Prog = RunJuls(Ndays=1,surface_relax=true)
23+
Prog = RunModel(Ndays=1,surface_relax=true)
2424
@test all(abs.(Prog.η) .< 10) # sea surface height shouldn't exceed +-10m
2525
@test all(Prog.u .!= 0.0f0)
2626

27-
Prog = RunJuls(Ndays=1,surface_forcing=true)
27+
Prog = RunModel(Ndays=1,surface_forcing=true)
2828
@test all(abs.(Prog.η) .< 10)
2929
@test all(Prog.u .!= 0.0f0)
3030
end
3131

3232
@testset "Mixed Precision" begin
33-
Prog = RunJuls(Float32,Tprog=Float64,Ndays=1)
33+
Prog = RunModel(Float32,Tprog=Float64,Ndays=1)
3434
@test all(abs.(Prog.η) .< 10) # sea surface height shouldn't exceed +-10m
3535
@test all(Prog.u .!= 0.0f0)
3636

37-
Prog = RunJuls(Float16,Tprog=Float32,Ndays=1)
37+
Prog = RunModel(Float16,Tprog=Float32,Ndays=1)
3838
@test all(abs.(Prog.η) .< 10) # sea surface height shouldn't exceed +-10m
3939
@test all(Prog.u .!= 0.0f0)
4040
end

0 commit comments

Comments
 (0)