-
Notifications
You must be signed in to change notification settings - Fork 13
/
test_examples.jl
57 lines (48 loc) · 1.72 KB
/
test_examples.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This tests the example scripts
using Test
const testing = true
@testset "examples in /scripts" begin
curdir = pwd()
pkg_dir = pkgdir(LaMEM)
cd(pkg_dir)
#cd(joinpath(pkg_dir,"test"))
# 3D subduction example
if !Sys.iswindows()
@testset "Subduction3D" begin
clean_directory()
include("../example_scripts/Subduction3D.jl")
data,time = read_LaMEM_timestep(model,last=true);
@test time ≈ 0.05504613
@test sum(data.fields.velocity[3][:,:,:]) ≈ -51.314083f0 rtol=1e-4 # check Vz
end
end
# Strength envelop example
@testset "StrengthEnvelop" begin
clean_directory()
include("../example_scripts/StrengthEnvelop.jl")
data,time = read_LaMEM_timestep(model,last=true);
@test time ≈ 0.09834706
@test sum(data.fields.velocity[3][:,:,:]) ≈ 14.305277f0 rtol=1e-4 # check Vz
end
# Subduction example
if !Sys.iswindows()
@testset "TM_Subduction_example" begin
clean_directory()
include("../example_scripts/TM_Subduction_example.jl")
data,time = read_LaMEM_timestep(model,last=true);
@test time ≈ 0.0021
@test sum(data.fields.velocity[3][:,:,:]) ≈ 420.10352f0 rtol=1e-4 # check Vz
end
end
# PassiveTracers example
if !Sys.iswindows()
@testset "PassiveTracers" begin
clean_directory()
include("../example_scripts/PassiveTracers.jl")
data,time = read_LaMEM_timestep(model,last=true);
@test time ≈ 1.078999
@test sum(data.fields.velocity[3][:,:,:]) ≈ 0.1642956f0 rtol=1e-4 # check Vz
end
end
cd(curdir)
end