# Compaq Fortran
User Manual for
Tru64 UNIX and
Linux Alpha Systems

Previous | Contents | Index

# Chapter 8
Run-Time Errors and Signals

This chapter contains the following topics:

- Section 8.1,Compaq Fortran Run-Time Library Default Error Processing
- Section 8.2, Handling Run-Time Errors
- Section 8.3, Signal Handling
- Section 8.4, Run-Time Error Messages

# 8.1 Compaq Fortran Run-Time Library Default Error Processing

During execution, your program may encounter errors or exception conditions. These conditions can result from any of the following:

- Errors that occur during I/O operations
- Invalid input data
- Argument errors in calls to the mathematical library
- Arithmetic errors
- Other system-detected errors

The Compaq Fortran Run-Time Library (RTL) generates appropriate messages and takes action to recover from errors whenever possible.

A default action is defined for each error recognized by the Compaq Fortran RTL. The default actions described throughout this chapter occur unless overridden by explicit error-processing methods.

The way in which the Compaq Fortran RTL actually processes errors depends upon the following factors:

- The severity of the error. For instance, the program usually continues executing when an error message with a severity level of warning or info (informational) is detected.
- For certain errors associated with I/O statements, whether or not an I/O error-handling specifier was specified.
- For certain errors, whether or not the default action of an associated signal was changed.
- For certain errors related to arithmetic operations (including floating-point exceptions), compilation options can determine whether the error is reported and the severity of the reported error.

How arithmetic exception conditions are reported and handled depends on the cause of the exception and how the program was compiled. Unless the program was compiled to handle exceptions, the exception might not be reported until after the instruction that caused the exception condition. The following `f90` command-line options are related to handling errors and exceptions:

- The `-check bounds` , `-check overflow` , and `-check underflow` options generate extra code to catch certain conditions. For example, the `-check overflow` option generates extra code to catch integer overflow conditions.
- The `-check noformat` , `-check nooutput_conversion` , and `-check nopower` options reduce the severity level of the associated run-time error to allow program continuation.
- The `-fpen` options and the `-check underflow` option control the handling and reporting of floating-point arithmetic exceptions at run time.
- The `-synchronous_exceptions` option (and certain `-fpen` option) influence the reporting of floating-point arithmetic exceptions at run time.
- The `-warn xxxx` , `-u` , `-nowarn` `-w` , and `-w1` options control compile-time warning messages, which in some circumstances can help determine the cause of a run-time error.

For More Information:

- On the `f90` command `-fpen` options and the `for_set_fpe` routine that control how floating-point exceptional conditions are handled at run time, see Section 3.44 and Chapter 14.
- On the `-check bounds` option, see Section 3.23.
- On the `-check noformat` option, see Section 3.24.
- On the `-check nooutput_conversion` option, see Section 3.27.
- On the `-check overflow` option, see Section 3.28.
- On the `-check nopower` option, see Section 3.25.
- On the `-check underflow` option, see Section 3.29.
- On the `f90` options that control warning messages, see Section 3.99.
- On IEEE floating-point data types and exceptional values, see Section 9.4.
- On `f90` and `fort` command-line options and their categories, see Table 3-1.
- On Compaq Fortran intrinsic data types and their ranges, see Chapter 9.

## 8.1.1 Run-Time Message Format

When errors occur during program execution (run time) of a scalar (nonparallel) program, the Compaq Fortran RTL issues diagnostic messages. These run-time messages have the following format:

    forrtl: severity (nnn): message-text

Run-time messages provide the following information:

Contents | Information Given
--- | ---
`forrtl` | Identifies the source as the Compaq Fortran RTL.
`severity` | The severity levels are: `severe` , `error` , `warning` , or `info` . (See Table 8-1, Severity Levels of Run-Time Messages.)
`nnn` | This is the message number, also the IOSTAT value for I/O statements.
`message_text` | Explains the event that caused the message.

Table 8-1 explains the severity levels of run-time messages, in the order of greatest to least severity.

Table 8-1 Severity Levels of Run-Time Messages
Severity | Description
--- | ---
`severe` | Must be corrected. The program's execution is terminated when the error is encountered, unless the program's I/O statements use the END, EOR, or ERR branch specifiers to transfer control, perhaps to a routine that uses the IOSTAT specifier (see Section 8.2.1 and Section 8.2.2).
`error` | Should be corrected. The program might continue execution, but the output from this execution may be incorrect.
`warning` | Should be investigated. The program continues execution, but output from this execution may be incorrect.
`info` | For informational purposes only. The program continues.

On Tru64 UNIX systems, for severe errors stack trace information is produced by default, unless the environment variable `FOR_DISABLE_STACK_TRACE` is set. If symbols are in the image (that is, if the command-line option `-g1` or higher is set and the image is not stripped), the stack trace information contains program counters set to symbolic information. Otherwise, the information contains merely hexadecimal program counter information.

In some cases, stack trace information is also produced by the compiled code at run time to provide details about the creation of array temporaries.

If `FOR_DISABLE_STACK_TRACE` is set, no stack trace information is produced.

Stack trace information is not produced on Linux Alpha systems.

See Example 8-1.

Example 8-1 Example of Stack Trace Information

    program ovf                     (1)
    real*4 x(5),y(5)
    integer*4 i

    x(1) = -1e32
    x(2) = 1e38
    x(3) = 1e38
    x(4) = 1e38
    x(5) = -36.0

    do i=1,5
       y(i) = 100.0*(x(i))
       print *, 'x = ', x(i), ' x*100.0 = ',y(i)
    end do

    end

    > f90 -O0 ovf.for -o ovf.exe
    > ovf.exe
     x =  -1.0000000E+32  x*100.0 =  -1.0000000E+34   (2)
    forrtl: error (72): floating overflow
       0: _call_remove_gp_range [0x3ff81a6c374]
       1: _call_remove_gp_range [0x3ff81a74464]
       2: _call_remove_gp_range [0x3ff800d8c60]
       3: ovf_ [ovf.for: 12, 0x1200019c4]
       4: main [for_main.c: 203, 0x1200018dc]
       5: __start [0x120001858]
    Abort process

    > strip ovf.exe
    > ovf.exe
     x =  -1.0000000E+32  x*100.0 =  -1.0000000E+34   (3)
    forrtl: error (72): floating overflow
    Symbol table not present, doing non-symbolic traceback
       0: [0x3ff81a6c374]
       1: [0x3ff81a74464]
       2: [0x3ff800d8c60]
       3: [0x1200019c4]
       4: [0x1200018dc]
       5: [0x120001858]
    Abort process

    > setenv FOR_DISABLE_STACK_TRACE "TRUE"
    > ovf.exe
     x =  -1.0000000E+32  x*100.0 =  -1.0000000E+34 (4)
    forrtl: error (72): floating overflow
    Abort process

