[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP Fortran for OpenVMS
User Manual


Previous Contents Index

If you omit /OPTIMIZE=TUNE=xxxx, HOST is used if /FAST is specified; otherwise, GENERIC is used.

UNROLL

You can specify the number of times loops are unrolled with /OPTIMIZE= UNROLL=n, where n is a number from 0 to 16. If you omit the UNROLL keyword or specify UNROLL=0 (the default), the optimizer determines how many times loops are unrolled. Usually loops are unrolled four times, but code analysis may result in certain loops being unrolled two times (twice).

HP Fortran unrolls loops at /OPTIMIZE=LEVEL=3 or higher. When timings using LEVEL=5 show that performance has not improved, consider specifying UNROLL=1 with LEVEL=5, such as the following:


$ FORTRAN /OPTIMIZE=(LEVEL=5,UNROLL=1) M_APP.F90+SUB.F90/NOLIST

For More Information:

2.3.36 /PAD_SOURCE --- Pad Source Lines with Spaces

Controls how the compiler treats fixed-form file source lines that are shorter than the statement field width (72 characters, or 132 characters if /EXTEND_SOURCE is in effect.) This determines how the compiler treats character and Hollerith constants that are continued across two or more source lines. This qualifier does not apply to free-form source files.

Specifying /PAD_SOURCE causes the compiler to treat short source lines as if they were padded with blanks out to the statement field width. This may be useful when compiling programs developed for non-HP compilers that assume that short source lines are blank-padded.

The default, /NOPAD_SOURCE, is compatible with current and previous HP Fortran compilers, which causes the compiler to not treat short source lines as padded with blanks so that the first character of a continuation line immediately follows the last character of the previous line.

If /NOPAD_SOURCE is in effect, the compiler issues an informational message if it detects a continued constant that might be affected by blank padding.

For More Information:

On /WARNINGS=USAGE qualifier, see Section 2.3.51.

2.3.37 /REAL_SIZE --- Floating-Point Data Size

The /REAL_SIZE qualifier controls how the compiler interprets floating-point declarations that do not have a specified length.

The qualifier has the following form:


/REAL_SIZE=
  • 32
  • 64
  • 128

32

Defines REAL declarations, constants, functions, and intrinsics as REAL (KIND=4) (single precision) and COMPLEX declarations, constants, functions, and intrinsics as COMPLEX (KIND=4) (single complex).

64

Defines REAL and COMPLEX declarations, constants, functions, and intrinsics as REAL (KIND=8) (double precision) and COMPLEX declarations, constants, functions, and intrinsics as COMPLEX (KIND=8) (double complex).

This also causes intrinsic functions to produce a double precision REAL (KIND=8) or COMPLEX (KIND=8) result instead of a single precision REAL (KIND=4) or COMPLEX (KIND=4) result, except if the argument is explicitly typed.

For example, references to the CMPLX intrinsic produce DCMPLX results (COMPLEX (KIND=8)), except if the argument to CMPLX is explicitly typed as REAL (KIND=4) or COMPLEX (KIND=4), in which case the resulting data type is COMPLEX (KIND=4). Other affected intrinsic functions include CMPLX, FLOAT, REAL, SNGL, and AIMAG.

128

Specifying /REAL_SIZE=128 defines:
  • REAL and DOUBLE PRECISION declarations, constants, functions, and intrinsics as REAL (KIND=16) (REAL*16)
  • COMPLEX and DOUBLE COMPLEX declarations, constants, functions, and intrinsics as COMPLEX (KIND=16) (COMPLEX*32)

If you omit /REAL_SIZE=128, then:

  • REAL declarations, constants, functions, and intrinsics are defined as REAL (KIND=4).
  • DOUBLE PRECISION declarations, constants, functions, and intrinsics are defined as REAL (KIND=8).
  • COMPLEX declarations, constants, functions, and intrinsics are defined as COMPLEX (KIND=4).
  • DOUBLE COMPLEX declarations, constants, functions, and intrinsics are defined as COMPLEX (KIND=8).

Specifying /REAL_SIZE=128 causes REAL, DOUBLE PRECISION, COMPLEX, and DOUBLE COMPLEX intrinsic functions to produce REAL (KIND=16) or COMPLEX (KIND=16) results unless their arguments are typed with an explicit KIND type parameter.

For example, a reference to the CMPLX intrinsic with /REAL_SIZE=128 produces a COMPLEX (KIND=16) result unless the argument is explicitly typed as REAL (KIND=4) or COMPLEX (KIND=4), in which case the result is COMPLEX (KIND=4).

The default is /REAL_SIZE=32.

For More Information:

  • On data types, see Chapter 8.
  • On intrinsic functions, see the HP Fortran for OpenVMS Language Reference Manual.

2.3.38 /RECURSIVE --- Data Storage and Recursion

The /RECURSIVE qualifier requests that HP Fortran generate code and allocate data so that a subroutine or a function can be called recursively.

The /RECURSIVE qualifier:

  • Changes the default allocation class for all local variables from STATIC to AUTOMATIC, except for variables that are data-initialized, named in a SAVE statement, or declared as STATIC.
  • Permits references to a routine name from inside the routine.

Subprograms declared with the RECURSIVE keyword are always recursive (whether you specify or omit the /RECURSIVE qualifier).

Variables declared with the AUTOMATIC statement or attribute always use stack-based storage for all local variables (whether you specify or omit the /RECURSIVE or /AUTOMATIC qualifiers).

Specifying /RECURSIVE sets /AUTOMATIC.

For More Information:

On the RECURSIVE keyword, see the HP Fortran for OpenVMS Language Reference Manual.

2.3.39 /REENTRANCY --- Specify Threaded or Asynchronous Reentrancy

The /REENTRANCY qualifier specifies whether code generated for the main program and any Fortran procedures it calls will be relying on threaded or asynchronous reentrancy. The default is /REENTRANCY=NONE.

The qualifier has the following form:


/REENTRANCY=
  • ASYNC
  • NONE
  • THREADED

ASYNC

Informs the HP Fortran run-time library that the program may contain asynchronous handlers that could call the RTL. The run-time library will guard against asynchronous interrupts inside its own critical regions.

NONE

Informs the HP Fortran run-time library that the program will not be relying on threaded or asynchronous reentrancy. The run-time library need not guard against such interrupts inside its own critical regions. Same as /NOREENTRANCY.

THREADED

Informs the HP Fortran run-time library that the program is multithreaded, such as programs using the POSIX threads library. The run-time library will use thread locking to guard its own critical regions.

To use the kernel threads libraries, also specify the /THREADS_ENABLE qualifier on the LINK command (see the Guide to the POSIX Threads Library).

Specifying NOREENTRANCY is equivalent to /REENTRANCY=NONE.

For More Information:

On writing multithreaded applications, see the Guide to the POSIX Threads Library.

2.3.40 /ROUNDING_MODE --- Specify IEEE Floating-Point Rounding Mode

The /ROUNDING_MODE qualifier allows you to control how rounding occurs during calculations. This qualifier applies only to IEEE data types (when you specify /FLOAT=IEEE_FLOAT). Note that if you specify /FLOAT=G_FLOAT or /FLOAT=D_FLOAT, /ROUNDING_MODE must not also be specified.

Note that the rounding mode applies to each program unit being compiled.

The qualifier has the following form:


/ROUNDING_MODE=
  • NEAREST
  • CHOPPED
  • MINUS_INFINITY
  • DYNAMIC

NEAREST

This is the normal rounding mode, where results are rounded to the nearest representable value. If you omit the /ROUNDING_MODE qualifier, /ROUNDING_MODE=NEAREST is used.

CHOPPED

Results are rounded to the nearest representable value in the direction toward zero.

MINUS_INFINITY

Results are rounded toward the next smallest representative value.

DYNAMIC

Lets you set the rounding mode at run time.

On OpenVMS I64, you can call the SYS$IEEE_SET_ROUNDING_MODE routine to set the rounding mode and obtain the previous rounding mode.

When you call SYS$IEEE_SET_ROUNDING_MODE, you can set the rounding mode to one of the following settings:

  • Round toward zero (same as /ROUNDING_MODE=CHOPPED)
  • Round toward nearest (same as /ROUNDING_MODE=NEAREST)
  • Round toward plus infinity
  • Round toward minus infinity (same as /ROUNDING_MODE=CHOPPED)

If you compile with /ROUNDING_MODE=DYNAMIC, the initial rounding mode is set to NEAREST. It will remain NEAREST until you call SYS$IEEE_SET_ROUNDING_MODE to change it.

On OpenVMS Alpha, there is no system routine to call to set the rounding mode dynamically. You have to write and call your own routines to set the rounding mode at run time. The mode is set by setting the rounding control bits in the floating-point control register (FPCR). You can do this in C using the asm feature from the system include file c_asm.h , or in assembly language.

Note

For the fastest run-time performance, avoid using /ROUNDING_MODE=DYNAMIC.

The rounding mode applies to each program unit being compiled.

For More Information:

  • On IEEE floating-point rounding modes, see the IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985).
  • On SYS$IEEE_SET_ROUNDING_MODE, see the HP OpenVMS System Services Reference Manual.
  • On the floating-point status register and Itanium architecture, see the Intel Itanium Architecture Software Developer's Manual, Volume 1: Application Architecture.
  • On the floating-point control register and Alpha architecture, see the Alpha Architecture Reference Manual.

