Too many cells open (ERROR)

GRASS 4.0 allows up to 60 cell files open. But if you call
G_close_cell() that really does close a cell file and its file
descriptor. Perhaps in other parts of your program you have
forgotten close other (non-raster) files. This could make it
impossible for GRASS to open cell files.

I carefully checked my programs and none of the non-raster files
are open. Whatever fiels (e.g G_tempfile) are all closed (fclose() and
free()).
I try to trace why this error happens, and found each time I open and
close a rater map the file descriptor or id increases.
Since I am opening and closing only two raster maps frequently
I could open them at the start of the program and close them before
the program quits. But, I am setting different region which will
cause trouble in reading the data from raster maps.
Any other suggestions. I saw MAXFILES defined as 20 and 30 in
G.h for GRASS3.1 and GRASS4.0 version respectively.

What problems are you having with colors?

Will post seperately.

Thanks.

Srinivasan.

srin@ecn.purdue.edu