


      IOINIT(3F)                  (bsd 4.2)                  IOINIT(3F)



      NAME
           ioinit - change f77 I/O initialization

      SYNTAX
           logical function ioinit (cctl, bzro, apnd, prefix, vrbose)
           logical cctl, bzro, apnd, vrbose
           character*(*) prefix

      DESCRIPTION
           This routine will initialize several global parameters in
           the f77 I/O system, and attach externally defined files to
           logical units at run time.  The effect of the flag arguments
           applies to logical units opened after ioinit is called.  The
           exception is the preassigned units, 5 and 6, to which cctl
           and bzro will apply at any time.  Ioinit is written in
           Fortran-77.

           By default, carriage control is not recognized on any
           logical unit. If cctl is .true. then carriage control will
           be recognized on formatted output to all logical units
           except unit 0, the diagnostic channel.  Otherwise the
           default will be restored.

           By default, trailing and embedded blanks in input data
           fields are ignored. If bzro is .true. then such blanks will
           be treated as zero's.  Otherwise the default will be
           restored.

           By default, all files opened for sequential access are
           positioned at their beginning.  It is sometimes necessary or
           convenient to open at the END-OF-FILE so that a write will
           append to the existing data.  If apnd is .true. then files
           opened subsequently on any logical unit will be positioned
           at their end upon opening.  A value of .false. will restore
           the default behavior.

           Many systems provide an automatic association of global
           names with fortran logical units when a program is run.
           There is no such automatic association in f77.  However, if
           the argument prefix is a non-blank string, then names of the
           form prefixNN will be sought in the program environment. The
           value associated with each such name found will be used to
           open logical unit NN for formatted sequential access.  For
           example, if f77 program myprogram included the call

                call ioinit (.true., .false., .false., 'FORT', .false.)

           then when the following C-Shell sequence:

                 % setenv FORT01 mydata
                 % setenv FORT12 myresults
                 % myprogram



      Page 1                                          (73 A2 03MT REV1)






      IOINIT(3F)                  (bsd 4.2)                  IOINIT(3F)



           or the following Bourne-Shell sequnece:

                 $ FORT01=mydata
                 $ FORT02=myresults
                 $ export FORT01 FORT02
                 $ myprogram
           would result in logical unit 1 opened to file mydata and
           logical unit 12 opened to file myresults.  Both files would
           be positioned at their beginning.  Any formatted output
           would have column 1 removed and interpreted as carriage
           control.  Embedded and trailing blanks would be ignored on
           input.

           If the argument vrbose is .true. then ioinit will report on
           its activity.

           The internal flags are stored in a labeled common block with
           the following definition:

                integer*2 ieof, ictl, ibzr
                common /ftn_ioiflg/ ieof, ictl, ibzr


      FILES
           /usr/lib/libI77.a       f77 I/O library

      SEE ALSO
           getarg(3F), getenv(3F),

      BUGS
           Prefix can be no longer than 30 characters.  A pathname
           associated with an environment name can be no longer than
           255 characters.

           The ``+'' carriage control does not work.




















      Page 2                                          (73 A2 03MT REV1)



