For detailed information about extensions and language features, see the Fortran langauge reference manual, which visually shows extensions of the FORTRAN-77 standard.
Note
The Digital Fortran for OpenVMS Alpha product supports most of the FORTRAN-77 language extensions supported by DEC Fortran for OpenVMS Alpha and the ISO/ANSI Fortran 90 standard. For information on compatibility, see the DEC Fortran 90 User Manual for OpenVMS Alpha Systems.
The remainder of this section summarizes language features specific to
Digital Fortran 77 for OpenVMS VAX Systems and Digital Fortran for OpenVMS Alpha, language
features that are shared but interpreted differently in each language,
Digital Fortran for OpenVMS Alpha restrictions that do not apply to Digital Fortran 77 for
OpenVMS VAX Systems, and data porting considerations.
11.4.1.1 Language Features Specific to Digital Fortran for OpenVMS Alpha
The following language features are available in Digital Fortran for OpenVMS Alpha but are not supported in Digital Fortran 77 for OpenVMS VAX Systems Version 6.4:
Note
When you use the Digital Fortran 90 compiler, certain features associated with the ANSI/ISO Fortran 90 standard are not available in Digital Fortran 77.
For an explanation of Digital Fortran language features, see the
Fortran language reference manual.
11.4.1.2 Language Features Specific to Digital Fortran 77 for OpenVMS VAX Systems
The following language features are available in Digital Fortran 77 for OpenVMS VAX Systems but are not supported in Digital Fortran for OpenVMS Alpha:
ASSIGN
CLOSE ERRSET |
ERRTST
FDBSET IRAD50 |
RAD50
R50ASC USEREX |
Certain Digital Fortran 77 for OpenVMS VAX Systems features have restricted use or are not available in Digital Fortran for OpenVMS Alpha:
SUBROUTINE F_INIT (A, N) REAL A(N) RETURN ENTRY F_DO_IT (X, I) A (I) = X ! No: A no longer visible RETURN END
The following language features are available in Digital Fortran 77 for OpenVMS VAX Systems but are not supported in Digital Fortran for OpenVMS Alpha because of differences between the Alpha architecture and the VAX architecture:
The following language features are interpreted differently between Digital Fortran 77 for OpenVMS VAX Systems and Digital Fortran for OpenVMS Alpha:
CHARACTER*(*) FMT2 PARAMETER (FMT2='(10Habcdefghij)') READ (5, FMT2) WRITE (6, FMT2)
READ (5, '(10Habcdefghij)') WRITE (6, '(10Habcdefghij)')
While Digital Fortran for OpenVMS Alpha and Digital Fortran 77 for OpenVMS VAX Systems share most qualifiers, some qualifiers are specific to each platform. This section summarizes the differences between Digital Fortran for OpenVMS Alpha and Digital Fortran 77 for OpenVMS VAX Systems command line qualifiers.
For complete details about the Digital Fortran for OpenVMS Alpha compilation command and options, see the DEC Fortran User Manual for OpenVMS AXP Systems. For complete details about the Digital Fortran 77 for OpenVMS VAX Systems compilation command and options, see the DEC Fortran User Manual for OpenVMS VAX Systems.
To initiate compilation on either VAX or Alpha systems, use the FORTRAN
command. On Alpha systems, use the F90 command to initiate compilation
using the Digital Fortran 90 compiler.
11.4.2.1 Qualifiers Specific to Digital Fortran for OpenVMS Alpha
Table 11-7 lists Digital Fortran for OpenVMS Alpha compiler qualifiers that have no equivalent Digital Fortran 77 for OpenVMS VAX Systems options and are not supported in Digital Fortran 77 for OpenVMS VAX Systems Version 6.4.
Qualifier | Description |
---|---|
/BY_REF_CALL | Allows character constant actual arguments to be associated with numeric dummy arguments (allowed by DEC Fortran for OpenVMS VAX Systems). |
/CHECK=FP_EXCEPTIONS | Controls whether messages about IEEE floating-point exceptional values are reported at run time. |
/DOUBLE_SIZE | Makes DOUBLE PRECISION declarations REAL*16 instead of REAL*8. |
/FAST | Sets several qualifiers that improve run-time performance. |
/FLOAT | Controls the format used for floating-point data (REAL or COMPLEX) in memory, including the selection of either VAX F_floating or IEEE S_floating for KIND=4 data and VAX G_floating, VAX D_floating, or IEEE T_floating for KIND=8 data. Digital Fortran 77 for OpenVMS VAX Systems provides the /[NO]G_FLOATING qualifier. |
/GRANULARITY | Controls the granularity of data access for shared data. |
/IEEE_MODE | Controls how floating-point exceptions are handled for IEEE data. |
/INTEGER_SIZE | Controls the size of INTEGER and LOGICAL declarations. |
/NAMES | Controls whether external names are converted to uppercase, lowercase, or as is. |
/OPTIMIZE | The /OPTIMIZE qualifier supports the INLINE keyword, the LOOPS keyword, the TUNE keyword, the UNROLL keyword, and software pipelining. |
/REAL_SIZE | Controls the size of REAL and COMPLEX declarations. |
/ROUNDING_MODE | Controls how floating-point calculations are rounded for IEEE data. |
/SEPARATE_COMPILATION |
Controls whether the DEC Fortran compiler:
|
/SYNTAX_ONLY | Requests that only syntax checking occurs and no object file is created. |
/WARNINGS | Certain keywords are not available on Digital Fortran 77 for OpenVMS VAX Systems. |
/VMS | Requests that Digital Fortran use certain Digital Fortran 77 for OpenVMS VAX Systems conventions. |
This section summarizes Digital Fortran 77 for OpenVMS VAX Systems compiler qualifiers that have no equivalent Digital Fortran for OpenVMS Alpha qualifiers.
Table 11-8 lists compilation qualifiers specific to Digital Fortran 77 for OpenVMS VAX Systems Version 6.4.
Digital Fortran for 77 OpenVMS VAX Systems Qualifier | Description |
---|---|
/BLAS=(INLINE,MAPPED) | Specifies whether Digital Fortran 77 for OpenVMS VAX Systems recognizes and inlines or maps the Basic Linear Algebra Subroutines (BLAS). Available only in Digital Fortran 77 for OpenVMS VAX Systems. |
/CHECK=ASSERTIONS | Enables or disables assertion checking. Available only in Digital Fortran 77 for OpenVMS VAX Systems. |
/DESIGN=[NO]COMMENTS
/DESIGN=[NO]PLACEHOLDERS |
Analyzes program for design information. |
/DIRECTIVES=DEPENDENCE | Specifies whether specified compiler directives are used at compilation. Available only in Digital Fortran 77 for OpenVMS VAX Systems. |
/PARALLEL=(MANUAL or AUTOMATIC) | Supports parallel processing. |
/SHOW=(DATA_DEPENDENCIES,DICTIONARY,LOOPS) |
Control whether the listing file includes:
The keywords DATA_DEPENDENCIES and LOOPS are available only in Digital Fortran 77 for OpenVMS VAX Systems. |
/VECTOR | Requests vector processing. Available only in Digital Fortran 77 for OpenVMS VAX Systems. |
/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. Available only in Digital Fortran 77 for OpenVMS VAX Systems. |
All CPAR$ directives and certain CDEC$ directives associated with directed (manual) decomposition and their associated qualifiers or keywords are specific to Digital Fortran 77 for OpenVMS VAX Systems, as described in the DEC Fortran Language Reference ManualDEC Fortran Language Reference Manual.
For details about the Digital Fortran 77 for OpenVMS VAX Systems
compilation commands and options, see the DEC Fortran User Manual for OpenVMS VAX Systems.
11.4.3 Interoperability with Translated Shared Images
Using Digital Fortran for OpenVMS Alpha, you can create images that can interoperate with translated images at image activation (run time).
To allow the use of translated shared images:
The created executable image contains code that allows the resulting executable image to interoperate with shared images, including allowing the Digital Fortran 77 for OpenVMS VAX Systems RTL (FORRTL) to work with the Digital Fortran for OpenVMS Alpha RTL (DEC$FORTRTL). The native (Digital Fortran for OpenVMS Alpha RTL) and translated (Digial Fortran 77 for OpenVMS VAX Systems RTL) programs can perform I/O to the same unit number, as long as the RTL that opens the file also closes it.
Programs should use the intrinsic names (without the prefix) rather
than calling routines by their complete (fac$xxxx)
name. One allowable exception to using fac$xxxx names is that
translated image programs declare the FOR$RAB system function as
EXTERNAL. Native Alpha programs should use FOR$RAB as an intrinsic
function.
11.4.4 Porting Digital Fortran 77 for OpenVMS VAX Systems Data
Record types are identical for Digial Fortran 77 for OpenVMS VAX Systems and Digital Fortran for OpenVMS Alpha. If needed, transport the data using the EXCHANGE command with the /NETWORK and /TRANSFER=BLOCK qualifiers. To convert the file to Stream_LF format during the copy operation, use /TRANSFER=(BLOCK,RECORD_SEPARATOR=LF) instead of /TRANSFER=BLOCK, or specify the /FDL qualifier to the EXCHANGE command to change the record type or other file characteristics.
If you need to convert unformatted floating-point data, keep in mind that Digital Fortran 77 for OpenVMS VAX programs (VAX hardware) store REAL*4 or COMPLEX*8 data in F_floating format, REAL*8, REAL*16, or COMPLEX*16 data in either D_floating or G_floating format, and REAL*16 data in H_floating format. Digital Fortran for OpenVMS Alpha programs (running on Alpha hardware) store REAL*4, REAL*8, REAL*16, COMPLEX*8, and COMPLEX*16 data in one of the formats shown in Table 11-9.
Data Declaration | VAX Formats | Alpha Formats |
---|---|---|
REAL*4 and COMPLEX*8 | VAX F_floating format | IEEE S_floating or VAX F_floating format |
REAL*8 and COMPLEX*16 | VAX D_floating or G_floating format | IEEE T_floating, VAX D_floating¹, or VAX G_floating format |
REAL*16 | VAX H_floating | X_floating. Requires conversion, perhaps using the /CONVERT qualifier or associated OPTION statement, logical name, or OPEN statement /CONVERT keyword. You can also use the RTL routine CVT$CONVERT_FLOAT. |
This section compares DEC Pascal to other Digital Pascal compilers
and lists the differences between DEC Pascal on VAX and Alpha
systems. For a complete description of these features, see the
DEC Pascal Language Reference Manual.
11.5.1 New Features of DEC Pascal
Table 11-10 lists features not previously supplied in VAX Pascal.
Feature | Description |
---|---|
Support for OpenVMS systems | Including all the data types available on the OpenVMS platforms. |
Redefinable values for predeclared constants | Values for MAXINT, MAXUNSIGNED, MAXREAL, MINREAL, EPSREAL are defined by the platform and the compiler switches for specifying the integer size and floating-point format. |
An optional quoted parameter to the COMMON, EXTERNAL, GLOBAL, PSECT, WEAK_EXTERNAL, and WEAK_GLOBAL attributes | Allows you to pass an unmodified identifier to the linker. |
Double-quoted strings | DEC Pascal now accepts the double-quote characters as string and character delimiters. |
Embedded string values | Inside of double-quoted strings, DEC Pascal now supports constant characters specified with a backslash as in the C programming language, such as ""\n"" for the linefeed character. |
Additional data types and values | DEC Pascal now supports these data types: ALFA, CARDINAL, CARDINAL16, CARDINAL32, INTEGER16, INTEGER32, INTEGER64, INTSET, POINTER, UNIV_PTR, UNSIGNED16, UNSIGNED32, and UNSIGNED64. |
Assignment of UNSIGNED values to INTEGER variables | DEC Pascal now allows UNSIGNED values to be assignment-compatible with INTEGER variables and array indices. |
Assignment of string values into unpacked arrays of characters | DEC Pascal now allows ARRAY of CHAR variables to be treated as fixed-length character strings. |
Additional statements | DEC Pascal now supports these statements: BREAK, CONTINUE, EXIT, NEXT, and RETURN. |
Additional predeclared routines | DEC Pascal now supports these functions and procedures: ADDR, ARGC, ARGV, ASSERT, BITAND, BITNOT, BITOR, BITXOR, HBOUND, LBOUND, FIRST, FIRSTOF, LAST, LASTOF, IN_RANGE, LSHIFT, RSHIFT, LSHFT, RSHFT, MESSAGE, NULL, RANDOM, SEED, REMOVE, SIZEOF, SYSCLOCK, and WALLCLOCK. |
Optional second parameter to RESET, REWRITE, and EXTEND | DEC Pascal now accepts a second parameter that is a literal string expression for the file name to be associated with the file variable. |
Compiler command switches | DEC Pascal now includes switches that allow you to specify the storage and alignment allocation for data types. You can also specify the level of optimization with a switch. On Alpha systems, an option controls the default meaning of the REAL and DOUBLE data types. Arguments to the usage switch enable messages relating to alignment, alignment compatibility on different platforms, and features that are not available on a specified platform. |
DEC Pascal provides the built-in routines, ESTABLISH and REVERT, to use
in place of LIB$ESTABLISH. If you declare and try to use LIB$ESTABLISH,
you will get a compile-time warning.
11.5.3 Modifying Default Alignment Rules for Record Fields
DEC Pascal allows you to override field alignment and position with
the POS, ALIGNED, and DATA attributes and the data compiler switch.
11.5.4 Recommended Use of Predeclared Identifiers
Although for backward compatibility DEC Pascal compiles programs that include the predeclared identifiers listed in Table 11-11, Digital recommends that you use the listed replacements.
Identifier | Recommended Usage |
---|---|
ADDR | Use the ADDRESS function |
ALFA | Equivalent to TYPE ALFA = PACKED ARRAY [1..10]OF CHAR |
BITAND | Equivalent to the UAND statement |
BITNOT | Equivalent to the UNOT statement |
BITOR | Equivalent to the UOR statement |
BITXOR | Equivalent to the UXOR statement |
EXIT | Equivalent to the BREAK statement |
FIRST, FIRSTOF | Equivalent to the LOWER function |
HBOUND | Equivalent to the UPPER function |
IN_RANGE | Useful only when subrange checking is disabled. IN_RANGE(X) is equivalent to (X=>LOWER(X))AND(X <=UPPER(X)). |
INTSET | Equivalent to TYPE INTSET = SET OF 0 .. 255; |
LAST, LASTOF | Equivalent to the UPPER function |
LBOUND | Equivalent to the LOWER function |
LSHFT | Equivalent to the LSHIFT function |
MESSAGE | Equivalent to WRITELN(ERR,expression) |
NEXT | Equivalent to the CONTINUE statement |
NULL | Equivalent to the empty statement |
REMOVE | Equivalent to the DELETE_FILE procedure |
RSHFT | Equivalent to the RSHIFT function |
SIZEOF | Equivalent to the SIZE function |
STLIMIT | Compiles but does not return an error |
UNIV_PTR | Equivalent to TYPE UNIV_PTR = POINTER; |
DEC Pascal can use an environment file only on the same platform (the combination of operating system and hardware) on which it was compiled.
In addition, the following lists features of DEC Pascal supplied only on VAX systems:
The following lists features of DEC Pascal supplied only on Alpha systems:
This section describes features that are supported, but not
recommended, by Digital. They are provided only for compatibility with
other Digital Pascal compilers.
11.5.6.1 /OLD_VERSION Qualifier
The /OLD_VERSION qualifier directed the compiler to resolve differences
between VAX Pascal Version 1.0 and subsequent versions by using the VAX
Pascal Version 1.0 definition of the language. The qualifier is
provided so that existing programs continue to work.
11.5.6.2 /G_FLOATING Qualifier
The /G_FLOATING qualifier directs the compiler to use the G_floating representation and instructions for values of type DOUBLE. The [[NO]G_FLOATING] attribute can be specified on both OpenVMS VAX and OpenVMS Alpha systems.
6459P014.HTM OSSG Documentation 22-NOV-1996 13:07:26.23
Copyright © Digital Equipment Corporation 1996. All Rights Reserved.