-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
module ClimaRivers | ||
|
||
greet() = print("Hello World!") | ||
#using deps: | ||
using LinearAlgebra, | ||
Distributions, | ||
Statistics, | ||
Random, | ||
DocStringExtensions | ||
|
||
# includes | ||
include("Environments.jl") | ||
include("States.jl") | ||
include("RiverModels.jl") | ||
include("Routing.jl") | ||
end # module ClimaRivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Contains the structs that define the static and dynamic environment that configures/forces the river model. | ||
|
||
struct StaticEnvironment | ||
# static data objects | ||
end | ||
struct DynamicEnvironment | ||
# timeseries objects | ||
# date/time - index map | ||
end | ||
struct Environment{SE <: StaticEnvironment, DE <: DynamicEnvironment} | ||
static_env::SE | ||
dyn_env::DE | ||
graph::Dict # river graph? | ||
end | ||
# get_static(env, :name) | ||
# get_dynamic(env, :name, time=date/time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Contains the Mizuroute model | ||
struct MizurouteHillslopeV1{FT <: AbstractFloat} <: AbstractHillslopeModel | ||
"Shape factor, a (adjusted)" | ||
shape::FT | ||
"Timescale factor, θ [day]" | ||
timescale::FT | ||
end | ||
|
||
function MizurouteHillslope{FT}() where {FT <: AbstractFloat} | ||
shape = FT(1.5) | ||
timescale = FT(1.0) | ||
return MizurouteHillslope(shape,timescale) | ||
end | ||
|
||
|
||
struct MizurouteChannelV1{FT <: AbstractFloat} <: AbstractChannelModel | ||
"Wave velocity, C [m/day]" | ||
wave_velocity::FT | ||
"Diffusivity, D [m²/day] (adjusted)" | ||
diffusivity::FT | ||
end | ||
|
||
function MizurouteChannel{FT}() where {FT <: AbstractFloat} | ||
wave_velocity = FT(1.5 * 86400) | ||
diffusivity = FT(8000 * 86400 ) | ||
return MizurouteHillslope(wave_velocity, diffusivity) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Contains the abstract river model types, structs and methods | ||
|
||
|
||
#general model level | ||
abstract type AbstractRiverModel end | ||
|
||
# hillslope-channel model | ||
abstract type AbstractHillslopeModel end | ||
abstract type AbstractChannelModel end | ||
|
||
struct HillslopeChannelRiverModel{HS <: AbstractHillslopeModel, CH <: AbstractChannelModel} <: RiverModel | ||
hillslope_model::HS | ||
channel_model::CH | ||
end | ||
|
||
# Specific hillslope-channel models loaded here: | ||
include("MizurouteV1.jl") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# general methods for routing rivers | ||
|
||
# methods | ||
function calculate_streamflow!( | ||
river_state::RS, | ||
river_model::RM, | ||
environment::E, | ||
) where { | ||
RS <:RiverState, | ||
RM <: AbstractRiverModel, | ||
E <: Environment, | ||
} | ||
# ...most general stub | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Contains the structs that are evolved by the river model, and methods to instantiate them | ||
|
||
struct RiverState{AM <: AbstractMatrix} | ||
hillslope::AM # instantaneous | ||
channel::AM # instantaneous | ||
graph::Dict # river graph copy? | ||
end | ||
|
||
# initialize method | ||
# initialize_state(river_model::HCRM) where {HCRM <: HillslopChannelRiverModel} end |