[Bug] r.sim.water: buffer overflow #4709
-
Error Report (grass84): While working on enhancing the r.sim.water documentation, I encountered a buffer overflow during testing. Below are the details: Python commands:Step 1: Generate dx and dy derivatives using r.slope.aspect #Calculate the slope derivatives from the elevation map
dx = 'dx_slope'
dy = 'dy_slope'
#Run the r.slope.aspect command to get x and y slopes
gs.run_command('r.slope.aspect',
elevation=dem,
dx=dx,
dy=dy,
overwrite=True) Step 2: Run r.sim.water with the required parameters, including #Now that we have the dx and dy maps, we can proceed with `r.sim.water`
gs.run_command('r.sim.water',
elevation=dem,
dx=dx,
dy=dy,
rain_value=rain_intensity,
depth=output_depth,
discharge=output_discharge,
overwrite=True) Step 3: Run soil_texture = 'soils_texture' # Example soil texture map, if available
output_erosion = 'erosion'
output_deposition = 'deposition'
gs.run_command('r.sim.sediment',
elevation=dem,
water_depth=output_depth,
sediment_detachment=output_erosion,
sediment_deposition=output_deposition,
overwrite=True)
print("Simulation completed successfully!") Error Message:Number of threads: 1
default nwalk=120040200, rwalk=120040200.000000
Min elevation = 55.89 m
Max elevation = 156.33 m
Mean Source Rate (rainf. excess or sediment) = 0.000000 m/s or kg/m2s
Mean flow velocity = 0.081579 m/s
Mean Mannings = 2.972316
Number of iterations = 4 cells_
Time step = 30.64 s
*** buffer overflow detected ***: terminated
---------------------------------------------------------------------------
CalledModuleError Traceback (most recent call last)
<ipython-input-30-d891834eab96> in <cell line: 16>()
14 # Now that we have the dx and dy maps, we can proceed with r.sim.water
15
---> 16 gs.run_command('r.sim.water',
17 elevation=dem,
18 dx=dx,
1 frames
/usr/lib/grass84/etc/python/grass/script/core.py in handle_errors(returncode, result, args, kwargs)
364 else:
365 module, code = get_module_and_code(args, kwargs)
--> 366 raise CalledModuleError(module=module, code=code, returncode=returncode)
367
368
CalledModuleError: Module run `r.sim.water --o elevation=elevation dx=dx_slope dy=dy_slope rain_value=50 depth=water_depth discharge=water_discharge` ended with an error.
The subprocess ended with a non-zero return code: -6. See errors above the traceback or in the error output. Steps Taken:
Could this issue be due to specific input data characteristics or a module-level limitation? Request:
|
Beta Was this translation helpful? Give feedback.
Answered by
rohannallamadge
Dec 7, 2024
Replies: 1 comment 2 replies
-
For better visibility, I have moved this report to Issue #4810 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for moving this report to Issue #4810 for better visibility. I'll follow up on that issue.