Starlink Project
Starlink User Note 143.4

P M Allan
A J Chipperfield

20 July 2001

Copyright © 2000 Council for the Central Laboratory of the Research Councils

FORTRAN file I/O routines

Version 1.5

Programmer’s Manual


FIO/RIO is a subroutine package that allows a FORTRAN programmer to access sequential and direct access data files in a machine independent manner. The package consists of stand alone FIO and RIO routines, which can be used independently of the Starlink software environment, plus routines to interface to the Starlink parameter system.


1 Introduction
2 FIO/RIO descriptors
3 Using FIO/RIO
 3.1 Routines to enhance simple FORTRAN I/O
 3.2 The stand-alone subroutines
 3.3 The environment level routines
4 Access Mode, Format and Record Size of Files
5 INCLUDE files
6 Reporting and handling errors
 6.1 Handling errors
 6.2 Note to software developers
7 Compiling and Linking
 7.1 Unix
 7.2 VMS
A Alphabetical List of Routines
B Classified List of Routines
 B.1 Simple I/O routines
 B.2 Stand alone routines
 B.3 ADAM parameter system routines
 B.4 Miscellaneous routines
C Routine Descriptions
FIO_ANNUL – Annul a file descriptor and close the file
FIO_ASSOC – Create/open a sequential file associated with a parameter
FIO_CANCL – Close a file and cancel the parameter
FIO_CLOSE – Close a sequential file
FIO_ERASE – Delete a file
FIO_FNAME – Get the full file name of a file
FIO_GUNIT – Get a unit number
FIO_OPEN – Create/open a sequential file
FIO_PUNIT – Release a unit number
FIO_READ – Read sequential record
FIO_READF – Fast read sequential record
FIO_REP – Report error from FORTRAN I/O statements
FIO_RWIND – Rewind a sequential file
FIO_SERR – Set error status
FIO_TEST – Test if an FIO status value belongs to a certain class of errors
FIO_UNIT – Get a unit number given a file descriptor
FIO_WRITE – Write a sequential record
RIO_ANNUL – Annul a file descriptor and close the file
RIO_ASSOC – Create/open a direct access file associated with a parameter
RIO_CANCL – Close a file and cancel the parameter
RIO_CLOSE – Close a direct access file
RIO_ERASE – Delete a file
RIO_OPEN – Open a direct access file
RIO_READ – Read record from direct access file
RIO_WRITE – Write a record to a direct access file

D Description of Miscellaneous Routines
FIO_ACTIV – Initialise FIO library for ADAM application
FIO_DEACT – Deactivate FIO
FIO_START – Set up units numbers and open standard I/O streams
FIO_STOP – Close down FIO

E FIO status values and error classes
F Implementation details
 F.1 Alpha OSF/1
 F.2 Sun4 Solaris
 F.3 Ultrix and sunOS/4
 F.4 VMS
G Changes and new features
 G.1 in version 1.5
 G.2 in version 1.5-2