PGI Fortran Reference - NMSU Astronomy

Transcription

PGI Fortran ReferenceThe Portland Group STMicroelectronicsTwo Centerpointe DriveLake Oswego, OR 97035

While every precaution has been taken in the preparation of this document, The Portland Group (PGI ), a wholly-owned subsidiary of STMicroelectronics, Inc., makes nowarranty for the use of its products and assumes no responsibility for any errors that may appear, or for damages resulting from the use of the information contained herein.The Portland Group retains the right to make changes to this information at any time, without notice. The software described in this document is distributed under licensefrom STMicroelectronics, Inc. and/or The Portland Group and may be used or copied only in accordance with the terms of the license agreement ("EULA"). No part of thisdocument may be reproduced or transmitted in any form or by any means, for any purpose other than the purchaser's or the end user's personal use without the expresswritten permission of STMicroelectronics, Inc and/or The Portland Group .Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this manual,STMicroelectronics was aware of a trademark claim. The designations have been printed in caps or initial caps.PGF95, PGF90, and PGI Unified Binary are trademarks; and PGI, PGHPF, PGF77, PGCC, PGC , PGI Visual Fortran, PVF, Cluster Development Kit, PGPROF, PGDBG, and ThePortland Group are registered trademarks of The Portland Group Incorporated. PGI CDK is a registered trademark of STMicroelectronics. *Other brands and names are theproperty of their respective owners.PGI Fortran ReferenceCopyright 2005-2008, STMicroelectronics, Inc.All rights reserved.Printed in the United States of AmericaFirst Printing: Release 6.0 March, 2005Second Printing: Release 6.1 December, 2005Third Printing: Release 6.1-3 February, 2006Fourth Printing: Release 7.0-1 December, 2006Fifth Printing: Release 7.0-2 February, 2007Sixth Printing: Release 7.2-1 May, 2008www.pgroup.comTechnical support: www.pgroup.com/support/Sales: sales@pgroup.comWeb: www.pgroup.com

ContentsPreface . xixAudience Description .Compatibility and Conformance to Standards .Organization .Hardware and Software Constraints .Conventions .Related Publications .xixxixxxxxixxixxi1. Language Overview . 1Elements of a Fortran Program Unit . 1Statements . 1Free and Fixed Source . 1Statement Ordering . 2The Fortran Character Set . 2Free Form Formatting . 4Fixed Formatting . 4Column Formatting . 4Fixed Format Label Field . 5Fixed Format Continuation Field . 5Fixed Format Statement Field . 5Fixed Format Debug Statements . 5Tab Formatting . 5Fixed Input File Format Summary . 5Include Fortran Source Files . 6The Components of Fortran Statements . 7Symbolic Names . 7Expressions . 7Expression Precedence Rules . 8Arithmetic Expressions . 9Relational Expressions . 10Logical Expressions . 11Character Expressions . 11Character Concatenation . 11iii

Symbolic Name Scope .Assignment Statements .Arithmetic Assignment .Logical Assignment .Character Assignment .Listing Controls .OpenMP Directives .HPF Directives .12121213131414142. Fortran Data Types . 17Intrinsic Data Types .Kind Parameter .Number of Bytes Specification .Constants .Integer Constants .Binary, Octal and Hexadecimal Constants .Real Constants .Double Precision Constants .Complex Constants .Double Complex Constants .Logical Constants .Character Constants .PARAMETER Constants .Derived Types .Arrays .An Array Declaration Element .Deferred Shape Arrays .Subscripts .Character Substring .Fortran Pointers and Targets .Fortran Binary, Octal and Hexadecimal Constants .Octal and Hexadecimal Constants - Alternate Form § .Hollerith Constants .Structures .Records .UNION and MAP Declarations .Data Initialization .Pointer Variables .Restrictions 8293131323. Fortran Statements . 33Statement Format Overview .Definition of Statement-related Terms .Origin of Statement .List-related Notation .ACCEPT .iv3333333434

PGI Fortran ReferenceALLOCATABLE .ALLOCATE .ARRAY .ASSIGN .BACKSPACE .BLOCK DATA .BYTE .CALL .CASE .CHARACTER .CLOSE .COMMON .COMPLEX .CONTAINS .CONTINUE .CYCLE .

PGF95, PGF90, and PGI Unified Binary are trademarks; and PGI, PGHPF, PGF77, PGCC, PGC , PGI Visual Fortran, PVF, Cluster Development Kit, PGPROF, PGDBG, and The Portland Group are registered trademarks of The Portland Group Incorporated. PGI CDK is a registered trademark of STMicroelectronics. *Other brands and names are the