#

Contents | Index

# Compaq Fortran

# User Manual for
Tru64 UNIX and
Linux Alpha Systems

Order Number: AA--Q66TE--TE

# January 2002

This manual provides information about the Compaq Fortran program development and run-time environment on Compaq Tru64 UNIX and Linux Alpha systems.

Revision/Update Information: This manual supersedes the previous version of this manual, order number AA--Q66TD--TE.

Software Version: Compaq Fortran for Tru64 UNIX Systems: Version 5.5 or higher
Compaq Fortran for Linux Alpha Systems: Version 1.2 or higher

Compaq Computer Corporation
Houston, Texas

First Printing, June 1994 Revision, January 2002

© 2002 Compaq Information Technologies Group, L.P.

Compaq and the Compaq logo, OpenVMS, Tru64, and VAX are trademarks of Compaq Information Technologies Group, L.P. in the U.S. and/or other countries.

Microsoft, Windows, and Windows NT are trademarks of Microsoft Corporation in the U.S. and/or other countries.

UNIX is a trademark of The Open Group in the U.S. and/or other countries.

All other product names mentioned herein may be trademarks of their respective companies.

Cover graphic, photographs: Copyright © 1997 PhotoDisc, Inc.

Cover graphic, image: CERN, European Laboratory for Particle Physics: ALICE detector on CERN's future accelerator, the LHC, Large Hadron Collider.

Confidential computer software. Valid license from Compaq required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty.

ZK6325

Contents | Index

# Preface

This manual describes the Compaq Fortran compiler command, compiler, and run-time environment. This includes how to compile, link, execute, and debug Compaq Fortran programs using the Compaq Tru64tm UNIX operating system on Alpha hardware and the Linux operating system on Alpha hardware.

This manual does not cover running, debugging, and profiling programs that execute in parallel using High Performance Fortran (HPF) features.

# Intended Audience

This manual makes the assumptions that:

- You already have a basic understanding of the Fortran 95/90 language. Tutorial Fortran 95/90 language information is widely available in commercially published books (see the online release notes or the Preface of the Compaq Fortran Language Reference Manual).
- You are familiar with the operating system shell commands used during program development and a text editor, such as `emacs` or `vi` . Such information is available in your operating system documentation set or commercially published books.
- You have access to the Compaq Fortran Language Reference Manual, which describes the Compaq Fortran language.

# Structure of This Document

This manual consists of the following chapters and appendixes:

- Chapter 1 introduces the programmer to the Compaq Fortran compiler, its components, and related commands.
- Chapter 2 explains how to compile and link Compaq Fortran source programs, previously compiled module files, object files, and routines written in other supported programming languages, such as C.
- Chapter 3 describes the Compaq Fortran compiler command-line options in detail.
- Chapter 4 describes using the Compaq Ladebug debugger to debug Compaq Fortran nonparallel programs.
- Chapter 5 describes ways to improve Compaq Fortran run-time performance for nonparallel programs, including general software environment recommendations, appropriate compiler command-line options, data alignment, efficiently performing I/O and array operations, other efficient coding techniques, profiling, and optimization.
- Chapter 6 describes how to use parallel compiler directives in Compaq Fortran programs to generate code that executes in parallel.
- Chapter 7 provides information on Compaq Fortran I/O, including statement forms, file organizations, I/O record formats, access modes, logical unit numbers, and efficient use of I/O.
- Chapter 8 lists run-time messages and describes how to control certain types of I/O errors and signal-handling considerations.
- Chapter 9 describes native Compaq Fortran Alpha data types, including their numeric ranges, representation, and floating-point exceptional values. It also discusses the intrinsic data types used with numeric data.
- Chapter 10 describes how to access unformatted files containing numeric little endian and big endian data different than the format used in memory.
- Chapter 11 describes the Compaq Fortran language interface, passing arguments, calling between Compaq Fortran and Compaq Fortran 77, and calling between Compaq Fortran and C.
- Chapter 12 lists and briefly describes the Section 3f interface routines, which include some routines specifically designed for the Compaq Fortran environment on Compaq Tru64 UNIX systems.
- Chapter 13 describes the Compaq Extended Math Library (CXML), including how to call and link CXML routines.
- Chapter 14 explains additional ways to control run-time floating-point exceptions.
- Appendix A provides compatibility information for those porting Compaq Fortran 77 (formerly DEC Fortran) applications and Compaq Fortran OpenVMStm applications, including an overview of Compaq Fortran 77 and Compaq Fortran extensions supported on the various platforms.
- Appendix B lists the Compaq Fortran environment variables recognized at compile time and run time.
- Appendix C describes the source listing formats supported by Compaq Fortran.
- Appendix D summarizes the library routines available for use with directed parallel decomposition.

