Forestry and Grass + scripts for models

Rich Shepard rshepard at appl-ecosys.com
Tue Oct 26 18:42:09 EDT 1999


On Tue, 26 Oct 1999, Agustin Lobo wrote:

> Well, I would not say that is "ideal", it is possible. Actually, writing
> (i.e. population or metapopulation) models in C (or C++) is far from
> ideal, as writing the code tends to imply too much time devoted to "low
> level" (not a fair term, but an usual one) programming and the resulting
> code uses to be too obscure for others to read (often it's easier to write
> your own program in C than reading it afterwards).

  Ah, you bring back memories of my graduate school days! I learned to
program in FORTRAN, and no one commented the code because that meant
punching more Hollerith cards on the 029 keypunch. The closest we came was
to make lines with a felt-tip marker across the top of the deck. That way,
if we dropped the cards, we could put them back in order fairly quickly.

  It was only when I moved to microcomputers and C (in the mid-1980's) that
I learned the value of commenting code. Scientists aren't taught this;
programmers are.

  My code now is at least 50% comments; often much more. I explain why I did
something a certain way or what I was trying to accomplish. The effort is
repaid manyfold when I look at old code years later. :-)
 
> Finally, I explored the possibility of using Splus (R is now a free
> alternative and mostly compatible) programs, as Splus (or R) can issue OS
> commands. Therefore, it is possible, from within an Splus program, run
> i.e. r.stats and read in the result into an S array and make computations.
> But the communication is through files.

  I've know of S-Plus and I just discovered R. I think that it would be
ideal to link GRASS and R for analytical purposes. 

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
              Making environmentally-responsible mining happen. (SM)         
                       --------------------------------
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
 + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard at appl-ecosys.com



More information about the grass-user mailing list