Skip to content

Commit

Permalink
fixed lateral snow transport
Browse files Browse the repository at this point in the history
snow and snowwater variables were not mutating in function lateral snow transport
  • Loading branch information
verseve committed Jan 12, 2022
1 parent d288b38 commit 080b0b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
model is initialized from state files, `q` and `h` are set to zero for indices with a zero
surface flow width.
- Fixed CSV output of variables with dimension `layer` (`SVector`) when data is extracted
for a specific location (coordinates or index).
for a specific location (coordinates or index).
- `snow` and `snowwater` were not mutating in the function `lateral_snow_transport!`, and
as a result `vertical.snow` and `vertical.snowwater` were not updated.

## v0.5.1 - 2021-11-24

Expand Down
4 changes: 2 additions & 2 deletions src/horizontal_process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ Lateral snow transport. Transports snow downhill. Mutates `snow` and `snowwater`
function lateral_snow_transport!(snow, snowwater, slope, network)
snowflux_frac = min.(0.5, slope ./ 5.67) .* min.(1.0, snow ./ 10000.0)
maxflux = snowflux_frac .* snow
snow = accucapacitystate!(snow, network, maxflux)
snowwater = accucapacitystate!(snowwater, network, snowwater .* snowflux_frac)
snow .= accucapacitystate!(snow, network, maxflux)
snowwater .= accucapacitystate!(snowwater, network, snowwater .* snowflux_frac)
return snow, snowwater
end

Expand Down

0 comments on commit 080b0b3

Please sign in to comment.