@@ -68,124 +68,3 @@ function update_state!(coupled_model::OceanSeaIceModel, callbacks=[]; compute_te
6868
6969 return nothing
7070end
71-
72- function thermodynamic_sea_ice_time_step! (coupled_model)
73- sea_ice = coupled_model. sea_ice
74- model = sea_ice. model
75- Δt = sea_ice. Δt
76- grid = coupled_model. sea_ice. model. grid
77- arch = architecture (grid)
78- clock = model. clock
79- thermodynamics = model. ice_thermodynamics
80- ice_thickness = model. ice_thickness
81- ice_concentration = model. ice_concentration
82- ice_consolidation_thickness = model. ice_consolidation_thickness
83- top_external_heat_flux = model. external_heat_fluxes. top
84- bottom_external_heat_flux = model. external_heat_fluxes. bottom
85- ocean_salinity = coupled_model. ocean. model. tracers. S
86-
87- launch! (arch, grid, :xy , update_thickness!,
88- ice_thickness,
89- grid, Δt,
90- ice_concentration,
91- ice_consolidation_thickness,
92- ocean_salinity,
93- thermodynamics,
94- top_external_heat_flux,
95- bottom_external_heat_flux,
96- clock)
97-
98- return nothing
99- end
100-
101- @inline function conservative_adjustment (ℵ, h, hᶜ)
102- V = ℵ * h # = ℵ⁺ * (h + dh)
103- dh = max (zero (h), hᶜ - h)
104- ℵ⁺ = V / (h + dh)
105- return ℵ⁺, h + dh
106- end
107-
108- @kernel function update_thickness! (ice_thickness,
109- grid, Δt,
110- ice_concentration,
111- ice_consolidation_thickness,
112- ocean_salinity,
113- thermodynamics,
114- top_external_heat_flux,
115- bottom_external_heat_flux,
116- clock)
117-
118- i, j = @index (Global, NTuple)
119- kᴺ = size (grid, 3 )
120-
121- phase_transitions = thermodynamics. phase_transitions
122- top_heat_bc = thermodynamics. heat_boundary_conditions. top
123- bottom_heat_bc = thermodynamics. heat_boundary_conditions. bottom
124- liquidus = phase_transitions. liquidus
125-
126- Qi = thermodynamics. internal_heat_flux
127- Qu = top_external_heat_flux
128- Qb = bottom_external_heat_flux
129- Tu = thermodynamics. top_surface_temperature
130-
131- @inbounds begin
132- hᶜ = ice_consolidation_thickness[i, j, kᴺ]
133- hᵢ = ice_thickness[i, j, kᴺ]
134- ℵᵢ = ice_concentration[i, j, kᴺ]
135- end
136-
137- # Volume conserving adjustment to respect minimum thickness
138- ℵᵢ, hᵢ = conservative_adjustment (ℵᵢ, hᵢ, hᶜ)
139-
140- # Consolidation criteria
141- @inbounds Tuᵢ = Tu[i, j, 1 ]
142-
143- # Bottom temperature at the melting temperature
144- Sₒ = @inbounds ocean_salinity[i, j, kᴺ]
145- Tbᵢ = SeaIceThermodynamics. melting_temperature (liquidus, Sₒ)
146- ℰb = SeaIceThermodynamics. latent_heat (phase_transitions, Tbᵢ)
147- ℰu = SeaIceThermodynamics. latent_heat (phase_transitions, Tuᵢ)
148-
149- # Retrieve fluxes
150- @inbounds begin
151- Quᵢ = Qu[i, j, 1 ]
152- Qbᵢ = Qb[i, j, 1 ]
153- end
154-
155- # If ice is consolidated, compute tendency for an ice slab; otherwise
156- # just add ocean fluxes from frazil ice formation or melting
157- # wb = - Qbᵢ / ℰb
158-
159- 𝓀 = Qi. parameters. flux. conductivity
160- Qiᵢ = - 𝓀 * (Tuᵢ - Tbᵢ) / hᵢ * (hᵢ > hᶜ) # getflux(Qi, i, j, grid, Tuᵢ, clock, model_fields)
161-
162- # Upper (top) and bottom interface velocities
163- w_top = (Quᵢ - Qiᵢ) / ℰu # < 0 => melting
164- w_bot = + Qiᵢ / ℰb # < 0 => freezing
165- w_frz = - Qbᵢ / ℰb # < 0 => freezing
166-
167- Δh_top = w_top * Δt * ℵᵢ
168- Δh_bot = w_bot * Δt * ℵᵢ
169- ΔV_frz = w_frz * Δt # frazil flux contributes from entire cell
170-
171- # Compute frazil growth: lateral first, then vertical
172- # dV = dh * ℵ + h * dℵ
173- dℵ = min (1 - ℵᵢ, ΔV_frz / hᵢ)
174- dℵ = max (dℵ, zero (dℵ))
175- ℵ⁺ = ℵᵢ + dℵ
176- Δh_frz = ΔV_frz - hᵢ * ℵ⁺
177-
178- Δh = Δh_frz + Δh_bot + Δh_top
179-
180- h⁺ = hᵢ + Δh / ℵ⁺ * (Δh > 0 )
181- h⁺ = max (zero (h⁺), h⁺)
182-
183- # Adjust again to be paranoid?
184- ℵ⁺, h⁺ = conservative_adjustment (ℵ⁺, h⁺, hᶜ)
185-
186- @inbounds begin
187- ice_thickness[i, j, kᴺ] = h⁺
188- ice_concentration[i, j, kᴺ] = ℵ⁺
189- end
190- end
191-
0 commit comments