1. Sample program that generates an error (at line 12).
2. Stack trace information when the symbol table is present.
3. Stack trace information when the image is stripped.
4. No stack trace information, because the `FOR_DISABLE_STACK_TRACE` environment variable is set.

## 8.1.2 Message Catalog Location

The Compaq Fortran RTL uses a message catalog file to store the text associated with each run-time message. When a run-time error occurs, the Compaq Fortran RTL uses the environment variable `NLSPATH` to locate the message catalog file, from which it obtains the text of the appropriate message. If the file is not found at the position indicated by `NLSPATH` , the RTL searches for the message catalog at the following location:

`/usr/lib/nls/msg/en_us.iso8859-1/for_msg.cat` (TU*X ONLY)
`/usr/lib/for_msg.cat` (L*X ONLY)

Before executing a Compaq Fortran program on a system where Compaq Fortran is not installed, you need to install the appropriate Compaq Fortran run-time subset. For instructions on installing Compaq Fortran run-time support, see the Compaq Fortran Installation Guide for Tru64 UNIX Systems.

When a run-time error occurs on a system where the message file is not found, the following messages may appear on a Tru64 UNIX system:

    forrtl: info: Fortran error message number is nnn.

    forrtl: warning: Could not open message catalog: for_msg.cat.

    forrtl: info: Check environment variable NLSPATH and protection of
                  usr/lib/nls/msg/en_US.ISO8859-1/for_msg.cat

The Compaq Fortran RTL returns an error number (displayed after the severity level) that the calling program can use with an IOSTAT variable to handle various I/O conditions, as described in Section 8.2.2.

For More Information:

- On `NLSPATH` , see the reference page `environ(5)`.

## 8.1.3 Values Returned to the Shell at Program Termination

A Compaq Fortran program can terminate in one of several ways:

- The program runs to normal completion. A value of zero is returned to the shell.
- The program stops with a STOP or a PAUSE statement. A value of zero is returned to the shell.
- The program stops because of a signal that is caught but does not allow the program to continue. A value of 1 is returned to the shell.
- The program stops because of a severe run-time error. The error number for that run-time error is returned to the shell. Error numbers are listed in Table 8-3.
- The program stops with a CALL EXIT statement. The value passed to EXIT is returned to the shell.

## 8.1.4 Forcing a Core Dump for Severe Errors

You can force a core dump for severe errors that do not usually cause a `core` file to be created. Before running the program, set the `decfort_dump_flag` environment variable to any of the common TRUE values (Y, y, Yes, yEs, True, and so forth) to cause severe errors to create a `core` file. For instance, the following C shell command sets the `decfort_dump_flag` environment variable:

    % setenv decfort_dump_flag y

The `core` file is written to the current directory and can be examined using a debugger.

For More Information:

- On the shell commands you can use to set or unset environment variables, see Appendix B.
- On `core` files (TU*X ONLY), see `core(4)`.
- On language syntax, see the Compaq Fortran Language Reference Manual.
- On file operations, see Section 7.5, Section 7.6, and Section 7.7.
- On record operations, see Section 7.8.

# 8.2 Handling Run-Time Errors

Whenever possible, the Compaq Fortran RTL does certain error handling, such as generating appropriate messages and taking necessary action to recover from errors. You can explicitly supplement or override default actions by using the following methods:

- To transfer control to error-handling code within the program, use the ERR, EOR, and END branch specifiers in I/O statements ( Section 8.2.1)
- To identify Fortran-specific I/O errors based on the value of Compaq Fortran RTL error codes, use the I/O status specifier (IOSTAT) in I/O statements (or call the ERRSNS subroutine) ( Section 8.2.2)
- Obtain system-level error codes by using the appropriate 3f library routines ( Section 8.2.3)
- For certain error conditions, use the signal handling facility to change the default action to be taken ( Section 8.3)

These error-processing methods are complementary; you can use any or all of them within the same program to obtain Compaq Fortran run-time and Compaq Tru64 UNIX system error codes.

If your program generates an exception, use the `-synchronous_exceptions` option and recompile and relink your application (see Section 4.9).

## 8.2.1 Using the END, EOR, and ERR Branch Specifiers

When a severe error occurs during Compaq Fortran program execution, the default action is to display an error message and terminate the program. To override this default action, there are three branch specifiers you can use in I/O statements to transfer control to a specified point in the program:

- The END branch specifier handles an end-of-file condition.
- The EOR branch specifier handles an end-of-record condition for nonadvancing reads.
- The ERR branch specifier handles all error conditions.

If you use the END, EOR, or ERR branch specifiers, no error message is displayed and execution continues at the designated statement, usually an error-handling routine.

You might encounter an unexpected error that the error-handling routine cannot handle. In this case, do one of the following:

- Modify the error-handling routine to display the error message number
- Remove the END, EOR, or ERR branch specifiers from the I/O statement that causes the error

After you modify the source code, compile, link, and run the program to display the error message. For example:

    READ (8,50,ERR=400)

If any severe error occurs during execution of this statement, the Compaq Fortran RTL transfers control to the statement at label 400. Similarly, you can use the END specifier to handle an end-of-file condition that might otherwise be treated as an error. For example:

    READ (12,70,END=550)

When using nonadvancing I/O, use the EOR specifier to handle the end-of-record condition. For example:

    150 FORMAT (F10.2, F10.2, I6)
        READ (UNIT=20, FMT=150, SIZE=X, ADVANCE='NO', EOR=700) A, F, I

You can also use ERR as a specifier in an OPEN, CLOSE, or INQUIRE statement. For example:

    OPEN (UNIT=10, FILE='FILNAM', STATUS='OLD', ERR=999)

