1IOINIT(3F) IOINIT(3F)
2
3
4
6 ioinit - change f77 I/O initialization
7
9 logical function ioinit (cctl, bzro, apnd, prefix, vrbose)
10 logical cctl, bzro, apnd, vrbose
11 character*(*) prefix
12
14 This routine will initialize several global parameters in the f77 I/O
15 system, and attach externally defined files to logical units at run
16 time. The effect of the flag arguments applies to logical units opened
17 after ioinit is called. The exception is the preassigned units, 5 and
18 6, to which cctl and bzro will apply at any time. Ioinit is written in
19 Fortran-77.
20
21 By default, carriage control is not recognized on any logical unit. If
22 cctl is .true. then carriage control will be recognized on formatted
23 output to all logical units except unit 0, the diagnostic channel.
24 Otherwise the default will be restored.
25
26 By default, trailing and embedded blanks in input data fields are
27 ignored. If bzro is .true. then such blanks will be treated as zeros.
28 Otherwise the default will be restored.
29
30 By default, all files opened for sequential access are positioned at
31 their beginning. It is sometimes necessary or convenient to open at
32 the END-OF-FILE so that a write will append to the existing data. If
33 apnd is .true. then files opened subsequently on any logical unit will
34 be positioned at their end upon opening. A value of .false. will
35 restore the default behavior.
36
37 Ioinit may be used to associate file names with Fortran logical unit
38 numbers through environment variables (see "Introduction to the f77 I/O
39 Library" for a more general way of doing this). If the argument prefix
40 is a non-blank string, then names of the form prefixNN will be sought
41 in the program environment. The value associated with each such name
42 found will be used to open logical unit NN for formatted sequential
43 access. For example, if f77 program myprogram included the call
44
45 call ioinit (.true., .false., .false., ′FORT′, .false.)
46
47 then when the following sequence
48
49 % setenv FORT01 mydata
50 % setenv FORT12 myresults
51 % myprogram
52
53 would result in logical unit 1 opened to file mydata and logical unit
54 12 opened to file myresults. Both files would be positioned at their
55 beginning. Any formatted output would have column 1 removed and inter‐
56 preted as carriage control. Embedded and trailing blanks would be
57 ignored on input.
58
59 If the argument vrbose is .true. then ioinit will report on its activ‐
60 ity.
61
62 The effect of
63
64 call ioinit (.true., .true., .false., ′′, .false.)
65
66 can be achieved without the actual call by including ``-lI66'' on the
67 f77 command line. This gives carriage control on all logical units
68 except 0, causes files to be opened at their beginning, and causes
69 blanks to be interpreted as zero's.
70
71 The internal flags are stored in a labeled common block with the fol‐
72 lowing definition:
73
74 integer*2 ieof, ictl, ibzr
75 common /ioiflg/ ieof, ictl, ibzr
76
77
79 /usr/lib/libI77.a f77 I/O library
80 /usr/lib/libI66.a sets older fortran I/O modes
81
83 getarg(3F), getenv(3F), ``Introduction to the f77 I/O Library''
84
86 Prefix can be no longer than 30 characters. A pathname associated with
87 an environment name can be no longer than 255 characters.
88
89 The ``+'' carriage control does not work.
90
91
92
934.2 Berkeley Distribution May 27, 1986 IOINIT(3F)