For PGI Visual Fortran - Docs.nvidia

Transcription

PGI Fortran Language ReferenceFor PGI Visual FortranRelease 2012The Portland Group

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 license fromSTMicroelectronics and/or The Portland Group and may be used or copied only in accordance with the terms of the end-user license agreement ("EULA").PGI Workstation, PGI Server, PGI Accelerator, PGF95, PGF90, PGFORTRAN, and PGI Unified Binary are trademarks; and PGI, PGHPF, PGF77, PGCC, PGC , PGI Visual Fortran,PVF, PGI CDK, Cluster Development Kit, PGPROF, PGDBG, and The Portland Group are registered trademarks of The Portland Group Incorporated.No part of this document 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 theexpress written permission of STMicroelectronics and/or The Portland Group.PGI Fortran ReferenceCopyright 2005-2011, 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, 2008Seventh Printing: Release 7.2-4 August, 2008Eighth Printing: Release 8.0-1 November, 2008Ninth Printing: Release 8.1 November, 2008Tenth Printing: Release 9.0 June, 2009Eleventh Printing: Release 2010 November, 2009Twelfth Printing: Release 2010, 10.3 March, 2010Thirteenth Printing: Release 2010, 10.3 June, 2010Fourteenth Printing: Release 2011, 11.0 December, 2010Fifteenth Printing: Release 2011, 11.2 February, 2011Sixteenth Printing: Release 2012, 12.1 January, 2012Seventeenth Printing: Release 2012, 12.2 February, 2012www.pgroup.comTechnical support: trs@pgroup.comSales: sales@pgroup.comWeb: www.pgroup.comID: 1238957

ContentsPreface . xxiiiAudience Description . xxiiiCompatibility and Conformance to Standards . xxiiiOrganization . xxivHardware and Software Constraints . xxivConventions . xxvRelated Publications . xxv1. Language Overview . 1Elements of a Fortran Program Unit . 1Statements . 1Free and Fixed Source . 1Statement Ordering . 2The Fortran Character Set . 3Free Form Formatting . 4Fixed Formatting . 4Column Formatting . 4Fixed Format Label Field . 5Fixed Format Continuation Field . 5Fixed Format Statement Field . 5Fixed Format Debug Statements . 5Tab Formatting . 6Fixed Input File Format Summary . 6Include Fortran Source Files . 6Components of Fortran Statements . 7Symbolic Names . 7Expressions . 8Forming Expressions . 8Expression Precedence Rules . 8Arithmetic Expressions . 9Relational Expressions . 11Logical Expressions . 11Character Expressions . 12iii

Character Concatenation .Symbolic Name Scope .Assignment Statements .Arithmetic Assignment .Logical Assignment .Character Assignment .Listing Controls .OpenMP Directives .12121213131414152. 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 .Structure Constructors .Derived Types .Deferred Type Parameters .Typed Allocation .Arrays .Array Declaration Element .Deferred Shape Arrays .Subscripts .Character Substring .Array Constructor Syntax .Fortran Pointers and Targets .Fortran Binary, Octal and Hexadecimal Constants .Octal and Hexadecimal Constants - Alternate Forms .Hollerith Constants .Structures .Records .UNION and MAP Declarations .Data Initialization .Pointer Variables .Restrictions .Pointer Assignment 82930313233343536363. Fortran Statements . 37iv

PGI Fortran ReferenceStatement Format Overview .Definition of Statement-related Terms .Origin of Statement .List-related Notation .Fortran Statement Summary Table .ACCEPT .ALLOCATABLE .ALLOCATE .ASSIGN .ASSOCIATE .ASYNCHRONOUS .BACKSPACE .BLOCK DATA .BYTE .CALL .

PGI Fortran Language Reference Release 2012 While every precaution has been taken in the preparation of this document, The Portland Group (PGI ), a wholly-owned subsidiary of STMicroelectronics, Inc., makes no