Skip to content

Commit ff57090

Browse files
add a forced simulation
1 parent adb8393 commit ff57090

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

experiments/veros_forced_simulation.jl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ VerosModule.veros_settings_set!(ocean, "dt_tracer", 1800.0)
1212
atmos = JRA55PrescribedAtmosphere(; backend = JRA55NetCDFBackend(10))
1313
radiation = Radiation()
1414
coupled_model = OceanSeaIceModel(ocean, nothing; atmosphere=atmos, radiation)
15-
simulation = Simulation(coupled_model; Δt = 1800, stop_iteration = 100)
15+
simulation = Simulation(coupled_model; Δt = 1800, stop_iteration = 100000)
1616

1717
wall_time = Ref(time_ns())
1818

19+
s = []
20+
tx = []
21+
ty = []
22+
23+
us = coupled_model.interfaces.exchanger.exchange_ocean_state.u
24+
vs = coupled_model.interfaces.exchanger.exchange_ocean_state.v
25+
26+
stmp = Field(sqrt(us^2 + vs^2))
27+
1928
function progress(sim)
2029
ocean = sim.model.ocean
2130
umax = maximum(PyArray(ocean.setup.state.variables.u))
@@ -30,11 +39,16 @@ function progress(sim)
3039

3140
@info msg1 * msg5 * msg6
3241

33-
wall_time[] = time_ns()
42+
wall_time[] = time_ns()
43+
44+
compute!(stmp)
45+
push!(s, deepcopy(interior(stmp, :, :, 1)))
46+
push!(tx, deepcopy(interior(coupled_model.interfaces.net_fluxes.ocean_surface.u, :, :, 1) .* 1020))
47+
push!(ty, deepcopy(interior(coupled_model.interfaces.net_fluxes.ocean_surface.v, :, :, 1) .* 1020))
3448

35-
return nothing
49+
return nothing
3650
end
3751

38-
add_callback!(simulation, progress, IterationInterval(10))
52+
add_callback!(simulation, progress, IterationInterval(5))
3953

4054
run!(simulation)

0 commit comments

Comments
 (0)