@@ -13,6 +13,7 @@ using Oceananigans
1313using Oceananigans. Units
1414using Dates
1515using Printf
16+ using Statistics
1617
1718# ### Grid and Bathymetry
1819
@@ -44,8 +45,8 @@ grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom_height);
4445#
4546# We include temperature and salinity surface restoring to ECCO data from 1993 thoughout the water column.
4647
47- start_date = DateTime (1993 , 1 , 1 )
48- stop_date = DateTime (1993 , 12 , 1 )
48+ start_date = DateTime (1993 , 6 , 1 )
49+ stop_date = DateTime (1994 , 5 , 1 )
4950dates = range (start_date, step= Month (1 ), stop= stop_date)
5051ecco_temperature = Metadata (:temperature ; dates, dataset= ECCO4Monthly ())
5152ecco_salinity = Metadata (:salinity ; dates, dataset= ECCO4Monthly ())
@@ -117,15 +118,15 @@ function progress(sim)
117118 u, v, w = ocean. model. velocities
118119 T = ocean. model. tracers. T
119120 e = ocean. model. tracers. e
120- Tmin, Tmax = minimum (T), maximum (T)
121+ Tmin, Tmax, Tavg = minimum (T), maximum (T), mean ( view (T, :, :, ocean . model . grid . Nz) )
121122 emax = maximum (e)
122123 umax = (maximum (abs, u), maximum (abs, v), maximum (abs, w))
123124
124125 step_time = 1e-9 * (time_ns () - wall_time[])
125126
126127 msg1 = @sprintf (" Time: %s, iter: %d" , prettytime (sim), iteration (sim))
127128 msg2 = @sprintf (" , max|u|: (%.1e, %.1e, %.1e) m s⁻¹, " , umax... )
128- msg3 = @sprintf (" , extrema(T): (%.1f, %.1f) ᵒC, " , Tmin, Tmax)
129+ msg3 = @sprintf (" , extrema(T): (%.1f, %.1f) ᵒC, mean(T(z=0)): %.1f ᵒC " , Tmin, Tmax, Tavg )
129130 msg4 = @sprintf (" , maximum(e): %.2f m² s⁻², " , emax)
130131 msg5 = @sprintf (" , wall time: %s \n " , prettytime (step_time))
131132
@@ -157,13 +158,13 @@ ocean.output_writers[:surface] = JLD2Writer(ocean.model, outputs;
157158
158159# We are ready to press the big red button and run the simulation.
159160
160- # After we run for a short time (here we set up the simulation with `stop_time = 10days `),
161+ # After we run for a short time (here we set up the simulation with `stop_time = 20days `),
161162# we increase the timestep and run for longer.
162163
163164run! (simulation)
164165
165166simulation. Δt = 20 minutes
166- simulation. stop_time = 360 days
167+ simulation. stop_time = 365 days
167168run! (simulation)
168169
169170# ### A pretty movie
@@ -222,7 +223,7 @@ axe = Axis(fig[3, 1])
222223hm = heatmap! (axs, sn, colorrange = (0 , 0.5 ), colormap = :deep , nan_color= :lightgray )
223224Colorbar (fig[1 , 2 ], hm, label = " Surface speed (m s⁻¹)" )
224225
225- hm = heatmap! (axT, Tn, colorrange = (- 1 , 30 ), colormap = :magma , nan_color= :lightgray )
226+ hm = heatmap! (axT, Tn, colorrange = (- 1 , 32 ), colormap = :magma , nan_color= :lightgray )
226227Colorbar (fig[2 , 2 ], hm, label = " Surface Temperature (ᵒC)" )
227228
228229hm = heatmap! (axe, en, colorrange = (0 , 1e-3 ), colormap = :solar , nan_color= :lightgray )
0 commit comments