Skip to content

Commit

Permalink
starting out
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri committed Oct 6, 2023
1 parent 1eab2c0 commit 11d7550
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/IceOceanModel/IceOceanModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import Oceananigans.Simulations: reset!, initialize!, iteration
import Oceananigans.TimeSteppers: time_step!, update_state!, time
import Oceananigans.Utils: prettytime

struct IceOceanModel{FT, I, C, G, O, S, PI, PC} <: AbstractModel{Nothing}
struct IceOceanModel{FT, I, O, F, C, G, S, PI, PC} <: AbstractModel{Nothing}
clock :: C
grid :: G # TODO: make it so simulation does not require this
ice :: I
previous_ice_thickness :: PI
previous_ice_concentration :: PC
ocean :: O
atmospheric_forcing :: F
solar_insolation :: S
ocean_density :: FT
ocean_heat_capacity :: FT
Expand All @@ -53,9 +54,13 @@ const IOM = IceOceanModel

# "Ocean only"
const OceanOnlyModel = IceOceanModel{<:Any, Nothing}
OceanOnlyModel(ocean; clock=default_clock(eltype(ocean.model))) = IceOceanModel(nothing, ocean; clock)

function IceOceanModel(ice, ocean; clock = default_clock(eltype(ocean.model)))

OceanOnlyModel(ocean; atmospheric_forcing = nothing, clock = default_clock(eltype(ocean.model))) =
IceOceanModel(nothing, ocean; atmospheric_forcing, clock)

function IceOceanModel(ice, ocean;
atmospheric_forcing = nothing,
clock = default_clock(eltype(ocean.model)))

previous_ice_thickness = deepcopy(ice.model.ice_thickness)
previous_ice_concentration = deepcopy(ice.model.ice_concentration)
Expand Down Expand Up @@ -93,6 +98,7 @@ function IceOceanModel(ice, ocean; clock = default_clock(eltype(ocean.model)))
previous_ice_concentration,
ocean,
solar_insolation,
atmospheric_forcing,
convert(FT, ocean_density),
convert(FT, ocean_heat_capacity),
convert(FT, ocean_emissivity),
Expand Down
18 changes: 18 additions & 0 deletions src/IceOceanModel/atmosphere_boundary_conditions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module AtmosphericForcings

# We generally have 2 types of atmospheric forcing: Prescribed fluxes and
# Prescribed atmospheric state (to treat with bulk formulae)

export PrescribedAtmosphere, PrescribedFluxes

abstract type AbstractAtmospericForcing end

struct PrescribedAtmosphere{} <: AbstractAtmospericForcing


end




end

0 comments on commit 11d7550

Please sign in to comment.