If an error is detected during execution of this OPEN statement, control transfers to the statement at label 999.

For More Information:

- On advancing and nonadvancing record I/O, see Section 7.8.4.
- On language syntax, see the Compaq Fortran Language Reference Manual.
- On file operations, see Section 7.5, Section 7.6, and Section 7.7.
- On record operations, see Section 7.8.

## 8.2.2 Using the IOSTAT Specifier

You can use the IOSTAT specifier to continue program execution after an I/O error and to return information about I/O operations, whether the program is executing as a scalar or parallel program (I/O is done in a scalar fashion). As described in Table 8-3, certain errors are not returned in IOSTAT.

Although the IOSTAT specifier transfers control, it can only return information returned by the Compaq Fortran RTL.

The IOSTAT specifier can supplement or replace the END, EOR, and ERR branch transfers. Execution of an I/O statement containing the IOSTAT specifier suppresses the display of an error message and defines the specified integer variable, array element, or scalar field reference as one of the following:

- A value of --2 if an end-of-record condition occurs with nonadvancing reads.
- A value of --1 if an end-of-file condition occurs.
- A value of 0 for normal completion (not an error condition, end-of-file, or end-of-record condition).
- A positive integer value if an error condition occurs. (This value is one of the Fortran-specific IOSTAT numbers listed in Table 8-3.)

Following the execution of the I/O statement and assignment of an IOSTAT value, control transfers to the END, EOR, or ERR statement label, if any. If there is no control transfer, normal execution continues.

You can include `/usr/include/foriosdef.f` in your program to obtain symbolic definitions for the values of IOSTAT.

Example 8-2 uses the IOSTAT specifier and the `foriosdef.f` file to handle an OPEN statement error (in the FILE specifier).

Example 8-2 Error Handling OPEN Statement File Name

         CHARACTER(LEN=40) :: FILNM
         INCLUDE '/usr/include/foriosdef.f'

         DO I=1,4
           FILNM = ''
           WRITE (6,*)  'Type file name '
           READ (5,*) FILNM
           OPEN (UNIT=1, FILE=FILNM, STATUS='OLD', IOSTAT=IERR, ERR=100)
           WRITE (6,*) 'Opening file: ', FILNM
    !       (process the input file)
           CLOSE (UNIT=1)
           STOP

      100  IF (IERR .EQ. FOR$IOS_FILNOTFOU) THEN
             WRITE (6,*) 'File: ', FILNM, ' does not exist '
           ELSE IF (IERR .EQ. FOR$IOS_FILNAMSPE) THEN
              WRITE (6,*) 'File: ', FILNM, ' was bad, enter new file name'
           ELSE
             PRINT *, 'Unrecoverable error, code =', IERR
             STOP
           END IF
         END DO
         WRITE (6,*) 'File not found. Type ls to find file and run again'
       END PROGRAM

Another way to obtain information about an error is the ERRSNS subroutine (a Compaq extension), which allows you to obtain the last I/O system error code associated with a Compaq Fortran RTL error (see the Compaq Fortran Language Reference Manual).

## 8.2.3 Using the 3f Library Routines to Return Operating System Errors

You can obtain the most recent operating system error codes or display associated error messages by using the following 3f library routines:

- The `ierrno` routine returns the most recent error code, as described in `ierrno(3f)`. For a list of operating system error codes, see `errno(2)`.
- The `gerror` and `perror` routines display a system error message, as described in `gerror(3f)` and `perror(3f)`.

For More Information:

- On using the 3f routines, see Chapter 12 and `intro(3f)`.
- On language syntax, see the Compaq Fortran Language Reference Manual.
- On file operations, see Section 7.5, Section 7.6, and Section 7.7.
- On record operations, see Section 7.8.
- On 3f library routines, see Chapter 12.

# 8.3 Signal Handling

A signal is an abnormal event generated by one of various sources, such as:

- A user of a terminal
- Program or hardware error
- Request of another program
- When a process is stopped to allow access to the control terminal

You can optionally set certain events to issue signals, for example:

- When a process resumes after being stopped
- When the status of a child process changes
- When input is ready at the terminal

Some signals terminate the receiving process if no action is taken (optionally creating a `core` file), while others are simply ignored unless the process has requested otherwise.

Except for certain signals, calling the `signal` or `sigaction` routine (see `signal(3f)`) allows specified signals to be ignored or causes an interrupt (transfer of control) to the location of a user-written signal handler.

You can establish one of the following actions for a signal with a call to `signal` :

- Ignore the specified signal (identified by number).
- Use the default action for the specified signal, which can reset a previously established action.
- Transfer control from the specified signal to a procedure to receive the signal, specified by name.

Calling the `signal` routine lets you change the action for a signal, such as intercepting an operating system signal and preventing the process from being stopped.

Table 8-2 shows the signals that the Compaq Fortran RTL arranges to catch when a program is started.

Table 8-2 Signals Caught by the Compaq Fortran Run-Time Library
Signal | Compaq Fortran RTL Message
--- | ---
SIGFPE | `Floating-point exception` (number 75)
SIGILL (L*X ONLY) | `Illegal instruction (SIGILL)` and related SIGILL messages indicate various breakpoint exceptions (numbers 130-139)
SIGINT | `Process interrupted` (number 69)
SIGIOT | `IOT trap signal` (number 76)
SIGQUIT | `Process quit` (number 79)
SIGSEGV | `Segmentation fault` (number 174)
SIGTERM | `Process killed` (number 78)
SIGTRAP (TU*X ONLY) | `Array index out of bounds (SIGTRAP)` and related SIGTRAP messages indicate various breakpoint exceptions (numbers 130-139)

Calling the `signal` routine (specifying the numbers for these signals) results in overwriting the signal-handling facility set up by the Compaq Fortran RTL. The only way to restore the default action is to save the returned value from the first call to `signal` .

When using a debugger, it may be necessary to enter a command to allow the Compaq Fortran RTL to receive and handle the appropriate signals, as described in Section 4.5.

For More Information:

- On the calling syntax of the `signal` jacket routine, see `signal(3f)`.
- On using the 3f routines, such as `signal` , see Chapter 12 and `intro(3f)`.
- On all signal names, their respective numbers, and a brief description of each signal, see `signal(3)` reference page or `/usr/include/signal.h` .

