RAM vs. SEG in r.watershed

I have successfully used r.watershed to create subbasins within a large
watershed...but I have only been able to do this using the seg version.
For the area I am using, this process takes about 5 hours. I have tried
using the ram version and it runs without any error messages but creates
obviously bogus data layers. I used the same options with ram as I did
with seg but my results are not the same. Does anyone know why this
is happening or, even better, how I can get the ram version to generate the
same results as the seg version??

Leslie Frankoski
Department of Civil, Environmental, and Architectural Engineering
University of Colorado at Boulder
frankosk@cadswes.colorado.edu

try the following:

replace raster/r.watershed/ram/ramseg.h

by the following fixed ramseg.h:

#define RAMSEG int
#define RAMSEGBITS 4
#define DOUBLEBITS 8 /* 2 * ramsegbits */
#define SEGLENLESS 15 /* 2 ^ ramsegbits - 1 */

#define SEG_INDEX(s,r,c) (int) \
   (((((r) >> RAMSEGBITS) * (s) + ((c) >> RAMSEGBITS)) << DOUBLEBITS) \
    + (((r) & SEGLENLESS) << RAMSEGBITS) + ((c) & SEGLENLESS))