From 11d75500e0733f47219c2c2c1f9d3f9cdb634ab2 Mon Sep 17 00:00:00 2001 From: Simone Silvestri <33547697+simone-silvestri@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:32:46 -0400 Subject: [PATCH] starting out --- src/IceOceanModel/IceOceanModel.jl | 14 ++++++++++---- .../atmosphere_boundary_conditions.jl | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/IceOceanModel/atmosphere_boundary_conditions.jl diff --git a/src/IceOceanModel/IceOceanModel.jl b/src/IceOceanModel/IceOceanModel.jl index 63f626b6..3f68811e 100644 --- a/src/IceOceanModel/IceOceanModel.jl +++ b/src/IceOceanModel/IceOceanModel.jl @@ -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 @@ -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) @@ -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), diff --git a/src/IceOceanModel/atmosphere_boundary_conditions.jl b/src/IceOceanModel/atmosphere_boundary_conditions.jl new file mode 100644 index 00000000..bd38aeeb --- /dev/null +++ b/src/IceOceanModel/atmosphere_boundary_conditions.jl @@ -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 \ No newline at end of file