Concurrent Fortran 77 Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
Concurrent Fortran 77 Reference Manual 0890240-100 August 2004 Copyright 2004 by Concurrent Computer Corporation. All rights reserved. This publication or any part thereof is intended for use with Concurrent products by Concurrent personnel, customers, and end–users. It may not be reproduced 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 change without notice. Concurrent makes no warranties, expressed or implied, concerning the information contained in this document. To report an error or comment on a specific portion of the manual, photocopy the page in question and mark the correction 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 the publisher. 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.0 Current 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 the Fortran 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 77 compiler. Language extensions, enhancements, syntax notation, and violations of the 1977 standard Fortran are discussed. • Chapter 2 describes the source program components; included in this chapter are character sets, statements, syntactical elements, program unit structure and terminology. Also discussed are data types, data constants, storage alignment and arrays. • Chapter 3 discusses Fortran expressions and assignments. The Fortran language permits arithmetic, character, relational, and logical expressions. The use of Fortran expressions in assignment statements is discussed in detail in this chapter. • Chapter 4 deals with the specification and declaration statements. Each statement is described in detail containing a definition, syntax line and explanation of the syntax. • Chapter 5 provides a general description of control statements, their order of 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 Fortran language. The input statements transfer data stored on an external storage medium into memory while the Fortran output statements transfer data from memory to an external storage medium. • Chapter 7 provides information about format specification, defining size of input and output fields, the type of data being read or written and how the data are to be edited. • Chapter 8 deals with the subprograms which are units independent of the main 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 the Fortran intrinsic functions as well as functions that are in addition to the Fortran 77 standard. • Chapter 10 provides the information necessary for compilation and execution. Discussed in this chapter are compiling, preprocessing, linking, and assembling. Also included in this chapter are the f77 compiler options and 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 manual pages. Syntax Notation The following notation is used throughout this guide: italic Books, reference cards, and items that the user must specify appear in italic type. Special terms may also appear in italic. list bold User input appears in list bold type and must be entered exactly as shown. Names of directories, files, commands, options and 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 are optional. You do not type the brackets if you choose to specify such 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 Fortran extensions and implementation details particular to Concurrent bear this suffix. b Blank spaces in input and output records and formats are designated as bs. Concurrent Concurrent-specific text and commands appear in Concurrent type. On color monitors, this is blue. 4 Preface ConcurrentParameter Concurrent-specific parameters appear in Concurrent Parameter type. On color monitors, this is blue. Referenced Publications The following publications are referenced in this document: 0890288 HAPSE Reference Manual 0890423 PowerUX Programming Guide 0890459 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-1 Language Extensions. 1-1 Enhancements (H) . 1-1 Violations of the Standard . 1-3 T and TL Formats (H) . 1-3 Chapter 2 Source Program Components General Component Information. 2-1 Fortran Character Set. 2-1 Treatment of Uppercase and Special Characters . 2-2 Collating Sequence. 2-2 Syntactical Elements of the Language. 2-2 Fortran Statements. 2-3 Lines . 2-4 Statement Label Field. 2-5 Continuation Field . 2-5 Statement Field. 2-6 Identification Field . 2-6 Comments . 2-6 Blank Lines . 2-7 Debugging Lines (H) . 2-7 #pragma Lines (H). 2-7 Include Lines (H). 2-8 Program Unit Structure and Terminology . 2-8 Execution Sequence . 2-9 PROGRAM and NAME Statements . 2-10 END Statement. 2-10 Symbolic Names . 2-11 Data Types . 2-12 Default Lengths for Data Types . 2-14 Storage Alignment . 2-15 Data Constants. 2-15 Hexadecimal Data (H) . 2-17 Octal Data (H) . 2-18 Binary Data (H) . 2-19 Integer Data . 2-20 Real Data . 2-21 Double Precision Data . 2-23 Complex Data . 2-25 Double Complex Data (H). 2-26 Logical Data . 2-27 Character Data . 2-28 Hollerith Data . 2-30 7 Concurrent Fortran 77 Reference Manual Variables. 2-30 Arrays. 2-31 Declaring an Array . 2-32 Referencing an Array . 2-34 Character Substrings . 2-35 Substring Referencing for Variables . 2-35 Substring Referencing for Array Elements. 2-36 Initialization of Variables and Arrays at Compile Time . 2-36 Arguments . 2-37 Definition Status. 2-37 Association of Symbolic Names . ..