Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

fpscomp

Controls whether certain aspects of the run-time system and semantic language features within the compiler are compatible with Intel® Fortran or Microsoft* Fortran PowerStation.

Syntax

Linux:

-fpscomp [keyword[, keyword...]]

-nofpscomp

macOS:

-fpscomp [keyword[, keyword...]]

-nofpscomp

Windows:

/fpscomp[:keyword[, keyword...]]

/nofpscomp

Arguments

keyword

Specifies the compatibility that the compiler should follow. Possible values are:

none

Specifies that no options should be used for compatibility.

[no]filesfromcmd

Determines what compatibility is used when the OPEN statement FILE= specifier is blank.

[no]general

Determines what compatibility is used when semantics differences exist between Fortran PowerStation and Intel® Fortran.

[no]ioformat

Determines what compatibility is used for list-directed formatted and unformatted I/O.

[no]libs

Determines whether the portability library is passed to the linker.

[no]ldio_spacing

Determines whether a blank is inserted at run-time after a numeric value before a character value.

[no]logicals

Determines what compatibility is used for representation of LOGICAL values.

all

Specifies that all options should be used for compatibility.

Default

fpscomp libs

The portability library is passed to the linker.

Description

This option controls whether certain aspects of the run-time system and semantic language features within the compiler are compatible with Intel Fortran or Microsoft* Fortran PowerStation.

If you experience problems when porting applications from Fortran PowerStation, specify fpscomp (or fpscomp all). When porting applications from Intel Fortran, use fpscomp none or fpscomp libs (the default).

Option

Description

fpscomp none

Specifies that no options should be used for compatibility with Fortran PowerStation. This is the same as specifying nofpscomp. Option fpscomp none enables full Intel® Fortran compatibility. If you omit fpscomp, the default is fpscomp libs. You cannot use the fpscomp and vms options in the same command.

fpscomp filesfromcmd

Specifies Fortran PowerStation behavior when the OPEN statement FILE= specifier is blank (FILE=' '). It causes the following actions to be taken at run time:

  • The program reads a file name from the list of arguments (if any) in the command line that invoked the program. If any of the command-line arguments contain a null string (''), the program asks the user for the corresponding file name. Each additional OPEN statement with a blank FILE= specifier reads the next command-line argument.

  • If there are more nameless OPEN statements than command-line arguments, the program prompts for additional file names.

  • In a QuickWin application, a "File Select" dialog box appears to request file names.

To prevent the run-time system from using the file name specified on the command line when the OPEN statement FILE specifier is omitted, specify fpscomp nofilesfromcmd. This allows the application of Intel Fortran defaults, such as the FORTn environment variable and the FORT. n file name (where n is the unit number).

The fpscomp filesfromcmd option affects the following Fortran features:

  • The OPEN statement FILE specifier

    For example, assume a program OPENTEST contains the following statements:

    OPEN(UNIT = 2, FILE = ' ')

    OPEN(UNIT = 3, FILE = ' ')

    OPEN(UNIT = 4, FILE = ' ')

    The following command line assigns the file TEST.DAT to unit 2, prompts the user for a file name to associate with unit 3, then prompts again for a file name to associate with unit 4:

    opentest test.dat '' ''

  • Implicit file open statements such as the WRITE, READ, and ENDFILE statements Unopened files referred to in READ or WRITE statements are opened implicitly as if there had been an OPEN statement with a name specified as all blanks. The name is read from the command line.

fpscomp general