The appendix formerly titled "Parallel Compiler Directives Reference Material" is no longer in this manual. The contents of this appendix are in the Compaq Fortran Language Reference Manual.

# Associated Documents

The following documents may also be useful to Compaq Fortran programmers:

- Compaq Fortran Language Reference Manual
  Describes the Compaq Fortran 95/90 source language for reference purposes, including the format and use of statements, intrinsic procedures, and other language elements. Compaq extensions to the Fortran 95 standard are identified by blue-green color in the printed document and HTML versions. It also provides an overview of new Fortran 90 features (not available in FORTRAN-77). Language differences between Compaq Fortran platforms are identified.
- Compaq Fortran Installation Guide for Tru64 UNIX Systems
  Explains how to install Compaq Fortran on the Compaq Tru64 UNIX operating system, including prerequisites and requirements.
  To install Compaq Fortran on Linux Alpha systems, refer to the online README file supplied with your kit.
- Compaq Fortran online release notes
  Provide more information on this version of Compaq Fortran, including known problems and a summary of the Compaq Fortran run-time error messages.
  The online release notes are located at:
  TU*X ONLY `/usr/lib/cmplrs/fort90/relnotes`
  L*X ONLY `/usr/doc/cfal-1.2.n/README`
  where the value of n in this location comes from the list 0, 1, 2, ...
- Compaq Fortran online reference pages
  Describe the Compaq Fortran software components, including `f90(1)` (Tru64 UNIX systems) or `fort(1)` (Linux systems), `fpr(1)`, `fsplit(1)`, `intro(3f)`, numerous Fortran library routines listed in `intro(3f)`, and numerous parallel Fortran library routines listed in `intro(3hpf)`.
- Official specification for OpenMP Fortran 1.1 Application Program Interface at:

      http://www.openmp.org/specs/

- Compaq Tru64 UNIX operating system documentation
  The operating system documentation set includes reference pages for operating system components and a programmer's subkit, in which certain documents describe the commands, tools, libraries, and other aspects of the programming environment:
  - For programming information, see the Compaq Tru64 UNIX Programmer's Guide and the Compaq Tru64 UNIX Using Programming Support Tools.
  - For performance information, see the Compaq Tru64 UNIX System Tuning and Performance.
  - For an overview of Compaq Tru64 UNIX documentation, see the Compaq Tru64 UNIX Reader's Guide.
- Other layered product documentation
  If you are using a programming-related layered product package from Compaq, consult the appropriate documentation for the layered product package for use of that product.

# Platform Labels

A platform is a combination of operating system and central processing unit (CPU) that provides a distinct environment in which to use a product (in this case, a language). All the information in this manual applies to both Compaq Tru64 UNIX on Alpha systems and Linux on Alpha systems unless otherwise labeled as shown below:

TU*X | Applies to Tru64 UNIX on Alpha systems
L*X | Applies to Linux on Alpha systems

For example, the `shcom_connect` library routine in Table 12-2 is labeled (TU*X ONLY), so this routine is only valid for Tru64 UNIX operating systems on Alpha processors.

# Sending Compaq Your Comments on This Manual

Compaq welcomes your comments on this or any other Compaq Fortran manual. You can send comments by e-mail to:

    fortran@compaq.com

