This manual introduces standard Fortran, supported Fortran extensions, and provides a discussion of flexible file input/output (FFIO) and other input/output (I/O) methods for UNICOS and UNICOS/mk systems and for IRIX systems. This manual is for Fortran programmers who need general I/O information or who need information on how to optimize their I/O.
Some information in this manual addresses usage information for UNICOS and UNICOS/mk systems only. When this occurs, the information is flagged as applicable only to those systems.
This manual contains the following chapters:
“Standard Fortran I/O,” Chapter 2, “Standard Fortran I/O”, discusses elements of the Fortran 95 standard that relate to I/O.
“Fortran I/O Extensions,” Chapter 3, “Fortran I/O Extensions ”, discusses Cray Research extensions to the Fortran standard.
“Tape and Named Pipe Support,” Chapter 4, “Tape and Named Pipe Support ”, discusses tape handling and FIFO special files.
“System and C I/O,” Chapter 5, “System and C I/O ”, discusses system calls and Fortran callable entry points to C library routines.
“The assign Environment,” Chapter 6, “The assign Environment”, discusses the use of the assign(1) command to access and update advisory information from the I/O library and how to create an I/O environment.
“File Structures,” Chapter 7, “File Structures ”, discusses native file structures.
“Buffering,” Chapter 8, “Buffering”, discusses file buffering as it applies to I/O.
“Devices,” Chapter 9, “Devices”, discusses types of storage devices.
“Introduction to FFIO,” Chapter 10, “Introduction to FFIO ”, provides an overview of the Flexible File I/O system.
“Using FFIO,” Chapter 11, “Using FFIO ”, describes how to use FFIO with common file structures, and how to use FFIO to enhance program performance.
“Foreign File Conversion,” Chapter 12, “Foreign File Conversion”, discusses how to convert data from one file structure to another.
“I/O Optimization,” Chapter 13, “I/O Optimization ”, discusses methods to speed up I/O processing.
“FFIO Layer Reference,” Chapter 14, “FFIO Layer Reference ”, provides details about individual FFIO layers.
“Creating a user Layer,” Chapter 15, “Creating a user Layer ”, provides an example of how to create an FFIO layer.
“Older Data Conversion Routines,” Appendix A, “Older Data Conversion Routines ”, lists outdated data conversion routines.
The UNICOS operating system contains an error message system that consists of commands, library routines, and files that allow error messages to be retrieved from message catalogs and formatted at run time.
The user who receives a message can request more information by using the explain(1) user command. The explain command retrieves a message explanation from an online explanation catalog and displays it on the standard output device.
The msgid argument to the explain command is the message ID string that appears when an error message is written. The ID string contains a product group code and the message number.
The product group code or product code is a string that identifies the product issuing the message. The product code for the Fortran libraries and for the I/O libraries is lib. The number specifies the number of the message. The following list describes the categories of message numbers:
All Fortran library errors on UNICOS and UNICOS/mk systems are within the range of 1000 to 2000. Library errors on IRIX systems are within the range of 4000-5000. Libraries may also return system error numbers in the range of 1 to the first library error number. You must use the sys product code with numbers in this range.
Flexible file I/O (FFIO) returns error values that are in the range of 5000 to 6000 and have a product code of lib.
On UNICOS systems, the tape system returns error numbers that are in the range of 90000 through 90500. The Tape Subsystem User's Guide, lists tape system error messages.
Both of the following are variations of the explain command used with a msgid from the Fortran I/O library:
The previous explain command produces the following description on a standard output file:
explain lib-1100 lib-1100: A READ operation tried to read a nonexistent record. On a Fortran READ statement, the REC (record) specifier was larger than the largest record number for that direct-access file. Check the value of the REC specifier to ensure that it is a valid record number. Check the file being read to ensure that it is the correct file. Also see the description of input/output statements in your Fortran reference manual. The class of the error is unrecoverable (issued by the Fortran run-time library).
There are two classes of Fortran library error messages: UNRECOVERABLE and WARNING.
The following is an example of a warning message:
lib-1951 a.out: At line <n> in Fortran routine "<name>", in dimension <d>, extents <e1> and <e2> are not equal. When bounds checking is enabled, this message is issued if an array assignment exceeds the bounds of the result array. The line number <n> in the Fortran routine <name> is where the two array extents (<el> and <e2>) did not match. Modify the program so as not exceed the bounds of the array, or ensure that the array extents are equal. Also see the description of array operations in your Fortran reference manual. Note that this message is issued as a warning. Execution of the program will continue.
If the message number is not valid, a message similar to the following appears:
explain: no explanation for lib-3000