Skip to content

Commit

Permalink
Add constructor for ocean only model
Browse files Browse the repository at this point in the history
  • Loading branch information
glwagner committed Oct 5, 2023
1 parent a108beb commit 1eab2c0
Showing 1 changed file with 10 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 @@ -35,9 +35,6 @@ struct IceOceanModel{FT, I, C, G, O, S, PI, PC} <: AbstractModel{Nothing}
reference_temperature :: FT
end

const IOM = IceOceanModel
const OceanOnlyModel = IceOceanModel{<:Any, Nothing}

Base.summary(::IOM) = "IceOceanModel"
prettytime(model::IOM) = prettytime(model.clock.time)
iteration(model::IOM) = model.clock.iteration
Expand All @@ -49,7 +46,16 @@ update_state!(::IOM) = nothing
prognostic_fields(cm::IOM) = nothing
fields(::IOM) = NamedTuple()

function IceOceanModel(ice, ocean; clock = Clock{Float64}(0, 0, 1))

default_clock(FT) = Clock{FT}(0, 0, 1)

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)))

previous_ice_thickness = deepcopy(ice.model.ice_thickness)
previous_ice_concentration = deepcopy(ice.model.ice_concentration)
Expand Down

0 comments on commit 1eab2c0

Please sign in to comment.