BIOSYS 2 recompile
Code changes to make GNU Fortran work
Mark A. Jensen/Fortinbras Research
01/31/09

Principles for running biosys2.exe

- STDIN is the input data file
- STDOUT is the output analysis file
so runs of biosys2.exe need to happen as ff:
 $ ./biosys2 < my.data > my.output
or
 C:> biosys2.exe < my.data > my.output

- The input files MUST have UNIX (not DOS) linebreaks
  currently. This means all lines end with ASCII 10 
  only, not ASCII 10, ASCII 13.

Refactorization compiles under f77 (g77)
with no warnings. Do:

$ f77 *.FOR -c
$ f77 *.o -o biosys2.exe

Fortran notes:

When UNITs are opened without filenames attaches, 
g77 looks for "fort.n" where n is the unit number.

input file: fort.1
output file: fort.2

input files require unix linebreaks
(DOS linebreaks cause a core dump)

the biosys-1 sample ".BIO" files have format issues:
- title line (line 1) is required
- the first designator line is removed

Changes to source to make things work:
changes in all files:
- all READs to unit 1 were changed to unit 5 (STDIN)
- all WRITEs to unit 2 were changed to unit 6 (STDOUT)
- This causes a problem when the program asks the user for
  a value via STDIN (as it does in BOOTDIST.FOR, where
  the user is requested to provide filenames and 
  random number seeds)

in MAIN.FOR
- commented out the $LARGE and $DEBUG tokens at lines 1, 2
- wrote PARAMETER statement to dimension array for 
  21st century computers

- added a 'GNU77' flag at line 359
- following was a key change for making it work:
  the fields in the input file are fixed-width
  That width is specified in different terms
  depending on the compiler. A factor of 4
  seemed to work here, at line 475

in various places
- 'FSTAT' is an instrinsic function, so the calls
   and definition of FSTAT (found in FSTAT4.FOR)
   changed to 'FSTAT4'
- 'RAND' is an instrinsic function, so the 
  calls and custom definition of 'RAND'
  (that allow the setting of a seed)
  changed to RANDS

in MISC.FOR
- SUBROUTINE GETDT : this required a GNU77-specific
  intrinsic function for date/time (Date_and_Time())
  This function is just for writing the date in the
  output file. 
  Commented out the "IBM-PC"-specific stuff

in BOOTDIST.FOR
- a kludge allows the PHYF and SEED tokens to be 
  assigned in the free-form parameter line, see
  SAMPLE1.BIO, under the section STEP BOOTDIST

