[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP Fortran for OpenVMS
User Manual


Previous Contents Index


PARAMETER ( X = 4.0 / 0.0 )

For More Information:

  • On passing arguments and returning function values between HP Fortran and Compaq Fortran 77, see Section 10.9.
  • On HP Fortran procedure calling and argument passing, see Section 10.2.
  • On the HP Fortran language, see the HP Fortran for OpenVMS Language Reference Manual.

B.5 Compiler Command-Line Differences

This section summarizes the differences between HP Fortran and Compaq Fortran 77 for OpenVMS Systems command lines.

The following commands initiate compilation on OpenVMS systems:

Platform Language Command
OpenVMS I64 systems HP Fortran FORTRAN
OpenVMS Alpha systems HP Fortran FORTRAN
OpenVMS Alpha systems Compaq Fortran 77 FORTRAN/OLD_F77
OpenVMS VAX systems Compaq Fortran 77 FORTRAN

Most qualifiers are the same between HP Fortran for OpenVMS Alpha systems and Compaq Fortran 77 for OpenVMS Alpha systems.

B.5.1 Qualifiers Not Available on OpenVMS VAX Systems

Table B-2 lists HP Fortran compiler qualifiers that have no equivalent Compaq Fortran 77 Version 6.4 for OpenVMS VAX Systems qualifiers.

Table B-2 HP Fortran Qualifiers Without Equivalents in Compaq Fortran 77 for OpenVMS VAX Systems
Qualifier Description
/ALIGNMENT=
[NO]SEQUENCE
Specifies that components of derived types with the SEQUENCE attribute will obey whatever alignment rules are currently in use (see Section 2.3.3).
/ANNOTATION Controls whether an annotated listing showing optimizations is included with the listing file (see Section 2.3.5).
/ARCHITECTURE= keyword Specifies the type of Alpha architecture code instructions generated for a particular program unit being compiled (see Section 2.3.6).
/ASSUME=ALT_PARAM 1 Allows the alternate syntax for PARAMETER statements. The alternate form has no parentheses surrounding the list, and the form of the constant, rather than implicit or explicit typing, determines the data type of the variable (see Section 2.3.7).
/ASSUME=FP_CONSTANT 1 Controls whether constants are evaluated in single or double precision (see Section 2.3.7). Compaq Fortran 77 always evaluates single-precision constants in double precision.
/ASSUME=MINUS0 1 Controls whether the compiler uses Fortran 95 standard semantics for the IEEE floating-point value of -0.0 (minus zero) in the SIGN intrinsic, if the processor is capable of distinguishing the difference between -0.0 and +0.0 (see Section 2.3.7).
/ASSUME=PROTECT_CONSTANTS Specifies whether constant actual arguments can be changed (see Section 2.3.7).
/BY_REF_CALL Allows character constant actual arguments to be associated with numeric dummy arguments (allowed by Compaq Fortran 77 for OpenVMS VAX Systems; see Section 2.3.9).
/CHECK=ARG_INFO (I64 only) Controls whether run-time checking of the actual argument list occurs (see Section 2.3.11).
/CHECK=ARG_TEMP_CREATED Issues a run-time warning message and continues execution if a temporary is created for an array actual argument (see Section 2.3.11).
/CHECK=FP_EXCEPTIONS Controls whether messages about IEEE floating-point exceptional values are reported at run time (see Section 2.3.11).
/CHECK=FP_MODE (I64 only) Controls whether run-time checking of the current state of the processor's floating-point status register (FPSR) occurs (see Section 2.3.11).
/CHECK=POWER Controls whether the compiler evaluates and returns a result for certain arithmetic expressions containing floating- point numbers and exponentiation (see Section 2.3.11).
/DOUBLE_SIZE Makes DOUBLE PRECISION declarations REAL (KIND=16) instead of REAL (KIND=8) (see Section 2.3.17).
/FAST Sets several qualifiers that improve run-time performance (see Section 2.3.21).
/FLOAT Controls the format used for floating-point data (REAL or COMPLEX) in memory, including the selection of either VAX F_float or IEEE S_float for KIND=4 data and VAX G_float, VAX D_float, or IEEE T_float for KIND=8 data (see Section 2.3.22). Compaq Fortran 77 for OpenVMS VAX Systems provides the /[NO]G_FLOAT qualifier.
/GRANULARITY Controls the granularity of data access for shared data (see Section 2.3.23).
/IEEE_MODE Controls how floating-point exceptions are handled for IEEE data (see Section 2.3.24).
/INTEGER_SIZE Controls the size of INTEGER and LOGICAL declarations (see Section 2.3.26).
/MODULE Controls where module files (.F90$MOD) are placed. If you omit this qualifier or specify /NOMODULE, the .F90$MOD files are placed in your current default directory (see Section 2.3.31).
/NAMES Controls whether external names are converted to uppercase, lowercase, or as is (see Section 2.3.32).
/OPTIMIZE Most keywords are not available on Compaq Fortran 77 for OpenVMS VAX Systems, including INLINE, LOOPS, PIPELINE, TUNE, and UNROLL (see Section 2.3.35).
/REAL_SIZE Controls the size of REAL and COMPLEX declarations (see Section 2.3.37).
/REENTRANCY Specifies whether code generated for the main program and Fortran procedures it calls will rely on threaded or asynchronous reentrancy (see Section 2.3.39).
/ROUNDING_MODE Controls how floating-point calculations are rounded for IEEE data (see Section 2.3.40).
/SEPARATE_COMPILATION Controls whether the HP Fortran compiler:
  • Places individual compilation units as separate modules in the object file like Compaq Fortran 77 for OpenVMS VAX Systems (/SEPARATE_COMPILATION)
  • Groups compilation units as a single module in the object file (/NOSEPARATE_COMPILATION, the default), which allows more interprocedure optimizations.

For more information, see Section 2.3.41.

/SEVERITY 1 Changes compiler diagnostic warning messages to have a severity of error instead of warning (see Section 2.3.42).
/SOURCE_FORM Controls whether the compiler expects free or fixed form source (see Section 2.3.44).
/STANDARD Flags extensions to the Fortran 90 or Fortran 95 standards (see Section 2.3.45).
/SYNTAX_ONLY Requests that only syntax checking occurs and no object file is created (see Section 2.3.47).
/WARNINGS Certain keywords are not available on Compaq Fortran 77 for OpenVMS VAX Systems (see Section 2.3.51).
/VMS Requests that HP Fortran use certain Compaq Fortran 77 for OpenVMS VAX Systems conventions (see Section 2.3.50).

1This qualifier applies only to HP Fortran and does not apply to Compaq Fortran 77 on any platform.

B.5.2 Qualifiers Specific to Compaq Fortran 77 for OpenVMS VAX Systems

This section summarizes Compaq Fortran 77 for OpenVMS VAX Systems compiler options that have no equivalent HP Fortran options.

Table B-3 lists compilation options that are specific to Compaq Fortran 77 for OpenVMS VAX Systems Version 6.4.

Table B-3 Compaq Fortran 77 for OpenVMS VAX Systems Options Not in HP Fortran
Compaq Fortran 77 for OpenVMS VAX Systems Qualifier Description
/BLAS=(INLINE,MAPPED) Specifies whether Compaq Fortran 77 for OpenVMS VAX Systems recognizes and inlines or maps the Basic Linear Algebra Subroutines (BLAS).
/CHECK=ASSERTIONS Enables or disables assertion checking.
/DESIGN=[NO]COMMENTS
/DESIGN=[NO]PLACEHOLDERS
Analyzes program for design information.
/DIRECTIVES=DEPENDENCE Specifies whether specified compiler directives are used at compilation.
/PARALLEL=(MANUAL or
AUTOMATIC)
Supports parallel processing.
/SHOW=(DATA_DEPENDENCIES,
LOOPS)
Control whether the listing file includes:
  • Diagnostics about loops that are ineligible for dependence analysis and data dependencies that inhibit vectorization or autodecomposition (DATA_DEPENDENCIES)
  • Reports about loop structures after compilation (LOOPS)
/VECTOR Requests vector processing.
/WARNINGS=INLINE Controls whether the compiler prints informational diagnostic messages when it is unable to generate inline code for a reference to an intrinsic routine. Other /WARNINGS keywords are only available with Compaq Fortran 77 for OpenVMS VAX Systems, including TRUNCATED_SOURCE.

All CPAR$ directives and certain CDEC$ directives associated with directed (manual) decomposition and their associated qualifiers or keywords are also specific to Compaq Fortran 77 for OpenVMS VAX Systems.

For More Information:

  • On the FORTRAN command and qualifiers, see Chapter 2.
  • On the Compaq Fortran 77 compilation commands and options, see the appropriate Compaq Fortran 77 user manual.

B.6 Interoperability with Translated Shared Images

HP Fortran provides the ability to interoperate with translated shared images. That is, when creating a native HP Fortran image, you can add certain qualifiers to the FORTRAN and LINK command lines to allow the resulting image to interoperate with translated shared images at image activation (run time).

To allow the use of translated shared images:

  • On the FORTRAN command line, specify the /TIE qualifier.
  • On the LINK command line, specify the /NONATIVE_ONLY qualifier (default).

The created executable image contains code that allows the resulting executable image to interoperate with shared (installed) images, including allowing the Compaq Fortran 77 for OpenVMS VAX Systems RTL (FORRTL_TV) to work with the HP Fortran RTL (DEC$FORRTL).

For More Information:

On porting, see Migrating an Application from OpenVMS VAX to OpenVMS Alpha.

B.7 Porting Compaq Fortran 77 for OpenVMS VAX Systems Data

Record types are identical for Compaq Fortran 77 on OpenVMS VAX Systems and HP Fortran on OpenVMS I64 or OpenVMS Alpha systems.

If you need to convert unformatted floating-point data, keep in mind that Compaq Fortran 77 for OpenVMS VAX Systems programs (VAX hardware) stores:

  • REAL*4 or COMPLEX*8 data in F_float format
  • REAL*8 or COMPLEX*16 data in either D_float or G_float format
  • REAL*16 data in H_float format.

HP Fortran programs (running on OpenVMS I64 or OpenVMS Alpha systems) store REAL*4, REAL*8, COMPLEX*8, and COMPLEX*16 data in one of the formats shown in Table B-4 and REAL*16 data in X_float format.

Table B-4 Floating-Point Data Formats on OpenVMS VAX and OpenVMS I64 and Alpha Systems
Data Declaration OpenVMS VAX Formats OpenVMS I64 and Alpha Formats
REAL*4 and COMPLEX*8 VAX F_float VAX F_float or IEEE S_float
REAL*8 and COMPLEX*16 VAX D_float or VAX G_float VAX D_float 1, VAX G_float, or IEEE T_float
REAL*16 VAX H_float X_float format. You can convert VAX H_float REAL*16 data to Alpha X_float format.

1The D_float format on I64 and Alpha systems has less precision during computations than on VAX systems.

The floating-point data types supported by HP Fortran on OpenVMS systems are described in Chapter 8.

Example B-1 shows the use of the CVT$CONVERT_FLOAT RTL routine to convert VAX S_float data to VAX F_float format. This allows the converted value to be used as an argument to the LIB$WAIT routine.

The parameter definitions used in the CVT$CONVERT_FLOAT argument list (such as CVT$K_IEEE_S) are included from the $CVTDEF library module in FORSYSDEF. The S_float value read as an argument is contained in the variable F_IN; the F_float value is returned by CVT$CONVERT_FLOAT to variable F_OUT.

Example B-1 Using the CVT$CONVERT_FLOAT Routine

! This program converts IEEE S_float data to VAX F_float format
!
! Compile with:   $  F90/FLOAT=IEEE_FLOAT
!
    PROGRAM CONVERT
    INCLUDE '($CVTDEF)'
    REAL(KIND=4)  F_IN
    REAL(KIND=4)  F_OUT
    INTEGER ISTAT

    F_IN = 20.0

    PRINT *,' Sample S_float input value is ', F_IN

    ISTAT=CVT$CONVERT_FLOAT(F_IN, %VAL(CVT$K_IEEE_S), F_OUT, &
              %VAL(CVT$K_VAX_F), %VAL(CVT$M_ROUND_TO_NEAREST))

    PRINT *,'Return status ISTAT',ISTAT

!   IF (.NOT. ISTAT) CALL LIB$SIGNAL(%VAL(ISTAT))

    PRINT *, ' Waiting for specified time '

    CALL LIB$WAIT (F_OUT)
    STOP
    END PROGRAM CONVERT

B.8 VAX H_float Representation

This section describes the REAL*16 VAX H_float data formats used on OpenVMS VAX systems. On OpenVMS I64 and OpenVMS Alpha systems, REAL*16 (extended precision) data is always stored in IEEE X_float format.

With VAX floating-point data types, the binary radix point is to the left of the most-significant bit.

The REAL*16 H_float format is available only on OpenVMS VAX systems; REAL*16 on OpenVMS I64 and OpenVMS Alpha systems use X_float format (see Section 8.4.4).

As shown in Figure B-1, REAL*16 H_float data is 16 contiguous bytes starting on an arbitrary byte boundary. The bits are labeled from the right, 0 through 127.

Figure B-1 VAX H_float REAL*16 Representation (VAX Systems)


The form of a REAL*16 (H_float) data is sign magnitude with bit 15 the sign bit, bits 14:0 an excess 16384 binary exponent, and bits 127:16 a normalized 113-bit fraction with the redundant most significant fraction bit not represented.

The value of H_float data is in the approximate range 0.84*10**--4932 through 0.59*10**4932. The precision of H_float data is approximately one part in 2**112 or typically 33 decimal digits.


Appendix C
Diagnostic Messages

This appendix describes:

C.1 Overview of Diagnostic Messages

Diagnostic messages related to an HP Fortran program can come from the compiler, the linker, or the HP Fortran run-time system:

  • The HP Fortran compiler detects syntax errors in the source program, such as unmatched parentheses, invalid characters, misspelled specifiers, and missing or invalid parameters. HP Fortran compiler messages are described in Section C.2.
  • The linker detects errors in object file format and source program errors such as undefined symbols. Linker messages are described in the OpenVMS System Messages and Recovery Procedures Reference Manual. Or you can use the DCL command HELP/MESSAGE.
  • The HP Fortran run-time system reports errors that occur during program execution. HP Fortran run-time messages are listed and described in Section C.3 and DCL HELP (enter HELP FORTRAN).

These messages are displayed on your terminal or in your log file. The format of the messages is:


%facility-severity-mnemonic, message_text

The contents of the fields of information in diagnostic messages are as follows:

% The percent sign identifies the line as a message.
facility A 2-, 3-, or 4-letter facility code that identifies the origin of the message, whether it came from the compiler (F90), the linker (LINK), or the run-time system (FOR, SS, or MTH).
severity A single character that determines message severity. The four levels of error message severity are: Fatal (F), Error (E), Warning (W), and Informational (I). The definition of each severity level depends on the facility issuing the message.
mnemonic A 6- to 9-character name that uniquely identifies that message.
message_text Explains the event that caused the message to be generated.

C.2 Diagnostic Messages from the HP Fortran Compiler

A diagnostic message issued by the compiler describes the detected error and, in some cases, contains an indication of the action taken by the compiler in response to the error.

Besides reporting errors detected in source program syntax, the compiler issues messages indicating errors that involve the compiler itself, such as I/O errors.

C.2.1 Source Program Diagnostic Messages

The severity level of source program diagnostic messages, in order of greatest to least severity, are as follows:

Severity Code Description
F Fatal; must be corrected before the program can be compiled. No object file is produced if an F-severity error is detected during compilation.
E Error; should be corrected. No object file is produced if an F-severity error is detected during compilation.
W Warning; should be investigated by checking the statements to which W-severity diagnostic messages apply. Warnings are issued for statements that use acceptable, but nonstandard, syntax and for statements corrected by the compiler. An object file is produced, but the program results may be incorrect.

Note that W-severity messages are produced unless the /NOWARNINGS qualifier is specified in the FORTRAN command.

I Information; not an error message and does not call for corrective action. However, the I-severity message informs you that either a correct HP Fortran statement may have unexpected results or you have used an HP Fortran extension to the Fortran 90 or Fortran 95 standard.

Typing mistakes are a likely cause of syntax errors; they can cause the compiler to generate misleading diagnostic messages. Beware especially of the following:

  • Missing comma or parenthesis in a complicated expression or FORMAT statement.
  • Misspelled variable names or (depending on the compilation qualifiers used) case-mismatched variable names. The compiler may not detect this error, so execution can be affected.
  • Inadvertent line continuation mark. This can cause a diagnostic message for the preceding line.
  • When compiling using fixed-form source files, if the statement line extends past column 72, this can cause the statement to terminate early (unless you specified the /EXTEND_SOURCE qualifier).
  • Confusion between the digit 0 and the uppercase letter O. This can result in variable names that appear identical to you but not to the compiler.
  • Nonprinting ASCII characters encountered in HP Fortran programs are generally interpreted as a space character and a warning message appears. For more information on valid nonprinting space characters, see Section 2.3.28.

Because a diagnostic message indicates only the immediate cause, you should always check the entire source statement carefully.

The following examples show how source program diagnostic messages are displayed in interactive mode on your screen.


  40    FORMAT (I3,)
..................^
%F90-E-ERROR, An extra comma appears in the format list.
at line number 13 in file DISK$:[USER]SAMP_MESS.FOR;4

        GO TO 66
..............^
%F90-E-ERROR, This label is undefined.   [66]
at line number 18 in file DISK$:[USER]SAMP_MESS.FOR;4

Example C-1 shows how these messages appear in listings.

Example C-1 Sample Diagnostic Messages (Listing Format)


MORTGAGE                   30-MAR-1995 14:19:21   HP Fortran Xn.n-xxx   Page  1
                           30-MAR-1995 14:18:48   DISK$:[USER]SAMP_MESS.F90;1

      1 !     Program to calculate monthly mortgage payments
      2
      3       PROGRAM MORTGAGE
      4
      5       TYPE 10
      6   10  FORMAT (' ENTER AMOUNT OF MORTGAGE ')
      7       ACCEPT 20, IPV
      8   20  FORMAT (I6)
      9
     10       TYPE 30
     11   30  FORMAT (' ENTER LENGTH OF MORTGAGE IN MONTHS ')
     12       ACCEPT 40, IMON
     13   40  FORMAT (I3,)
        ................1
%F90-E-ERROR, An extra comma appears in the format list.
at line number 13 in file DISK$:[USER]SAMP_MESS.F90;1
     14       TYPE 50
     15   50  FORMAT (' ENTER ANNUAL INTEREST RATE ')
     16       ACCEPT 60, YINT
     17   60  FORMAT (F6.4)
     18       GO TO 66
        ............1
%F90-E-ERROR, This label is undefined.   [66]
at line number 18 in file DISK$:[USER]SAMP_MESS.F90;1
     19   65  YI = YINT/12     ! Get monthly rate
     20       IMON = -IMON
     21       FIPV = IPV * YI
     22       YI = YI + 1
     23       FIMON = YI**IMON
     24       FIMON = 1 - FIMON
     25       FMNTHLY = FIPV/FIMON
     26
     27       TYPE 70, FMNTHLY
     28   70  FORMAT (' MONTHLY PAYMENT EQUALS ',F7.3 )
     29       STOP
     30       END PROGRAM MORTGAGE


Previous Next Contents Index