Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setup_river_floodplain method #123

Merged
merged 24 commits into from May 25, 2023
Merged

add setup_river_floodplain method #123

merged 24 commits into from May 25, 2023

Conversation

DirkEilander
Copy link
Contributor

@DirkEilander DirkEilander commented Nov 9, 2022

see #107

TODO:

  • create tests
  • add to docs
  • add toml setting in setup_river_floodplain
  • add options for manning roughness
  • merge setup_hydrodem & setup_river_floodplain?
  • release and update pyflwdir dependency.

@DirkEilander DirkEilander marked this pull request as draft November 9, 2022 14:17
@DirkEilander
Copy link
Contributor Author

Note that setting a list via the hydromt ini file does not work currently. A fix is proposed in Deltares/hydromt#246

@DirkEilander
Copy link
Contributor Author

@JoostBuitink @laurenebouaziz @verseve

There are a few last TODO's to finalize this PR. see description above. Regarding the question whether to merge setup_hydrodem and setup_river_floodplain, I'd like to get your opinion. Both methods deal with (different ways) to schematize the floodplains and to use the 1D floodplains you still need to run setup_hydrodem first. What is a clear way to divide the different processes?

My suggestion:

  • remove setup_hydrodem
  • move the setup of 1D riverbed elevation (hydrodem) to setup_rivers.
  • move the setup of 2D elevation (i.e. updating the hydrodem) to setup_floodplains if the user chooses the 2D floodplain option.

Also, I cannot reproduce the failing test locally. Does it also fail for you? I'll try to do a clean checkout to see if there is a local file conflict somewhere..

@laurenebouaziz
Copy link
Contributor

@DirkEilander, yes I think this is a very good suggestion! Now we have:

[input.lateral.river]
bankfull_elevation = "hydrodem_subgrid_D4"

but in fact in case we have floodplain 1d routing, D4 or D8 does not matter because the river is D8 anyways. So we could have this standard as D8 if floodplain 1d is applied.

If 1d2d is applied, it makes sense to update to D4 in a specific setup_2d_floodplains method (maybe good to have 2d included in the name of the method to make it very clear?)

@verseve, we were just discussing with @JoostBuitink that the toml also includes:
[input.vertical]
altitude = "wflow_dem"

how is this used in wflow and should this also be consistent (dem versus subgrid?)

About the test, I had updated the staticmaps and the local tests were working for me, but I will check again and add some more tests as we discussed!

@verseve
Copy link
Member

verseve commented Feb 23, 2023

@verseve, we were just discussing with @JoostBuitink that the toml also includes: [input.vertical] altitude = "wflow_dem"

how is this used in wflow and should this also be consistent (dem versus subgrid?)

This is not used by the sbm model type, it is only used by the sbm_gwf model type (as surface elevation).

@verseve
Copy link
Member

verseve commented Feb 23, 2023

but in fact in case we have floodplain 1d routing, D4 or D8 does not matter because the river is D8 anyways. So we could have this standard as D8 if floodplain 1d is applied.

Is it also then still possible to use the average dem value (hydrodem_avg ?) ?

@DirkEilander
Copy link
Contributor Author

but in fact in case we have floodplain 1d routing, D4 or D8 does not matter because the river is D8 anyways. So we could have this standard as D8 if floodplain 1d is applied.

Is it also then still possible to use the average dem value (hydrodem_avg ?) ?

Yes, we will keep this option. Or perhaps even remove the other option (subgrid outlet pixel elevation) as it is not a logical approach as we discussed this largely overestimates the floodplain volume, right? For the river bed elevation I will then also implement #126

@laurenebouaziz
Copy link
Contributor

but in fact in case we have floodplain 1d routing, D4 or D8 does not matter because the river is D8 anyways. So we could have this standard as D8 if floodplain 1d is applied.

Is it also then still possible to use the average dem value (hydrodem_avg ?) ?

Yes, we will keep this option. Or perhaps even remove the other option (subgrid outlet pixel elevation) as it is not a logical approach as we discussed this largely overestimates the floodplain volume, right? For the river bed elevation I will then also implement #126

I think the subgrid option is good to keep, because it has a more realistic river slope profile right? with the average option, there was too much delay in the Meuse and Rhine models.

@DirkEilander DirkEilander linked an issue Mar 9, 2023 that may be closed by this pull request
The example model was currently a model not compatible with Wflow (local-inertial for land routing, and floodplain_1d set to true will not work)
change example models to be based on kinematic-wave for both river and land routing, and update staticmaps to reflect this (essentially removing the `hydrodem_avg_D4` layer, as this was breaking the tests)
@DirkEilander
Copy link
Contributor Author

pyflwdir v0.5.7 has been released https://pypi.org/project/pyflwdir/

@JoostBuitink JoostBuitink marked this pull request as ready for review March 22, 2023 12:59
@JoostBuitink
Copy link
Collaborator

JoostBuitink commented Mar 23, 2023

  • add riv_uparea attribute to metadata of river map in staticmaps. Use this if no uparea is specified in the setup_floodplain function (raise error if different)
  • check against pre-build model layers
  • update toml with new pyflwdir version

if an existing model, which already contains floodplain_volume, is updated with different flood_depth intervals, the staticmaps were not updated correctly
added test/data/floodplain_layers.nc to use as reference data during the tests. If these layers are included in the example model, the build test are failing, as these layers will not be produced when following the test build ini files
Copy link
Contributor Author

@DirkEilander DirkEilander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work @JoostBuitink
I made two small suggestion, but in general I think this is good to go.
I'm however not allowed to approve it as I started the PR.

docs/changelog.rst Show resolved Hide resolved
hydromt_wflow/wflow.py Outdated Show resolved Hide resolved
@JoostBuitink
Copy link
Collaborator

It looks like the glacier map was failing the tests. I reverted the glacier map back (in 7f9909e) to the original map (see #143), as this now again represents expected behavior with all_touched=True

Copy link
Collaborator

@JoostBuitink JoostBuitink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing on behalf of @DirkEilander, quoting:

Really nice work @JoostBuitink I made two small suggestion, but in general I think this is good to go. I'm however not allowed to approve it as I started the PR.

The two small suggestion are included, so this PR is good to go

@JoostBuitink JoostBuitink merged commit c001baa into main May 25, 2023
1 of 2 checks passed
@JoostBuitink JoostBuitink deleted the river_floodplain branch May 25, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

floodplain 1D schematization
4 participants