• No results found

Setting Run-Time Environment Variables

In document Intel Fortran Compiler User Guide (Page 132-137)

The Intel®Fortran run-time system recognizes a number of environment variables. These

variables can be used to customize run-time diagnostic error reporting, allow program

continuation under certain conditions, disable the display of certain dialog boxes under certain conditions, and allow just-in-time debugging. For a list of run-time environment variables used by OpenMP*, seeOpenMP Environment Variablesin Optimizing Applications.

For information on setting compile time environment variables, seeSetting Compile-Time Environment Variables.

The run-time environment variables are:

If this variable is set to Y or y, a core dump will be taken when any severe Intel Fortran run-time error occurs.

• F_UFMTENDIAN

This variable specifies the numbers of the units to be used for little-endian-to-big-endian conversion purposes. SeeEnvironmentVariable F_UFMTENDIANMethod.

• FOR_FMT_TERMINATOR

This variable specifies the numbers of the units to have a specific record terminator. See

Record Types.

• FOR_ACCEPT

The ACCEPT statement does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and theFOR_ACCEPTenvironment variable. IfFOR_ACCEPT

is not defined, the codeACCEPT f,iolistreads fromCONIN$(standard input). If

FOR_ACCEPTis defined (as a file name optionally containing a path), the specified file would be read.

• FOR_DEBUGGER_IS_PRESENT

This variable tells the Fortran run-time library that your program is executing under a debugger. If set to True, it generates debug exceptions whenever severe or continuous errors are detected. Under normal conditions you don't need to set this variable on Windows systems, as this information can be extracted from the operating system. On Linux* OS and Mac OS* X, you will need to set this variable if you want debug exceptions. Setting this variable to True when your program is not executing under a debugger will cause unpredictable behavior.

• FOR_DEFAULT_PRINT_DEVICE(Windows* OS only)

This variable lets you specify the print device other than the default print device PRN (LPT1) for files closed (CLOSEstatement) with theDISPOSE='PRINT'specifier. To specify a different print device for the file associated with theCLOSEstatementDISPOSE='PRINT'specifier, setFOR_DEFAULT_PRINT_DEVICEto any legal DOS print device before executing the program.

• FOR_DIAGNOSTIC_LOG_FILE

If this variable is set to the name of a file, diagnostic output is written to the specified file. The Fortran run-time system attempts to open that file (append output) and write the error information (ASCII text) to the file.

The setting ofFOR_DIAGNOSTIC_LOG_FILEis independent of

FOR_DISABLE_DIAGNOSTIC_DISPLAY, so you can disable the screen display of information but still capture the error information in a file. The text string you assign for the file name is used literally, so you must specify the full name. If the file open fails, no error is reported and the run-time system continues diagnostic processing.

See alsoLocating Run-Time ErrorsandUsing Traceback Information.

• FOR_DISABLE_DIAGNOSTIC_DISPLAY

This variable disables the display of all error information. This variable is helpful if you just want to test the error status of your program and do not want the Fortran run-time system to display any information about an abnormal program termination.

See alsoUsing Traceback Information.

• FOR_DISABLE_STACK_TRACE

This variable disables the call stack trace information that follows the displayed severe error message text.

The Fortran run-time error message is displayed whether or notFOR_DISABLE_STACK_TRACE

is set to true. If the program is executing under a debugger, the automatic output of the stack trace information by the Fortran library will be disabled to reduce noise. You should use the debugger's stack trace facility if you want to view the stack trace.

See alsoLocating Run-Time ErrorsandUsing Traceback Information.

• FOR_IGNORE_EXCEPTIONS

This variable disables the default run-time exception handling, for example, to allow just-in-time debugging. The run-time system exception handler returns

EXCEPTION_CONTINUE_SEARCHto the operating system, which looks for other handlers to service the exception.

• FOR_NOERROR_DIALOGS

This variable disables the display of dialog boxes when certain exceptions or errors occur. This is useful when running many test programs in batch mode to prevent a failure from stopping execution of the entire test stream.

• FOR_PRINT

