[GRASS-dev] r.sim.water buffer overflow

Markus Neteler neteler at osgeo.org
Wed Aug 18 11:03:02 EDT 2010


On Wed, Aug 18, 2010 at 8:31 AM, Hanlie Pretorius
<hanlie.pretorius at gmail.com> wrote:
> Hi,
>
> I'm posting here because I had no reaction on the users email list.


(Hint: if you post an example for a sampe data set like Spearfish or
North Carolina, then it is way easier to reproduce for us...)

> I'm using GRASS64 RC6 on Linux 10.04 (64-bit) and I'm trying to run
> r.sim.water on a catchment about 5000 km2 in size.
>
> I started with a very fine resolution in my region (00:00:00.18) and
> got the following:
> -----
> GRASS 6.4.0RC6 (world_wgs84):~ > r.sim.water
> elevin=lieb_dem_25m_clipped dxin=lieb_dem_25m_clipped_dx
> dyin=lieb_dem_25m_clipped_dy  rain_val=2.0 manin_val=0.1
> infil_val=13.0 depth=rsimwater.depth.18s disch=rsimwater.disch.18s
> default nwalk=600505650, rwalk=600505650.000000
> Killed

Here for NC:

g.region -d res=1000 -p
r.slope.aspect elevation=elevation dx=elevation_dx dy=elevation_dy
r.sim.water elevin=elevation dxin=elevation_dx dyin=elevation_dy  \
        rain_val=2.0 manin_val=0.1 infil_val=13.0 \
        depth=rsimwater.depth.18s disch=rsimwater.disch.18s
...
WARNING: Infiltration exceeds the rainfall rate everywhere! No overland
         flow.
...
Number of iterations = 0 cells
Time step = 129663.85 s
GRASS 6.4.0svn (nc_spm_08):~ >

So no crash. But my region had way less pixels.

> ----
>
> Since this resolution gives about 300 million cells in the region, I
> progressively coarsened the resolution, but I get buffer overflows
> even with just 2736 cells in the region (resolution = 00:01:00)

The question is; how big are the internal tmp files?
Did you compile GRASS with large file support (--enable-largefile)?

> Below is an example of the error I got at a resolution of 1 minute.
> The output at all resolutions (except 00:00:00.18) is similar:

Second possibility is a bug when having LatLong coordinates. I
used a metric system.

...
> Time step = 0.00 s
> *** buffer overflow detected ***: r.sim.water terminated
> ======= Backtrace: =========

We would need a full backtrace (maybe not posted to the list)
which requires GRASS compiled with debugging symbols.

> I can run the Spearfish example as shown in the r.sim.water manual
> page and that region contains 2654802 cells.

Could you prepare a LatLong example with public data?

> My DEM is not rectangular and I'm setting the region to a vector file
> that is an irregular boundary. So, the DEM has NULL values outside the
> vector boundary but inside the region. Could this be a problem?

I don't think so.

Markus


More information about the grass-dev mailing list