During execution, your program may encounter errors or exception conditions. These conditions can result from any of the following:
The Intel® 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 Fortran RTL. The default actions described throughout this chapter occur unless overridden by explicit error-processing methods.
The way in which the Fortran RTL actually processes errors depends upon the following factors:
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 compiler options are related to handling errors and exceptions:
The -check bounds option generates extra code to catch certain conditions.
The -check noformat and -check nooutput_conversion options reduce the severity level of the associated run-time error to allow program continuation.
When errors occur during execution (run time) of a program, the Fortran RTL issues diagnostic messages. These run-time messages have the following format:
forrtl: severity (nnn): message-text
where:
forrtl identifies the source as the Intel Fortran RTL.
severity identifies the severity level: severe, error, warning, or info.
nnn identifies the message number; also the IOSTAT value for I/O statements.
message-text explains the event that caused the message.
The severity levels are described in order of greatest to least severity:
A severe message 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.
An error message should be corrected. The program might continue execution, but the output from this execution may be incorrect.
A warning message should be investigated. The program continues execution, but output from this execution may be incorrect.
An info message is for informational purposes only. The program continues.
For severe errors, stack trace information is produced by default, unless the environment variable FOR_DISABLE_STACK_TRACE is set. If the command-line option -traceback is set, 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.
See the following example of stack trace information. The program generates an error at line 12.
program ovf
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
> ifort -O0 ovf.for -o ovf.exe
> ovf.exe
x = -1.0000000E+32 x*100.0 = -1.0000000E+34 (1)
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 (2)
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 (3)
forrtl: error (72): floating overflow
Abort process
The following information corresponds to the numbers at the right of the example:
(1) Stack trace information when the symbol table is present..The Intel Fortran RTL uses a message catalog file to store the text associated with each run-time message. When a run-time error occurs, the Fortran RTL uses the environment variable NLSPATH to locate the message catalog file, from which it obtains the text of the appropriate message. NLSPATH should include a pointer to /opt/intel_fc_80/lib. 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/ifcore_msg.cat
Before executing an Intel Fortran program on a system where Intel Fortran is not installed, you need to copy the redistributable files from the appropriate locations specified in the fredist.txt file.
When a run-time error occurs on a system where the message file is not found, the following messages may appear:
forrtl: info: Fortran error message number is nnn.
forrtl: warning: Could not open message catalog: ifcore_msg.cat.
forrtl: info: Check environment variable NLSPATH and protection of usr/lib/ifcore_msg.cat
The Intel 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.
For more information on NLSPATH, see the reference page environ(5).
An Intel Fortran program can terminate in one of several ways:
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.
Note
If you requested a core file to be created on severe errors and you don't get one when expected, the problem might be that your process limit for the allowable size of a core file is set too low (or to zero). See the man page for your shell for information on setting process limits. For example, the C shell command limit (with no arguments) will report your current settings, and limit coredumpsize unlimited will raise the allowable limit to your current system maximum.