If you have suggestions for improving particular sections or find any errors, please indicate the title, order number, and section numbers. Compaq also welcomes general comments.

# Communicating with Compaq

If you have a customer support contract and have comments or questions about Compaq Fortran software, you can contact our Customer Support Center (CSC), preferably using electronic means (such as DSNlink). In the United States, customers can call the CSC at 1-800-354-9000.

You can also send comments, questions and suggestions about the Compaq Fortran product to the following e-mail address: `fortran@compaq.com` . Note that this address is for informational inquiries only and is not a formal support channel.

# Compaq Fortran Web Site

The Compaq Fortran home page is located at:

    http://www.compaq.com/fortran

This site contains information about software patch kits, example programs, and additional product information.

# Conventions Used in This Document

This manual uses the conventions listed in Table 1.

Table 1 Conventions Used in This Document
Convention | Meaning
--- | ---
% | The default user prompt is your system name followed by a right angle bracket. This manual uses a percent sign (%) to represent this prompt. The actual user prompt varies with the shell in use.
`[RETURN]` | This symbol indicates that you must press the named key on the keyboard.
Ctrl/ x | This symbol indicates that you must press the Ctrl key while you simultaneously press the key labeled x.
% pwd /usr/usrc/jones | This manual displays system prompts and responses using a monospaced font. User input is displayed in a bold monospaced font.
`monospaced` | This typeface indicates the name of a command, option, pathname, file name, directory path, or environment variable. This typeface is also used in examples of program code, interactive examples, and other screen displays.
`cat(1)` | A shell command name followed by the number 1 in parentheses refers to a command reference page. Similarly, a routine name followed by the number 2 or 3 in parentheses refers to a system call or library routine reference page. (The number in parentheses indicates the section containing the reference page.) To read online reference pages, use the `man` command. Your operating system documentation also contains reference page descriptions.
new term | Bold type indicates the introduction of a new term in text.
variable | Italic type indicates important information, a complete title of a manual, or variable information, such as user-supplied information in command or option syntax.
UPPERCASE lowercase | The operating system shell differentiates between lowercase and uppercase characters. Literal strings that appear in text, examples, syntax descriptions, and function definitions must be typed exactly as shown.
| Large braces enclose lists from which you must choose one item. For example: STATUS DISPOSE DISP
[ ] | Square brackets enclose items that are optional. For example: `BLOCK DATA [name]`
... | A horizontal ellipsis means that the item preceding the ellipsis can be repeated. For example: `s[,s]...`
. . . | A vertical ellipsis in a figure or example means that not all of the statements are shown.
real | This term refers to all floating-point intrinsic data types as a group.
complex | This term refers to all complex floating-point intrinsic data types as a group.
logical | This term refers to logical data types as a group.
integer | This term refers to integer data types as a group.
Compaq Fortran | The term Compaq Fortran (formerly DIGITAL Fortran 90) refers to language information that is common to the Fortran 95/90 standards and any Compaq Fortran extensions.
Fortran | This term refers to language information that is common to ANSI FORTRAN 77, ANSI/ISO Fortran 95/90, and Compaq Fortran.
Fortran 95/90 | This term refers to language information that is common to ANSI/ISO Fortran 95 and ANSI/ISO Fortran 90.
`f90` | This command invokes the Compaq Fortran compiler on Tru64 UNIX Alpha systems while the `fort` command invokes the Compaq Fortran compiler on Linux Alpha systems. This manual frequently uses the `f90` command to indicate invoking the Compaq Fortran on both systems, so replace this command with `fort` if you are working on a Linux Alpha system.
`fort` | This command invokes the Compaq Fortran compiler on Linux Alpha systems. See the previous convention for the `f90` command.
OpenMP | This term refers to OpenMP Fortran as specified in the OpenMP Fortran 1.1 Application Program Interface.
HPF | This term refers to the High Performance Fortran extensions to the Fortran language.

Previous | Next | Contents | Index