2.3.41 /SEPARATE_COMPILATION --- Control Compilation Unit Use in Object Files

Controls whether the HP Fortran compiler:

  • Places individual compilation units in an HP Fortran source file as separate object modules in the object file (/SEPARATE_COMPILATION)
  • Groups individual compilation units in an HP Fortran source file as a single object module in the object file (/NOSEPARATE_COMPILATION), which allows more interprocedure optimization

The default is /NOSEPARATE_COMPILATION.

When creating object modules for use in an object library, consider using /SEPARATE_COMPILATION to minimize the size of the routines included by the linker as it creates the executable image. In most cases, to allow more interprocedure optimizations, use the default /NOSEPARATE_COMPILATION.

For More Information:

2.3.42 /SEVERITY --- Specify Compiler Diagnostic Severity

The /SEVERITY qualifier changes one or both of the following:

  • Changes compiler diagnostic warning messages to have a severity of error (instead of warning). The severity of informational compiler diagnostic messages remains informational severity.
    To control the conditions checked during compilation that prevent or request messages, use the /WARNINGS qualifier keywords (see Section 2.3.51.
  • When used with the /STANDARD qualifier, /SEVERITY changes standards checking warning messages to have a severity of error (instead of warning). The severity of informational standards checking diagnostic messages remains informational severity.
    To control the type of standards checking performed, specify the /STANDARDS qualifier with either the F90 keyword (default) or the F95 keyword (see Section 2.3.45.

The qualifier has the following form:


/SEVERITY=WARNINGS=
  • WARNING
  • ERROR
  • STDERROR

The default is that compiler diagnostic warning messages and standards checking messages have a severity of warning or /SEVERITY=(WARNINGS=WARNING).

You can specify one of the following:

  • ERROR
    Specifies that all warning messages are to be issued with ERROR severity.
  • STDERROR
    Specifies that if /STANDARD is in effect and diagnostics indicating non-standard features are issued, the diagnostics are issued with ERROR severity (the default is that these are informational). All other warning messages are issued with WARNING severity.
  • WARNINGS
    Specifies that all warning messages are to be issued with WARNING severity.

For example, the following command line requests that compiler diagnostic messages have a severity of warning (default) and standards checking messages have a severity of error (and requests Fortran 95 standards checking)::


$ FORTRAN/SEVERITY=WARNINGS=STDERROR/STANDARD=F95 file.F90

For More Information:

  • On using the /WARNINGS qualifier to control the conditions checked during compilation, see Section 2.3.51.
  • On using the /STANDARDS qualifier to control the type of standards checking performed, see Section 2.3.45.

2.3.43 /SHOW --- Control Source Content in Listing File

The /SHOW qualifier controls whether optionally listed source lines and a symbol map appear in the source listing. (Optionally listed source lines are text-module source lines and preprocessor-generated source lines.)

For the /SHOW qualifier to take effect, you must specify the /LIST qualifier.

The qualifier has the following form:


/SHOW =
    • [NO]DICTIONARY
    • [NO]INCLUDE
    • [NO]MAP
    • [NO]PREPROCESSOR
    [, ...]
    • ALL
    • NONE

ALL

Requests that all optionally listed source lines and a symbol map be included in the listing file. Specifying /SHOW is equivalent to /SHOW=ALL.

[NO]DICTIONARY

Controls whether HP Fortran source representations of any CDD/Repository records referenced by DICTIONARY statements are included in the listing file.

[NO]INCLUDE

Controls whether the source lines from any file or text module specified by INCLUDE statements are included in the source listing.

[NO]MAP

Controls whether the symbol map is included in the listing file.

[NO]PREPROCESSOR

Controls whether preprocessor-generated source lines are included in the listing file.

NONE

Requests that no optionally listed source lines or a symbol map be included in the listing file. Specifying /NOSHOW is equivalent to /SHOW=NONE.

The /SHOW qualifier defaults are NOINCLUDE and MAP.

For More Information:

On the /LIST qualifier, see Section 2.3.28.

2.3.44 /SOURCE_FORM --- Fortran 90/95 Source Form

The /SOURCE_FORM qualifier allows you to specify whether all HP Fortran source files on the FORTRAN command line are in fixed or free source form. The qualifier has the following form:


/SOURCE_FORM=
  • FIXED
  • FREE

FIXED

Specifies that the input source files will be in fixed source form, regardless of the file type. Source files with a file type of FOR or F (or any file type other than F90) are assumed to contain fixed source form.

FREE

Specifies that the input source files will be free form, regardless of the file type. Source files with a file type of F90 are assumed to contain free source form.

For More Information:

On column positions and source forms, see the HP Fortran for OpenVMS Language Reference Manual.

2.3.45 /STANDARD --- Perform Fortran 90/95 Standards Checking

The /STANDARD qualifier instructs the compiler to generate informational messages for language elements that are not standard in the Fortran 90 or Fortran 95 language and that can be identified at compile-time. The default is /NOSTANDARD. If you specify /STANDARD with no value, the default is Fortran 95.

The qualifier has the following form:


/[NO]STANDARD=
  • F90
  • F95
  • NONE

The /STANDARD=F90 qualifier requests that the compiler issue informational messages for:

  • Syntax extensions to the Fortran 90 standard. SYNTAX extensions include nonstandard statements and language constructs.
  • Fortran 90 standard-conforming statements that become nonstandard due to the way in which they are used. Data type information and statement locations are considered when determining semantic extensions.
  • For fixed-format source files, lines that use tab formatting.

The /STANDARD=F95 qualifier (or /STANDARD) requests that the compiler issue informational messages for:

  • Syntax extensions to the Fortran 95 standard. SYNTAX extensions include nonstandard statements and language constructs.
  • Fortran 95 standard-conforming statements that become nonstandard due to the way in which they are used. Data type information and statement locations are considered when determining semantic extensions.
  • For fixed-format source files, lines that use tab formatting.
  • Deleted Fortran language features.

Specifying /STANDARD=NONE is equivalent to /NOSTANDARD.

If you specify the /NOWARNINGS qualifier, the /STANDARD qualifier is ignored.

If you omit the /STANDARD qualifier, the default is /NOSTANDARD.

To change the severity of standards checking warning messages to error severity, specify /SEVERITY=WARNINGS=SDTERROR (see Section 2.3.42).

Source statements that do not conform to Fortran 90 or Fortran 95 language standards are detected by the HP Fortran compiler under the following circumstances:

  • The statements contain ordinary syntax and semantic errors.
  • A source program containing nonconforming statements is compiled with the /STANDARD or /CHECK qualifiers.

Given these circumstances, the compiler is able to detect most instances of nonconforming usage. It does not detect all instances because the /STANDARD qualifier does not produce checks for all nonconforming usage at compile time. In general, the unchecked cases of nonconforming usage arise from the following situations:

  • The standard violation results from conditions that cannot be checked at compile time.
  • The compile-time checking is prone to false alarms.

Most of the unchecked cases occur in the interface between calling and called subprograms. However, other cases are not checked, even within a single subprogram.

The following items are known to be unchecked:

  • Use of a data item prior to defining it
  • Use of the SAVE statement to ensure that data items or common blocks retain their values when reinvoked
  • Association of character data items on the right and left sides of character assignment statements
  • Mismatch in order, number, or type in passing actual arguments to subprograms with implicit interfaces
  • Association of one or more actual arguments with a data item in a common block when calling a subprogram that assigns a new value to one or more of the arguments

For More Information:

On the HP Fortran language, see the HP Fortran for OpenVMS Language Reference Manual.

2.3.46 /SYNCHRONOUS_EXCEPTIONS --- Report Exceptions More Precisely (Alpha only)

The /SYNCHRONOUS_EXCEPTIONS qualifier associates an exception with the instruction that causes it. Specifying /SYNCHRONOUS_EXCEPTIONS slows program execution, you should specify it only when debugging a specific problem, such as locating the source of an exception.

If you omit /SYNCHRONOUS_EXCEPTIONS, /NOSYNCHRONOUS_EXCEPTIONS is used where exceptions can be reported imprecisely one or more instructions after the instruction that caused the exception.

Specifying /IEEE_MODE=FAST (default) provides imprecise exception reporting (same as /NOSYNCHRONOUS_EXCEPTIONS). Specifying other /IEEE_MODE keywords (when you also specify /FLOAT=IEEE_FLOAT) provides precise exception reporting (same as /SYNCHRONOUS_EXCEPTIONS on Alpha systems).

Note that floating-point exceptions are always synchronous on EV6 and later processors, regardless of whether /SYNCHRONOUS_EXCEPTIONS is used.

For More Information:

  • On run-time arithmetic exception handling (/IEEE_MODE qualifier), see Section 2.3.24.
  • On controlling run-time arithmetic exception messages (/CHECK=FP_EXCEPTIONS qualifier), see Section 2.3.11.
  • On the Alpha architecture and instruction pipelining, see the Alpha Architecture Reference Manual.


Previous Next Contents Index