Specifies that Fortran PowerStation semantics should be used when a difference exists between Intel Fortran and Fortran PowerStation. The fpscomp general option affects the following Fortran features:

  • The BACKSPACE statement:

    • It allows files opened with ACCESS='APPEND' to be used with the BACKSPACE statement.

    • It allows files opened with ACCESS='DIRECT' to be used with the BACKSPACE statement.

    Note: Allowing files that are not opened with sequential access (such as ACCESS='DIRECT') to be used with the BACKSPACE statement violates the Fortran 95 standard and may be removed in the future.

  • The READ statement:

    • It causes a READ from a formatted file opened for direct access to read records that have the same record type format as Fortran PowerStation. This consists of accounting for the trailing Carriage Return/Line Feed pair (<CR><LF>) that is part of the record. It allows sequential reads from a formatted file opened for direct access.

      Note: Allowing files that are not opened with sequential access (such as ACCESS='DIRECT') to be used with the sequential READ statement violates the Fortran 95 standard and may be removed in the future.

    • It allows the last record in a file opened with FORM='FORMATTED' and a record type of STREAM_LF or STREAM_CR that does not end with a proper record terminator (<line feed> or <carriage return>) to be read without producing an error.

    • It allows sequential reads from an unformatted file opened for direct access.

    • Note: Allowing files that are not opened with sequential access (such as ACCESS='DIRECT') to be read with the sequential READ statement violates the Fortran 95 standard and may be removed in the future.

  • The INQUIRE statement:

    • The CARRIAGECONTROL specifier returns the value "UNDEFINED" instead of "UNKNOWN" when the carriage control is not known.

    • The NAME specifier returns the file name "UNKNOWN" instead of filling the file name with spaces when the file name is not known.

    • The SEQUENTIAL specifier returns the value "YES" instead of "NO" for a direct access formatted file.

    • The UNFORMATTED specifier returns the value "NO" instead of "UNKNOWN" when it is not known whether unformatted I/O can be performed to the file.

      Note: Returning the value "NO" instead of "UNKNOWN" for this specifier violates the Fortran 95 standard and may be removed in the future.

  • The OPEN statement:

    • If a file is opened with an unspecified STATUS keyword value, and is not named (no FILE specifier), the file is opened as a scratch file.

      For example:

      OPEN (UNIT = 4)

    • In contrast, when fpscomp nogeneral is in effect with an unspecified STATUS value with no FILE specifier, the FORTn environment variable and the FORT.n file name are used (where n is the unit number).

    • If the STATUS value was not specified and if the name of the file is "USER", the file is marked for deletion when it is closed.

    • It allows a file to be opened with the APPEND and READONLY characteristics.

    • If the default for the CARRIAGECONTROL specifier is assumed, it gives "LIST" carriage control to direct access formatted files instead of "NONE".

    • If the default for the CARRIAGECONTROL specifier is assumed and the device type is a terminal file, the file is given the default carriage control value of "FORTRAN" instead of "LIST".

    • It gives an opened file the additional default of write sharing.

    • It gives the file a default block size of 1024 instead of 8192.

    • If the default for the MODE and ACTION specifier is assumed and there was an error opening the file, try opening the file as read only, then write only.

    • If a file that is being re-opened has a different file type than the current existing file, an error is returned.

    • It gives direct access formatted files the same record type as Fortran PowerStation. This means accounting for the trailing Carriage Return/Line Feed pair (<CR><LF>) that is part of the record.

  • The STOP statement: It writes the Fortran PowerStation output string and/or returns the same exit condition values.

  • The WRITE statement:

    • Writing to formatted direct files

      When writing to a formatted file opened for direct access, records are written in the same record type format as Fortran PowerStation. This consists of adding the trailing Carriage Return/Line Feed pair <CR><LF>) that is part of the record.

      It ignores the CARRIAGECONTROL specifier setting when writing to a formatted direct access file.

    • Interpreting Fortran carriage control characters

      When interpreting Fortran carriage control characters during formatted I/O, carriage control sequences are written that are the same as Fortran PowerStation. This is true for the "Space, 0, 1 and + " characters.

    • Performing non-advancing I/O to the terminal

      When performing non-advancing I/O to the terminal, output is written in the same format as Fortran PowerStation.

    • Interpreting the backslash (\) and dollar ($) edit descriptors

      When interpreting backslash and dollar edit descriptors during formatted I/O, sequences are written the same as Fortran PowerStation.

    • Performing sequential writes

      It allows sequential writes from an unformatted file opened for direct access.

      Note: Allowing files that are not opened with sequential access (such as ACCESS='DIRECT') to be read with the sequential WRITE statement violates the Fortran 95 standard and may be removed in the future.

Specifying fpscomp general sets fpscomp ldio_spacing.

fpscomp ioformat

