Skip to content

Commit 06940ab

Browse files
committed
add averages
1 parent 133f008 commit 06940ab

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

examples/bomex.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ using CloudMicrophysics.Microphysics0M: remove_precipitation
1313

1414
# Siebesma et al (2003) resolution!
1515
# DOI: https://doi.org/10.1175/1520-0469(2003)60<1201:ALESIS>2.0.CO;2
16-
Nx = Ny = 64
17-
Nz = 75
16+
Nx = Ny = 32
17+
Nz = 40
1818

1919
Lx = 6400
2020
Ly = 6400
@@ -245,15 +245,24 @@ add_callback!(simulation, progress, IterationInterval(10))
245245
# Sʳ = ForcingOperation(:q, model)
246246
# outputs = merge(model.velocities, model.tracers, (; T, qˡ, qᵛ★, Sʳ))
247247
outputs = merge(model.velocities, model.tracers, (; T, qˡ, qᵛ★))
248+
averaged_outputs = NamedTuple(name => Average(outputs[name], dims=(1, 2)) for name in keys(outputs))
248249

249250
filename = string("bomex_", Nx, "_", Ny, "_", Nz, ".jld2")
251+
averages_filename = string("bomex_averages", Nx, "_", Ny, "_", Nz, ".jld2")
250252

251253
ow = JLD2Writer(model, outputs; filename,
252254
schedule = TimeInterval(1minutes),
253255
overwrite_existing = true)
254256

255257
simulation.output_writers[:jld2] = ow
256258

259+
averages_ow = JLD2Writer(model, averaged_outputs;
260+
filename = averages_filename,
261+
. schedule = TimeInterval(1minutes),
262+
overwrite_existing = true)
263+
264+
simulation.output_writers[:avg] = averages_ow
265+
257266
@info "Running BOMEX on grid: \n $grid \n and using model: \n $model"
258267
run!(simulation)
259268

0 commit comments

Comments
 (0)