diff --git a/examples/one_degree_simulation.jl b/examples/one_degree_simulation.jl index efb29e0f..9170dc45 100644 --- a/examples/one_degree_simulation.jl +++ b/examples/one_degree_simulation.jl @@ -13,6 +13,7 @@ using Oceananigans using Oceananigans.Units using Dates using Printf +using Statistics # ### Grid and Bathymetry @@ -44,8 +45,8 @@ grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom_height); # # We include temperature and salinity surface restoring to ECCO data from 1993 thoughout the water column. -start_date = DateTime(1993, 1, 1) -stop_date = DateTime(1993, 12, 1) +start_date = DateTime(1993, 6, 1) +stop_date = DateTime(1994, 5, 1) dates = range(start_date, step=Month(1), stop=stop_date) ecco_temperature = Metadata(:temperature; dates, dataset=ECCO4Monthly()) ecco_salinity = Metadata(:salinity; dates, dataset=ECCO4Monthly()) @@ -117,7 +118,7 @@ function progress(sim) u, v, w = ocean.model.velocities T = ocean.model.tracers.T e = ocean.model.tracers.e - Tmin, Tmax = minimum(T), maximum(T) + Tmin, Tmax, Tavg = minimum(T), maximum(T), mean(view(T, :, :, ocean.model.grid.Nz)) emax = maximum(e) umax = (maximum(abs, u), maximum(abs, v), maximum(abs, w)) @@ -125,7 +126,7 @@ function progress(sim) msg1 = @sprintf("Time: %s, iter: %d", prettytime(sim), iteration(sim)) msg2 = @sprintf(", max|u|: (%.1e, %.1e, %.1e) m s⁻¹, ", umax...) - msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, ", Tmin, Tmax) + msg3 = @sprintf(", extrema(T): (%.1f, %.1f) ᵒC, mean(T(z=0)): %.1f ᵒC", Tmin, Tmax, Tavg) msg4 = @sprintf(", maximum(e): %.2f m² s⁻², ", emax) msg5 = @sprintf(", wall time: %s \n", prettytime(step_time)) @@ -157,13 +158,13 @@ ocean.output_writers[:surface] = JLD2Writer(ocean.model, outputs; # We are ready to press the big red button and run the simulation. -# After we run for a short time (here we set up the simulation with `stop_time = 10days`), +# After we run for a short time (here we set up the simulation with `stop_time = 20days`), # we increase the timestep and run for longer. run!(simulation) simulation.Δt = 20minutes -simulation.stop_time = 360days +simulation.stop_time = 365days run!(simulation) # ### A pretty movie @@ -222,7 +223,7 @@ axe = Axis(fig[3, 1]) hm = heatmap!(axs, sn, colorrange = (0, 0.5), colormap = :deep, nan_color=:lightgray) Colorbar(fig[1, 2], hm, label = "Surface speed (m s⁻¹)") -hm = heatmap!(axT, Tn, colorrange = (-1, 30), colormap = :magma, nan_color=:lightgray) +hm = heatmap!(axT, Tn, colorrange = (-1, 32), colormap = :magma, nan_color=:lightgray) Colorbar(fig[2, 2], hm, label = "Surface Temperature (ᵒC)") hm = heatmap!(axe, en, colorrange = (0, 1e-3), colormap = :solar, nan_color=:lightgray)