@@ -52,8 +52,8 @@ ocean = ocean_simulation(grid;
52
52
53
53
dataset = ECCO4Monthly ()
54
54
55
- set! (ocean. model, T= Metadata (:temperature ; dataset),
56
- S= Metadata (:salinity ; dataset))
55
+ set! (ocean. model, T= Metadatum (:temperature ; dataset),
56
+ S= Metadatum (:salinity ; dataset))
57
57
58
58
# ####
59
59
# #### A Prognostic Sea-ice model
@@ -63,12 +63,11 @@ using ClimaSeaIce.SeaIceMomentumEquations
63
63
using ClimaSeaIce. Rheologies
64
64
65
65
# Remember to pass the SSS as a bottom bc to the sea ice!
66
- SSS = view (ocean. model. tracers. S, :, :, grid. Nz)
66
+ SSS = view (ocean. model. tracers. S. data , :, :, grid. Nz)
67
67
bottom_heat_boundary_condition = IceWaterThermalEquilibrium (SSS)
68
68
69
69
SSU = view (ocean. model. velocities. u, :, :, grid. Nz)
70
70
SSV = view (ocean. model. velocities. u, :, :, grid. Nz)
71
-
72
71
τo = SemiImplicitStress (uₑ= SSU, vₑ= SSV)
73
72
τua = Field {Face, Center, Nothing} (grid)
74
73
τva = Field {Center, Face, Nothing} (grid)
@@ -77,14 +76,14 @@ dynamics = SeaIceMomentumEquation(grid;
77
76
coriolis = ocean. model. coriolis,
78
77
top_momentum_stress = (u= τua, v= τva),
79
78
bottom_momentum_stress = τo,
80
- ocean_velocities = (u= SSU, v= SSV),
79
+ ocean_velocities = (u= 0.1 * SSU, v= 0.1 * SSV),
81
80
rheology = ElastoViscoPlasticRheology (),
82
81
solver = SplitExplicitSolver (120 ))
83
82
84
83
sea_ice = sea_ice_simulation (grid; bottom_heat_boundary_condition, dynamics, advection= WENO (order= 7 ))
85
84
86
- set! (sea_ice. model, h= Metadata (:sea_ice_thickness ; dataset),
87
- ℵ= Metadata (:sea_ice_concentration ; dataset))
85
+ set! (sea_ice. model, h= Metadatum (:sea_ice_thickness ; dataset),
86
+ ℵ= Metadatum (:sea_ice_concentration ; dataset))
88
87
89
88
# ####
90
89
# #### A Prescribed Atmosphere model
@@ -134,19 +133,20 @@ using Statistics
134
133
135
134
function progress (sim)
136
135
sea_ice = sim. model. sea_ice
137
- hmax = maximum (sea_ice. model. ice_thickness)
138
- ℵmax = maximum (sea_ice. model. ice_concentration)
139
- hmean = mean (sea_ice. model. ice_thickness)
140
- ℵmean = mean (sea_ice. model. ice_concentration)
141
- Tmax = maximum (sim. model. interfaces. atmosphere_sea_ice_interface. temperature)
142
- Tmin = minimum (sim. model. interfaces. atmosphere_sea_ice_interface. temperature)
136
+ ocean = sim. model. ocean
137
+ hmax = maximum (sea_ice. model. ice_thickness)
138
+ ℵmax = maximum (sea_ice. model. ice_concentration)
139
+ uimax = maximum (abs, sea_ice. model. velocities. u)
140
+ vimax = maximum (abs, sea_ice. model. velocities. v)
141
+ uomax = maximum (abs, ocean. model. velocities. u)
142
+ vomax = maximum (abs, ocean. model. velocities. v)
143
143
144
144
step_time = 1e-9 * (time_ns () - wall_time[])
145
145
146
146
msg1 = @sprintf (" time: %s, iteration: %d, Δt: %s, " , prettytime (sim), iteration (sim), prettytime (sim. Δt))
147
147
msg2 = @sprintf (" max(h): %.2e m, max(ℵ): %.2e " , hmax, ℵmax)
148
- msg3 = @sprintf (" mean(h): %.2e m, mean(ℵ): %.2e " , hmean, ℵmean )
149
- msg4 = @sprintf (" extrema(T) : (%.2f, %.2f) ᵒC , " , Tmax, Tmin )
148
+ msg3 = @sprintf (" max uᵢ: (%.2f, %.2f) m s⁻¹, " , uimax, vimax )
149
+ msg4 = @sprintf (" max uₒ : (%.2f, %.2f) m s⁻¹ , " , uomax, vomax )
150
150
msg5 = @sprintf (" wall time: %s \n " , prettytime (step_time))
151
151
152
152
@info msg1 * msg2 * msg3 * msg4 * msg5
@@ -183,16 +183,6 @@ h = FieldTimeSeries("averaged_sea_ice_quantities.jld2", "h")
183
183
hm = FieldTimeSeries {Center, Center, Nothing} (grid, hE. times; backend= InMemory ())
184
184
ℵm = FieldTimeSeries {Center, Center, Nothing} (grid, hE. times; backend= InMemory ())
185
185
186
- for (i, time) in enumerate (hm. times)
187
- counter = 0
188
- for (j, t) in enumerate (h. times)
189
- if t ≤ time
190
- hm[i] .+ = h[j]
191
- ℵm[i] .+ = ℵ[j]
192
- counter += 1
193
- end
194
- end
195
- @show counter
196
- hm[i] ./= counter
197
- ℵm[i] ./= counter
198
- end
186
+ hMe = [mean (h[t]) for t in 1 : length (h. times)]
187
+ ℵMe = [mean (ℵ[t]) for t in 1 : length (ℵ. times)]
188
+
0 commit comments