Scott O'Donnell odonnell at
Tue Aug 19 21:52:06 EDT 1997


I'm sure that M.W. & P.L are trying to help you out, but
the referenced code is FAR from ready to use.  I've been 
working with it for nearly a year and I'm still trying to 
work out the bugs.  The authors of this code were not 
programmers, just PhD students.  So, what you're getting is 
some "apl-hacked-into-FORTRAN-hacked-into-C" 
"good-enough-for-who-its-for" code by civil engineering students 
learning C.  There are countless rookie coding errors that show 
up if you use an ANSI C compiler on the source.  If you're going 
to use a rigorous C compiler, expect to redeclare all the functions, 
(they're currently written in K&R style definitions.) A significant 
portion of the code is in the "main ()" function (I'm talking 1700 
lines), violating first semester programming style guides of breaking 
any solution into small, managable functions.  I could go on and 
on.  If you are not a C programmer, you may want to consider 

Data development is a challenge as well.  Expect to commit a 
great deal of time to establishing the data necessary to support
this numerical model.  This will be true of any GIS based model.
This is one of the "big-ticket" items that people forget to talk 
about.  The amount of time necessary develop the GIS that will 
support a model is not trivial.  And, the larger the area, typically, 
the more complex the database.  Of course, this assumes the source 
data you will need is available.  Some investigation here is well
worth the effort, regardless of the model choice you make.

Algorithmically, the model performs (qualified) OK.  There are 
a few disturbing comments in the code.  My favorite, 
"/* why 14.9?  It works. */ troubles me.  This suggests
an empirical approach to solving some of the numerical equations.
You might expect to find some volume loss in a diffusive wave 
solution, as is used here.  My experiments show that the losses 
can be as large as 7%.  I don't know what your requirements are, 
this may be an acceptable error.

I expected much more from a numerical hydrologic model located at 
the "moon" site.  By the time I developed these opinions, I felt I 
had too much time and effort committed to my project to start 
over, so I'm working through the stuff the authors didn't get 
around to dealing with.

Good luck in your endeavor,
Scott O'Donnell

Paul Loechl wrote:
> You should look under /pub/grass/outgoing/Raster for the program
> r.hydro.CASC2D_1.01.tar.Z
> ----
> ----------
> Paul Loechl
"I don't think so,"                      Scott O'Donnell        
   said Rene Descartes.                  odonnell at
Just then, he vanished!                  303 497 6562

More information about the grass-user mailing list