Skip to content

Commit 5d5ae5f

Browse files
authored
Properly extend default_included_properties(::SeaIceModel) (#107)
* default_included_properties wasn't extended properly? * bump patch release * tuple -> Vector{Symbol}
1 parent 3923731 commit 5d5ae5f

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimaSeaIce"
22
uuid = "6ba0ff68-24e6-4315-936c-2e99227c95a4"
33
authors = ["Climate Modeling Alliance and contributors"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/SeaIceThermodynamics/SeaIceThermodynamics.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module SeaIceThermodynamics
22

3-
export SlabSeaIceThermodynamics,
3+
export SlabSeaIceThermodynamics,
44
PhaseTransitions,
55
MeltingConstrainedFluxBalance,
66
PrescribedTemperature,
@@ -81,7 +81,7 @@ The latent heat of fusion ``ℒ(T)`` (more simply just "latent heat") is
8181
a function of temperature ``T`` via
8282
8383
```math
84-
ρᵢ ℒ(T) = ρᵢ ℒ₀ + (ρ_ℓ c_ℓ - ρᵢ cᵢ) (T - T₀)
84+
ρᵢ ℒ(T) = ρᵢ ℒ₀ + (ρ_ℓ c_ℓ - ρᵢ cᵢ) (T - T₀)
8585
```
8686
8787
where ``ρᵢ`` is the `ice_density`, ``ρ_ℓ`` is the liquid density,
@@ -110,7 +110,7 @@ and that temperature is degrees Celsius.
110110
end
111111

112112
@inline function latent_heat(thermo::PhaseTransitions, T)
113-
T₀ = thermo.reference_temperature
113+
T₀ = thermo.reference_temperature
114114
ℒ₀ = thermo.reference_latent_heat
115115
ρᵢ = thermo.ice_density
116116
ρℓ = thermo.liquid_density
@@ -140,7 +140,6 @@ using Oceananigans.Fields: field, Field, Center, ZeroField, ConstantField
140140
import Oceananigans: fields, prognostic_fields
141141
import Oceananigans.Fields: set!
142142
import Oceananigans.Models: AbstractModel
143-
import Oceananigans.OutputWriters: default_included_properties
144143
import Oceananigans.Simulations: reset!, initialize!, iteration
145144
import Oceananigans.TimeSteppers: time_step!, update_state!
146145

src/sea_ice_model.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using ClimaSeaIce.SeaIceThermodynamics.HeatBoundaryConditions: flux_summary
1313

1414
import Oceananigans.Architectures: architecture
1515
import Oceananigans.Models: update_model_field_time_series!
16+
import Oceananigans.OutputWriters: default_included_properties
1617

1718
@inline instantiate(T::DataType) = T()
1819
@inline instantiate(T) = T
@@ -202,7 +203,7 @@ end
202203

203204
reset!(::SIM) = nothing
204205
initialize!(::SIM) = nothing
205-
default_included_properties(::SIM) = tuple(:grid)
206+
default_included_properties(::SIM) = [:grid]
206207
checkpointer_address(::SeaIceModel) = "SeaIceModel"
207208

208209
# Fallback

validation/ice_ocean_model/ice_ocean_model.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ iteration(model::IOM) = model.clock.iteration
4141
timestepper(::IOM) = nothing
4242
reset!(::IOM) = nothing
4343
initialize!(::IOM) = nothing
44-
default_included_properties(::IOM) = tuple()
44+
default_included_properties(::IOM) = Symbol[]
4545
update_state!(::IOM) = nothing
4646
prognostic_fields(cm::IOM) = nothing
4747
fields(::IOM) = NamedTuple()
4848

4949
function IceOceanModel(ice, ocean; clock = Clock{Float64}(0, 0, 1))
50-
50+
5151
previous_ice_thickness = deepcopy(ice.model.ice_thickness)
5252
previous_ice_concentration = deepcopy(ice.model.ice_concentration)
5353

@@ -183,12 +183,12 @@ function time_step!(coupled_model::IceOceanModel, Δt; callbacks=nothing)
183183
# accurate flux computation?
184184
# - Or, input "excess heat flux" into ocean after the ice melts
185185
# - Currently, non-conservative for heat due bc we don't account for excess
186-
186+
187187
# TODO after ice time-step:
188188
# - Adjust ocean temperature if the ice completely melts?
189-
189+
190190
tick!(coupled_model.clock, Δt)
191-
191+
192192
return nothing
193193
end
194194

@@ -236,7 +236,7 @@ end
236236

237237
# Update surface salinity flux.
238238
# Note: the Δt below is the ocean time-step, eg.
239-
# ΔS = ⋯ - ∮ Qˢ dt ≈ ⋯ - Δtₒ * Qˢ
239+
# ΔS = ⋯ - ∮ Qˢ dt ≈ ⋯ - Δtₒ * Qˢ
240240
Qˢ[i, j, 1] = Δh / Δt * (Sᵢ[i, j, 1] - Sₒ[i, j, Nz])
241241

242242
# Update previous ice thickness
@@ -294,10 +294,10 @@ end
294294

295295
# Melting / freezing temperature at the surface of the ocean
296296
Tₘ = melting_temperature(liquidus, Sᴺ)
297-
297+
298298
# Conditions for non-zero ice-ocean flux:
299299
# - the ocean is below the freezing temperature, causing formation of ice.
300-
freezing = Tᴺ < Tₘ
300+
freezing = Tᴺ < Tₘ
301301

302302
# - We are at the surface and the cell is covered by ice.
303303
icy_surface_cell = (k == Nz) & icy_cell
@@ -314,7 +314,7 @@ end
314314
#
315315
# - When Tᴺ > Tₘ and we are in a surface cell covered by ice, we assume equilibrium
316316
# and cool the ocean by injecting excess heat into the ice.
317-
#
317+
#
318318
δEₒ = adjust_temperature * ρₒ * cₒ * (Tₘ - Tᴺ)
319319

320320
# Perform temperature adjustment
@@ -329,7 +329,7 @@ end
329329
# A negative value δQ < 0 implies that heat is fluxed from the ice into
330330
# the ocean, cooling the ice and heating the ocean (δEₒ > 0). This occurs when
331331
# frazil ice is formed within the ocean.
332-
332+
333333
δQ -= δEₒ * Δz / Δt
334334
end
335335

0 commit comments

Comments
 (0)