RavenPy icon indicating copy to clipboard operation
RavenPy copied to clipboard

Issues with rvx files generation for sub-basins with lake HRUs

Open lou-a opened this issue 1 year ago • 1 comments

  • RavenPy version: 0.13
  • Python version: 3.10.13
  • Operating System: PAVICS, alpha test version server

Description

I am creating rvx files from a shapefile, using the BasinMakerExtractor function. My shapefile contains lake HRUs. In these sub-basins, the river slope, river length, floodplain and river channel Manning's coefficient, max and min DEM are all set to -1.2345, following BasinMaker 'standards'.

In the BasinMaker code, these sub-basins are handled differently when generating the .rvh and .rvp files. In the .rvh file: the REACH_LENGTH is set to ZERO-. In the .rvp file: the channel profile for these sub-basins is created using default Manning values. See the BasinMaker code starting at the line: https://github.com/dustming/basinmaker/blob/ad3bfbec167f8f6afa0cbb39f13611bf6e5e6838/basinmaker/hymodin/raveninput.py#L1420

In RavenPy, these sub-basins are not handled differently (as far as I can see from the code), and certain key variables in the .rvh and .rvp files are therefore negative (-1.2345, with possible unit changes), causing issues when running a model (see example below).

@huard, would it be possible for us to add some code to the RavenPy BasinMakerExtractor to handle these cases the way it is done in BasinMaker?

What I Did

When I try to run my model with these files:

outputs_path = run(modelname="SLSO_lowres_gr4j", configdir="/notebook_dir/INPACT-share/HBVECMOD/test_with_Aida_config/lowres2/")

The following error comes up:

RavenError: Config directory: /notebook_dir/INPACT-share/HBVECMOD/test_with_Aida_config/lowres2 ParseClassPropertiesFile: Mannings n values in :RoughnessZones command must be greater than zero ParseClassPropertiesFile: Mannings n values in :RoughnessZones command must be greater than zero ParseClassPropertiesFile: Mannings n values in :RoughnessZones command must be greater than zero ParseClassPropertiesFile: Mannings n values in :RoughnessZones command must be greater than zero ParseClassPropertiesFile: Mannings n values in :RoughnessZones command must be greater than zero CChannelXSect::Constructor: invalid mannings n

lou-a avatar Mar 26 '24 16:03 lou-a

Sure, by all means. Please add the necessary logic and a test for it.

huard avatar Mar 26 '24 17:03 huard