Skip to content

Commit

Permalink
Add PREM_NOOCEAN, PREM but without the ocean
Browse files Browse the repository at this point in the history
This model is used by other packages (e.g., SPECFEM, TauP) since
it avoids the liquid layer at the surface, which is tricky for
some calculations.  It simply removes the ocean and continues the
layer below to the surface, this has slightly higher mass and
gravity.
  • Loading branch information
anowacki committed Jan 14, 2021
1 parent e622f3c commit 12b647d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -21,8 +21,7 @@ Currently, only three kinds of one-dimensional models are supported, but all mod
parameterisations and models are acceptable for inclusion. Contributions
are welcome.

Built in models are ak135, PREM, iasp91, and Weber et al. (Science, 2011)'s
model of the moon.
Built in models are [listed in the documentation](https://anowacki.github.io/SeisModels.jl/dev/inbuilt_models/).


## How to install
Expand Down Expand Up @@ -123,6 +122,7 @@ does support reading and writing of
- `AK135`
- `IASP91`
- `PREM`
- `PREM_NOOCEAN`
- `STW105`
- Moon
- `MOON_WEBER_2011`
Expand Down Expand Up @@ -163,6 +163,8 @@ does support reading and writing of
#### IO
- `read_mineos`: Read Mineos tabular-format file
- `write_mineos`: Write Mineos tabular-format file
- `read_tvel`: Write tvel-format file
- `write_tvel`: Write tvel-format file


## Getting help
Expand Down
4 changes: 3 additions & 1 deletion docs/src/inbuilt_models.md
@@ -1,14 +1,16 @@
# Inbuilt models

Most users of SeisModels will probably want to simply calculate
properties for one of the inbuilt models. These are listed below:
properties for one of the inbuilt models, which are all exported.
These are listed below:

## Earth models
```@docs
AK135
EK137
IASP91
PREM
PREM_NOOCEAN
STW105
```

Expand Down
2 changes: 1 addition & 1 deletion src/Earth/Earth.jl
Expand Up @@ -14,7 +14,7 @@ List of Earth model instances as `Symbol`s.
If adding new inbuilt Earth models, append the name of the new model to this list
"""
const ALL_MODELS = (:AK135, :EK137, :IASP91, :PREM, :STW105)
const ALL_MODELS = (:AK135, :EK137, :IASP91, :PREM, :PREM_NOOCEAN, :STW105)

include("ak135.jl")
include("ek137.jl")
Expand Down
25 changes: 24 additions & 1 deletion src/Earth/prem.jl
Expand Up @@ -56,4 +56,27 @@ const PREM = PREMPolyModel(
[1327.7 57823. 57823. 57823. 57823. 57823. 57823. 57823. 57823. 57823. 57823. 57823. 57823.],
fref =
1.0
)
)

"""
# `PREM_NOOCEAN`
Version of [`PREM`](@ref) where the liquid ocean layer is replaced by the
crust beneath. This model may be useful when the surface must be a solid.
"""
const PREM_NOOCEAN = let inds = 1:(PREM.n - 1)
PREMPolyModel(
r = [PREM.r[1:(PREM.n - 2)]; PREM.a],
vp = PREM.vp[:,inds],
vs = PREM.vs[:,inds],
density = PREM.density[:,inds],
vph = PREM.vph[:,inds],
vpv = PREM.vpv[:,inds],
vsh = PREM.vsh[:,inds],
vsv = PREM.vsv[:,inds],
eta = PREM.eta[:,inds],
= PREM.Qμ[:,inds],
= PREM.Qκ[:,inds],
fref = PREM.fref
)
end
14 changes: 14 additions & 0 deletions test/inbuilt_models.jl
Expand Up @@ -48,6 +48,20 @@ using SeisModels
@test gravity(PREM, surface_radius(PREM)) 9.81 atol=0.02
end

@testset "PREM_NOOCEAN" begin
@test surface_radius(PREM_NOOCEAN) == surface_radius(PREM)
@test length(PREM_NOOCEAN.r) == length(PREM.r) - 1
@test isanisotropic(PREM_NOOCEAN)
@test vp(PREM_NOOCEAN, 0) 11.2622
@test hasattenuation(PREM_NOOCEAN)
@test hasreffrequency(PREM_NOOCEAN)
@test reffrequency(PREM_NOOCEAN) == 1.0
@test (PREM_NOOCEAN, 0, depth=true) == 600.0
@test eta(PREM_NOOCEAN, 0, depth=true) == 1.0
@test vp(PREM_NOOCEAN, 0, depth=true) == 5.8
@test vsv(PREM_NOOCEAN, 0, depth=true) == 3.2
end

@testset "STW105" begin
@test surface_radius(STW105) == 6371.0
@test isanisotropic(STW105)
Expand Down

0 comments on commit 12b647d

Please sign in to comment.