Fortran User's Guide

Appendix A Runtime Error Messages

This appendix describes the error messages generated by the Fortran I/O library, signal handler, and operating system.

Operating System Error Messages

Operating system error messages include system call failures, C library errors, and shell diagnostics. The system call error messages are found in intro(2). System calls made through the Fortran library do not produce error messages directly. The following system routine in the Fortran library calls C library routines which produce an error message:

	CALL SYSTEM("rm /") 

The following message is displayed:

rm: / directory

Signal Handler Error Messages

Before beginning execution of a program, the Fortran library sets up a signal handler (sigdie) for signals that can cause termination of the program. sigdie prints a message that describes the signal, flushes any pending output, and generates a core image and a traceback.

Presently, the only arithmetic exception that produces an error message is the INTEGER*2 division with a denominator of zero. All other arithmetic exceptions are ignored.

A signal handler error example follows, where the subroutine SUB tries to access parameters that are not passed to it:


The following error message results:

*** Segmentation violation
Illegal instruction (core dumped)

I/O Error Messages (f77)

The error messages in this section are generated by the Fortran 77 I/O library. The error numbers are returned in the IOSTAT variable if the ERR return is taken.

For example, the following program tries to do an unformatted write to a file opened for formatted output:

      WRITE( 6 ) 1 

and produces error messages like the following:

sue: [1003] unformatted io not allowed
logical unit 6, named 'stdout'
lately: writing sequential unformatted external IO

The following error messages are generated. These same messages are also documented at the end of the man page perror(3F).

If the error number is less than 1000, then it is a system error. See intro (2).

Table A-1 f77 Runtime I/O Messages




error in format

Read the error message output for the location of the error in the format. It can be caused by more than 10 levels of nested parentheses or an extremely long format statement. 


illegal unit number

It is illegal to close logical unit 0. Negative unit numbers are not allowed. The upper limit is 231 - 1.


formatted io not allowed

The logical unit was opened for unformatted I/O. 


unformatted io not allowed

The logical unit was opened for formatted I/O. 


direct io not allowed

The logical unit was opened for sequential access, or the logical record length was specified as 0. 


sequential io not allowed

The logical unit was opened for direct access I/O. 


can't backspace file

You cannot do a seek on the file associated with the logical unit; therefore, you cannot backspace. The file may be a tty device or a pipe.


off beginning of record

You tried to do a left tab to a position before the beginning of an internal input record. 


can't stat file

The system cannot return status information about the file. Perhaps the directory is unreadable. 


no * after repeat count

Repeat counts in list-directed I/O must be followed by an * with no blank spaces.


off end of record

A formatted write tried to go beyond the logical end-of-record. An unformatted read or write also causes this 


<Not used>


incomprehensible list input

List input has to be as specified in the declaration. 


out of free space

The library dynamically creates buffers for internal use. You ran out of memory for them; that is, your program is too big. 


unit not connected

The logical unit was not open. 


read unexpected character

Certain format conversions cannot tolerate nonnumeric data. 


illegal logical input field

logical data must be T or F. 


'new' file exists

You tried to open an existing file with status='new'. 


can't find 'old' file

You tried to open a nonexistent file with status='old'. 


unknown system error

This error should not happen, but.. 


requires seek ability

Attempted a seek on a file that does not allow it. I/O operation requiring a seek are direct access, sequential unformatted I/O, and tabbing left.


illegal argument

Certain arguments to open and related functions are checked for legitimacy. Often only nondefault forms are checked 


negative repeat count

The repeat count for list-directed input must be a positive integer. 


illegal operation for unit

Attempted an I/O operation that is not possible for the device associated with the logical unit. You get this error if you try to read past end-of-tape, or end-of-file. 


<Not used>


incompatible specifiers in open

Attempted to open a file with the 'new' option and the access='append' option, or some other invalid combination. 


illegal input for namelist

A namelist read encountered an invalid data item. 


error in FILEOPT parameter

The FILEOPT string in an OPEN statement has bad syntax.


WRITE to readonly file

Attempt to write on a unit that was opened for reading only. 


READ from writeonly file

Attempt to read from a unit that was opened for writing only. 


overflow converting numeric input

Integer input data is too large for the corresponding input variable 


exponent overflow on numeric input

The floating-point input data is too large to be represented by the corresponding input variable. 

I/O Error Messages (f90)

This is a partial list of runtime I/O messages issued by f90

