Skip to content

Commit 02aeeab

Browse files
add possibility to change BC at the top (#657)
1 parent 4aaa868 commit 02aeeab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SeaIceSimulations.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function sea_ice_simulation(grid, ocean=nothing;
3232
ice_density = 900, # kg m⁻³
3333
dynamics = sea_ice_dynamics(grid, ocean),
3434
bottom_heat_boundary_condition = nothing,
35+
top_heat_boundary_condition = nothing,
3536
phase_transitions = PhaseTransitions(; ice_heat_capacity, ice_density),
3637
conductivity = 2, # kg m s⁻³ K⁻¹
3738
internal_heat_flux = ConductiveFlux(; conductivity))
@@ -40,8 +41,10 @@ function sea_ice_simulation(grid, ocean=nothing;
4041
# - bottom -> flux boundary condition
4142
# - top -> prescribed temperature boundary condition (calculated in the flux computation)
4243

43-
top_surface_temperature = Field{Center, Center, Nothing}(grid)
44-
top_heat_boundary_condition = PrescribedTemperature(top_surface_temperature)
44+
if isnothing(top_heat_boundary_condition)
45+
top_surface_temperature = Field{Center, Center, Nothing}(grid)
46+
top_heat_boundary_condition = PrescribedTemperature(top_surface_temperature)
47+
end
4548

4649
if isnothing(bottom_heat_boundary_condition)
4750
if isnothing(ocean)

0 commit comments

Comments
 (0)