From 3a1bc9d785e30d5f5bcc80629c913d41fb6a96fb Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 21:02:09 +1000 Subject: [PATCH 1/8] Support nothing for sea ice thermodynamics --- .../sea_ice_ocean_fluxes.jl | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl index b2670bd8..79bd6ba8 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl @@ -144,29 +144,25 @@ end δ𝒬ᶠʳᶻ = zero(grid) - for k = Nz:-1:1 - @inbounds begin - Δz = Δzᶜᶜᶜ(i, j, k, grid) - Tᵏ = Tᵒᶜ[i, j, k] - Sᵏ = Sᵒᶜ[i, j, k] + if !isnothing(flux_formulation.sea_ice_heat_flux) + for k = Nz:-1:1 + @inbounds begin + Δz = Δzᶜᶜᶜ(i, j, k, grid) + Tᵏ = Tᵒᶜ[i, j, k] + Sᵏ = Sᵒᶜ[i, j, k] + end + + Tₘ = melting_temperature(liquidus, Sᵏ) + freezing = Tᵏ < Tₘ + + δE = freezing * ρᵒᶜ * cᵒᶜ * (Tₘ - Tᵏ) + + @inbounds Tᵒᶜ[i, j, k] = ifelse(freezing, Tₘ, Tᵏ) + # Compute the heat flux from ocean into ice during frazil formation. + # A negative value δ𝒬ᶠʳᶻ < 0 implies heat is fluxed from the ice into + # the ocean (frazil ice formation). + δ𝒬ᶠʳᶻ -= δE * Δz / Δt end - - # Melting/freezing temperature at this depth - Tₘ = melting_temperature(liquidus, Sᵏ) - freezing = Tᵏ < Tₘ - - # Compute change in ocean heat energy due to freezing. - # When Tᵏ < Tₘ, we heat the ocean back to melting temperature - # by extracting heat from the ice. - δE = freezing * ρᵒᶜ * cᵒᶜ * (Tₘ - Tᵏ) - - # Perform temperature adjustment - @inbounds Tᵒᶜ[i, j, k] = ifelse(freezing, Tₘ, Tᵏ) - - # Compute the heat flux from ocean into ice during frazil formation. - # A negative value δ𝒬ᶠʳᶻ < 0 implies heat is fluxed from the ice into - # the ocean (frazil ice formation). - δ𝒬ᶠʳᶻ -= δE * Δz / Δt end # Store frazil heat flux @@ -194,23 +190,26 @@ end # Compute friction velocity u★ = get_friction_velocity(flux_formulation.friction_velocity, i, j, grid, τˣ, τʸ, ρᵒᶜ) - # ============================================= - # Part 3: Interface heat flux (formulation-specific) - # ============================================= - # Returns interfacial heat flux, melt rate qᵐ, and interface T, S - 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_interface_heat_flux(flux_formulation, - ocean_surface_state, ice_state, - liquidus, ocean_properties, ℰ, u★) + if isnothing(flux_formulation.sea_ice_heat_flux) + qᵐ = zero(grid) - # Store interface values and heat flux - @inbounds 𝒬ⁱⁿᵗ[i, j, 1] = 𝒬ⁱᵒ - store_interface_state!(flux_formulation, T★, S★, i, j, Tᵦ, Sᵦ) + @inbounds begin + 𝒬ⁱⁿᵗ[i, j, 1] = zero(grid) + T★[i, j, 1] = zero(grid) + S★[i, j, 1] = zero(grid) + end + else + 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_interface_heat_flux(flux_formulation, + ocean_surface_state, ice_state, + liquidus, ocean_properties, ℰ, u★) - # ============================================= - # Part 4: Salt flux - # ============================================= - # Salt flux from melting/freezing: - # - during ice melt (qᵐ > 0), fresh meltwater dilutes the ocean - # - during ice growth (qᶠ < 0), brine rejection adds salt to ocean - @inbounds Jˢ[i, j, 1] = (qᵐ + qᶠ) / ρᵒᶜ * (Sᴺ - Sˢⁱ) -end + @inbounds 𝒬ⁱⁿᵗ[i, j, 1] = 𝒬ⁱᵒ + store_interface_state!(flux_formulation, T★, S★, i, j, Tᵦ, Sᵦ) + end + + if isnothing(flux_formulation.salinity_flux) + @inbounds Jˢ[i, j, 1] = zero(grid) + else + @inbounds Jˢ[i, j, 1] = (qᵐ + qᶠ) / ρᵒᶜ * (Sᴺ - Sˢⁱ) + end +end \ No newline at end of file From 3ec8cb10e2f40a70dfcbbc9466ad2899752a88e9 Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 22:03:14 +1000 Subject: [PATCH 2/8] Extend no_salinity_flux to appropriate locations --- .../component_interfaces.jl | 39 ++- .../sea_ice_ocean_fluxes.jl | 230 ++++++++++++------ .../sea_ice_ocean_heat_flux_formulations.jl | 53 +++- 3 files changed, 240 insertions(+), 82 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index ec0e710c..8b2c937a 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -254,6 +254,29 @@ end ##### Sea Ice-Ocean Interface ##### +struct DefaultSeaIceOceanSalinityFlux end +const default_sea_ice_ocean_salinity_flux = DefaultSeaIceOceanSalinityFlux() + +with_sea_ice_ocean_salinity_flux(flux_formulation, ::DefaultSeaIceOceanSalinityFlux) = flux_formulation +with_sea_ice_ocean_salinity_flux(::Nothing, salinity_flux) = nothing + +function with_sea_ice_ocean_salinity_flux(flux::IceBathHeatFlux, salinity_flux) + return IceBathHeatFlux(flux.heat_transfer_coefficient, + flux.friction_velocity; + sea_ice_heat_flux = flux.sea_ice_heat_flux, + salinity_flux) +end + +function with_sea_ice_ocean_salinity_flux(flux::ThreeEquationHeatFlux, salinity_flux) + return ThreeEquationHeatFlux(flux.conductive_flux, + flux.internal_temperature, + flux.heat_transfer_coefficient, + flux.salt_transfer_coefficient, + flux.friction_velocity; + sea_ice_heat_flux = flux.sea_ice_heat_flux, + salinity_flux) +end + sea_ice_ocean_interface(grid, ::Nothing, ocean, flux_formulation; kwargs...) = nothing sea_ice_ocean_interface(grid, ::Nothing, ::Nothing, flux_formulation; kwargs...) = nothing sea_ice_ocean_interface(grid, sea_ice, ::Nothing, flux_formulation; kwargs...) = nothing @@ -280,7 +303,9 @@ Arguments - `ocean`: ocean simulation - `flux_formulation`: heat flux formulation (`IceBathHeatFlux` or `ThreeEquationHeatFlux`) """ -function sea_ice_ocean_interface(grid, sea_ice, ocean, flux_formulation) +function sea_ice_ocean_interface(grid, sea_ice, ocean, flux_formulation; + sea_ice_ocean_salinity_flux = default_sea_ice_ocean_salinity_flux) + flux_formulation = with_sea_ice_ocean_salinity_flux(flux_formulation, sea_ice_ocean_salinity_flux) io_fluxes = SeaIceOceanFluxes(grid) # For default flux formulations, interface temperature and salinity point to ocean surface @@ -290,7 +315,9 @@ function sea_ice_ocean_interface(grid, sea_ice, ocean, flux_formulation) return SeaIceOceanInterface(io_fluxes, flux_formulation, Tⁱⁿᵗ, Sⁱⁿᵗ) end -function sea_ice_ocean_interface(grid, sea_ice, ocean, flux_formulation::ThreeEquationHeatFlux) +function sea_ice_ocean_interface(grid, sea_ice, ocean, flux_formulation::ThreeEquationHeatFlux; + sea_ice_ocean_salinity_flux = default_sea_ice_ocean_salinity_flux) + flux_formulation = with_sea_ice_ocean_salinity_flux(flux_formulation, sea_ice_ocean_salinity_flux) io_fluxes = SeaIceOceanFluxes(grid) # Interface temperature and salinity are computed fields @@ -324,9 +351,9 @@ Keyword Arguments - `sea_ice_ocean_heat_flux`: formulation for sea ice-ocean heat flux. Options are: - `IceBathHeatFlux()`: bulk heat flux with interface at freezing point - `ThreeEquationHeatFlux()`: coupled heat/salt/freezing point system (default) +- `sea_ice_ocean_salinity_flux`: formulation for sea ice-ocean salinity flux. Set to `nothing` to omit it. -- `radiation`: radiation component. Default: `Radiation()`. -+ `radiation`: radiation component. Default: `nothing`. +- `radiation`: radiation component. Default: `nothing`. - `freshwater_density`: reference density of freshwater. Default: `default_freshwater_density`. - `atmosphere_ocean_fluxes`: flux formulation for atmosphere-ocean interface. Default: `SimilarityTheoryFluxes()`. - `atmosphere_sea_ice_fluxes`: flux formulation for atmosphere-sea ice interface. Default: `SimilarityTheoryFluxes()`. @@ -349,6 +376,7 @@ function ComponentInterfaces(atmosphere, ocean, sea_ice=nothing; atmosphere_ocean_fluxes = SimilarityTheoryFluxes(eltype(exchange_grid)), atmosphere_sea_ice_fluxes = atmosphere_sea_ice_similarity_theory(eltype(exchange_grid)), sea_ice_ocean_heat_flux = ThreeEquationHeatFlux(sea_ice), + sea_ice_ocean_salinity_flux = default_sea_ice_ocean_salinity_flux, atmosphere_ocean_interface_temperature = BulkTemperature(), atmosphere_ocean_velocity_difference = RelativeVelocity(), atmosphere_ocean_interface_specific_humidity = default_ao_specific_humidity(ocean), @@ -399,7 +427,8 @@ function ComponentInterfaces(atmosphere, ocean, sea_ice=nothing; atmosphere_ocean_velocity_difference, atmosphere_ocean_interface_specific_humidity) - io_interface = sea_ice_ocean_interface(exchange_grid, sea_ice, ocean, sea_ice_ocean_heat_flux) + io_interface = sea_ice_ocean_interface(exchange_grid, sea_ice, ocean, sea_ice_ocean_heat_flux; + sea_ice_ocean_salinity_flux) ai_interface = atmosphere_sea_ice_interface(exchange_grid, atmosphere, diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl index 79bd6ba8..a971bf5f 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl @@ -57,6 +57,7 @@ function compute_sea_ice_ocean_fluxes!(interface, ocean, sea_ice, ocean_properti if !isnothing(dynamics) kernel_parameters = interface_kernel_parameters(grid) τₛ = dynamics.external_momentum_stresses.bottom + launch!(arch, grid, kernel_parameters, _compute_sea_ice_ocean_stress!, fluxes, grid, clock, hˢⁱ, ℵ, uˢⁱ, vˢⁱ, τₛ) else @@ -98,6 +99,87 @@ end end end +@inline compute_frazil_heat_flux!(::Nothing, i, j, grid, Tᵒᶜ, Sᵒᶜ, + liquidus, ρᵒᶜ, cᵒᶜ, Δt) = zero(grid) + +@inline function compute_frazil_heat_flux!(sea_ice_heat_flux, i, j, grid, Tᵒᶜ, Sᵒᶜ, + liquidus, ρᵒᶜ, cᵒᶜ, Δt) + + Nz = size(grid, 3) + + # ============================================= + # Part 1: Frazil ice formation (all formulations) + # ============================================= + # When ocean temperature drops below freezing, frazil ice forms + # and heat is released to the ice component. + + δ𝒬ᶠʳᶻ = zero(grid) + + for k = Nz:-1:1 + @inbounds begin + Δz = Δzᶜᶜᶜ(i, j, k, grid) + Tᵏ = Tᵒᶜ[i, j, k] + Sᵏ = Sᵒᶜ[i, j, k] + end + + # Melting/freezing temperature at this depth + Tₘ = melting_temperature(liquidus, Sᵏ) + freezing = Tᵏ < Tₘ + + # Compute change in ocean heat energy due to freezing. + # When Tᵏ < Tₘ, we heat the ocean back to melting temperature + # by extracting heat from the ice. + δE = freezing * ρᵒᶜ * cᵒᶜ * (Tₘ - Tᵏ) + + # Perform temperature adjustment + @inbounds Tᵒᶜ[i, j, k] = ifelse(freezing, Tₘ, Tᵏ) + + # Compute the heat flux from ocean into ice during frazil formation. + # A negative value δ𝒬ᶠʳᶻ < 0 implies heat is fluxed from the ice into + # the ocean (frazil ice formation). + δ𝒬ᶠʳᶻ -= δE * Δz / Δt + end + + return δ𝒬ᶠʳᶻ +end + +@inline function compute_sea_ice_heat_flux(::Nothing, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) + + return zero(grid), zero(grid), zero(grid), zero(grid) +end + +@inline function compute_sea_ice_heat_flux(sea_ice_heat_flux, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) + + return compute_interface_heat_flux(flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★) +end + +@inline compute_salinity_flux(::Nothing, qᵐ, qᶠ, ρᵒᶜ, Sᴺ, Sˢⁱ, grid) = zero(grid) + +@inline compute_salinity_flux(salinity_flux, qᵐ, qᶠ, ρᵒᶜ, Sᴺ, Sˢⁱ, grid) = + (qᵐ + qᶠ) / ρᵒᶜ * (Sᴺ - Sˢⁱ) + @kernel function _compute_sea_ice_ocean_fluxes!(flux_formulation, fluxes, interface_temperature, @@ -120,96 +202,104 @@ end i, j = @index(Global, NTuple) - Nz = size(grid, 3) 𝒬ᶠʳᶻ = fluxes.frazil_heat 𝒬ⁱⁿᵗ = fluxes.interface_heat Jˢ = fluxes.salt - τˣ = fluxes.x_momentum - τʸ = fluxes.y_momentum T★ = interface_temperature S★ = interface_salinity - Tᵒᶜ = ocean_temperature - Sᵒᶜ = ocean_salinity - hc = ice_consolidation_thickness - ℰ = latent_heat - ρᵒᶜ = ocean_properties.reference_density - cᵒᶜ = ocean_properties.heat_capacity + if isnothing(flux_formulation) - # ============================================= - # Part 1: Frazil ice formation (all formulations) - # ============================================= - # When ocean temperature drops below freezing, frazil ice forms - # and heat is released to the ice component. - - δ𝒬ᶠʳᶻ = zero(grid) - - if !isnothing(flux_formulation.sea_ice_heat_flux) - for k = Nz:-1:1 - @inbounds begin - Δz = Δzᶜᶜᶜ(i, j, k, grid) - Tᵏ = Tᵒᶜ[i, j, k] - Sᵏ = Sᵒᶜ[i, j, k] - end - - Tₘ = melting_temperature(liquidus, Sᵏ) - freezing = Tᵏ < Tₘ - - δE = freezing * ρᵒᶜ * cᵒᶜ * (Tₘ - Tᵏ) - - @inbounds Tᵒᶜ[i, j, k] = ifelse(freezing, Tₘ, Tᵏ) - # Compute the heat flux from ocean into ice during frazil formation. - # A negative value δ𝒬ᶠʳᶻ < 0 implies heat is fluxed from the ice into - # the ocean (frazil ice formation). - δ𝒬ᶠʳᶻ -= δE * Δz / Δt + @inbounds begin + 𝒬ᶠʳᶻ[i, j, 1] = zero(grid) + 𝒬ⁱⁿᵗ[i, j, 1] = zero(grid) + Jˢ[i, j, 1] = zero(grid) + T★[i, j, 1] = zero(grid) + S★[i, j, 1] = zero(grid) end - end - # Store frazil heat flux - @inbounds 𝒬ᶠʳᶻ[i, j, 1] = δ𝒬ᶠʳᶻ + else - # Freezing rate - qᶠ = δ𝒬ᶠʳᶻ / ℰ + Nz = size(grid, 3) - @inbounds begin - Tᴺ = Tᵒᶜ[i, j, Nz] - Sᴺ = Sᵒᶜ[i, j, Nz] - Sˢⁱ = ice_salinity[i, j, 1] - hˢⁱ = ice_thickness[i, j, 1] - ℵᵢ = ice_concentration[i, j, 1] - hc = ice_consolidation_thickness[i, j, 1] - end + τˣ = fluxes.x_momentum + τʸ = fluxes.y_momentum + Tᵒᶜ = ocean_temperature + Sᵒᶜ = ocean_salinity + ℰ = latent_heat - # Extract internal temperature (for ConductiveFluxTEF, zero otherwise) - Tˢⁱ = extract_internal_temperature(flux_formulation, i, j) + ρᵒᶜ = ocean_properties.reference_density + cᵒᶜ = ocean_properties.heat_capacity - # Package states - ocean_surface_state = (; T = Tᴺ, S = Sᴺ) - ice_state = (; S = Sˢⁱ, h = hˢⁱ, hc = hc, ℵ = ℵᵢ, T = Tˢⁱ) + sea_ice_heat_flux = flux_formulation.sea_ice_heat_flux + salinity_flux = flux_formulation.salinity_flux - # Compute friction velocity - u★ = get_friction_velocity(flux_formulation.friction_velocity, i, j, grid, τˣ, τʸ, ρᵒᶜ) + # Store frazil heat flux + δ𝒬ᶠʳᶻ = compute_frazil_heat_flux!(sea_ice_heat_flux, + i, j, grid, Tᵒᶜ, Sᵒᶜ, + liquidus, ρᵒᶜ, cᵒᶜ, Δt) - if isnothing(flux_formulation.sea_ice_heat_flux) - qᵐ = zero(grid) + @inbounds 𝒬ᶠʳᶻ[i, j, 1] = δ𝒬ᶠʳᶻ + + # Freezing rate + qᶠ = δ𝒬ᶠʳᶻ / ℰ @inbounds begin - 𝒬ⁱⁿᵗ[i, j, 1] = zero(grid) - T★[i, j, 1] = zero(grid) - S★[i, j, 1] = zero(grid) + Tᴺ = Tᵒᶜ[i, j, Nz] + Sᴺ = Sᵒᶜ[i, j, Nz] + Sˢⁱ = ice_salinity[i, j, 1] + hˢⁱ = ice_thickness[i, j, 1] + ℵᵢ = ice_concentration[i, j, 1] + hc = ice_consolidation_thickness[i, j, 1] end - else - 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_interface_heat_flux(flux_formulation, - ocean_surface_state, ice_state, - liquidus, ocean_properties, ℰ, u★) + # Extract internal temperature (for ConductiveFluxTEF, zero otherwise) + Tˢⁱ = extract_internal_temperature(flux_formulation, i, j) + + # Package states + ocean_surface_state = (; T = Tᴺ, S = Sᴺ) + ice_state = (; S = Sˢⁱ, h = hˢⁱ, hc = hc, ℵ = ℵᵢ, T = Tˢⁱ) + + # Compute friction velocity + u★ = get_friction_velocity(flux_formulation.friction_velocity, + i, j, grid, τˣ, τʸ, ρᵒᶜ) + + # ============================================= + # Part 3: Interface heat flux (formulation-specific) + # ============================================= + # Returns interfacial heat flux, melt rate qᵐ, and interface T, S + + 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_sea_ice_heat_flux(sea_ice_heat_flux, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + ℰ, + u★, + grid) + + # Store interface values and heat flux @inbounds 𝒬ⁱⁿᵗ[i, j, 1] = 𝒬ⁱᵒ - store_interface_state!(flux_formulation, T★, S★, i, j, Tᵦ, Sᵦ) - end - if isnothing(flux_formulation.salinity_flux) - @inbounds Jˢ[i, j, 1] = zero(grid) - else - @inbounds Jˢ[i, j, 1] = (qᵐ + qᶠ) / ρᵒᶜ * (Sᴺ - Sˢⁱ) + if isnothing(sea_ice_heat_flux) + @inbounds begin + T★[i, j, 1] = zero(grid) + S★[i, j, 1] = zero(grid) + end + else + store_interface_state!(flux_formulation, T★, S★, i, j, Tᵦ, Sᵦ) + end + + # ============================================= + # Part 4: Salt flux + # ============================================= + # Salt flux from melting/freezing: + # - during ice melt (qᵐ > 0), fresh meltwater dilutes the ocean + # - during ice growth (qᶠ < 0), brine rejection adds salt to ocean + + @inbounds Jˢ[i, j, 1] = compute_salinity_flux(salinity_flux, + qᵐ, qᶠ, ρᵒᶜ, + Sᴺ, Sˢⁱ, grid) end end \ No newline at end of file diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl index 888cf166..d095548f 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl @@ -42,11 +42,21 @@ References - [holland1999modeling](@citet): Holland, D. M., & Jenkins, A. (1999). Modeling thermodynamic ice–ocean interactions at the base of an ice shelf. *Journal of Physical Oceanography*, 29(8), 1787-1800. """ -struct IceBathHeatFlux{FT, U} +struct IceBathHeatFlux{FT, U, H, S} heat_transfer_coefficient :: FT friction_velocity :: U + sea_ice_heat_flux :: H + salinity_flux :: S end +IceBathHeatFlux(heat_transfer_coefficient, friction_velocity; + sea_ice_heat_flux = true, + salinity_flux = true) = + IceBathHeatFlux(heat_transfer_coefficient, + friction_velocity, + sea_ice_heat_flux, + salinity_flux) + """ IceBathHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = 0.006, @@ -62,8 +72,13 @@ Keyword Arguments """ function IceBathHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = convert(FT, 0.006), - friction_velocity = convert(FT, 0.02)) - return IceBathHeatFlux(convert(FT, heat_transfer_coefficient), friction_velocity) + friction_velocity = convert(FT, 0.02), + sea_ice_heat_flux = true, + salinity_flux = true) + return IceBathHeatFlux(convert(FT, heat_transfer_coefficient), + friction_velocity; + sea_ice_heat_flux, + salinity_flux) end ##### @@ -115,12 +130,14 @@ References - [shi2021sensitivity](@citet): Shi, X., Notz, D., Liu, J., Yang, H., & Lohmann, G. (2021). Sensitivity of Northern Hemisphere climate to ice-ocean interface heat flux parameterizations. *Geosci. Model Dev.*, 14, 4891-4908. """ -struct ThreeEquationHeatFlux{F, T, FT, U} +struct ThreeEquationHeatFlux{F, T, FT, U, H, S} conductive_flux :: F internal_temperature :: T heat_transfer_coefficient :: FT salt_transfer_coefficient :: FT friction_velocity :: U + sea_ice_heat_flux :: H + salinity_flux :: S end Adapt.adapt_structure(to, f::ThreeEquationHeatFlux) = @@ -128,7 +145,9 @@ Adapt.adapt_structure(to, f::ThreeEquationHeatFlux) = Adapt.adapt(to, f.internal_temperature), f.heat_transfer_coefficient, f.salt_transfer_coefficient, - Adapt.adapt(to, f.friction_velocity)) + Adapt.adapt(to, f.friction_velocity), + Adapt.adapt(to, f.sea_ice_heat_flux), + Adapt.adapt(to, f.salinity_flux)) """ ThreeEquationHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; @@ -150,12 +169,32 @@ Keyword Arguments function ThreeEquationHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = 0.0095, salt_transfer_coefficient = heat_transfer_coefficient / 35, - friction_velocity = convert(FT, 0.002)) + friction_velocity = convert(FT, 0.002), + sea_ice_heat_flux = true, + salinity_flux = true) return ThreeEquationHeatFlux(nothing, nothing, convert(FT, heat_transfer_coefficient), convert(FT, salt_transfer_coefficient), - friction_velocity) + friction_velocity, + sea_ice_heat_flux, + salinity_flux) +end + +function ThreeEquationHeatFlux(conductive_flux, + internal_temperature, + heat_transfer_coefficient, + salt_transfer_coefficient, + friction_velocity; + sea_ice_heat_flux = true, + salinity_flux = true) + return ThreeEquationHeatFlux(conductive_flux, + internal_temperature, + heat_transfer_coefficient, + salt_transfer_coefficient, + friction_velocity, + sea_ice_heat_flux, + salinity_flux) end # Constructor that accepts the sea-ice model From 2bcda6e9d42f75778c5a02c84bfe43f23006a6a4 Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 22:32:50 +1000 Subject: [PATCH 3/8] Solve ambiguity in methods --- .../InterfaceComputations/component_interfaces.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index 8b2c937a..de4d1e42 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -259,6 +259,7 @@ const default_sea_ice_ocean_salinity_flux = DefaultSeaIceOceanSalinityFlux() with_sea_ice_ocean_salinity_flux(flux_formulation, ::DefaultSeaIceOceanSalinityFlux) = flux_formulation with_sea_ice_ocean_salinity_flux(::Nothing, salinity_flux) = nothing +with_sea_ice_ocean_salinity_flux(::Nothing, ::DefaultSeaIceOceanSalinityFlux) = nothing function with_sea_ice_ocean_salinity_flux(flux::IceBathHeatFlux, salinity_flux) return IceBathHeatFlux(flux.heat_transfer_coefficient, From 290d707cbc75dc5d39de8ec534289536a0fafd71 Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 23:08:24 +1000 Subject: [PATCH 4/8] Rename sea ice thermodynamics flag --- .../component_interfaces.jl | 4 +- .../sea_ice_ocean_fluxes.jl | 46 +++++++++---------- .../sea_ice_ocean_heat_flux_formulations.jl | 20 +++++--- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index de4d1e42..248cbb2d 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -264,7 +264,7 @@ with_sea_ice_ocean_salinity_flux(::Nothing, ::DefaultSeaIceOceanSalinityFlux) = function with_sea_ice_ocean_salinity_flux(flux::IceBathHeatFlux, salinity_flux) return IceBathHeatFlux(flux.heat_transfer_coefficient, flux.friction_velocity; - sea_ice_heat_flux = flux.sea_ice_heat_flux, + sea_ice_thermodynamics = flux.sea_ice_thermodynamics, salinity_flux) end @@ -274,7 +274,7 @@ function with_sea_ice_ocean_salinity_flux(flux::ThreeEquationHeatFlux, salinity_ flux.heat_transfer_coefficient, flux.salt_transfer_coefficient, flux.friction_velocity; - sea_ice_heat_flux = flux.sea_ice_heat_flux, + sea_ice_thermodynamics = flux.sea_ice_thermodynamics, salinity_flux) end diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl index a971bf5f..3d660429 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl @@ -102,7 +102,7 @@ end @inline compute_frazil_heat_flux!(::Nothing, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) = zero(grid) -@inline function compute_frazil_heat_flux!(sea_ice_heat_flux, i, j, grid, Tᵒᶜ, Sᵒᶜ, +@inline function compute_frazil_heat_flux!(sea_ice_thermodynamics, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) Nz = size(grid, 3) @@ -143,28 +143,28 @@ end return δ𝒬ᶠʳᶻ end -@inline function compute_sea_ice_heat_flux(::Nothing, - flux_formulation, - ocean_surface_state, - ice_state, - liquidus, - ocean_properties, - latent_heat, - u★, - grid) +@inline function compute_sea_ice_thermodynamics(::Nothing, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) return zero(grid), zero(grid), zero(grid), zero(grid) end -@inline function compute_sea_ice_heat_flux(sea_ice_heat_flux, - flux_formulation, - ocean_surface_state, - ice_state, - liquidus, - ocean_properties, - latent_heat, - u★, - grid) +@inline function compute_sea_ice_thermodynamics(sea_ice_thermodynamics, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) return compute_interface_heat_flux(flux_formulation, ocean_surface_state, @@ -231,11 +231,11 @@ end ρᵒᶜ = ocean_properties.reference_density cᵒᶜ = ocean_properties.heat_capacity - sea_ice_heat_flux = flux_formulation.sea_ice_heat_flux + sea_ice_thermodynamics = flux_formulation.sea_ice_thermodynamics salinity_flux = flux_formulation.salinity_flux # Store frazil heat flux - δ𝒬ᶠʳᶻ = compute_frazil_heat_flux!(sea_ice_heat_flux, + δ𝒬ᶠʳᶻ = compute_frazil_heat_flux!(sea_ice_thermodynamics, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) @@ -269,7 +269,7 @@ end # ============================================= # Returns interfacial heat flux, melt rate qᵐ, and interface T, S - 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_sea_ice_heat_flux(sea_ice_heat_flux, + 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_sea_ice_thermodynamics(sea_ice_thermodynamics, flux_formulation, ocean_surface_state, ice_state, @@ -282,7 +282,7 @@ end # Store interface values and heat flux @inbounds 𝒬ⁱⁿᵗ[i, j, 1] = 𝒬ⁱᵒ - if isnothing(sea_ice_heat_flux) + if isnothing(sea_ice_thermodynamics) @inbounds begin T★[i, j, 1] = zero(grid) S★[i, j, 1] = zero(grid) diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl index d095548f..854ea4a6 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl @@ -45,12 +45,13 @@ References struct IceBathHeatFlux{FT, U, H, S} heat_transfer_coefficient :: FT friction_velocity :: U - sea_ice_heat_flux :: H + sea_ice_thermodynamics :: H salinity_flux :: S end IceBathHeatFlux(heat_transfer_coefficient, friction_velocity; - sea_ice_heat_flux = true, + sea_ice_thermodynamics = true, + sea_ice_heat_flux = sea_ice_thermodynamics, salinity_flux = true) = IceBathHeatFlux(heat_transfer_coefficient, friction_velocity, @@ -69,11 +70,13 @@ Keyword Arguments - `heat_transfer_coefficient`: turbulent heat exchange coefficient. Default: 0.006. - `friction_velocity`: friction velocity value or formulation. Default: 0.02. +- `sea_ice_thermodynamics`: set to `nothing` to omit sea ice-ocean thermodynamic exchange. Default: `true`. """ function IceBathHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = convert(FT, 0.006), friction_velocity = convert(FT, 0.02), - sea_ice_heat_flux = true, + sea_ice_thermodynamics = true, + sea_ice_heat_flux = sea_ice_thermodynamics, salinity_flux = true) return IceBathHeatFlux(convert(FT, heat_transfer_coefficient), friction_velocity; @@ -136,7 +139,7 @@ struct ThreeEquationHeatFlux{F, T, FT, U, H, S} heat_transfer_coefficient :: FT salt_transfer_coefficient :: FT friction_velocity :: U - sea_ice_heat_flux :: H + sea_ice_thermodynamics :: H salinity_flux :: S end @@ -146,7 +149,7 @@ Adapt.adapt_structure(to, f::ThreeEquationHeatFlux) = f.heat_transfer_coefficient, f.salt_transfer_coefficient, Adapt.adapt(to, f.friction_velocity), - Adapt.adapt(to, f.sea_ice_heat_flux), + Adapt.adapt(to, f.sea_ice_thermodynamics), Adapt.adapt(to, f.salinity_flux)) """ @@ -165,12 +168,14 @@ Keyword Arguments - `heat_transfer_coefficient`: turbulent heat exchange coefficient ``\\alpha_h``. Default: 0.0095. - `salt_transfer_coefficient`: turbulent salt exchange coefficient ``\\alpha_s``. Default: ``\\alpha_h / 35 \\approx 0.000271``. - `friction_velocity`: friction velocity value or formulation. Default: 0.002. +- `sea_ice_thermodynamics`: set to `nothing` to omit sea ice-ocean thermodynamic exchange. Default: `true`. """ function ThreeEquationHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = 0.0095, salt_transfer_coefficient = heat_transfer_coefficient / 35, friction_velocity = convert(FT, 0.002), - sea_ice_heat_flux = true, + sea_ice_thermodynamics = true, + sea_ice_heat_flux = sea_ice_thermodynamics, salinity_flux = true) return ThreeEquationHeatFlux(nothing, nothing, @@ -186,7 +191,8 @@ function ThreeEquationHeatFlux(conductive_flux, heat_transfer_coefficient, salt_transfer_coefficient, friction_velocity; - sea_ice_heat_flux = true, + sea_ice_thermodynamics = true, + sea_ice_heat_flux = sea_ice_thermodynamics, salinity_flux = true) return ThreeEquationHeatFlux(conductive_flux, internal_temperature, From ddec8d4a5102f4331e4cdf28b0958389f04337c6 Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 23:10:11 +1000 Subject: [PATCH 5/8] Add sea ice ocean thermodynamics keyword --- .../InterfaceComputations/component_interfaces.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index 248cbb2d..a5d5042c 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -349,9 +349,11 @@ Construct component interfaces for atmosphere-ocean-sea ice coupling. Keyword Arguments ================= -- `sea_ice_ocean_heat_flux`: formulation for sea ice-ocean heat flux. Options are: +- `sea_ice_ocean_thermodynamics`: formulation for sea ice-ocean thermodynamics. Options are: - `IceBathHeatFlux()`: bulk heat flux with interface at freezing point - `ThreeEquationHeatFlux()`: coupled heat/salt/freezing point system (default) + - `nothing`: omit sea ice-ocean thermodynamic exchange +- `sea_ice_ocean_heat_flux`: deprecated alias for `sea_ice_ocean_thermodynamics` - `sea_ice_ocean_salinity_flux`: formulation for sea ice-ocean salinity flux. Set to `nothing` to omit it. - `radiation`: radiation component. Default: `nothing`. @@ -376,7 +378,8 @@ function ComponentInterfaces(atmosphere, ocean, sea_ice=nothing; freshwater_density = default_freshwater_density, atmosphere_ocean_fluxes = SimilarityTheoryFluxes(eltype(exchange_grid)), atmosphere_sea_ice_fluxes = atmosphere_sea_ice_similarity_theory(eltype(exchange_grid)), - sea_ice_ocean_heat_flux = ThreeEquationHeatFlux(sea_ice), + sea_ice_ocean_thermodynamics = ThreeEquationHeatFlux(sea_ice), + sea_ice_ocean_heat_flux = sea_ice_ocean_thermodynamics, sea_ice_ocean_salinity_flux = default_sea_ice_ocean_salinity_flux, atmosphere_ocean_interface_temperature = BulkTemperature(), atmosphere_ocean_velocity_difference = RelativeVelocity(), From b2d15fa2fff02499cd2154d78ef61c8c7d0951ed Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Mon, 18 May 2026 23:12:20 +1000 Subject: [PATCH 6/8] Keep sea ice heat flux internals --- .../component_interfaces.jl | 6 +-- .../sea_ice_ocean_fluxes.jl | 46 +++++++++---------- .../sea_ice_ocean_heat_flux_formulations.jl | 20 +++----- 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index a5d5042c..22900ee0 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -264,7 +264,7 @@ with_sea_ice_ocean_salinity_flux(::Nothing, ::DefaultSeaIceOceanSalinityFlux) = function with_sea_ice_ocean_salinity_flux(flux::IceBathHeatFlux, salinity_flux) return IceBathHeatFlux(flux.heat_transfer_coefficient, flux.friction_velocity; - sea_ice_thermodynamics = flux.sea_ice_thermodynamics, + sea_ice_heat_flux = flux.sea_ice_heat_flux, salinity_flux) end @@ -274,7 +274,7 @@ function with_sea_ice_ocean_salinity_flux(flux::ThreeEquationHeatFlux, salinity_ flux.heat_transfer_coefficient, flux.salt_transfer_coefficient, flux.friction_velocity; - sea_ice_thermodynamics = flux.sea_ice_thermodynamics, + sea_ice_heat_flux = flux.sea_ice_heat_flux, salinity_flux) end @@ -353,7 +353,7 @@ Keyword Arguments - `IceBathHeatFlux()`: bulk heat flux with interface at freezing point - `ThreeEquationHeatFlux()`: coupled heat/salt/freezing point system (default) - `nothing`: omit sea ice-ocean thermodynamic exchange -- `sea_ice_ocean_heat_flux`: deprecated alias for `sea_ice_ocean_thermodynamics` +- `sea_ice_ocean_heat_flux`: alias for `sea_ice_ocean_thermodynamics` - `sea_ice_ocean_salinity_flux`: formulation for sea ice-ocean salinity flux. Set to `nothing` to omit it. - `radiation`: radiation component. Default: `nothing`. diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl index 3d660429..a971bf5f 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_fluxes.jl @@ -102,7 +102,7 @@ end @inline compute_frazil_heat_flux!(::Nothing, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) = zero(grid) -@inline function compute_frazil_heat_flux!(sea_ice_thermodynamics, i, j, grid, Tᵒᶜ, Sᵒᶜ, +@inline function compute_frazil_heat_flux!(sea_ice_heat_flux, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) Nz = size(grid, 3) @@ -143,28 +143,28 @@ end return δ𝒬ᶠʳᶻ end -@inline function compute_sea_ice_thermodynamics(::Nothing, - flux_formulation, - ocean_surface_state, - ice_state, - liquidus, - ocean_properties, - latent_heat, - u★, - grid) +@inline function compute_sea_ice_heat_flux(::Nothing, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) return zero(grid), zero(grid), zero(grid), zero(grid) end -@inline function compute_sea_ice_thermodynamics(sea_ice_thermodynamics, - flux_formulation, - ocean_surface_state, - ice_state, - liquidus, - ocean_properties, - latent_heat, - u★, - grid) +@inline function compute_sea_ice_heat_flux(sea_ice_heat_flux, + flux_formulation, + ocean_surface_state, + ice_state, + liquidus, + ocean_properties, + latent_heat, + u★, + grid) return compute_interface_heat_flux(flux_formulation, ocean_surface_state, @@ -231,11 +231,11 @@ end ρᵒᶜ = ocean_properties.reference_density cᵒᶜ = ocean_properties.heat_capacity - sea_ice_thermodynamics = flux_formulation.sea_ice_thermodynamics + sea_ice_heat_flux = flux_formulation.sea_ice_heat_flux salinity_flux = flux_formulation.salinity_flux # Store frazil heat flux - δ𝒬ᶠʳᶻ = compute_frazil_heat_flux!(sea_ice_thermodynamics, + δ𝒬ᶠʳᶻ = compute_frazil_heat_flux!(sea_ice_heat_flux, i, j, grid, Tᵒᶜ, Sᵒᶜ, liquidus, ρᵒᶜ, cᵒᶜ, Δt) @@ -269,7 +269,7 @@ end # ============================================= # Returns interfacial heat flux, melt rate qᵐ, and interface T, S - 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_sea_ice_thermodynamics(sea_ice_thermodynamics, + 𝒬ⁱᵒ, qᵐ, Tᵦ, Sᵦ = compute_sea_ice_heat_flux(sea_ice_heat_flux, flux_formulation, ocean_surface_state, ice_state, @@ -282,7 +282,7 @@ end # Store interface values and heat flux @inbounds 𝒬ⁱⁿᵗ[i, j, 1] = 𝒬ⁱᵒ - if isnothing(sea_ice_thermodynamics) + if isnothing(sea_ice_heat_flux) @inbounds begin T★[i, j, 1] = zero(grid) S★[i, j, 1] = zero(grid) diff --git a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl index 854ea4a6..d095548f 100644 --- a/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl +++ b/src/EarthSystemModels/InterfaceComputations/sea_ice_ocean_heat_flux_formulations.jl @@ -45,13 +45,12 @@ References struct IceBathHeatFlux{FT, U, H, S} heat_transfer_coefficient :: FT friction_velocity :: U - sea_ice_thermodynamics :: H + sea_ice_heat_flux :: H salinity_flux :: S end IceBathHeatFlux(heat_transfer_coefficient, friction_velocity; - sea_ice_thermodynamics = true, - sea_ice_heat_flux = sea_ice_thermodynamics, + sea_ice_heat_flux = true, salinity_flux = true) = IceBathHeatFlux(heat_transfer_coefficient, friction_velocity, @@ -70,13 +69,11 @@ Keyword Arguments - `heat_transfer_coefficient`: turbulent heat exchange coefficient. Default: 0.006. - `friction_velocity`: friction velocity value or formulation. Default: 0.02. -- `sea_ice_thermodynamics`: set to `nothing` to omit sea ice-ocean thermodynamic exchange. Default: `true`. """ function IceBathHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = convert(FT, 0.006), friction_velocity = convert(FT, 0.02), - sea_ice_thermodynamics = true, - sea_ice_heat_flux = sea_ice_thermodynamics, + sea_ice_heat_flux = true, salinity_flux = true) return IceBathHeatFlux(convert(FT, heat_transfer_coefficient), friction_velocity; @@ -139,7 +136,7 @@ struct ThreeEquationHeatFlux{F, T, FT, U, H, S} heat_transfer_coefficient :: FT salt_transfer_coefficient :: FT friction_velocity :: U - sea_ice_thermodynamics :: H + sea_ice_heat_flux :: H salinity_flux :: S end @@ -149,7 +146,7 @@ Adapt.adapt_structure(to, f::ThreeEquationHeatFlux) = f.heat_transfer_coefficient, f.salt_transfer_coefficient, Adapt.adapt(to, f.friction_velocity), - Adapt.adapt(to, f.sea_ice_thermodynamics), + Adapt.adapt(to, f.sea_ice_heat_flux), Adapt.adapt(to, f.salinity_flux)) """ @@ -168,14 +165,12 @@ Keyword Arguments - `heat_transfer_coefficient`: turbulent heat exchange coefficient ``\\alpha_h``. Default: 0.0095. - `salt_transfer_coefficient`: turbulent salt exchange coefficient ``\\alpha_s``. Default: ``\\alpha_h / 35 \\approx 0.000271``. - `friction_velocity`: friction velocity value or formulation. Default: 0.002. -- `sea_ice_thermodynamics`: set to `nothing` to omit sea ice-ocean thermodynamic exchange. Default: `true`. """ function ThreeEquationHeatFlux(FT::DataType = Oceananigans.defaults.FloatType; heat_transfer_coefficient = 0.0095, salt_transfer_coefficient = heat_transfer_coefficient / 35, friction_velocity = convert(FT, 0.002), - sea_ice_thermodynamics = true, - sea_ice_heat_flux = sea_ice_thermodynamics, + sea_ice_heat_flux = true, salinity_flux = true) return ThreeEquationHeatFlux(nothing, nothing, @@ -191,8 +186,7 @@ function ThreeEquationHeatFlux(conductive_flux, heat_transfer_coefficient, salt_transfer_coefficient, friction_velocity; - sea_ice_thermodynamics = true, - sea_ice_heat_flux = sea_ice_thermodynamics, + sea_ice_heat_flux = true, salinity_flux = true) return ThreeEquationHeatFlux(conductive_flux, internal_temperature, From 207fbf8b4da5af84bdf7b4c74452a90737f19f31 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 19 May 2026 17:13:31 +1000 Subject: [PATCH 7/8] compat for Oceananigans 0.108 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d0cd6123..fcd64bd2 100644 --- a/Project.toml +++ b/Project.toml @@ -77,7 +77,7 @@ JLD2 = "0.4, 0.5, 0.6" KernelAbstractions = "0.9" MeshArrays = "0.3, 0.4, 0.5" NCDatasets = "0.12, 0.13, 0.14" -Oceananigans = "0.107.7" +Oceananigans = "0.107.7, 0.108" OffsetArrays = "1.14" PrecompileTools = "1" PythonCall = "0.9.28" From 7bcc3220c3791fe674034d01b91fd9a3fe75fc75 Mon Sep 17 00:00:00 2001 From: Taimoor Sohail Date: Tue, 19 May 2026 17:22:48 +1000 Subject: [PATCH 8/8] Remove some overlapping functions --- .../InterfaceComputations/component_interfaces.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl index 22900ee0..7b5cf2df 100644 --- a/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl +++ b/src/EarthSystemModels/InterfaceComputations/component_interfaces.jl @@ -257,9 +257,7 @@ end struct DefaultSeaIceOceanSalinityFlux end const default_sea_ice_ocean_salinity_flux = DefaultSeaIceOceanSalinityFlux() -with_sea_ice_ocean_salinity_flux(flux_formulation, ::DefaultSeaIceOceanSalinityFlux) = flux_formulation with_sea_ice_ocean_salinity_flux(::Nothing, salinity_flux) = nothing -with_sea_ice_ocean_salinity_flux(::Nothing, ::DefaultSeaIceOceanSalinityFlux) = nothing function with_sea_ice_ocean_salinity_flux(flux::IceBathHeatFlux, salinity_flux) return IceBathHeatFlux(flux.heat_transfer_coefficient,