Skip to content

Commit 16ea334

Browse files
szy21juliasloan25
authored andcommitted
binary ice/ocean fraction
1 parent 2b1bdf4 commit 16ea334

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

experiments/ClimaEarth/components/ocean/prescr_seaice.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ function PrescribedIceSimulation(
124124
# Overwrite ice fraction with the static land area fraction anywhere we have nonzero land area
125125
# max needed to avoid Float32 errors (see issue #271; Heisenbug on HPC)
126126
ice_fraction = @. max(min(SIC_init, FT(1) - land_fraction), FT(0))
127+
ice_fraction = ifelse.(ice_fraction .> FT(0.5), FT(1), FT(0))
127128

128129
params = IceSlabParameters{FT}()
129130

@@ -263,14 +264,14 @@ function ice_rhs!(dY, Y, p, t)
263264

264265
# Update the cached area fraction with the current SIC
265266
evaluate!(p.area_fraction, p.SIC_timevaryinginput, t)
267+
@. p.area_fraction = ifelse(p.area_fraction > FT(0.5), FT(1), FT(0))
266268

267269
# Overwrite ice fraction with the static land area fraction anywhere we have nonzero land area
268270
# max needed to avoid Float32 errors (see issue #271; Heisenbug on HPC)
269271
@. p.area_fraction = max(min(p.area_fraction, FT(1) - p.land_fraction), FT(0))
270272

271273
# Calculate the conductive flux, and set it to zero if the area fraction is zero
272274
F_conductive = @. params.k_ice / (params.h) * (params.T_base - Y.T_sfc) # fluxes are defined to be positive when upward
273-
274275
rhs = @. (-p.F_turb_energy - p.F_radiative + F_conductive) /
275276
(params.h * params.ρ * params.c)
276277

experiments/ClimaEarth/setup_run.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ function CoupledSimulation(config_dict::AbstractDict)
373373

374374
## ocean model using prescribed data
375375
ice_fraction = Interfacer.get_field(ice_sim, Val(:area_fraction))
376+
ice_fraction = ifelse.(ice_fraction .> FT(0.5), FT(1), FT(0))
376377
ocean_fraction = FT(1) .- ice_fraction .- land_fraction
377378

378379
if sim_mode <: CMIPMode

0 commit comments

Comments
 (0)