DIGITAL Fortran 90
User Manual for
DIGITAL
UNIX Systems
A.2.4 Compiler Command-Line Differences
DIGITAL Fortran 77 (
f77
command) and DIGITAL Fortran 90 (
f90
command) share most of the same command-line options. The following
options are provided only by DIGITAL Fortran 77 (not by DIGITAL Fortran
90):
-
-assume backslash
-
-fpp
-
-noident
-
-show xref
(same as
-cross_reference
)
-
-stand keyword
-
-warn informational
-
-warn uncalled
-
-warn unused
-
-warn nounreachable
The following options are provided only by DIGITAL Fortran 90 (not by
DIGITAL Fortran 77):
-
-fpconstant
-
-fuse_xref
-
-hpf_matmul
-
-ladebug
-
-mp
-
-nowsf_main
-
-omp
-
-wsf
and associated HPF parallel options, including
-assume nozsize
,
-nearest_neighbor
,
-show hpf
, and
-pprof method
-
-std
(performs Fortran 90 standards checking, whereas the DIGITAL Fortran 77
-stand keyword
performs FORTRAN-77 and NTT MIA standards checking)
A.3 Language Compatibility with DIGITAL Visual Fortran
The following language features found in DIGITAL Visual Fortran (and
Microsoft® Fortran Powerstation Version 4) are now supported by
DIGITAL Fortran on DIGITAL UNIX systems:
- # Constants. Constants using a base other than 10.
- C Strings. NULL terminated strings contain C-style escape sequences.
- Conditional Compilation And Metacommand Expressions ($define,
$undefine, $if, $elseif, $else, $endif).
- $FREEFORM, $NOFREEFORM, $FIXEDFORM. Source file format
- $INTEGER, $REAL. Selects size.
- $FIXEDFORMLINESIZE. Line length for fixed form source.
- $STRICT, $NOSTRICT. F90 conformance.
- $PACK. Structure packing.
- $ATTRIBUTES ALIAS. External name for a subprogram or common block.
- $ATTRIBUTES C, STDCALL. Calling and naming conventions.
- $ATTRIBUTES VALUE, REFERENCE. Calling conventions.
- \ Descriptor. Prevents writing an end-of-record mark.
- Ew.dDe and Gw.dDe Edit Descriptors. Similar to Ew.dEe and Gw.dEe.
- 7200 Character Statement Length.
- Free form infinite line length.
- $DECLARE and $NODECLARE :=,= IMPLICIT NONE.
- $ATTRIBUTES EXTERN. Variable allocated in another source file.
- $ATTRIBUTES VARYING. Variable number of arguments.
- $ATTRIBUTES ALLOCATABLE. Allocatable array.
- Mixing Subroutines/Functions in Generic Interfaces
- $MESSAGE. Output message during compilation.
- $LINE :=,= C's #line
- INT1. Converts to one byte integer by truncating.
- INT2. Converts to two byte integer by truncating.
- INT4. Converts to four byte integer by truncating.
- COTAN. Returns cotangent.
- DCOTAN. Returns double precision cotangent.
- IMAG. Returns the imaginary part of complex number.
- IBCHNG. Reverses value of bit.
- ISHA. Shifts arithmetically left or right.
- ISHC. Performs a circular shift.
- ISHL. Shifts logically left or right.
A.4 Compatibility with DIGITAL Fortran 77 and DIGITAL Fortran 90 for OpenVMS Systems
This section provides compatibility information for those who:
- Port DIGITAL Fortran 77 and DIGITAL Fortran 90 applications from
OpenVMS systems to DIGITAL Fortran 90 on DIGITAL UNIX Systems
- Design DIGITAL Fortran 90 applications to run on multiple
platforms, including OpenVMS and DIGITAL UNIX systems
If your primary concern is the design and development of DIGITAL
Fortran applications for only DIGITAL UNIX (or other U*X) systems,
consider skipping this section.
This section discusses the following topics:
- DIGITAL Fortran 77 extensions for OpenVMS systems that are not
supported by this version of DIGITAL Fortran 77 or DIGITAL Fortran 90
on DIGITAL UNIX Systems ( Section A.4.1)
- Porting DIGITAL Fortran data files from an OpenVMS system to a
DIGITAL UNIX system ( Section A.4.2)
- Nonnative VAX floating-point representations, provided for those
converting unformatted OpenVMS floating-point data ( Section A.4.3)
A.4.1 Language Features Specific to DIGITAL Fortran 77 and DIGITAL Fortran 90 for OpenVMS Systems
Some extensions to the FORTRAN-77 standard provided by DIGITAL Fortran
77 and DIGITAL Fortran 90 for OpenVMS Systems are specific to the
OpenVMS operating system, VAX architecture, or certain products on
OpenVMS systems. Such extensions are not included in DIGITAL Fortran 77
or DIGITAL Fortran 90 on DIGITAL UNIX Systems.
For information on language compatibility between DIGITAL Fortran 90 and
DIGITAL Fortran 77 without regard to operating system or architecture
differences, see Section A.2.
DIGITAL Fortran 77 and DIGITAL Fortran 90 products for OpenVMS systems
include:
- DIGITAL Fortran 90 Version 7.0 for OpenVMS Alpha Systems
- DIGITAL Fortran 77 Version 7.0 for OpenVMS Alpha Systems
- DIGITAL Fortran 77 Version 6.4 for OpenVMS VAX Systems (previously
called VAX FORTRAN)
Unless otherwise noted, the following list describes the DIGITAL
Fortran 77 extensions in DIGITAL Fortran 77 and/or DIGITAL Fortran 90
for OpenVMS systems that are not supported by DIGITAL Fortran 90
Version 5.n for DIGITAL UNIX Systems:
- DICTIONARY statement
The DICTIONARY and related support for the
CDD/Repository (common data dictionary) product are not provided by
DIGITAL Fortran 90 or DIGITAL Fortran 77 for DIGITAL UNIX Systems.
- Support for indexed sequential files
I/O statement specifiers
for indexed file (keyed access) record I/O using OpenVMS OPEN and
INQUIRE statement specifiers are not provided by DIGITAL Fortran 90 or
DIGITAL Fortran 77 for Digital UNIX Systems, as follows:
ACCESS=
'
KEYED
'
|
EXTENDSIZE
|
INITIALSIZE
|
KEY
|
NOSPANBLOCKS
|
ORGANIZATION=
'
INDEXED
'
|
SHARED
|
|
- FORSYSDEF symbol definitions for OpenVMS systems
The parameter
definitions of run-time messages found in FORSYSDEF.TLB library module
FORIOSDEF on OpenVMS systems are provided in the file
/usr/include/foriosdef.f
(see Section 8.2.2) on DIGITAL UNIX Systems. On DIGITAL UNIX systems,
DIGITAL Fortran 90 and DIGITAL Fortran 77 provides jacket routines to
simplify calling system calls and library routines (see Chapter 12).
- The INCLUDE statement option of including text from text libraries.
On DIGITAL UNIX Systems, OpenVMS text libraries are not supported.
- The %DESCR built-in function (for OpenVMS character descriptors).
On DIGITAL UNIX systems, character data is passed by address and
hidden length. For information about calling or being called by
procedures written in other languages, see Chapter 11.
- Run-time default I/O units spelled as FOR0nn.dat, SYS$INPUT, and so
on
In DIGITAL Fortran 90 and DIGITAL Fortran 77 on DIGITAL UNIX
systems, these are environment variables FORTn,
stdin
,
stdout
, and so forth (see Section 7.5.1).
- VAX floating-point formats and related selection of the
floating-point format in memory
Only IEEE floating-point formats
are supported in memory on DIGITAL UNIX (Alpha) systems. (DIGITAL
proprietary VAX floating-point formats are not supported in memory.)
You can request conversion of unformatted files containing VAX
floating-point formats into the appropriate IEEE memory format during
record I/O (see Chapter 10).
On OpenVMS VAX systems, you
specify the floating-point format to be used in memory with either the
option [NO]G_FLOATING in the OPTIONS statement or the qualifier
/[NO]G_FLOATING on the FORTRAN command line.
On OpenVMS Alpha
systems, you specify the floating-point format to be used in memory
using the /FLOAT qualifier on the FORTRAN command line.
- Stream record format differences
With DIGITAL Fortran 77 and DIGITAL Fortran 90 for OpenVMS systems, the
Stream record type is delimited by CR-LF character sequence (carriage
control and line feed characters). In DIGITAL Fortran 90 for DIGITAL UNIX
systems, the Stream record type uses no delimiters.
For more
information on compatible record types, see Section A.4.2.
- Other differences related to the OpenVMS operating system and the
DIGITAL UNIX operating system
When parsing file specifications for the OPEN, INQUIRE, and INCLUDE
statements, keep in mind that file names are case-sensitive on DIGITAL
UNIX systems and that OpenVMS file specification syntax differs from
pathname syntax.
For the INCLUDE statement, the network node names
(terminated by "::"), logical names (usually terminated by
":"), and other OpenVMS file specification components are not
recognized. Instead, the INCLUDE statement should specify a pathname,
possibly with an absolute directory path.
- The OpenVMS operating system provides various system services (SYS$
prefix) and run-time library routines (LIB$, SMG$, and other prefixes)
that are not supported on DIGITAL UNIX systems. DIGITAL UNIX systems
support system calls and library routines with similar functions (but
different names).
To make programs more portable to other operating
systems, wherever possible you should use standard-conforming DIGITAL
Fortran 90 intrinsic routines in place of routines specific to a
particular operating system.
For more information on specifying
files, see Section 7.5.1.3.
The following language and VAX architecture features are associated
only with DIGITAL Fortran 77 on OpenVMS VAX Systems (previously called
VAX FORTRAN) and are not supported by DIGITAL Fortran 90 Version 5.n for
DIGITAL UNIX systems:
- Directed decomposition features and CPAR$ directives for parallel
processing
CPAR$ directives are treated as a comment (ignored).
Parallel processing capabilities (appropriate
f90
options and HPF data mapping directives) are provided by DIGITAL Fortran 90.
- OPTIONS statement options /BLAS, /NOBLAS, /CHECK=ALIGNMENT,
/CHECK=NOALIGNMENT, /CHECK=ASSERTION, /CHECK=NOASSERTION, /G_FLOAT, and
/NOG_FLOAT
You can specify some of these options by using the
corresponding
f90
command-line options. The OPTIONS statement is treated as a comment
(ignored).
- CDEC$ performance directives ASSERT, INIT_DEP_FWD, NOVECTOR
CDEC$ directives are treated as comments (ignored).
- The REAL*16 floating-point data type
On VAX systems, REAL*16
data is in H_float format. On Alpha systems, REAL*16 data is in the
native IEEE style X_float.
- The following subroutines for PDP-11 compatibility:
ASSIGN
CLOSE
ERRSET
|
ERRTST
FDBSET
IRAD50
|
RAD50
R50ASC
USEREX
|
- Radix-50 constants and character set
- The BLAS routines
Similar basic linear algebra routines are
provided in the DIGITAL Extended Mathematical Library (DXML) product
(see Section 5.1.1).
The following language and VAX architecture features are interpretation
differences between DIGITAL Fortran 90 and DIGITAL Fortran 77 on Alpha
systems and DIGITAL Fortran 77 on OpenVMS VAX Systems (previously
called VAX FORTRAN):
- Random number generator (RAN)
The RAN function (one argument)
generates a different pattern of numbers in DIGITAL Fortran 90 than in
DIGITAL Fortran 77 on OpenVMS VAX Systems for the same random seed.
DIGITAL Fortran 90 and DIGITAL Fortran 77 use the same random seed. (The
RAN and RANDU functions are provided for DIGITAL Fortran 77 on OpenVMS
VAX Systems compatibility. See DIGITAL Fortran Language Reference Manual.)
- Hollerith constants in formatted I/O statements
DIGITAL Fortran
77 on OpenVMS VAX Systems and DIGITAL Fortran 90 behave differently if
either of the following occurs:
- Two different I/O statements refer to the same CHARACTER PARAMETER
constant as their format specifier. For example:
CHARACTER*(*) FMT2
PARAMETER (FMT2='(10Habcdefghij)')
READ (5, FMT2)
WRITE (6, FMT2)
|
- Two different I/O statements use the identical character constant
as their format specifier. For example:
READ (5, '(10Habcdefghij)')
WRITE (6, '(10Habcdefghij)')
|
In DIGITAL Fortran 77 for OpenVMS VAX Systems, the parameter value
obtained by the READ statement is modified. The parameter value
modified by the READ statement is used as the output of the WRITE
statement (FMT2 is ignored). However, in DIGITAL Fortran 90, the parameter
value is not modified (the parameter value read by the READ
statement has no effect on the parameter value written by the WRITE
statement.)
For More Information:
- On language compatibility information about DIGITAL Fortran 90 for
DIGITAL UNIX systems and DIGITAL Fortran 77, see Section A.2.2.
- On language interpretation differences between DIGITAL Fortran 90 for
DIGITAL UNIX systems and DIGITAL Fortran 77, see Section A.2.3.
- About the DIGITAL Fortran 90 language, see the DIGITAL Fortran Language Reference Manual.
A.4.2 OpenVMS Data Porting Considerations
When porting data between systems running the DIGITAL UNIX operating
system and systems running the OpenVMS operating system, the file
formats and the floating-point representations may differ.
The file and record formats of DIGITAL Fortran 77 on DIGITAL UNIX
systems are compatible with DIGITAL Fortran 90 on DIGITAL UNIX systems;
they share the same language run-time I/O environment (see
Chapter 7).
OpenVMS Fortran1 files containing only character, integer,
or logical data do not need field-by-field conversion, but the record
types must match. The segmented record type is the same on OpenVMS
Fortran systems and DIGITAL Fortran 90 on DIGITAL UNIX systems. Certain
other record types, such as variable-length records, differ between
OpenVMS systems and DIGITAL Fortran 90 on DIGITAL UNIX systems.
Table A-2 summarizes the OpenVMS Fortran record types and their
equivalent record types in DIGITAL Fortran 90 on DIGITAL UNIX systems.
Table A-2 Equivalent Record Types for OpenVMS Fortran and DIGITAL Fortran 90 on DIGITAL UNIX Systems
OpenVMS Fortran Record Type |
DIGITAL UNIX Fortran Record Type |
Comments |
Fixed-length
|
None
|
Equivalent (must be copied correctly) if you use sequential access and
you specify the
-vms
option when compiling the DIGITAL Fortran 90
file. Otherwise, convert the file to a different record type.
|
Variable-length
|
None
|
Not equivalent.
Convert the file to a different record type.
|
Segmented
|
Segmented
|
Equivalent (must be copied correctly). Segmented data files
can contain formatted or unformatted data.
|
Stream
|
None
|
Not equivalent. Convert the file to
a different record type.
|
Stream_CR
|
Stream_CR
|
Equivalent (must be copied correctly).
|
Stream_LF
|
Stream_LF
|
Equivalent (must be copied correctly).
|
A.4.2.1 Matching Record Types
To match record types, there are several options:
- For the Segmented, Stream_CR, and Stream_LF record types, you do
not need to convert the files.
- For fixed-length records where you will only use sequential access,
use the
-vms
option when compiling the DIGITAL Fortran 90 program that will access the
OpenVMS Fortran files. For fixed-length records where you will use
direct access, convert the files to a different record format.
- For incompatible record types, convert the files by writing a
OpenVMS Fortran or C conversion program or by using the ANALYZE/RMS/FDL
and CONVERT/FDL (or EXCHANGE/FDL) commands for an appropriate file. For
instance, convert the OpenVMS Fortran file to the segmented record type.
A.4.2.2 Copying Files
Equivalent record types must be copied carefully to preserve control
information and record characteristics. For example:
- Do not use the ASCII transfer mode for binary files.
- Segmented files must be copied in a manner that preserves record
length information.
To transfer (copy) the files, choose one of the following methods:
- From an NFS mounted disk, use the
cp
command (see cp(1)).
- Perform a DECnet copy from a DIGITAL UNIX system running the
appropriate optional network software using
dcp
(see dcp(8)). Use the
dcp -i
option when you want to preserve record format information
- Perform a copy from a DIGITAL UNIX system with
rcp
, possibly by using an intermediate node running the appropriate
optional network software when using a version of the OpenVMS operating
system that does not support a compatible network protocol (optional
product).
- Use ftp from a DIGITAL UNIX system to copy a file between a DIGITAL
UNIX system and an OpenVMS system. Use the
binary
or
ascii
command to set the mode before you copy (get or put) the file. For
example, use the ftp
binary
command before copying an unformatted file (such as the segmented
record type).
- Perform a DECnet copy from an OpenVMS system with 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 specify the
record type.
In addition to using the correct record type and carefully transferring
the files, the data inside unformatted records may need to be
converted. OpenVMS Fortran data files that contain VAX binary
floating-point data must be converted before they can be accessed by a
DIGITAL Fortran 90 program. There are several methods:
- On an OpenVMS system, a Fortran program can convert files
containing unformatted data to files containing formatted data. Once
the files contain formatted data, they can be read by the appropriate
DIGITAL Fortran 90 programs.
However, converting unformatted data to formatted data may result in a
loss of accuracy for unformatted floating-point data.
- On an OpenVMS VAX system, a DIGITAL Fortran 77 program can read and
write files containing unformatted data by using the DIGITAL Fortran 90
conversion capabilities described in DEC Fortran User Manual for OpenVMS VAX Systems.
- On an OpenVMS Alpha system, a Fortran program can read and write
files containing unformatted data by using the DIGITAL Fortran 90
conversion capabilities described in the DEC Fortran User Manual for OpenVMS AXP Systems or the
DEC Fortran 90 User Manual for OpenVMS Alpha Systems.
A DIGITAL Fortran 77 for OpenVMS Alpha Systems
program can also use the CVT$CONVERT_FLOAT routine to convert
individual floating-point fields.
- On a DIGITAL UNIX system, a DIGITAL Fortran 90 program can read and
write files containing unformatted data using the DIGITAL Fortran 90
conversion capabilities described in Section 10.2. A program using
the DIGITAL Fortran 90 conversion capabilities can also convert such data
to other formats.
If you need to convert unformatted floating-point data, keep in mind
that DIGITAL Fortran 77 for OpenVMS VAX programs (VAX hardware) store
the following:
- REAL*4 or COMPLEX*8 data in VAX F_float format
- REAL*8 or COMPLEX*16 data in either VAX D_float or G_float format
- REAL*16 data in VAX H_float format
In contrast, DIGITAL Fortran 90 programs running the DIGITAL UNIX operating
system on Alpha hardware store the following:
- REAL*4 or COMPLEX*8 data in IEEE S_float format
- REAL*8 or COMPLEX*16 data in IEEE T_float format
- REAL*16 data in native (IEEE style) X_float format
DIGITAL Fortran 77 and DIGITAL Fortran 90 for OpenVMS Alpha programs
store floating-point data in the format specified by the /FLOAT
qualifier:
- REAL*4 or COMPLEX*8 data in VAX F_float or IEEE S_float format
- REAL*8 or COMPLEX*16 data in VAX D_float, VAX G_float, or IEEE
T_float format
- REAL*16 data in native IEEE style X_float format
For information on DIGITAL Fortran 90 data types, see Chapter 9.
For More Information:
- On DIGITAL Fortran 90 I/O, see Chapter 7.
- About the DIGITAL Fortran 90 language, see the DIGITAL Fortran Language Reference Manual.
A.4.3 Nonnative VAX Floating-Point Representations
This section provides information about VAX floating-point data
formats. You can convert unformatted files from OpenVMS systems by
using the methods described in Chapter 10.
On OpenVMS VAX systems, single-precision data (such as REAL*4) is
stored in VAX F_float format and double-precision data (such as REAL*8)
data can be stored in either VAX D_float or VAX G_float formats,
depending on whether the /G_FLOATING qualifier was specified on the
FORTRAN command line (see the DEC Fortran User Manual for OpenVMS VAX Systems).
On OpenVMS Alpha systems, you can specify the floating-point format in
memory by using the /FLOAT qualifier (see the DEC Fortran User Manual for OpenVMS AXP Systems).
Single-precision data on OpenVMS Alpha systems is stored in either VAX
F_float or IEEE S_float formats; double-precision data can be stored in
VAX D_float, VAX G_float, or IEEE T_float formats.
REAL*16 (extended precision) data is always stored in IEEE style
X_float format on Alpha systems.
With VAX floating-point data types, the binary radix point is to the
left of the most-significant bit.
Note
1 OpenVMS Fortran refers collectively
to VAX FORTRAN, DIGITAL Fortran 77 for OpenVMS Alpha Systems, and
DIGITAL Fortran 77 for OpenVMS VAX Systems
|