# 8.4 Run-Time Error Messages

Table 8-3 lists the errors processed by the Compaq Fortran RTL. For each error, the table provides the error number, the severity code, error message text, condition symbol name, and a detailed description of the errors.

To define the condition symbol values (PARAMETER statements) in your program, include the following file:

    /usr/include/foriosdef.f

As described in Table 8-1, the severity of the message determines whether program execution continues ( `info` and `warning` ), the results may be incorrect ( `error` ), or program execution stops unless a recovery method is specified ( `severe` ).

When a `severe` error occurs for which no recovery method is specified, an error message is displayed and execution stops. To prevent program termination, you must include either an appropriate I/O error-handling specifier (see Section 8.2.1 and Section 8.2.2) and recompile or, for certain errors, change the default action of a signal (see Section 8.3) before you run the program again.

In Table 8-3, the first column lists error numbers returned to IOSTAT variables when an I/O error is detected. The Compaq Fortran error numbers are compatible with Compaq Fortran 77. Certain messages are specific to Compaq Fortran on Compaq Tru64 UNIX systems, including most signal-related errors (such as error number 79, `Process quit (SIGQUIT)` and errors 130-139) listed in Table 8-3.

The first line of the second column provides the message as it is displayed (following `forrtl:` ), including the severity level, message number, and the message text. The following lines of the second column contain the status condition symbol (such as FOR$IOS_INCRECTYP) and an explanation of the message.

This table is also provided in the online release notes file in text format. To view the explanation of a message, use the `more` command to display the file and enter a slash (/) followed by the number or part of the message text (to initiate a search). For example, the following `more` command searches for number 68 ( `Variable format expression value error` ):

    % more /68

