Problem:
There is an assumption that all water from upstream runs through the grid cell in one time step, however, the way it is updated in the loop is adding too much water:
New_accumulated runoff(t1) = surface_runoff(t1, me) + previous_accumulated_runoff(t0, upstream cells)
then set
Previous_accumulated_runoff(t1) = new_accumulated_runoff(t1)
New_accumulated runoff(t2)
= surface_runoff(t2, me) + previous_accumulated_runoff(t1, upstream cells)
= surface_runoff(t2, me) + surface_runoff(t1, me) + previous_accumulated_runoff(t0, upstream cells) + previous_accumulated_runoff(t1, upstream cells)
So we keep adding the same water over and over again
Possible solutions:
- move water only a shorter distance, like one grid cell per time step, make sure inflow and outflow is considered.
Flow_through_cell (t1)=next highest neighbour(t0)-me(t1)
- Make water run through the whole grid, adjust how previous_accumulated is handled, I believe it should be the surface runoff from the previous timestep only. Maybe better to call it
upstream_runoff, definitely explain variables better in documentation
New_accumulated runoff(t1) = surface_runoff(t1, me) + upstream_runoff(t0)
then set
net upstream_runoff(t1) = surface_runoff(t1, upstream cells)
New_accumulated runoff(t2) = surface_runoff(t2, me) + upstream_runoff(t1)
This means that the water will magically disappear at the lowest points with the new time step.
@lelavathy , @sallymatson and I started a discussion that we might want to move to a proper river routing implementation, which would make this problem go away (see #1034 ) but for now decided to fix the bug first.
Problem:
There is an assumption that all water from upstream runs through the grid cell in one time step, however, the way it is updated in the loop is adding too much water:
New_accumulated runoff(t1) = surface_runoff(t1, me) + previous_accumulated_runoff(t0, upstream cells)then set
Previous_accumulated_runoff(t1) = new_accumulated_runoff(t1)So we keep adding the same water over and over again
Possible solutions:
Flow_through_cell (t1)=next highest neighbour(t0)-me(t1)upstream_runoff, definitely explain variables better in documentationNew_accumulated runoff(t1) = surface_runoff(t1, me) + upstream_runoff(t0)then set
net upstream_runoff(t1) = surface_runoff(t1, upstream cells)New_accumulated runoff(t2) = surface_runoff(t2, me) + upstream_runoff(t1)This means that the water will magically disappear at the lowest points with the new time step.
@lelavathy , @sallymatson and I started a discussion that we might want to move to a proper river routing implementation, which would make this problem go away (see #1034 ) but for now decided to fix the bug first.