Table A-2 f90 Runtime I/O Messages



 1000 format error
 1001 illegal unit number
 1002 formatted I/O on unformatted unit
 1003 unformatted I/O on formatted unit
 1004 direct-access I/O on sequential-access unit
 1005 sequential-access I/O on direct-access unit
 1006 device does not support BACKSPACE
 1007 off beginning of record
 1008 can't stat file
 1009 no * after repeat count
 1010 record too long
 1011 truncation failed
 1012 incomprehensible list input
 1013 out of free space
 1014 unit not connected
 1015 read unexpected character
 1016 illegal logical input field
 1017 `new' file exists
 1018 can't find `old' file
 1019 unknown system error
 1020 requires seek ability
 1021 illegal argument
 1022 negative repeat count
 1023 illegal operation for channel or device
 1024 reentrant I/O
 1025 incompatible specifiers in open
 1026 illegal input for namelist
 1027 error in FILEOPT parameter
 1028 writing not allowed
 1029 reading not allowed
 1030 integer overflow on input
 1031 floating-point overflow on input
 1032 floating-point underflow on input
 1051 default input unit closed
 1052 default output unit closed
 1053 direct-access READ from unconnected unit
 1054 direct-access WRITE to unconnected unit
 1055 unassociated internal unit
 1056 null reference to internal unit
 1057 empty internal file
 1058 list-directed I/O on unformatted unit
 1059 namelist I/O on unformatted unit
 1060 tried to write past end of internal file
 1061 unassociated ADVANCE specifier
 1062 ADVANCE specifier is not `YES' or `NO'
 1063 EOR specifier present for advancing input
 1064 SIZE specifier present for advancing input
 1065 negative or zero record number
 1066 record not in file
 1067 corrupted format
 1068 unassociated input variable
 1069 more I/O-list items than data edit descriptors
 1070 zero stride in subscript triplet
 1071 zero step in implied DO-loop
 1072 negative field width
 1073 zero-width field
 1074 character string edit descriptor reached on input
 1075 Hollerith edit descriptor reached on input
 1076 no digits found in digit string
 1077 no digits found in exponent
 1078 scale factor out of range
 1079 digit equals or exceeds radix
 1080 unexpected character in integer field
 1081 unexpected character in real field
 1082 unexpected character in logical field
 1083 unexpected character in integer value
 1084 unexpected character in real value
 1085 unexpected character in complex value
 1086 unexpected character in logical value
 1087 unexpected character in character value
 1088 unexpected character before NAMELIST group name
 1089 NAMELIST group name does not match the name in the program
 1090 unexpected character in NAMELIST item
 1091 unmatched parenthesis in NAMELIST item name
 1092 variable not in NAMELIST group
 1093 too many subscripts in NAMELIST object name
 1094 not enough subscripts in NAMELIST object name
 1095 zero stride in NAMELIST object name
 1096 empty section subscript in NAMELIST object name
 1097 subscript out of bounds in NAMELIST object name
 1098 empty substring in NAMELIST object name
 1099 substring out of range in NAMELIST object name
 1100 unexpected component name in NAMELIST object name
 1111 unassociated ACCESS specifier
 1112 unassociated ACTION specifier
 1113 unassociated BINARY specifier
 1114 unassociated BLANK specifier
 1115 unassociated DELIM specifier
 1116 unassociated DIRECT specifier
 1117 unassociated FILE specifier
 1118 unassociated FMT specifier
 1119 unassociated FORM specifier
 1120 unassociated FORMATTED specifier
 1121 unassociated NAME specifier
 1122 unassociated PAD specifier
 1123 unassociated POSITION specifier
 1124 unassociated READ specifier
 1125 unassociated READWRITE specifier
 1126 unassociated SEQUENTIAL specifier
 1127 unassociated STATUS specifier
 1128 unassociated UNFORMATTED specifier
 1129 unassociated WRITE specifier
 1130 zero length file name
 1131 ACCESS specifier is not `SEQUENTIAL' or `DIRECT'
 1132 ACTION specifier is not `READ', `WRITE' or `READWRITE'
 1133 BLANK specifier is not `ZERO' or `NULL'
 1134 DELIM specifier is not `APOSTROPHE', `QUOTE', or `NONE'
 1135 unexpected FORM specifier
 1136 PAD specifier is not `YES' or `NO'
 1137 POSITION specifier is not `APPEND', `ASIS', or `REWIND'
 1138 RECL specifier is zero or negative
 1139 no record length specified for direct-access file
 1140 unexpected STATUS specifier
 1141 status is specified and not `OLD' for connected unit
 1142 STATUS specifier is not `KEEP' or `DELETE'
 1143 status `KEEP' specified for a scratch file
 1144 impossible status value
 1145 a file name has been specified for a scratch file
 1146 attempting to open a unit that is being read from or written to
 1147 attempting to close a unit that is being read from or written to
 1148 attempting to open a directory
 1149 status is `OLD' and the file is a dangling symbolic link
 1150 status is `NEW' and the file is a symbolic link
 1151 no free scratch file names
 1161 device does not support REWIND
 1162 read permission required for BACKSPACE
 1163 BACKSPACE on direct-access unit
 1164 BACKSPACE on binary unit
 1165 end-of-file seen while backspacing
 1166 write permission required for ENDFILE
 1167 ENDFILE on direct-access unit
 1181 attempting to allocate an allocated array
 1182 deallocating an unassociated pointer
 1183 deallocating an unallocated allocatable array
 1184 deallocating an allocatable array through a pointer
 1185 deallocating an object not allocated by an ALLOCATE statement
 1186 deallocating a part of an object
 1187 deallocating a larger object than was allocated
 1191 unallocated array passed to array intrinsic function
 1192 illegal rank
 1193 small source size
 1194 zero array size
 1195 negative elements in shape
 1196 illegal kind
 1197 nonconformable array
 2001 invalid constant, structure, or component name
 2002 handle not created
 2003 character argument too short
 2004 array argument too long or too short
 2005 end of file, record, or directory stream