Concurrent Fortran 77 Reference ??Concurrent Fortran 77 Reference Manual 4 • Chapter 9 contains the Fortran library description. The library contains the Fortran intrinsic functions as ...

Download Concurrent Fortran 77 Reference  ??Concurrent Fortran 77 Reference Manual 4 • Chapter 9 contains the Fortran library description. The library contains the Fortran intrinsic functions as ...

Post on 06-Mar-2018

222 views

Category:

Documents

10 download

TRANSCRIPT

  • Concurrent Fortran 77 Reference Manual

    0890240-100August 2004

  • Copyright 2004 by Concurrent Computer Corporation. All rights reserved. This publication or any part thereof isintended for use with Concurrent products by Concurrent personnel, customers, and endusers. It may not bereproduced in any form without the written permission of the publisher.

    The information contained in this document is believed to be correct at the time of publication. It is subject to changewithout notice. Concurrent makes no warranties, expressed or implied, concerning the information contained in thisdocument.

    To report an error or comment on a specific portion of the manual, photocopy the page in question and mark thecorrection or comment on the copy. Mail the copy (and any additional comments) to Concurrent Computer Corpora-tion, 2881 Gateway Drive, Pompano Beach, FL 33069-4324. Mark the envelope Attention: Publications Depart-ment. This publication may not be reproduced for any other reason in any form without written permission of thepublisher.

    POSIX is a registered trademark of the Institute of Electrical and Electronics Engineers, Inc.PowerPC and PowerPC 604 are trademarks of International Business Machines Corporation.UNIX is a registered trademark, licensed exclusively by X/Open Company Ltd.VAX is a trademark of Digital Equipment Corporation.

    Printed in U. S. A.

    Revision History: Level: Effective With:Original Release -- January 1989 000 CX/UX 4.0Current Releease -- July 2004 100 Concurrent Fortran 77 6.1

  • Preface

    Scope of Manual

    This manual provides an overview of the Concurrent Fortran compiler, general enhance-ments to the compiler, violations of the standard, and general source components of theFortran language.

    Information in this manual applies to PowerPCTM platforms as well as RedHawkTM Intel.

    Structure of Manual

    A brief description of the chapters and appendixes in this manual follows:

    Chapter 1 provides a general introduction and overview of the Fortran 77compiler. Language extensions, enhancements, syntax notation, andviolations of the 1977 standard Fortran are discussed.

    Chapter 2 describes the source program components; included in thischapter are character sets, statements, syntactical elements, program unitstructure and terminology. Also discussed are data types, data constants,storage alignment and arrays.

    Chapter 3 discusses Fortran expressions and assignments. The Fortranlanguage permits arithmetic, character, relational, and logical expressions.The use of Fortran expressions in assignment statements is discussed indetail in this chapter.

    Chapter 4 deals with the specification and declaration statements. Eachstatement is described in detail containing a definition, syntax line andexplanation of the syntax.

    Chapter 5 provides a general description of control statements, their orderof execution, and transfer of control. Examples and definitions are pro-vided throughout this chapter.

    Chapter 6 describes the general input and output statements of the Fortranlanguage. The input statements transfer data stored on an external storagemedium into memory while the Fortran output statements transfer datafrom memory to an external storage medium.

    Chapter 7 provides information about format specification, defining size ofinput and output fields, the type of data being read or written and how thedata are to be edited.

    Chapter 8 deals with the subprograms which are units independent of themain program and are written by the user or supplied by the compiler.Inter-language interfacing between C and Fortran is covered in depth.

    3

  • Concurrent Fortran 77 Reference Manual

    Chapter 9 contains the Fortran library description. The library contains theFortran intrinsic functions as well as functions that are in addition to theFortran 77 standard.

    Chapter 10 provides the information necessary for compilation andexecution. Discussed in this chapter are compiling, preprocessing, linking,and assembling. Also included in this chapter are the f77 compiler optionsand necessary support files.

    Appendix A illustrates array storage. Appendix B lists non-standard extensions to Fortran 77. Appendix C enumerates incompatibilities with Fortran 66.

    The index contains an alphabetical list of topics, names, etc. found in the manual.

    Man page descriptions of programs and library routines can be found in system manualpages.

    Syntax Notation

    The following notation is used throughout this guide:

    italic Books, reference cards, and items that the user must specifyappear in italic type. Special terms may also appear in italic.

    list bold User input appears in list bold type and must be enteredexactly as shown. Names of directories, files, commands, optionsand man page references also appear in list bold type.

    list Operating system and program output such as prompts and mes-sages and listings of files and programs appears in list type.Keywords also appear in list type.

    emphasis Words or phrases that require extra emphasis use emphasis type.

    [] Brackets enclose command options and arguments that areoptional. You do not type the brackets if you choose to specifysuch option or arguments

    {} Braces enclose mutually exclusive choices separated by the pipe(|) character, where one choice must be selected. You do not type the braces with the choice.

    ... An ellipsis follows an item that can be repeated.

    (H) Sections, chapters, and appendixes that document Fortranextensions and implementation details particular to Concurrentbear this suffix.

    b Blank spaces in input and output records and formats aredesignated as bs.

    Concurrent Concurrent-specific text and commands appear in Concurrenttype. On color monitors, this is blue.

    4

  • Preface

    ConcurrentParameter Concurrent-specific parameters appear in Concurrent Parametertype. On color monitors, this is blue.

    Referenced Publications

    The following publications are referenced in this document:

    0890288 HAPSE Reference Manual0890423 PowerUX Programming Guide0890459 Compilation Systems Volume 1 (Tools)0890460 Compilation Systems Volume 2 (Concepts)0891019 C Reference Manual

    5

  • Concurrent Fortran 77 Reference Manual

    6

  • Contents

    Chapter 1 Introduction

    Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Language Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Enhancements (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Violations of the Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3T and TL Formats (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

    Chapter 2 Source Program Components

    General Component Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1Fortran Character Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1

    Treatment of Uppercase and Special Characters . . . . . . . . . . . . . . . . . . . . . . . . 2-2Collating Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

    Syntactical Elements of the Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Fortran Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

    Statement Label Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5Continuation Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5Statement Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Identification Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Blank Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7Debugging Lines (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7#pragma Lines (H). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7Include Lines (H). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8Program Unit Structure and Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8

    Execution Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9PROGRAM and NAME Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10END Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10

    Symbolic Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12

    Default Lengths for Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14Storage Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15

    Data Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15Hexadecimal Data (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17Octal Data (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18Binary Data (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19Integer Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20Real Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21Double Precision Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23Complex Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25Double Complex Data (H). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26Logical Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27Character Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28Hollerith Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30

    7

  • Concurrent Fortran 77 Reference Manual

    Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31

    Declaring an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32Referencing an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

    Character Substrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35Substring Referencing for Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35Substring Referencing for Array Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36

    Initialization of Variables and Arrays at Compile Time . . . . . . . . . . . . . . . . . . . . . . 2-36Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37Definition Status. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37Association of Symbolic Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38

    Chapter 3 Expressions and Assignment Statements

    Expressions and Statements Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1Arithmetic Expressions and Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1

    Simple and Compound Arithmetic Expressions. . . . . . . . . . . . . . . . . . . . . . . . . 3-1Constant Arithmetic Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Character Constant Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Precedence of Arithmetic Operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3Examples of Arithmetic Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4Exponentiation Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5Data Type Conversions (Mixed Modes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5Arithmetic Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10.SHIFT. and .ROTAT. Integer Operators (H) . . . . . . . . . . . . . . . . . . . . . . . . . 3-12

    Character Expressions and Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13Character Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13Character String Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14Character Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14

    Relational and Logical Comparisons and Assignments. . . . . . . . . . . . . . . . . . . . . . . 3-16Relational Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16Logical Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17Logical Operations Using Integer Operands (H) . . . . . . . . . . . . . . . . . . . . . . 3-20Logical Assignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21Implementation of the LOGICAL Data Type (H) . . . . . . . . . . . . . . . . . . . . . 3-22

    Default Implementation (H) . . . . . . . . . . . . . . . . . . . . . . . . . . ....

Recommended

View more >