Order Number: AA-PU45C-TK
April 1999
This manual contains the complete description of the Compaq Fortran 77 (formerly DEC Fortran) programming language. It contains information on language syntax and semantics, on adherence to various Fortran standards, and on extensions to those standards.
Revision /Update Information | This revised manual supersedes all previous DEC Fortran and VAX FORTRAN language reference manuals. |
Compaq Computer Corporation
Houston, Texas
©Compaq Computer Corporation 1999. All Rights Reserved.
1.3 Elements of Source Programs
1.3.2 Statements
1.3.3 Symbolic Names
1.3.4 Comments
1.5 Coding Rules
1.5.2 Tab-Format Lines
1.5.3 Statement Label Field
1.5.3.2 Debugging Statement Indicator
1.5.5 Statement Field
1.5.6 Sequence Number Field
1.6.2 INCLUDE Statement
1.6.3 OPTIONS Statement
2 Data Types, Data Items, and Expressions
2.2 Data Items
2.2.1.2 Real Constants
2.2.1.3 Complex Constants
2.2.1.4 Bit Constants
2.2.1.5 Logical Constants
2.2.1.6 Character Constants
2.2.1.7 Hollerith Constants
2.2.2.2 Data Type by Implication
2.2.3.2 Array Subscripts
2.2.3.3 Arrangement of Array Elements in Storage
2.2.3.4 Data Type of an Array
2.2.3.5 Referencing Arrays Without Subscripts
2.2.3.6 Classes of Arrays
2.2.5 Records
2.2.5.2 References to Record Fields
2.3.1.2 Data Type of an Arithmetic Expression
2.3.3 Relational Expressions
2.3.4 Logical Expressions
3.2 Logical Assignment Statement
3.3 Character Assignment Statement
3.4 Aggregate Assignment Statement
3.5 ASSIGN Statement
4.3 COMMON Statement
4.4 DATA Statement
4.5 Type Declaration Statements
4.5.2 Character Type Declaration Statements
4.7.2 Making Substrings Equivalent
4.7.3 EQUIVALENCE and COMMON Interaction
4.10 INTRINSIC Statement
4.11 NAMELIST Statement
4.12 PARAMETER Statement
4.13 POINTER Statement
4.14 PROGRAM Statement
4.15 RECORD Statement
4.16 SAVE Statement
4.17.2 Substructure Declarations in Structure Declarations
4.17.3 Union Declarations in Structure Declarations
5.2 CASE Construct (Alpha only)
5.4 DO Constructs
5.4.1.2 Nested DO Loops
5.4.1.3 Control Transfers in DO Loops
5.4.1.4 Extended Range
5.4.3 CYCLE Statement (Alpha only)
5.4.4 EXIT Statement (Alpha only)
5.6 GO TO Statements
5.6.2 Computed GO TO Statement
5.6.3 Assigned GO TO Statement
5.7.2 Logical IF Statement
5.7.3 IF Constructs
5.7.3.2 Examples of IF Constructs
5.7.3.3 Nested IF Constructs
5.9 RETURN Statement
5.10 STOP Statement
6 Subprograms: Subroutines and Functions
6.1.1.2 Assumed-Size Arrays
6.1.1.3 Automatic Arrays (Alpha only)
6.1.1.4 Passed-Length Character Arguments
6.1.1.5 Hollerith and Character Constants as Actual Arguments
6.1.1.6 Alternate Return Arguments
6.1.2.2 %LOC Built-In Function
6.2.2 Function Subprograms
6.2.2.2 Character Functions
6.2.2.3 Function Reference
6.2.4 ENTRY Statement
6.2.4.2 ENTRY Statements in Subroutine Subprograms
6.3.1.2 Using Intrinsic Function Names
6.3.2.2 Lexical Comparison Functions
7.1.1.2 Logical Unit Specifier
7.1.1.3 Internal File Specifier
7.1.1.4 Format Specifier
7.1.1.5 Namelist Specifier
7.1.1.6 Record Specifier
7.1.1.7 Key-Field-Value Specifier (VMS only)
7.1.1.8 Key-of-Reference Specifier (VMS only)
7.1.1.9 I/O Status Specifier
7.1.1.10 Transfer-of-Control Specifiers
7.1.2.2 Implied-DO Lists in I/O Statements
7.2.1.2 List-Directed Sequential READ Statement
7.2.1.3 Namelist Sequential READ Statement
7.2.1.4 Unformatted Sequential READ Statement
7.2.2.2 Unformatted Direct Access READ Statement
7.2.3.2 Unformatted Indexed READ Statement (VMS only)
7.2.4.2 List-Directed Internal READ Statement
7.3.1.2 List-Directed Sequential WRITE Statement
7.3.1.3 Namelist Sequential WRITE Statement
7.3.1.4 Unformatted Sequential WRITE Statement
7.3.2.2 Unformatted Direct Access WRITE Statement
7.3.3.2 Unformatted Indexed WRITE Statement (VMS only)
7.3.4.2 List-Directed Internal WRITE Statement
7.4.2 Unformatted REWRITE Statement
8.1.2 Edit Descriptor Syntax
8.1.3 FORMAT Codes
8.2.2 General Output Rules for FORMAT Statements
8.3.1.2 O Field Descriptor
8.3.1.3 Z Field Descriptor
8.3.2.2 E Field Descriptor
8.3.2.3 D Field Descriptor
8.3.2.4 G Field Descriptor
8.3.2.5 Complex Editing
8.3.4 Character Editing - the A Field Descriptor
8.3.5 Default Field Descriptor Parameters
8.3.6 Repeat Counts and Group Repeat Counts
8.3.7 Variable Format Expressions
8.4.1.2 TL Edit Descriptor
8.4.1.3 TR Edit Descriptor
8.4.1.4 X Edit Descriptor
8.4.2.2 SS Edit Descriptor
8.4.2.3 S Edit Descriptor
8.4.3.2 BZ Edit Descriptor
8.4.5 Character String Editing
8.4.5.2 Character Constants
8.5.2 Dollar Sign Edit Descriptor
8.5.3 Q Edit Descriptor
8.7 Format Specification Separators
8.9 Run-Time Formats
8.10 Format Control Interaction with I/O Lists
9 Auxiliary I/O Statements on OpenVMS Systems
9.2 CLOSE Statement
9.3 DELETE Statement
9.5.2 BLANK Specifier
9.5.3 CARRIAGECONTROL Specifier
9.5.4 CONVERT Specifier
9.5.5 DIRECT Specifier
9.5.6 ERR Specifier
9.5.7 EXIST Specifier
9.5.8 FORM Specifier
9.5.9 FORMATTED Specifier
9.5.10 IOSTAT Specifier
9.5.11 KEYED Specifier
9.5.12 NAME Specifier
9.5.13 NAMED Specifier
9.5.14 NEXTREC Specifier
9.5.15 NUMBER Specifier
9.5.16 OPENED Specifier
9.5.17 ORGANIZATION Specifier
9.5.18 RECL Specifier
9.5.19 RECORDTYPE Specifier
9.5.20 SEQUENTIAL Specifier
9.5.21 UNFORMATTED Specifier
9.6.2 ASSOCIATEVARIABLE Keyword
9.6.3 BLANK Keyword
9.6.4 BLOCKSIZE Keyword
9.6.5 BUFFERCOUNT Keyword
9.6.6 CARRIAGECONTROL Keyword
9.6.7 CONVERT Keyword
9.6.8 DEFAULTFILE Keyword
9.6.9 DISPOSE Keyword
9.6.10 ERR Keyword
9.6.11 EXTENDSIZE Keyword
9.6.12 FILE Keyword
9.6.13 FORM Keyword
9.6.14 INITIALSIZE Keyword
9.6.15 IOSTAT Keyword
9.6.16 KEY Keyword
9.6.17 MAXREC Keyword
9.6.18 NAME Keyword
9.6.19 NOSPANBLOCKS Keyword
9.6.20 ORGANIZATION Keyword
9.6.21 READONLY Keyword
9.6.22 RECL Keyword
9.6.23 RECORDSIZE Keyword
9.6.24 RECORDTYPE Keyword
9.6.25 SHARED Keyword
9.6.26 STATUS Keyword
9.6.27 TYPE Keyword
9.6.28 UNIT Keyword
9.6.29 USEROPEN Keyword
9.8 UNLOCK Statement
10 Auxiliary I/O Statements on Tru64 UNIX Systems
10.2 CLOSE Statement
10.3 DELETE Statement
10.4 ENDFILE Statement
10.5 INQUIRE Statement
10.5.2 BLANK Specifier
10.5.3 CARRIAGECONTROL Specifier
10.5.4 CONVERT Specifier
10.5.5 DIRECT Specifier
10.5.6 ERR Specifier
10.5.7 EXIST Specifier
10.5.8 FORM Specifier
10.5.9 FORMATTED Specifier
10.5.10 IOSTAT Specifier
10.5.11 NAME Specifier
10.5.12 NAMED Specifier
10.5.13 NEXTREC Specifier
10.5.14 NUMBER Specifier
10.5.15 OPENED Specifier
10.5.16 ORGANIZATION Specifier
10.5.17 RECL Specifier
10.5.18 RECORDTYPE Specifier
10.5.19 SEQUENTIAL Specifier
10.5.20 UNFORMATTED Specifier
10.6.2 ASSOCIATEVARIABLE Keyword
10.6.3 BLANK Keyword
10.6.4 BLOCKSIZE Keyword
10.6.5 BUFFERCOUNT Keyword
10.6.6 CARRIAGECONTROL Keyword
10.6.7 CONVERT Keyword
10.6.8 DEFAULTFILE Keyword
10.6.9 DISPOSE Keyword
10.6.10 ERR Keyword
10.6.11 FILE Keyword
10.6.12 FORM Keyword
10.6.13 IOSTAT Keyword
10.6.14 MAXREC Keyword
10.6.15 NAME Keyword
10.6.16 ORGANIZATION Keyword
10.6.17 READONLY Keyword
10.6.18 RECL Keyword
10.6.19 RECORDSIZE Keyword
10.6.20 RECORDTYPE Keyword
10.6.21 STATUS Keyword
10.6.22 TYPE Keyword
10.6.23 UNIT Keyword
10.6.24 USEROPEN Keyword
10.8 UNLOCK Statement
11.2 General Directives
11.2.2 ASSERT Directive (VAX only)
11.2.3 IDENT Directive
11.2.4 INIT_DEP_FWD Directive (VAX only)
11.2.5 NOVECTOR Directive (VAX only)
11.2.6 OPTIONS Directive (Alpha only)
11.2.7 PSECT Directive
11.2.8 TITLE and SUBTITLE Directives
11.3.2 CONTEXT_SHARED_ALL Directive (VAX only)
11.3.3 DO_PARALLEL Directive (VAX only)
11.3.4 LOCKON and LOCKOFF Directives (VAX only)
11.3.5 PRIVATE Directive (VAX only)
11.3.6 PRIVATE_ALL Directive (VAX only)
11.3.7 SHARED Directive (VAX only)
11.3.8 SHARED_ALL Directive (VAX only)
11.3.9 Parallel Directive Examples (VAX only)
A Additional Language Features
A.2 ENCODE and DECODE Statements
A.3 FIND Statement
A.4 NOF77 Interpretation of the EXTERNAL Statement
A.5 Octal Notation for Integer Constants
A.9 Alternative Syntax for Bit Constants
A.10 C-Style Escape Sequences (Alpha only)
A.11 Alternative Syntax for a Record Specifier
A.12 Alternative Syntax for the DELETE Statement
A.13 Alternative Syntax for Character Constants (Alpha only)
B.2 ASCII and DEC Multinational Character Sets
B.3 Radix-50 Constants and Character Set (VAX only)
C Expression Operators and Intrinsic Procedures
C.2.2 Numeric Intrinsic Functions
C.2.3 Bit Manipulation Intrinsic Functions
C.2.4 Character Intrinsic Functions
C.2.5 Miscellaneous Intrinsic Functions
C.3.2 Extended Set (VAX only)
D System Subprograms and Bit Manipulation Functions
D.1.2 EXIT Subroutine
D.1.3 IDATE Subroutine
D.1.4 MVBITS Subroutine
D.1.5 RAN Function
D.1.6 SECNDS Function
D.1.7 TIME Subroutine
D.2.2 Bit Function Arguments
E Summary of Language Extensions
E.2 Platform-Specific Extensions
E.3 Summary of Data Types and Characteristics
E.4 Platform-Specific Compiler Options
Examples
6-1 Using and Redefining an Intrinsic Function Name
8-1 Interaction Between an I/O List and a FORMAT Statement
11-1 Using the LOCKON and LOCKOFF Directives (VAX only)
11-2 Using the SHARED, CONTEXT_SHARED, and PRIVATE Directives (VAX only)
A-1 Using the NOF77 EXTERNAL Statement
Figures
2-1 Array Storage
2-2 Memory Diagram of REC for Packed Records
2-3 Memory Diagram of REC for Naturally Aligned Records (Alpha only)
2-4 Memory Diagram of AREC for Packed Records
2-5 Memory Diagram of AREC for Naturally Aligned Records (Alpha only)
2-6 Memory Diagram of NRD for Packed Records
2-7 Memory Diagram of NRD for Naturally Aligned Records (Alpha only)
2-8 Memory Diagram of Mapped Fields
3-1 Conversion Rules for Assignment Statements
4-2 Equivalence of Character Arrays
4-3 A Valid Extension of a Common Block
4-4 An Invalid Extension of a Common Block
4-5 Memory Map of Structure DATE
4-6 Memory Map of Structure APPOINTMENT
4-7 Memory Map of Structure WORDS_LONG
5-1 Flow of Control in CASE Constructs (Alpha only)
5-2 Nested DO Loops
5-3 Control Transfers and Extended Range
5-5 Example of Nested IF Construct
8-1 Example of a Group Repeat Count
B-1 Graphical Representation of the ASCII Character Set
B-2 Graphical Representation of the DEC Multinational Extension to the ASCII Character Set
Tables
1-1 Entities Identified by Symbolic Names
2-1 Data Type Storage Requirements
4-1 Equivalence of Array Storage
4-2 Equivalence of Arrays with Nonunity Lower Bounds
6-1 Argument List Built-In Functions and Defaults
6-2 Types of User-Written Subprograms
6-3 Summary of Generic Intrinsic Function Names
7-1 List-Directed Default Output Formats
8-2 Effect of Data Magnitude on G Format Conversions
8-3 Size Limit of Numeric Elements Using the A Field Descriptor
8-4 Default Field Descriptor Values
8-5 Carriage Control Characters
9-1 OPEN Statement Keyword Values on OpenVMS Systems
9-2 Record Size (RECL) Limits on OpenVMS Systems
9-3 Record Size (RECL) Default Values on OpenVMS Systems
10-1 OPEN Statement Keyword Values on Tru64 UNIX Systems
10-2 Record Size (RECL) Limits on Tru64 UNIX Systems
10-3 Record Size (RECL) Default Values on Tru64 UNIX Systems
11-1 Common Block Default Attributes and PSECT Modification
B-1 Radix-50 Character Set with Comparative Values (VAX only)
C-2 Mathematical Intrinsic Functions
C-3 Numeric Intrinsic Functions
C-4 Bit Manipulation Intrinsic Functions
C-5 Character Intrinsic Functions
C-6 Miscellaneous Intrinsic Functions
C-7 BLAS Basic Set Routines (VAX only)
C-8 BLAS Extended Set Routines (VAX only)
E-1 Intrinsic Data Types and Numeric Ranges
E-2 Compiler Option Names in This Manual