Table 8-3 Run-Time Error Messages and Explanations
Number | Severity Level, Number, and Message Text; Condition Symbol and Explanation
--- | ---
None 1 | `info: Fortran error message number is nnn` The Compaq Fortran message catalog file was not found on this system. For information about the message file location, see Section 8.1.2 or the Compaq Fortran Installation Guide for Tru64 UNIX Systems. This error has no condition symbol.
None 1 | `warning: Could not open message catalog: for_msg.cat` The Compaq Fortran message catalog file was not found on this system. See Section 8.1.2 or the Compaq Fortran Installation Guide for Tru64 UNIX Systems for more information. This error has no condition symbol.
None 1 | `info: Check environment variable NLSPATH and protection of path-name/for_msg.dat` The Compaq Fortran message catalog file was not found. See Section 8.1.2 or the Compaq Fortran Installation Guide for Tru64 UNIX Systems for more information. This error has no condition symbol.
None 1 | `Insufficient memory to open Fortran RTL catalog: message 41` The Compaq Fortran message catalog file could not be opened because of insufficient virtual memory. To overcome this problem, increase the per-process data limit by using the `limit` (C shell) or `ulimit` (Bourne and Korn and bash (L*X ONLY) shells) commands (see Section 1.1) before running the program again. For more information, see error 41. This error has no condition symbol.
1 1 | `severe (1): Not a Fortran-specific error` FOR$IOS_NOTFORSPE. An error in the user program or in the RTL was not a Compaq Fortran-specific error and was not reportable through any other Compaq Fortran run-time messages. If you call ERRSNS, an error of this kind returns a value of 1 (for more information on the ERRSNS subroutine, see the Compaq Fortran Language Reference Manual).
8 | `severe (8): Internal consistency check failure` FOR$IOS_BUG_CHECK. Internal error. Please check that the program is correct. Recompile if an error existed in the program. If this error persists, submit a problem report.
9 | `severe (9): Permission to access file denied` FOR$IOS_PERACCFIL. Check the mode (protection) of the specified file. Make sure the correct file was being accessed. Change the protection, specified file, or process used before rerunning program.
10 | `severe (10): Cannot overwrite existing file` FOR$IOS_CAOVEEXI. Specified file xxx already exists when OPEN statement specified STATUS= `'` NEW `'` (create new file) using I/O unit x. Make sure correct file name, directory path, unit, and so forth were specified in the source program. Decide whether to: Rename or remove the existing file before rerunning the program. Modify the source file to specify different file specification, I/O unit, or OPEN statement STATUS.
11 | `info (11) 1: Unit not connected` FOR$IOS_UNINOTCON. The specified unit was not open at the time of the attempted I/O operation. Check if correct unit number was specified. If appropriate, use an OPEN statement to explicitly open the file (connect the file to the unit number).
17 | `severe (17): Syntax error in NAMELIST input` FOR$IOS_SYNERRNAM. The syntax of input to a namelist-directed READ statement was incorrect.
18 | `severe (18): Too many values for NAMELIST variable` FOR$IOS_TOOMANVAL. An attempt was made to assign too many values to a variable during a namelist READ statement.
19 | `severe (19): Invalid reference to variable in NAMELIST input` FOR$IOS_INVREFVAR. One of the following conditions occurred: The variable was not a member of the namelist group. An attempt was made to subscript a scalar variable. A subscript of the array variable was out-of-bounds. An array variable was specified with too many or too few subscripts for the variable. An attempt was made to specify a substring of a noncharacter variable or array name. A substring specifier of the character variable was out-of-bounds. A subscript or substring specifier of the variable was not an integer constant. An attempt was made to specify a substring by using an unsubscripted array variable.
20 | `severe (20): REWIND error` FOR$IOS_REWERR. One of the following conditions occurred: The file was not a sequential file. The file was not opened for sequential or append access. The Compaq Fortran RTL I/O system detected an error condition during execution of a REWIND statement.
21 | `severe (21): Duplicate file specifications` FOR$IOS_DUPFILSPE. Multiple attempts were made to specify file attributes without an intervening close operation. A DEFINE FILE statement was followed by another DEFINE FILE statement or an OPEN statement
22 | `severe (22): Input record too long` FOR$IOS_INPRECTOO. A record was read that exceeded the explicit or default record length specified when the file was opened. To read the file, use an OPEN statement with a RECL= value (record length) of the appropriate size.
23 | `severe (23): BACKSPACE error` FOR$IOS_BACERR. The Compaq Fortran RTL I/O system detected an error condition during execution of a BACKSPACE statement.
24 1 | `severe (24): End-of-file during read` FOR$IOS_ENDDURREA. One of the following conditions occurred: A Compaq Fortran RTL I/O system end-of-file condition was encountered during execution of a READ statement that did not contain an END, ERR, or IOSTAT specification. An end-of-file record written by the ENDFILE statement was encountered during execution of a READ statement that did not contain an END, ERR, or IOSTAT specification. An attempt was made to read past the end of an internal file character string or array during execution of a READ statement that did not contain an END, ERR, or IOSTAT specification. This error is returned by END and ERRSNS.
25 | `severe (25): Record number outside range` FOR$IOS_RECNUMOUT. A direct access READ, WRITE, or FIND statement specified a record number outside the range specified when the file was opened.
26 | `severe (26): OPEN or DEFINE FILE required` FOR$IOS_OPEDEFREQ. A direct access READ, WRITE, or FIND statement was attempted for a file when no prior DEFINE FILE or OPEN statement with ACCESS= `'` DIRECT `'` was performed for that file.
27 | `severe (27): Too many records in I/O statement` FOR$IOS_TOOMANREC. An attempt was made to do one of the following: Read or write more than one record with an ENCODE or DECODE statement. Write more records than existed.
28 | `severe (28): CLOSE error` FOR$IOS_CLOERR. An error condition was detected by the Compaq Fortran RTL I/O system during execution of a CLOSE statement.
29 | `severe (29): File not found` FOR$IOS_FILNOTFOU. A file with the specified name could not be found during an open operation.
30 | `severe (30): Open failure` FOR$IOS_OPEFAI. An error was detected by the Compaq Fortran RTL I/O system while attempting to open a file in an OPEN, INQUIRE, or other I/O statement. This message is issued when the error condition is not one of the more common conditions for which specific error messages are provided. It can occur when an OPEN operation was attempted for one of the following: Segmented file that was not on a disk or a raw magnetic tape Standard I/O file that had been closed
31 | `severe (31): Mixed file access modes` FOR$IOS_MIXFILACC. An attempt was made to use any of the following combinations: Formatted and unformatted operations on the same unit An invalid combination of access modes on a unit, such as direct and sequential A Compaq Fortran RTL I/O statement on a logical unit that was opened by a program coded in another language
32 | `severe (32): Invalid logical unit number` FOR$IOS_INVLOGUNI. A logical unit number greater than 2,147,483,647 or less than zero was used in an I/O statement.
33 | `severe (33): ENDFILE error` FOR$IOS_ENDFILERR. One of the following conditions occurred: The file was not a sequential organization file with variable-length records. The file was not opened for sequential or append access. An unformatted file did not contain segmented records. The Compaq Fortran RTL I/O system detected an error during execution of an ENDFILE statement.
34 | `severe (34): Unit already open` FOR$IOS_UNIALROPE. A DEFINE FILE statement specified a logical unit that was already opened.
35 | `severe (35): Segmented record format error` FOR$IOS_SEGRECFOR. An invalid segmented record control data word was detected in an unformatted sequential file. The file was probably either created with RECORDTYPE= `'` FIXED `'` or `'` VARIABLE `'` in effect, or was created by a program written in a language other than Fortran.
36 | `severe (36): Attempt to access non-existent record` FOR$IOS_ATTACCNON. A direct-access READ or FIND statement attempted to access beyond the end of a relative file (or a sequential file on disk with fixed-length records) or access a record that was previously deleted in a relative file.
37 | `severe (37): Inconsistent record length` FOR$IOS_INCRECLEN. An attempt was made to open a direct access file without specifying a record length.
38 | `severe (38): Error during write` FOR$IOS_ERRDURWRI. The Compaq Fortran RTL I/O system detected an error condition during execution of a WRITE statement.
39 | `severe (39): Error during read` FOR$IOS_ERRDURREA. The Compaq Fortran RTL I/O system detected an error condition during execution of a READ statement.
40 | `severe (40): Recursive I/O operation` FOR$IOS_RECIO_OPE. While processing an I/O statement for a logical unit, another I/O operation on the same logical unit was attempted, such as a function subprogram that performs I/O to the same logical unit that was referenced in an expression in an I/O list or variable format expression.
41 | `severe (41): Insufficient virtual memory` FOR$IOS_INSVIRMEM. The Compaq Fortran RTL attempted to exceed its available virtual memory while dynamically allocating space. To overcome this problem, increase the per-process data limit by using the `limit` (C shell) or `ulimit` (Bourne and Korn and bash (L*X ONLY) shell) commands before you run this program again (see Section 1.1). To determine whether the maximum per-process data size is already allocated, check the value of the maxdsiz parameter in the sysconfigtab or system configuration file. If necessary, increase its value. Changes to do not take effect until the system has been rebooted (you do not need to rebuild the kernel if you modify sysconfigtab). For more information about system configuration parameters on Tru64 UNIX systems, see the Compaq Tru64 UNIX System Tuning and Performance Management guide. Before you try to run this program again, wait until the new system resources take effect.
42 | `severe (42): No such device` FOR$IOS_NO_SUCDEV. A pathname included an invalid or unknown device name when an OPEN operation was attempted.
43 | `severe (43): File name specification error` FOR$IOS_FILNAMSPE. A pathname or file name given to an OPEN or INQUIRE statement was not acceptable to the Compaq Fortran RTL I/O system.
44 | `severe (44): Inconsistent record type` FOR$IOS_INCRECTYP. The RECORDTYPE value in an OPEN statement did not match the record type attribute of the existing file that was opened.
45 | `severe (45): Keyword value error in OPEN statement` FOR$IOS_KEYVALERR. An improper value was specified for an OPEN or CLOSE statement specifier requiring a value.
46 | `severe (46): Inconsistent OPEN/CLOSE parameters` FOR$IOS_INCOPECLO. Specifications in an OPEN or CLOSE statement were inconsistent. Some invalid combinations follow: READONLY or ACTION= `'` READ `'` with STATUS= `'` NEW `'` or STATUS= `'` SCRATCH `'` READONLY with STATUS= `'` REPLACE `'` , ACTION= `'` WRITE `'` , or ACTION= `'` READWRITE `'` ACCESS= `'` APPEND `'` with READONLY, ACTION= `'` READ `'` , STATUS= `'` NEW `'` , or STATUS= `'` SCRATCH `'` DISPOSE= `'` SAVE `'` , `'` PRINT `'` , or `'` SUBMIT `'` with STATUS= `'` SCRATCH `'` DISPOSE= `'` DELETE `'` with READONLY CLOSE statement STATUS= `'` DELETE `'` with OPEN statement READONLY ACCESS= `'` APPEND `'` with STATUS= `'` REPLACE `'` ACCESS= `'` DIRECT `'` or `'` KEYED `'` with POSITION= `'` APPEND `'` , `'` ASIS `'` , or `'` REWIND `'`
47 | `severe (47): Write to READONLY file` FOR$IOS_WRIREAFIL. A write operation was attempted to a file that was declared ACTION= `'` READ `'` or READONLY in the OPEN statement that is currently in effect.
48 | `severe (48): Invalid argument to Fortran Run-Time Library` FOR$IOS_INVARGFOR. The compiler passed an invalid or improperly coded argument to the Compaq Fortran RTL. This can occur if the compiler is newer than the RTL in use.
51 | `severe (51): Inconsistent file organization` FOR$IOS_INCFILORG. The file organization specified in an OPEN statement did not match the organization of the existing file.
53 | `severe (53): No current record` FOR$IOS_NO_CURREC. Attempted to execute a REWRITE statement to rewrite a record when the current record was undefined. To define the current record, execute a successful READ statement. You can optionally perform an INQUIRE statement on the logical unit after the READ statement and before the REWRITE statement. No other operations on the logical unit may be performed between the READ and REWRITE statements.
55 | `severe (55): DELETE error` FOR$IOS_DELERR. An error condition was detected by the Compaq Fortran RTL I/O system during execution of a DELETE statement.
57 | `severe (57): FIND error` FOR$IOS_FINERR. The Compaq Fortran RTL I/O system detected an error condition during execution of a FIND statement.
58 1 | `info (58): Format syntax error at or near xx` FOR$IOS_FMTSYN. Check the statement containing xx, a character substring from the format string, for a format syntax error. For information about FORMAT statements, refer to the Compaq Fortran Language Reference Manual.
59 | `severe (59): List-directed I/O syntax error` FOR$IOS_LISIO_SYN 2. The data in a list-directed input record had an invalid format, or the type of the constant was incompatible with the corresponding variable. The value of the variable was unchanged.
60 | `severe (60): Infinite format loop` FOR$IOS_INFFORLOO. The format associated with an I/O statement that included an I/O list had no field descriptors to use in transferring those values.
61 | `severe or info 3 (61): Format/variable-type mismatch` FOR$IOS_FORVARMIS 2. An attempt was made either to read or write a real variable with an integer field descriptor (I, L, O, Z, B), or to read or write an integer or logical variable with a real field descriptor (D, E, or F). To suppress this error message, see Section 3.24.
62 | `severe (62): Syntax error in format` FOR$IOS_SYNERRFOR. A syntax error was encountered while the RTL was processing a format stored in an array or character variable.
63 | `error or info 3 (63): Output conversion error` FOR$IOS_OUTCONERR 2. During a formatted output operation, the value of a particular number could not be output in the specified field length without loss of significant digits. When this situation is encountered, the overflowed field is filled with asterisks to indicate the error in the output record. If no ERR address has been defined for this error, the program continues after the error message is displayed. To suppress this error message, see Section 3.27.
64 | `severe (64): Input conversion error` FOR$IOS_INPCONERR 2. During a formatted input operation, an invalid character was detected in an input field, or the input value overflowed the range representable in the input variable. The value of the variable was set to zero.
65 | `error (65): Floating invalid` FOR$IOS_FLTINV. During an arithmetic operation, the floating-point values used in a calculation were invalid for the type of operation requested or invalid exceptional values. For example, when requesting a log of the floating-point values 0.0 or a negative number. For certain arithmetic expressions, specifying the `-check nopower` option can suppress this message (see Section 3.25). For information on allowing exceptional IEEE values, see Section 3.44.
66 | `severe (66): Output statement overflows record` FOR$IOS_OUTSTAOVE. An output statement attempted to transfer more data than would fit in the maximum record size.
67 | `severe (67): Input statement requires too much data` FOR$IOS_INPSTAREQ. Attempted to read more data than exists in a record with an unformatted READ statement or with a formatted sequential READ statement from a file opened with a PAD specifier value of `'` NO `'` .
68 | `severe (68): Variable format expression value error` FOR$IOS_VFEVALERR 2. The value of a variable format expression was not within the range acceptable for its intended use; for example, a field width was less than or equal to zero. A value of 1 was assumed, except for a P edit descriptor, for which a value of zero was assumed.
69 1 | `error (69): Process interrupted (SIGINT)` FOR$IOS_SIGINT. The process received the signal SIGINT. Determine source of this interrupt signal (described in `signal(3)` ).
70 1 | `severe (70): Integer overflow` FOR$IOS_INTOVF. During an arithmetic operation, an integer value exceeded byte, word, or longword range. The result of the operation was the correct low-order part. See Chapter 9 for ranges of the various integer data types. Consider specifying a larger integer data size (modify source program or, for an INTEGER declaration, possibly use the `f90` option `-integer_size nn` ).
71 1 | `severe (71): Integer divide by zero` FOR$IOS_INTDIV. During an integer arithmetic operation, an attempt was made to divide by zero. The result of the operation was set to the dividend, which is equivalent to division by 1.
72 1 | `error (72): Floating overflow` FOR$IOS_FLTOVF. During an arithmetic operation, a floating-point value exceeded the largest representable value for that data type. See Chapter 9 for ranges of the various data types.
73 1 | `error (73): Floating divide by zero` FOR$IOS_FLTDIV. During a floating-point arithmetic operation, an attempt was made to divide by zero.
74 1 | `error (74): Floating underflow` FOR$IOS_FLTUND. During an arithmetic operation, a floating-point value became less than the smallest finite value for that data type. Depending on the values of the `-fpe` n option (see Section 3.44), the underflowed result was either set to zero or allowed to gradually underflow. See Chapter 9 for ranges of the various data types.
75 1 | `error (75): Floating point exception` FOR$IOS_SIGFPE. A floating-point exception occurred. Core dump file created. Possible causes include: Division by zero Overflow Invalid operation, such as subtraction of infinite values, multiplication of zero by infinity (without signs), division of zero by zero or infinity by infinity Conversion of floating-point to fixed-point format when an overflow prevents conversion
76 1 | `error (76): IOT trap signal` FOR$IOS_SIGIOT. Core dump file created. Examine core dump for possible cause of this IOT signal. For more information about signals, see Section 8.3.
77 1 | `severe (77): Subscript out of range` FOR$IOS_SUBRNG. An array reference was detected outside the declared array bounds.
78 1 | `error (78): Process killed (SIGTERM)` FOR$IOS_SIGTERM. The process received the signal SIGTERM. Determine source of this software termination signal (described in `signal(3)` ).
79 1 | `error (79): Process quit (SIGQUIT)` FOR$IOS_SIGQUIT. The process received the signal SIGQUIT. Core dump file created. Determine source of this quit signal (described in `signal(3)` ).
95 1 | `info (95): Floating-point conversion failed` FOR$IOS_FLOCONFAI. The attempted unformatted read or write of nonnative floating-point data failed because the floating-point value: Exceeded the allowable maximum value for the equivalent native format and was set equal to infinity (plus or minus) Was infinity (plus or minus) and was set to infinity (plus or minus) Was invalid and was set to not a number (NaN) Very small numbers are set to zero (0). This error could be caused by the specified nonnative floating-point format not matching the floating-point format found in the specified file. Check the following: The correct file was specified. The record layout matches the format Compaq Fortran is expecting. The ranges for the data being used (Chapter 9) The correct nonnative floating-point data format was specified (Chapter 10).
108 | `severe (108): Cannot stat file` FOR$IOS_CANSTAFIL. Attempted stat operation on the indicated file failed. Make sure correct file and unit were specified.
120 | `severe (120): Operation requires seek ability` FOR$IOS_OPEREQSEE. Attempted an operation on a file that requires the ability to perform seek operations on that file. Make sure the correct unit, directory path, and file were specified.
130 1 (TU*X ONLY) | `severe (130): User breakpoint (SIGTRAP)` FOR$IOS_BRK_USERBP. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. Examine core dump for possible cause.
131 1 (TU*X ONLY) | `severe (131): Kernel breakpoint (SIGTRAP)` FOR$IOS_BRK_KERNELBP. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. Examine core dump for possible cause.
135 1 (TU*X ONLY) | `severe (135): User single step (SIGTRAP)` FOR$IOS_BRK_SSTEPBP. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. Examine core dump for possible cause.
136 1 (TU*X ONLY) | `severe (136): Overflow check (SIGTRAP)` FOR$IOS_BRK_OVERFLOW. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. The cause is an integer overflow. Try recompiling with the `-check overflow` option (perhaps with the `decfort_dump_flag` environment variable set) or examine the core dump file to determine the source code in error.
137 1 (TU*X ONLY) | `severe (137): Divide by zero check (SIGTRAP)` FOR$IOS_BRK_DIVZERO. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. Examine core dump file for possible cause.
138 1 | `severe (138): Array index out of bounds (SIGTRAP on TU*X, SIGILL on L*UX)` FOR$IOS_BRK_RANGE. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. The cause is an array subscript that is outside the dimensioned boundaries of that array. Either recompile with the `-check bounds` option (perhaps with the `decfort_dump_flag` environment variable set) or examine the core dump file to determine the source code in error.
139 1 | `severe (139): Array index out of bounds for index nn (SIGTRAP on TU*X, SIGILL on L*UX)` FOR$IOS_BRK_RANGE2. Break exception generated a SIGTRAP signal (described in `signal(3)` ). Core dump file created. The cause is an array subscript that is outside the dimensioned boundaries of the array index n. Either recompile with the `-check bounds` option (perhaps with the `decfort_dump_flag` environment variable set) or examine the core dump file to determine the source code in error.
140 1 | `severe (140): Floating inexact` FOR$IOS_FLTINE. A floating-point arithmetic or conversion operation gave a result that differs from the mathematically exact result. This trap is reported if the rounded result of an IEEE operation is not exact.
144 1 | `severe (144): reserved operand` FOR$IOS_ROPRAND. The Compaq Fortran RTL encountered a reserved operand. Please report the problem to Compaq.
145 1 | `severe (145): Assertion error` FOR$IOS_ASSERTERR. The Compaq Fortran RTL encountered an assertion error. Please report the problem to Compaq.
146 1 | `severe (146): Null pointer error` FOR$IOS_NULPTRERR. Attempted to use a pointer that does not contain an address. Modify the source program, recompile, and relink.
147 1 | `severe (147): stack overflow` FOR$IOS_STKOVF. The Compaq Fortran RTL encountered a stack overflow while executing your program.
148 1 | `severe (148): String length error` FOR$IOS_STRLENERR. During a string operation, an integer value appears in a context where the value of the integer is outside the permissible string length range. Either recompile with the `-check bounds` option (perhaps with the `decfort_dump_flag` environment variable set) or examine the `core` file to determine the source code causing the error.
149 1 | `severe (149): Substring error` FOR$IOS_SUBSTRERR. An array subscript is outside the dimensioned boundaries of an array. Either recompile with the `-check bounds` option (perhaps with the `decfort_dump_flag` environment variable set) or examine the `core` file to determine the source code causing the error.
150 1 | `severe (150): Range error` FOR$IOS_RANGEERR. An integer value appears in a context where the value of the integer is outside the permissible range.
151 1 | `severe (151): Allocatable array is already allocated` FOR$IOS_INVREALLOC. An allocatable array must not already be allocated when you attempt to allocate it. You must deallocate the array before it can again be allocated.
152 1 | `severe (152): Unresolved contention for Compaq Fortran RTL global resource` FOR$IOS_RESACQFAI. Failed to acquire a Compaq Fortran RTL global resource for a reentrant routine. For a multithreaded program, the requested global resource is held by a different thread in your program. For a program using asynchronous handlers, the requested global resource is held by the calling part of the program (such as main program) and your asynchronous handler attempted to acquire the same global resource.
153 1 | `severe (153): Allocatable array or pointer is not allocated` FOR$IOS_INVDEALLOC. A Fortran-90 allocatable array or pointer must already be allocated when you attempt to deallocate it. You must allocate the array or pointer before it can again be deallocated.
173 1 | `severe (173): A pointer passed to DEALLOCATE points to an array that cannot be deallocated` FOR$IOS_INVDEALLOC2. A pointer that was passed to DEALLOCATE pointed to an explicit array, an array slice, or some other type of memory that could not be deallocated in a DEALLOCATE statement. Only whole arrays previous allocated with an ALLOCATE statement can be validly passed to DEALLOCATE.
- 174 1 | `severe (174): SIGSEGV, message-text` FOR$IOS_SIGSEGV. One of two possible messages occurs for this error number: `severe (174): SIGSEGV, segmentation fault occurred` For both Compaq Tru64 UNIX and Linux systems, this message indicates that the program attempted an invalid memory reference. Check the program for possible errors. `severe (174): SIGSEGV, possible program stack overflow occurred` On Compaq Tru64 UNIX systems, the following explanatory text also appears:
      Program requirements exceed the maximum available stacksize

      resource limit. Contact your system administrator for help.
  On Linux systems, the following explanatory text also appears:
      Program requirements exceed current stacksize resource limit.

      Superusers may try increasing this resource by using the

      limit stacksize
      xxx command, where
      xxx

      is unlimited or something larger than your current limit.

      Other users should contact your system administrator for help.