Neither thePRINTstatement nor aWRITEstatement with an asterisk (*) in place of a unit number includes an explicit logical unit number. Instead, both use an implicit internal logical unit number and theFOR_PRINTenvironment variable. IfFOR_PRINTis not defined, the codePRINT f,iolistorWRITE (*,f) iolistwrites toCONOUT$(standard output). If

FOR_PRINTis defined (as a file name optionally containing a path), the specified file would be written to.

• FOR_READ

AREADstatement that uses an asterisk (*) in place of a unit number does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and the

FOR_READenvironment variable. IfFOR_READis not defined, the codeREAD (*,f) iolist

orREAD f,iolistreads fromCONIN$(standard input). IfFOR_READis defined (as a file name optionally containing a path), the specified file would be read.

• FOR_TYPE

TheTYPEstatement does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and theFOR_TYPEenvironment variable. IfFOR_TYPE

is not defined, the codeTYPE f,iolistwrites toCONOUT$(standard output). IfFOR_TYPE

is defined (as a file name optionally containing a path), the specified file would be written to.

• FORT_BUFFERED

Lets you request that buffered I/O should be used at run time for output of all Fortran I/O units, except those with output to the terminal. This provides a run-time mechanism to support the-assume buffered_io (Linux OS and Mac OS X) or/assume:buffered_io

(Windows OS) compiler option.

• FORT_CONVERTn

Lets you specify the data format for an unformatted file associated with a particular unit number (n), as described inMethods of Specifying the Data Format.

FORT_CONVERT.extandFORT_CONVERT_ext

Lets you specify the data format for unformatted files with a particular file extension suffix (ext), as described inMethods of Specifying the Data Format.

• FORT_FMT_RECL

Lets you specify the default record length (normally 132 bytes) for formatted files.

• FORT_UFMT_RECL

Lets you specify the default record length (normally 2040 bytes) for unformatted files.

FORTn

Lets you specify the file name for a particular unit number n, when a file name is not specified in the OPEN statement or an implicit OPEN is used, and the compiler option-fpscomp filesfromcmd(Linux OS and Mac OS X) or/fpscomp:filesfromcmd(Windows OS) was not specified. Preconnected files attached to units 0, 5, and 6 are by default associated with system standard I/O files.

• NLSPATH(Linux OS and Mac OS X only)

The path for the Intel Fortran run-time error message catalog.

• TBK_ENABLE_VERBOSE_STACK_TRACE

This variable displays more detailed call stack information in the event of an error. The default brief output is usually sufficient to determine where an error occurred. Brief output includes up to twenty stack frames, reported one line per stack frame. For each frame, the image name containing the PC, routine name, line number, and source file are given.

The verbose output, if selected, will provide (in addition to the information in brief output) the exception context record if the error was a machine exception (machine register dump), and for each frame, the return address, frame pointer and stack pointer and possible parameters to the routine. This output can be quite long (but limited to 16K bytes) and use of the environment variableFOR_DIAGNOSTIC_LOG_FILEis recommended if you want to capture the output accurately. Most situations should not require the use of verbose output. The variableFOR_ENABLE_VERBOSE_STACK_TRACEis also recognized for compatibility with Compaq* Visual Fortran.

See alsoUsing Traceback Information.

• TBK_FULL_SRC_FILE_SPEC

By default, the traceback output displays only the file name and extension in the source file field. To display complete file name information including the path, set the environment variableTBK_FULL_SRC_FILE_SPECto true.

The variableFOR_FULL_SRC_FILE_SPECis also recognized for compatibility with Compaq* Visual Fortran.

See alsoUsing Traceback Information.

• FORT_TMPDIR,TMP,TMPDIR, andTEMP

Specifies an alternate working directory where scratch files are created.

Setting Environment Variables within a Program

You can set a run-time environment variable from within a program by calling the SETENVQQ routine. For example:

program ENVVAR use ifport LOGICAL(4) res

! Add other data declarations here ! call SETENVQQ as a function

7

In document Intel Fortran Compiler User Guide (Page 132-137)