Fortran Library Reference

Description of Arguments

These are the arguments for ioinit.

cctl (Carriage Control)

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

bzro (Blanks)

By default, trailing and embedded blanks in input data fields are ignored. If bzro is .TRUE., then such blanks are treated as zeros. Otherwise, the default is restored.

apnd (Append)

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 are positioned at their end upon opening. A value of .FALSE. restores the default behavior.

prefix (Automatic File Connection)

If the argument prefix is a nonblank string, then names of the form prefixNN are sought in the program environment. The value associated with each such name found is used to open the logical unit NN for formatted sequential access.

This search and connection is provided only for NN between 0 and 19, inclusive. For NN > 19, nothing is done; see "Source Code".

vrbose (IOINIT Activity)

If the argument vrbose is .TRUE., then IOINIT reports on its own activity.

Example: The program myprogram has the following ioinit call:


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

You can assign file name in at least two ways.

In sh:


demo$ FORT01=mydata 
demo$ FORT12=myresults 
demo$ export FORT01 FORT12 
demo$ myprogram 

In csh:


demo% setenv FORT01 mydata 
demo% setenv FORT12 myresults 
demo% myprogram

With either shell, the ioinit call in the above example gives these results:

Example: ioinit()--list and compile:


demo% cat tioinit.f
    character*3  s
    call ioinit( .true., .false., .false., 'FORT', .false.)
    do i = 1, 2
        read( 1, '(a3,i4)')  s, n
        write( 12, 10 ) s, n
    end do
10    format(a3,i4)
    end
demo% cat tioinit.data 
abc 123 
PDQ 789 
demo% f77 -silent tioinit.f 
demo% 

You can set environment variables as follows, using either sh or csh:

ioinit()--sh:


demo$ FORT01=tioinit.data 
demo$ FORT12=tioinit.au 
demo$ export FORT01 FORT12
demo$ 

ioinit()--csh:


demo% a.out 
demo% cat tioinit.au 
abc 123 
PDQ 789 

ioinit()--Run and test:


demo% a.out 
demo% cat tioinit.au 
abc 123 
PDQ 789