-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export Surface | ||
export Bottom | ||
|
||
abstract type OceanInterface end | ||
abstract type Surface <: OceanInterface end | ||
abstract type Bottom <: OceanInterface end | ||
|
||
struct BoundaryProfileFunctionType{BoundaryType <: OceanInterface} <: ModellingFunction{2} end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export altimetry_profile | ||
|
||
const altimetry_profile = BoundaryProfileFunctionType{Surface}() | ||
|
||
altimetry_profile(::ModelName{:Flat}, x::Real, y::Real; z::Real = 0.0)::Float64 = z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export bathymetry_profile | ||
|
||
const bathymetry_profile = BoundaryProfileFunctionType{Bottom}() | ||
|
||
bathymetry_profile(::ModelName{:Flat}, x::Real, y::Real; z::Real)::Float64 = z | ||
|
||
bathymetry_profile(::ModelName{:Epipelagic}, x::Real, y::Real)::Float64 = 100.0 | ||
bathymetry_profile(::ModelName{:Mesopelagic}, x::Real, y::Real)::Float64 = 1e3 | ||
bathymetry_profile(::ModelName{:Bathypelagic}, x::Real, y::Real)::Float64 = 4e3 | ||
bathymetry_profile(::ModelName{:Abyssopelagic}, x::Real, y::Real)::Float64 = 6e3 | ||
|
||
bathymetry_profile(::ModelName{:Bottomless}, x::Real, y::Real)::Float64 = Inf | ||
|
||
function bathymetry_profile(::ModelName{:Parabolic}, x::Real, y::Real; | ||
b = 250e3, c = 250.0 | ||
)::Float64 | ||
r = hypot(x, y) | ||
2e-3b * sqrt(1 + r/c) | ||
end |
15 changes: 15 additions & 0 deletions
15
src/99_postliminary/01_functors/boundary/99_postliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export BoundaryProfile | ||
|
||
struct BoundaryProfile{InterfaceType <: OceanInterface, ProfileFunctionType <: Function} <: ModellingFunctor{2} | ||
profile::ProfileFunctionType | ||
|
||
function BoundaryProfile{InterfaceType}(model::ModelName; pars...) where {InterfaceType <: OceanInterface} | ||
boundary_profile = BoundaryProfileFunctionType{InterfaceType}() | ||
profile(x::Real, y::Real) = boundary_profile(model, x, y; pars...) | ||
new{InterfaceType, profile |> typeof}(profile) | ||
end | ||
end | ||
|
||
function (bnd::BoundaryProfile{<:OceanInterface, <:Function})(x::Real, y::Real) | ||
bnd.profile(x, y) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
struct CelerityProfileFunctionType{MediumType <: AcousticMedium} <: ModellingFunction{3} end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...y/01_profiles/celerity/99_postliminary.jl → ...y/01_functors/celerity/99_postliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export CelerityProfile | ||
|
||
struct CelerityProfile{MediumType <: Medium, ProfileFunctionType <: Function} <: ModellingFunctor{3} | ||
struct CelerityProfile{MediumType <: AcousticMedium, ProfileFunctionType <: Function} <: ModellingFunctor{3} | ||
profile::ProfileFunctionType | ||
|
||
function CelerityProfile{MediumType}(model::ModelName; pars...) where {MediumType <: Medium} | ||
function CelerityProfile{MediumType}(model::ModelName; pars...) where {MediumType <: AcousticMedium} | ||
celerity_profile = CelerityProfileFunctionType{MediumType}() | ||
profile(x::Real, y::Real, z::Real) = celerity_profile(model, x, y, z; pars...) | ||
new{MediumType, profile |> typeof}(profile) | ||
end | ||
end | ||
|
||
function (cel::CelerityProfile{<:Medium, <:Function})(x::Real, y::Real, z::Real) | ||
function (cel::CelerityProfile{<:AcousticMedium, <:Function})(x::Real, y::Real, z::Real) | ||
cel.profile(x, y, z) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
struct DensityProfileFunctionType{MediumType <: AcousticMedium} <: ModellingFunction{3} end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...ry/01_profiles/density/99_postliminary.jl → ...ry/01_functors/density/99_postliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export DensityProfile | ||
|
||
struct DensityProfile{MediumType <: Medium, ProfileFunctionType <: Function} <: ModellingFunctor{3} | ||
struct DensityProfile{MediumType <: AcousticMedium, ProfileFunctionType <: Function} <: ModellingFunctor{3} | ||
profile::ProfileFunctionType | ||
|
||
function DensityProfile{MediumType}(model::ModelName; pars...) where {MediumType <: Medium} | ||
function DensityProfile{MediumType}(model::ModelName; pars...) where {MediumType <: AcousticMedium} | ||
density_profile = DensityProfileFunctionType{MediumType}() | ||
profile(x::Real, y::Real, z::Real) = density_profile(model, x, y, z; pars...) | ||
new{MediumType, profile |> typeof}(profile) | ||
end | ||
end | ||
|
||
function (den::DensityProfile{<:Medium, <:Function})(x::Real, y::Real, z::Real) | ||
function (den::DensityProfile{<:AcousticMedium, <:Function})(x::Real, y::Real, z::Real) | ||
den.profile(x, y, z) | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.