You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
struct for the environments
struct StaticEnvironment
# static data objectsendstruct DynamicEnvironment
# timeseries objects# date/time - index mapendstruct 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)
generic methods for river routing environment -> streamflow
functioncalculate_streamflow(river_model, river_state, static_environment, dyamic_environment) end# this function contains:functioncalculate_hillslope(hillslope_model, hillslope_state, static_environment, dyamic_environment) endfunctioncalculate_streamflow_from_channel(channel_model, channel_state, static_environment, dyamic_environment) end
User interface in examples/
We wish to move towards the "model_type==evolutionary" paradigm
using ClimaRivers
# build model
hillslope =MizurouteHillslopeV1(params)
channel =MizurouteChannelV1(params)
river_model =HillslopeChannelRiverModel(hillslope, channel)
# build data
graph =...
static_env =StaticEnvironment(...)
dynamic_env =DynamicEnvironment(...)
env =Environment(static_env, dynamic_env, graph)
# get exp conditions
start_date =...
end_date =...## evolutionary model, evolving a state over time
model_types = ["evolutionary", "instant"]
model_type = model_types[1]
streamflow =zeros(dates,basins)
if model_type =="evolutionary"## intialize river state
river_state =zeros(dates,basins)
river_state_instant =set_state(river_model, env, start_date)
for date in [start_date,end_date]
river_state[date,:] =evolve_state!(river_state_instant, river_model, env, date)
streamflow[date,...] =compute_streamflow(river_state_instant)
endelseif model_type =="instant"## full-timeseries model, predicts all states at once
river_state =compute_state(river_model, env, start_date, end_date)
streamflow =compute_streamflow(river_state)
end
The text was updated successfully, but these errors were encountered:
odunbar
changed the title
Refactored Mizuroute source code, with unit tests, docstrings
O2.4.1 Refactored Mizuroute source code, with unit tests, docstrings
Nov 6, 2024
To refactor the source code of mizuroute from https://github.com/limamau/Rivers.
Based off meeting with Andrew/Kat
Tasks
Implementation idea
objects in src/
Follow the Julian style:
User interface in examples/
We wish to move towards the "model_type==evolutionary" paradigm
The text was updated successfully, but these errors were encountered: