Skip to content

Commit b53fcf1

Browse files
Use a thermodynamic tendency ice-ocean salt flux (#539)
* add a thermodynamic tendency * Update src/OceanSeaIceModels/InterfaceComputations/sea_ice_ocean_fluxes.jl Co-authored-by: Gregory L. Wagner <[email protected]> * Update src/OceanSeaIceModels/InterfaceComputations/sea_ice_ocean_fluxes.jl * bugfix --------- Co-authored-by: Gregory L. Wagner <[email protected]>
1 parent 952ee41 commit b53fcf1

File tree

4 files changed

+9
-36
lines changed

4 files changed

+9
-36
lines changed

src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ mutable struct AtmosphereInterface{J, F, ST, P}
4242
properties :: P
4343
end
4444

45-
mutable struct SeaIceOceanInterface{J, P, H, A}
45+
mutable struct SeaIceOceanInterface{J, P}
4646
fluxes :: J
4747
properties :: P
48-
previous_ice_thickness :: H
49-
previous_ice_concentration :: A
5048
end
5149

5250
mutable struct ComponentInterfaces{AO, ASI, SIO, C, AP, OP, SIP, EX, P}
@@ -261,8 +259,6 @@ sea_ice_ocean_interface(sea_ice, ocean) = nothing
261259
function sea_ice_ocean_interface(sea_ice::SeaIceSimulation, ocean;
262260
characteristic_melting_speed = 1e-5)
263261

264-
previous_ice_thickness = deepcopy(sea_ice.model.ice_thickness)
265-
previous_ice_concentration = deepcopy(sea_ice.model.ice_concentration)
266262
io_bottom_heat_flux = Field{Center, Center, Nothing}(ocean.model.grid)
267263
io_frazil_heat_flux = Field{Center, Center, Nothing}(ocean.model.grid)
268264
io_salt_flux = Field{Center, Center, Nothing}(ocean.model.grid)
@@ -281,10 +277,7 @@ function sea_ice_ocean_interface(sea_ice::SeaIceSimulation, ocean;
281277

282278
io_properties = (; characteristic_melting_speed)
283279

284-
return SeaIceOceanInterface(io_fluxes,
285-
io_properties,
286-
previous_ice_thickness,
287-
previous_ice_concentration)
280+
return SeaIceOceanInterface(io_fluxes, io_properties)
288281
end
289282

290283
default_ai_temperature(sea_ice) = nothing

src/OceanSeaIceModels/InterfaceComputations/sea_ice_ocean_fluxes.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function compute_sea_ice_ocean_fluxes!(coupled_model)
1515
Sᵢ = sea_ice.model.tracers.S
1616
ℵᵢ = sea_ice.model.ice_concentration
1717
hᵢ = sea_ice.model.ice_thickness
18-
h⁻ = coupled_model.interfaces.sea_ice_ocean_interface.previous_ice_thickness
18+
Gh = sea_ice.model.ice_thermodynamics.thermodynamic_tendency
1919

2020
ocean_properties = coupled_model.interfaces.ocean_properties
2121
liquidus = sea_ice.model.ice_thermodynamics.phase_transitions.liquidus
@@ -35,7 +35,7 @@ function compute_sea_ice_ocean_fluxes!(coupled_model)
3535
# What about the latent heat removed from the ocean when ice forms?
3636
# Is it immediately removed from the ocean? Or is it stored in the ice?
3737
launch!(arch, grid, :xy, _compute_sea_ice_ocean_fluxes!,
38-
sea_ice_ocean_fluxes, grid, clock, hᵢ, h⁻, ℵᵢ, Sᵢ, Tₒ, Sₒ, uᵢ, vᵢ,
38+
sea_ice_ocean_fluxes, grid, clock, hᵢ, ℵᵢ, Sᵢ, Gh, Tₒ, Sₒ, uᵢ, vᵢ,
3939
τs, liquidus, ocean_properties, interface_properties, Δt)
4040

4141
return nothing
@@ -45,9 +45,9 @@ end
4545
grid,
4646
clock,
4747
ice_thickness,
48-
previous_ice_thickness,
4948
ice_concentration,
5049
ice_salinity,
50+
thermodynamic_tendency,
5151
ocean_temperature,
5252
ocean_salinity,
5353
sea_ice_u_velocity,
@@ -73,7 +73,6 @@ end
7373
Sᵢ = ice_salinity
7474
hᵢ = ice_thickness
7575
ℵᵢ = ice_concentration
76-
h⁻ = previous_ice_thickness
7776
ρₒ = ocean_properties.reference_density
7877
cₒ = ocean_properties.heat_capacity
7978
uₘ★ = interface_properties.characteristic_melting_speed
@@ -136,16 +135,10 @@ end
136135
τₒᵢ = sea_ice_ocean_stresses
137136

138137
@inbounds begin
139-
# Change in thickness
140-
Δh = hᵢ[i, j, 1] - h⁻[i, j, 1]
141-
142138
# Update surface salinity flux.
143139
# Note: the Δt below is the ocean time-step, eg.
144140
# ΔS = ⋯ - ∮ Jˢ dt ≈ ⋯ - Δtₒ * Jˢ
145-
Jˢ[i, j, 1] = Δh / Δt * (Sᵢ[i, j, 1] - Sₒ[i, j, Nz])
146-
147-
# Update previous ice thickness
148-
h⁻[i, j, 1] = hᵢ[i, j, 1]
141+
Jˢ[i, j, 1] = thermodynamic_tendency[i, j, 1] * (Sᵢ[i, j, 1] - Sₒ[i, j, Nz])
149142

150143
# Momentum stresses
151144
τx[i, j, 1] = x_momentum_stress(i, j, Nz, grid, τₒᵢ, clock, sea_ice_fields)

src/OceanSeaIceModels/freezing_limited_ocean_temperature.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sea_ice_thickness(::FreezingLimitedOceanTemperature) = nothing
2929
# does not matter
3030
reference_density(::FreezingLimitedOceanTemperature) = 0
3131
heat_capacity(::FreezingLimitedOceanTemperature) = 0
32+
time_step!(::FreezingLimitedOceanTemperature, Δt) = nothing
3233

3334
function compute_sea_ice_ocean_fluxes!(cm::FreezingLimitedCoupledModel)
3435
ocean = cm.ocean

src/OceanSeaIceModels/time_step_ocean_sea_ice_model.jl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,10 @@ function time_step!(coupled_model::OceanSeaIceModel, Δt; callbacks=[], compute_
1414
ocean = coupled_model.ocean
1515
sea_ice = coupled_model.sea_ice
1616
atmosphere = coupled_model.atmosphere
17-
clock = coupled_model.clock
1817

1918
# Eventually, split out into OceanOnlyModel
20-
if sea_ice isa SeaIceSimulation
21-
h = sea_ice.model.ice_thickness
22-
fill_halo_regions!(h)
23-
24-
# Initialization
25-
if coupled_model.clock.iteration == 0
26-
@info "Initializing coupled model ice thickness..."
27-
h⁻ = coupled_model.interfaces.sea_ice_ocean_interface.previous_ice_thickness
28-
hⁿ = coupled_model.sea_ice.model.ice_thickness
29-
parent(h⁻) .= parent(hⁿ)
30-
end
31-
32-
time_step!(sea_ice, Δt)
33-
end
34-
19+
!isnothing(sea_ice) && time_step!(sea_ice, Δt)
20+
3521
# TODO after ice time-step:
3622
# - Adjust ocean heat flux if the ice completely melts?
3723
time_step!(ocean, Δt)

0 commit comments

Comments
 (0)