-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_osc.jl
69 lines (59 loc) · 1.98 KB
/
test_osc.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
58
59
60
61
62
63
64
65
66
67
68
69
using Serialization
using Random
Random.seed!(1234)
include("models.jl")
include("integrators.jl")
include("enoc.jl")
using .Models
using .Integrators
using .enoc
M = 100
D = 5
k = 40
k_r = 30
window = 50
da = false
inflation = 1.0
osc_vars = 1:2
modes = 1:2
model = Models.osc_true
model_err = Models.osc_err
integrator = Integrators.rk4
outfreq = 10
Δt = 0.05
m = 20
cycles = 1000
record_length = 25000
ens_err_pct = 0.2
obs_err_pct = 0.1
transient = 3000
mp = 5
y0 = [randn(3)..., 0, 0.3*10]
varimax = false
check_bounds = false
y_fcst = true
α = 0.5
if !da
info, ssa_info = enoc.run(model=model, model_err=model_err, M=M, D=D, k=k,
k_r=k_r, modes=modes, osc_vars=osc_vars,
integrator=integrator, outfreq=outfreq, Δt=Δt,
m=m, cycles=1000, window=window,
record_length=record_length,
ens_err_pct=ens_err_pct, obs_err_pct=obs_err_pct,
transient=transient, y0=y0, mp=mp,
varimax=varimax, da=false, inflation=inflation,
check_bounds=check_bounds, y_fcst=y_fcst, α=α,
preload="osc")
mp = argmin(enoc.optimal_ens(info)[1])[1]
end
Random.seed!(1234)
info, ssa_info = enoc.run(model=model, model_err=model_err, M=M, D=D, k=k,
k_r=k_r, modes=modes, osc_vars=osc_vars,
integrator=integrator, outfreq=outfreq, Δt=Δt, m=m,
cycles=cycles, window=window,
record_length=record_length, ens_err_pct=ens_err_pct,
obs_err_pct=obs_err_pct, transient=transient, y0=y0,
mp=mp, varimax=varimax, da=da, inflation=inflation,
check_bounds=check_bounds, y_fcst=y_fcst, α=α,
preload="osc")
serialize(open(string("out_osc_", ARGS[1]), "w"), info)