Specifies that Fortran PowerStation semantic conventions and record formats should be used for list-directed formatted and unformatted I/O. The fpscomp ioformat option affects the following Fortran features:

  • The WRITE statement:

    • For formatted list-directed WRITE statements, formatted internal list-directed WRITE statements, and formatted namelist WRITE statements, the output line, field width values, and the list-directed data type semantics are determined according to the following sample for real constants (N below):

      For 1 <= N < 10**7, use F15.6 for single precision or F24.15 for double.

      For N < 1 or N >= 10**7, use E15.6E2 for single precision or E24.15E3 for double.

      See the Fortran PowerStation documentation for more detailed information about the other data types affected.

    • For unformatted WRITE statements, the unformatted file semantics are dictated according to the Fortran PowerStation documentation; these semantics are different from the Intel Fortran file format. See the Fortran PowerStation documentation for more detailed information.

      The following table summarizes the default output formats for list-directed output with the intrinsic data types:

      Data Type

      Output Format with fpscomp noioformat

      Output Format with fpscomp ioformat

      BYTE

      I5

      I12

      LOGICAL (all)

      L2

      L2

      INTEGER(1)

      I5

      I12

      INTEGER(2)

      I7

      I12

      INTEGER(4)

      I12

      I12

      INTEGER(8)

      I22

      I22

      REAL(4)

      1PG15.7E2

      1PG16.6E2

      REAL(8)

      1PG24.15E3

      1PG25.15E3

      COMPLEX(4)

      '( ',1PG14.7E2, ', ',1PG14.7E2, ') '

      '( ',1PG16.6E2, ', ',1PG16.6E2, ') '

      COMPLEX(8)

      '( ',1PG23.15E3, ', ',1PG23.15E3, ') '

      '( ',1PG25.15E3, ', ',1PG25.15E3, ') '

      CHARACTER

      Aw

      Aw

  • The READ statement:

    • For formatted list-directed READ statements, formatted internal list-directed READ statements, and formatted namelist READ statements, the field width values and the list-directed semantics are dictated according to the following sample for real constants (N below):

      For 1 <= N < 10**7, use F15.6 for single precision or F24.15 for double.

      For N < 1 or N >= 10**7, use E15.6E2 for single precision or E24.15E3 for double.

      See the Fortran PowerStation documentation for more detailed information about the other data types affected.

    • For unformatted READ statements, the unformatted file semantics are dictated according to the Fortran PowerStation documentation; these semantics are different from the Intel Fortran file format. See the Fortran PowerStation documentation for more detailed information.

fpscomp nolibs

Prevents the portability library from being passed to the linker.

fpscomp ldio_spacing

Specifies that at run time a blank should not be inserted after a numeric value before a character value (undelimited character string). This representation is used by Intel Fortran releases before Version 8.0 and by Fortran PowerStation. If you specify fpscomp general, it sets fpscomp ldio_spacing.

fpscomp logicals

Specifies that integers with a non-zero value are treated as true, integers with a zero value are treated as false. The literal constant .TRUE. has an integer value of 1, and the literal constant .FALSE. has an integer value of 0. This representation is used by Intel Fortran releases before Version 8.0 and by Fortran PowerStation.

The default is fpscomp nologicals, which specifies that odd integer values (low bit one) are treated as true and even integer values (low bit zero) are treated as false.

The literal constant .TRUE. has an integer value of -1, and the literal constant .FALSE. has an integer value of 0. This representation is used by Compaq* Visual Fortran. The internal representation of LOGICAL values is not specified by the Fortran standard. Programs which use integer values in LOGICAL contexts, or which pass LOGICAL values to procedures written in other languages, are non-portable and may not execute correctly. Intel recommends that you avoid coding practices that depend on the internal representation of LOGICAL values.

The fpscomp logicals option affects the results of all logical expressions and affects the return value for the following Fortran features:

  • The INQUIRE statement specifiers OPENED, IOFOCUS, EXISTS, and NAMED

  • The EOF intrinsic function

  • The BTEST intrinsic function

  • The lexical intrinsic functions LLT, LLE, LGT, and LGE

fpscomp all

Specifies that all options should be used for compatibility with Fortran PowerStation. This is the same as specifying fpscomp with no keyword. Option fpscomp all enables full compatibility with Fortran PowerStation.

IDE Equivalent

Visual Studio: Compatibility > Use Filenames from Command Line (/fpscomp:filesfromcmd)

Compatibility > Use PowerStation I/O Format (/fpscomp:ioformat)

Compatibility > Use PowerStation Portability Library (/fpscomp:nolibs)

Compatibility > Use PowerStation List-Directed I/O Spacing (/fpscomp:ldio_spacing)

Compatibility > Use PowerStation Logical Values (/fpscomp:logicals)

Compatibility > Use Other PowerStation Run-time Behavior (/fpscomp:general)

Alternate Options

None