Hi Sigbjørn.
ok, thanks, god to know. I can set up a single cell test (I'm aware of the multi-cell nosetest) and will share it with you, so you can review it in case it's not working how i set it up.
Best,
Felix
To view this discussion on the web visit https://groups.google.com/d/msgid/shyft/orrn41g169osl5j8amg2hh3u.1506706623852%40email.android.com.
Hi,
I created a test with a single cell. I ran it with a daily time step. Seems like if I use a short hydro length, routing doesn't have any impact, routed and unrouted discharge (river_local_inflow_m3s and river_output_flow_m3s) are exactly the same, double by double (is that what one would expect?). If I choose the river to be sufficient long in terms of hydro length, then I get a difference in routed VS unrouted discharge.
Another question is:
Are routing parameters (alpha, beta, velocity) available for
calibration? I see that I can access them as region_parameter,
e.g.
params = region_model.get_region_parameter()
params.routing.alpha
but I set up a test and run a calibration and it does not seem that the region_parameters for routing have any impact on the simulation. How do these region_paramers interact with what is set up for a certein river in the river network?
Might be that I don't understand the complete concept of how
routing is implemented. Are there any publications describing the
approach?
All the best,
Felix
To view this discussion on the web visit https://groups.google.com/d/msgid/shyft/orrn41g169osl5j8amg2hh3u.1506706623852%40email.android.com.
Hi,
again to routing in shyft... I have the feeling that there's a
small bug, but please review ...
If I use shyft API functionality to create a UHG, the "api.make_uhg_from_gamma" function returns an array with length i-1 when the step_n parameter is i for i > 1.
Shouldn't it return a array with length i (except when i=0)?
E.g.: the first parameter passed in the function is the step_n
parameter, here evaluated for step_n = 0,1,2,3
api.make_uhg_from_gamma(0, 1,1).to_numpy() -> array([ 1.]) #
that should be correct, no delay
api.make_uhg_from_gamma(1, 1,1).to_numpy() -> array([ 1.]) # should also be correct, no delay
api.make_uhg_from_gamma(2, 1,1).to_numpy() -> array([ 1.]) #
here I would expect an array with length 2
api.make_uhg_from_gamma(3, 1,1).to_numpy() -> array([ 0.66666667, 0.33333333]) # here I would expect an array with length 3.
The "step_n" parameter is calculated from the hydrologic length of the river, the velocity, and the timestep dt:
step_n = int((distance / velocity) / dt + 0.5) # rounded int
e.g. from a river length of 2000 m length, with a velocity of 1
km/h, and 1 h timestep, I would expect that routing should have an
impact.
however, this results in step_n = 2, so that make_uhg_from_gamma returns an array with size 1 and no routing happens.
The reason for this is a for-loop in https://github.com/statkraft/shyft/blob/master/core/routing.h#L405 that stops too early.
I think it should rather be sth like
for (double q = d;q <= 1.0; q += d) { etc...
or
double small = 1.0E-10;
for (double q = d;q < 1.0+small; q += d) { etc...
It would be nice if someone could review this. I can also create
a pull-request...
Best,
Felix
To view this discussion on the web visit https://groups.google.com/d/msgid/shyft/af7a1253-7279-1a1b-16a6-da38e4482812%40geo.uio.no.