PGI Fortran Reference Release 2013 - Docs.nvidia

1y ago
4 Views
1 Downloads
1.98 MB
248 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Francisco Tran
Transcription

PGI Fortran Reference Release 2013 The Portland Group

PGI Fortran Reference Copyright 2013 NVIDIA Corporation All rights reserved. Printed in the United States of America First Printing: Release 6.0 March, 2005 Second Printing: Release 6.1 December, 2005 Third Printing: Release 6.1-3 February, 2006 Fourth Printing: Release 7.0-1 December, 2006 Fifth Printing: Release 7.0-2 February, 2007 Sixth Printing: Release 7.2-1 May, 2008 Seventh Printing: Release 7.2-4 August, 2008 Eighth Printing: Release 8.0-1 November, 2008 Ninth Printing: Release 8.1 November, 2008 Tenth Printing: Release 9.0 June, 2009 Eleventh Printing: Release 2010 November, 2009 Twelfth Printing: Release 2010, 10.3 March, 2010 Thirteenth Printing: Release 2010, 10.3 June, 2010 Fourteenth Printing: Release 2011, 11.0 December, 2010 Fifteenth Printing: Release 2011, 11.2 February, 2011 Sixteenth Printing: Release 2012, 12.1 January, 2012 Seventeenth Printing: Release 2012, 12.2 February, 2012 Eighteenth Printing: Release 2012, 12.6 June, 2012 Nineteenth Printing: Release 2012, 12.10 October, 2012 Twentieth Printing: Release 2013, 13.3 March, 2013 Twenty-first Printing: Release 2013, 13.8 August, 2013 Twenty-second Printing: Release 2013, 13.9 September, 2013 www.pgroup.com Technical support: trs@pgroup.com Sales: sales@pgroup.com Web: www.pgroup.com ID: 13254149

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

Character Concatenation . Symbolic Name Scope . Assignment Statements . Arithmetic Assignment . Logical Assignment . Character Assignment . Listing Controls . OpenMP Directives . 12 12 12 13 13 14 14 15 2. Fortran Data Types . 17 Intrinsic 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 . 17 17 18 20 20 21 21 21 22 22 22 22 23 23 24 25 25 26 26 27 27 27 27 28 28 29 30 31 31 32 34 34 35 36 3. Fortran Statements . 37 iv

PGI Fortran Reference Statement Format Overview . Definition of Statement-related Terms . Origin of Statement . List-related Notation . Fortran Statement Summary Table . ACCEPT . ARRAY . BYTE . DECODE . DOUBLE COMPLEX . DOUBLE PRECISION . ENCODE . END MAP . END STRUCTURE . END UNION . INCLUDE . MAP . POINTER (Cray) . PROTECTED . RECORD . REDIMENSION . RETURN . STRUCTURE . UNION . VOLATILE . WAIT . 37 37 37 38 38 44 45 46 46 47 48 49 50 50 51 51 52 53 54 55 56 57 57 59 60 61 4. Fortran Arrays . 63 Array Types . Explicit Shape Arrays . Assumed Shape Arrays . Deferred Shape Arrays . Assumed Size Arrays . Array Specification . Explicit Shape Arrays . Assumed Shape Arrays . Deferred Shape Arrays . Assumed Size Arrays . Array Subscripts and Access . Array Sections and Subscript Triplets . Array Sections and Vector Subscripts . Array Constructors . 63 63 64 64 64 64 64 64 65 65 65 65 66 66 5. Input and Output . 67 File Access Methods . 67 Standard Preconnected Units . 68 v

Opening and Closing Files . Direct Access Files . Closing a File . Data Transfer Statements . Unformatted Data Transfer . Formatted Data Transfer . Implied DO List Input Output List . Format Specifications . Variable Format Expressions . Non-advancing Input and Output . List-directed formatting . List-directed input . List-directed output . Commas in External Field . Character Encoding Format . Namelist Groups . Namelist Input . Namelist Output . Recursive Input/Output . Input and Output of IEEE Infinities and NaNs . Output Format . Input Format . 68 68 69 71 72 72 72 73 82 82 82 82 83 84 85 85 85 86 86 86 86 87 6. Fortran Intrinsics . 89 Intrinsics Support . 89 ACOSD . 103 AND . 103 ASIND . 103 ASSOCIATED . 104 ATAN2D . 104 ATAND . 105 COMPL . 105 CONJG . 105 COSD . 106 DIM . 106 ININT . 106 INT8 . 107 IZEXT . 107 JINT . 108 JNINT . 108 KNINT . 108 LEADZ . 109 LSHIFT . 109 OR . 110 RSHIFT . 110 SHIFT . 111 vi

