@@ -2,9 +2,9 @@ using Parameters
22using ModelParameters
33
44
5- const SYMHYD_SOIL_ET_CONST = 10.0
5+ const SIMHYD_SOIL_ET_CONST = 10.0
66
7- Base. @kwdef mutable struct SYMHYDNode {P, A<: AbstractFloat } <: NetworkNode
7+ Base. @kwdef mutable struct SIMHYDNode {P,A<: AbstractFloat } <: NetworkNode
88 name:: String
99 area:: A
1010
3434
3535
3636"""
37- SYMHYDNode (name::String, spec::AbstractDict)::SYMHYDNode
37+ SIMHYDNode (name::String, spec::AbstractDict)::SIMHYDNode
3838
39- Create SYMHYD node from spec.
39+ Create SIMHYD node from spec.
4040"""
41- function SYMHYDNode (name:: String , spec:: AbstractDict ):: SYMHYDNode
42- n = create_node (SYMHYDNode , name, spec[" area" ])
41+ function SIMHYDNode (name:: String , spec:: AbstractDict ):: SIMHYDNode
42+ n = create_node (SIMHYDNode , name, spec[" area" ])
4343 node_params = spec[" parameters" ]
4444 node_params[" sm_store" ] = [node_params[" initial_sm_store" ]]
4545 node_params[" gw_store" ] = [node_params[" initial_gw_store" ]]
@@ -70,10 +70,10 @@ function SYMHYDNode(name::String, spec::AbstractDict)::SYMHYDNode
7070 return n
7171end
7272
73- function prep_state! (node:: SYMHYDNode , sim_length:: Int64 ):: Nothing
74- resize! (node. sm_store, sim_length+ 1 )
75- resize! (node. gw_store, sim_length+ 1 )
76- resize! (node. total_store, sim_length+ 1 )
73+ function prep_state! (node:: SIMHYDNode , sim_length:: Int64 ):: Nothing
74+ resize! (node. sm_store, sim_length + 1 )
75+ resize! (node. gw_store, sim_length + 1 )
76+ resize! (node. total_store, sim_length + 1 )
7777 node. sm_store[2 : end ] .= 0.0
7878 node. gw_store[2 : end ] .= 0.0
7979 node. total_store[2 : end ] .= 0.0
8888
8989"""
9090 run_timestep!(
91- node::SYMHYDNode , climate::Climate, ts::Int;
91+ node::SIMHYDNode , climate::Climate, ts::Int;
9292 inflow=nothing, extraction=extraction, exchange=nothing
9393 )::AbstractFloat
9494 run_timestep!(
95- node::SYMHYDNode ,
95+ node::SIMHYDNode ,
9696 rain::F,
9797 et::F,
9898 ts::Int;
@@ -101,26 +101,26 @@ end
101101 exchange=nothing
102102 )::F where {F<:AbstractFloat}
103103
104- Run SYMHYD for a given timestep.
104+ Run SIMHYD for a given timestep.
105105"""
106106function run_timestep! (
107- node:: SYMHYDNode , climate:: Climate , ts:: Int ;
107+ node:: SIMHYDNode , climate:: Climate , ts:: Int ;
108108 inflow= nothing , extraction= extraction, exchange= nothing
109109):: AbstractFloat
110110 P, E = climate_values (node, climate, ts)
111111
112112 return run_timestep! (node, P, E, ts; inflow= inflow, extraction= extraction, exchange= exchange)
113113end
114114function run_timestep! (
115- node:: SYMHYDNode ,
115+ node:: SIMHYDNode ,
116116 rain:: F ,
117117 et:: F ,
118118 ts:: Int ;
119119 inflow= nothing ,
120120 extraction= nothing ,
121121 exchange= nothing
122122):: F where {F<: AbstractFloat }
123- sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff = run_symhyd (node, rain, et, ts)
123+ sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff = run_simhyd (node, rain, et, ts)
124124
125125 node_name = node. name
126126 wo = timestep_value (ts, node_name, " releases" , extraction)
@@ -138,15 +138,15 @@ function run_timestep!(
138138end
139139
140140
141- function update_state! (node:: SYMHYDNode , sm_store, gw_store, total_store, outflow, baseflow, quickflow)
141+ function update_state! (node:: SIMHYDNode , sm_store, gw_store, total_store, outflow, baseflow, quickflow)
142142 push! (node. sm_store, sm_store)
143143 push! (node. gw_store, gw_store)
144144 push! (node. total_store, total_store)
145145 push! (node. outflow, outflow)
146146 push! (node. baseflow, baseflow)
147147 push! (node. quickflow, quickflow)
148148end
149- function update_state! (node:: SYMHYDNode , ts:: Int64 , sm_store, gw_store, total_store, outflow, baseflow, quickflow)
149+ function update_state! (node:: SIMHYDNode , ts:: Int64 , sm_store, gw_store, total_store, outflow, baseflow, quickflow)
150150 node. sm_store[ts+ 1 ] = sm_store
151151 node. gw_store[ts+ 1 ] = gw_store
152152 node. total_store[ts+ 1 ] = total_store
157157
158158"""
159159 update_params!(
160- node::SYMHYDNode ,
160+ node::SIMHYDNode ,
161161 baseflow_coef::Float64,
162162 impervious_threshold::Float64,
163163 infiltration_coef::Float64,
172172Update model parameters.
173173"""
174174function update_params! (
175- node:: SYMHYDNode ,
175+ node:: SIMHYDNode ,
176176 baseflow_coef:: Float64 ,
177177 impervious_threshold:: Float64 ,
178178 infiltration_coef:: Float64 ,
@@ -198,11 +198,11 @@ end
198198
199199
200200"""
201- reset!(node::SYMHYDNode )::Nothing
201+ reset!(node::SIMHYDNode )::Nothing
202202
203203Reset node. Clears all states back to their initial values.
204204"""
205- function reset! (node:: SYMHYDNode ):: Nothing
205+ function reset! (node:: SIMHYDNode ):: Nothing
206206 # stores
207207 node. sm_store = [node. sm_store[1 ]]
208208 node. gw_store = [node. gw_store[1 ]]
@@ -218,18 +218,18 @@ end
218218
219219
220220"""
221- run_symhyd (node::SYMHYDNode , P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
221+ run_simhyd (node::SIMHYDNode , P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
222222
223- Run SYMHYD for a single time step with given inputs and state variables.
223+ Run SIMHYD for a single time step with given inputs and state variables.
224224"""
225- function run_symhyd (node:: SYMHYDNode , P:: F , ET:: F , ts:: Int64 ):: NTuple{6,F} where {F<: Float64 }
225+ function run_simhyd (node:: SIMHYDNode , P:: F , ET:: F , ts:: Int64 ):: NTuple{6,F} where {F<: Float64 }
226226
227227 sm_store:: F = node. sm_store[ts]
228228 gw_store:: F = node. gw_store[ts]
229229 total_store:: F = node. total_store[ts]
230230
231231 pervious_incident:: F = P
232- impervious_incident:: F = P
232+ impervious_incident:: F = P
233233
234234 impervious_ET:: F = min (node. impervious_threshold, impervious_incident)
235235 impervious_runoff:: F = impervious_incident - impervious_ET
@@ -264,7 +264,7 @@ function run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where
264264 baseflow_runoff:: F = node. baseflow_coef. val:: F * gw_store
265265 gw_store -= baseflow_runoff
266266
267- soil_ET:: F = min (sm_store, min (ET - interception_ET, sm_fraction* SYMHYD_SOIL_ET_CONST ))
267+ soil_ET:: F = min (sm_store, min (ET - interception_ET, sm_fraction * SIMHYD_SOIL_ET_CONST ))
268268 sm_store -= soil_ET
269269
270270 pervious_frac:: F = node. pervious_fraction. val:: F
@@ -274,6 +274,6 @@ function run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where
274274 total_runoff:: F = event_runoff + pervious_frac * baseflow_runoff
275275 baseflow:: F = baseflow_runoff * pervious_frac
276276
277- # values for time step...
278- return sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff
277+ # values for time step...
278+ return sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff
279279end
0 commit comments