C ioinit - initialize the I/O system
C logical function ioinit (io66, ioapnd, prefix, vrbose)
C io66 is .true. to turn on fortran-66 carriage control
C ioapnd is .true. to open files at their end
C prefix is a string defining environment variables to
C be used to initialize logical units.
C vrbose is .true. if the caller wants output showing the lu association
C .true. if all went well
logical function ioinit (io66, ioapnd, prefix, vrbose)
logical io66, ioapnd, vrbose
automatic iok, ename, fname
if ((lp .gt. 0) .and. (lp .le. 30) .and. (prefix .ne. " ")) then
if (nb .eq. 0) nb = lp + 1
if (vrbose) write (0, "('ioinit: initializing from ', a, 'nn')")
write (ename(nb:), "(i2.2)") lu
call getenv (ename, fname)
if (fname .eq. " ") go to 200
open (unit=lu, file=fname, form='f', access='s', err=100)
if (vrbose) write (0, 2000) lu, fname(:lnblnk(fname))
100 write (0, "('ioinit: ', a, ' ', $)") ename(:lnblnk(ename))
call perror (fname(:lnblnk(fname)))
write (0, "('ioinit: io66=', l, ', ioapnd=', l)") io66, ioapnd
2000 format ('ioinit: logical unit ', i2,' opened to ', a)