PGI Fortran Reference SIND . TAND . XOR . ZEXT . Intrinsic Modules . Module IEEE ARITHMETIC . Module IEEE EXCEPTIONS . IEEE FEATURES . Module iso c binding . Module iso fortran env . 111 111 112 112 112 113 117 120 120 121 7. Object Oriented Programming . 123 Inheritance . Polymorphic Entities . Unlimited Polymorphic Entities . Typed Allocation for Polymorphic Variables . Sourced Allocation for Polymorphic Variables . Procedure Polymorphism . Procedure Polymorphism with Type-Bound Procedures . Inheritance and Type-Bound Procedures . Procedure Overriding . Functions as Type-Bound Procedures . Information Hiding . Type Overloading . Data Polymorphism . Pointer Polymorphic Variables . Allocatable Polymorphic Variables . Sourced Allocation . Unlimited Polymorphic Objects . Abstract Types and Deferred Bindings . IEEE Modules . Intrinsic Functions . 123 124 125 126 126 126 127 131 132 134 134 136 137 137 138 139 140 145 148 148 8. OpenMP Directives for Fortran . 151 OpenMP Overview . OpenMP Shared-Memory Parallel Programming Model . Terminology . OpenMP Example . Task Overview . Tasks . Task Characteristics and Activities . Task Scheduling Points . Task Construct . Parallelization Directives . Directive Recognition . Directive Clauses . 151 151 152 153 154 154 155 155 156 157 158 158 vii

COLLAPSE (n) . 161 COPYIN (list) . 161 COPYPRIVATE(list) . 161 DEFAULT . 162 FIRSTPRIVATE(list) . 162 IF() . 162 LASTPRIVATE(list) . 162 NOWAIT . 162 NUM THREADS . 162 ORDERED . 163 PRIVATE .

This manual describes the Portland Group's implementation of the FORTRAN 77, Fortran 90/95, and Fortran 2003 languages. Collectively, The Portland Group compilers that implement these languages are referred to as

Related Documents:

Course focus on Fortran 90 (called Fortran for simplicity) Changes in later versions (mostly) not important for us ‣ Fortran 95: Minor revision of Fortran 90 ‣ Fortran 2003: Major additions to Fortran 95 ‣ Fortran 2008: Minor revision of Fortran 2003 gfortran compiler: ‣ Fortran 95: Completely supported

Fortran Evolution Fortran stands for FORmula TRANslation. The first compiler appeared in 1957 and the first official standard in 1972 which was given the name of Fortran 66'. This was updated in 1980 to Fortran 77, updated in 1991 to Fortran 90, updated in 1997 to Fortran 95, and further updated in 2004 to Fortran 2003. At each update some

PGI Installation Guide 1 Chapter 1. INTRODUCTION Welcome to Release 2015 of PGI Workstation , PGI Server , and PGI CDK Cluster Development Kit , a set of compilers and development tools for 32–bit and 64–bit x86– compatible processor–based workstations, servers, and clusters running versions of the Linux

PGI Installation Guide 1 Chapter 1. INTRODUCTION Welcome to Release 2016 of PGI Workstation , PGI Server , and PGI CDK Cluster Development Kit , a set of compilers and development tools for 32–bit and 64–bit x86– compatible processor–based workstations, servers, and clusters running versions of the Linux

INTRODUCTION TO ABSOFT FORTRAN Absoft Fortran is a complete implementation of the FORTRAN programming languages: FORTRAN 77, Fortran 90, and Fortran 95. It also completely implements ISO Technical Reports TR15580 and TR15581. The microprocessor-based computers of today are vastly more powerful and sophisticated than their predecessors.

Fortran is short for FORmula TRANslation and this guide is based on Fortran 90, which is a version agreed in 1990. Fortran 95, a later standard, was a minor revision of Fortran 90. The latest standard, Fortran 2003, is now supported by some compilers as well. Fortran was developed for general scientific computing and is a very

PGI Fortran Reference Guide Version 2015 PGI Compilers and Tools

Parallel Profiling for Scientists and Engineers 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 . PGI Fortran Reference Manual describes the FORTRAN 77, Fortran 90/