@@ -82,33 +82,25 @@ function ClimaSeaIceSimulation(land_fraction, ocean; output_dir)
8282 # Allocate space for the sea ice-ocean (io) fluxes
8383 ocean_ice_fluxes = ocean. ocean_ice_fluxes
8484
85- # TODO clean this up
8685 # Get the initial area fraction from the fractional ice concentration
87- area_fraction = ice. model. ice_concentration
88-
89- # Overwrite ice fraction with the static land area fraction anywhere we have nonzero land area
90- # max needed to avoid Float32 errors (see issue #271; Heisenbug on HPC)
9186 boundary_space = axes (ocean. area_fraction)
9287 FT = CC. Spaces. undertype (boundary_space)
88+ area_fraction = Interfacer. remap (ice. model. ice_concentration, boundary_space)
9389
94- area_fraction_boundary_space = Interfacer . remap (area_fraction, boundary_space)
95- @. area_fraction_boundary_space =
96- max (min (area_fraction_boundary_space , FT (1 ) - land_fraction), FT (0 ))
90+ # Overwrite ice fraction with the static land area fraction anywhere we have nonzero land area
91+ # max needed to avoid Float32 errors (see issue #271; Heisenbug on HPC)
92+ @. area_fraction = max (min (area_fraction , FT (1 ) - land_fraction), FT (0 ))
9793
9894 sim = ClimaSeaIceSimulation (
9995 ice,
100- area_fraction_boundary_space ,
96+ area_fraction ,
10197 melting_speed,
10298 remapping,
10399 ocean_ice_fluxes,
104100 )
105101 return sim
106102end
107103
108- function update_sic! (area_fraction, ice)
109- # TODO
110- end
111-
112104# ##############################################################################
113105# ## Functions required by ClimaCoupler.jl for a SurfaceModelSimulation
114106# ##############################################################################
@@ -146,6 +138,8 @@ Interfacer.get_field(sim::ClimaSeaIceSimulation, ::Val{:surface_temperature}) =
146138Update the turbulent fluxes in the simulation using the values stored in the coupler fields.
147139These include latent heat flux, sensible heat flux, momentum fluxes, and moisture flux.
148140
141+ The input `fields` are already area-weighted, so there's no need to weight them again.
142+
149143Note that currently the moisture flux has no effect on the sea ice model, which has
150144constant salinity.
151145
@@ -202,10 +196,7 @@ function FluxCalculator.update_turbulent_fluxes!(sim::ClimaSeaIceSimulation, fie
202196 # Update the sea ice only where the concentration is greater than zero.
203197 si_flux_heat = ice_sim. ice. model. external_heat_fluxes. top
204198 OC. interior (si_flux_heat, :, :, 1 ) .=
205- OC. interior (si_flux_heat, :, :, 1 ) .+ (
206- (OC. interior (sim. ice. model. ice_concentration, :, :, 1 ) .> 0 ) .*
207- (remapped_F_lh .+ remapped_F_sh)
208- )
199+ OC. interior (si_flux_heat, :, :, 1 ) .+ (remapped_F_lh .+ remapped_F_sh)
209200
210201 return nothing
211202end
@@ -245,16 +236,14 @@ function FieldExchanger.update_sim!(sim::ClimaSeaIceSimulation, csf, area_fracti
245236
246237 # Update only the part due to radiative fluxes. For the full update, the component due
247238 # to latent and sensible heat is missing and will be updated in update_turbulent_fluxes.
248- # Update the sea ice only where the concentration is greater than zero.
249239 si_flux_heat = sim. ice. model. external_heat_fluxes. top
250- OC. interior (si_flux_heat, :, :, 1 ) .=
251- (OC. interior (sim. ice. model. ice_concentration, :, :, 1 ) .> 0 ) .* remapped_F_radiative
240+ OC. interior (si_flux_heat, :, :, 1 ) .= remapped_F_radiative
252241
253242 return nothing
254243end
255244
256245"""
257- ocean_seaice_fluxes!(ocean_sim, ice_sim)
246+ ocean_seaice_fluxes!(ocean_sim::OceananigansSimulation , ice_sim::ClimaSeaIceSimulation )
258247
259248Compute the fluxes between the ocean and sea ice, storing them in the `ocean_ice_fluxes`
260249fields of the ocean and sea ice simulations.
0 commit comments