Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
use abbreviated model names
Browse files Browse the repository at this point in the history
  • Loading branch information
blallen committed Jul 21, 2020
1 parent 8e141a6 commit 36e1baa
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
16 changes: 8 additions & 8 deletions src/Ocean/SplitExplicit/Communication.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ...BalanceLaws: number_state_conservative, number_state_auxiliary

@inline function initialize_states!(
baroclinic::HydrostaticBoussinesqModel{C},
barotropic::ShallowWaterModel{C},
baroclinic::HBModel{C},
barotropic::SWModel{C},
model_bc,
model_bt,
state_bc,
Expand All @@ -14,8 +14,8 @@ using ...BalanceLaws: number_state_conservative, number_state_auxiliary
end

@inline function tendency_from_slow_to_fast!(
baroclinic::HydrostaticBoussinesqModel{C},
barotropic::ShallowWaterModel{C},
baroclinic::HBModel{C},
barotropic::SWModel{C},
model_bc,
model_bt,
state_bc,
Expand Down Expand Up @@ -67,8 +67,8 @@ end
end

@inline function cummulate_fast_solution!(
baroclinic::HydrostaticBoussinesqModel{C},
barotropic::ShallowWaterModel{C},
baroclinic::HBModel{C},
barotropic::SWModel{C},
model_bt,
state_bt,
fast_time,
Expand All @@ -79,8 +79,8 @@ end
end

@inline function reconcile_from_fast_to_slow!(
baroclinic::HydrostaticBoussinesqModel{C},
barotropic::ShallowWaterModel{C},
baroclinic::HBModel{C},
barotropic::SWModel{C},
model_bc,
model_bt,
state_bc,
Expand Down
2 changes: 0 additions & 2 deletions src/Ocean/SplitExplicit/HydrostaticBoussinesqCoupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import ..HydrostaticBoussinesq:
hydrostatic_pressure!,
compute_flow_deviation!

HBModel = HydrostaticBoussinesqModel

@inline function velocity_gradient_argument!(m::HBModel, ::Coupled, G, Q, A, t)
G.∇u = Q.u
G.∇uᵈ = A.uᵈ
Expand Down
6 changes: 3 additions & 3 deletions src/Ocean/SplitExplicit/ShallowWaterCoupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ...BalanceLaws: flux_second_order!
import ..ShallowWater: forcing_term!

@inline function flux_second_order!(
::ShallowWaterModel,
::SWModel,
::ConstantViscosity,
::Coupled,
G::Grad,
Expand All @@ -19,7 +19,7 @@ import ..ShallowWater: forcing_term!
return nothing
end

@inline function coriolis_force!(::ShallowWaterModel, ::Coupled, S, Q, A, t)
@inline function coriolis_force!(::SWModel, ::Coupled, S, Q, A, t)
# f × u
f = A.f
U, V = Q.U
Expand All @@ -28,7 +28,7 @@ end
return nothing
end

@inline function forcing_term!(::ShallowWaterModel, ::Coupled, S, Q, A, t)
@inline function forcing_term!(::SWModel, ::Coupled, S, Q, A, t)
S.U += A.Gᵁ

return nothing
Expand Down
43 changes: 27 additions & 16 deletions src/Ocean/SplitExplicit/SplitExplicitModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,37 @@ import ...BalanceLaws:
cummulate_fast_solution!,
reconcile_from_fast_to_slow!

initialize_states!(
::HydrostaticBoussinesqModel{C},
::ShallowWaterModel{C},
HBModel = HydrostaticBoussinesqModel
SWModel = ShallowWaterModel

function initialize_states!(
::HBModel{C},
::SWModel{C},
_...,
) where {C <: Uncoupled} = nothing
tendency_from_slow_to_fast!(
::HydrostaticBoussinesqModel{C},
::ShallowWaterModel{C},
) where {C <: Uncoupled}
return nothing
end
function tendency_from_slow_to_fast!(
::HBModel{C},
::SWModel{C},
_...,
) where {C <: Uncoupled} = nothing
cummulate_fast_solution!(
::HydrostaticBoussinesqModel{C},
::ShallowWaterModel{C},
) where {C <: Uncoupled}
return nothing
end
function cummulate_fast_solution!(
::HBModel{C},
::SWModel{C},
_...,
) where {C <: Uncoupled} = nothing
reconcile_from_fast_to_slow!(
::HydrostaticBoussinesqModel{C},
::ShallowWaterModel{C},
) where {C <: Uncoupled}
return nothing
end
function reconcile_from_fast_to_slow!(
::HBModel{C},
::SWModel{C},
_...,
) where {C <: Uncoupled} = nothing
) where {C <: Uncoupled}
return nothing
end

include("VerticalIntegralModel.jl")
include("Communication.jl")
Expand Down

0 comments on commit 36e1baa

Please sign in to comment.