175 1 | `severe (175): DATE argument to DATE_AND_TIME is too short (LEN=n), required LEN=8` FOR$IOS_SHORTDATEARG. The number of characters associated with the DATE argument to the DATE_AND_TIME intrinsic was shorter than the required length. You must increase the number of characters passed in for this argument to be at least 8 characters in length. Verify that the TIME and ZONE arguments also meet their minimum lengths.
176 1 | `severe (176): TIME argument to DATE_AND_TIME is too short (LEN=n), required LEN=10` FOR$IOS_SHORTTIMEARG. The number of characters associated with the TIME argument to the DATE_AND_TIME intrinsic was shorter than the required length. You must increase the number of characters passed in for this argument to be at least 10 characters in length. Verify that the DATE and ZONE arguments also meet their minimum lengths.
177 1 | `severe(177): ZONE argument to DATE_AND_TIME is too short (LEN=n), required LEN=5` FOR$IOS_SHORTZONEARG. The number of characters associated with the ZONE argument to the DATE_AND_TIME intrinsic was shorter than the required length. You must increase the number of characters passed in for this argument to be at least 5 characters in length. Verify that the DATE and TIME arguments also meet their minimum lengths.
178 1 | `severe(178): Divide by zero` FOR$IOS_DIV. A floating-point or integer divide-by-zero exception occurred.
179 1,4 | `severe(179): Cannot allocate array---overflow on array size calculation` FOR$IOS_ARRSIZEOVF. An attempt to dynamically allocate storage for an array failed because the required storage size exceeds addressable memory.
256 | `severe (256): Unformatted I/O to unit open for formatted transfers` FOR$IOS_UNFIO_FMT. Attempted unformatted I/O to a unit where the OPEN statement (FORM specifier) indicated the file was formatted. Check that the correct unit (file) was specified. If the FORM specifier was not present in the OPEN statement and the file contains unformatted data, specify FORM= `'` UNFORMATTED `'` in the OPEN statement. Otherwise, if appropriate, use formatted I/O (such as list-directed or namelist I/O).
257 | `severe (257): Formatted I/O to unit open for unformatted transfers` FOR$IOS_FMTIO_UNF. Attempted formatted I/O (such as list-directed or namelist I/O) to a unit where the OPEN statement indicated the file was unformatted (FORM specifier). Check that the correct unit (file) was specified. If the FORM specifier was not present in the OPEN statement and the file contains formatted data, specify FORM= `'` FORMATTED `'` in the OPEN statement. Otherwise, if appropriate, use unformatted I/O.
264 | `severe (264): operation requires file to be on disk or tape` FOR$IOS_OPERREQDIS. Attempted to use a BACKSPACE statement on such devices as a terminal or pipe.
265 | `severe (265): operation requires sequential file organization and access` FOR$IOS_OPEREQSEQ. Attempted to use a BACKSPACE statement on a file whose organization was not sequential or whose access was not sequential. A BACKSPACE statement can only be used for sequential files opened for sequential access.
266 1 | `error (266): Fortran abort routine called` FOR$IOS_PROABOUSE. The program called `abort` to terminate the program. For more information on signals, see Section 8.3.
268 1 | `severe (268): End of record during read` FOR$IOS_ENDRECDUR. An end-of-record condition was encountered during execution of a nonadvancing I/O READ statement that did not specify the EOR branch specifier.
297 1 | `info (297): nn floating invalid traps` FOR$IOS_FLOINVEXC. The total number of floating-point invalid data traps encountered during program execution was nn. This message appears at program completion.
298 1 | `info (298): nnfloating overflow traps` FOR$IOS_FLOOVFEXC. The total number of floating-point overflow traps encountered during program execution was nn. This message appears at program completion.
299 1 | `info (299): nnfloating divide-by-zero traps` FOR$IOS_FLODIV0EXC. The total number of floating-point divide-by-zero traps encountered during program execution was nn. This message appears at program completion.
300 1 | `info (300): nnfloating underflow traps` FOR$IOS_FLOUNDEXC. The total number of floating-point underflow traps encountered during program execution was nn. This message appears at program completion.

1Identifies errors not returned by IOSTAT.
2The ERR transfer is taken after completion of the I/O statement for error numbers 59, 61, 63, 64, and 68. The resulting file status and record position are the same as if no error had occurred. However, other I/O errors take the ERR transfer as soon as the error is detected, so file status and record position are undefined.
3For errors 61 and 63, the severity depends on the `-check` keywords used during compilation (`f90` command).
4Identifies errors that can be returned by STAT in an ALLOCATE statement.

For More Information:

- On locating exceptions within the debugger, see Section 4.9.
- On file operations, see Section 7.5, Section 7.6, and Section 7.7.
- On record operations, see Section 7.8.
- On `f90` and `fort` command-line options, see Chapter 3.
- On data types, see Chapter 9.

Previous | Next | Contents | Index