Intel ® Fortran Programmer's Reference
Total Page:16
File Type:pdf, Size:1020Kb
® Intel Fortran Programmer’s Reference Copyright © 1996-2003 Intel Corporation All Rights Reserved Issued in U.S.A. Version Number: FWL-710-02 World Wide Web: http://developer.intel.com Information in this document is provided in connection with Intel products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSO- EVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PAR- TICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life saving, or life sustaining applications. This Intel® Fortran Programmer’s Reference as well as the software described in it is furnished under license and may only be used or copied in accordance with the terms of the license. The information in this manual is furnished for infor- mational use only, is subject to change without notice, and should not be construed as a commitment by Intel Corpora- tion. Intel Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this document or any software that may be provided in association with this document. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "unde- fined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibil- ities arising from future changes to them. Intel SpeedStep, Intel Thread Checker, Celeron, Dialogic, i386, i486, iCOMP, Intel, Intel logo, Intel386, Intel486, Intel740, IntelDX2, IntelDX4, IntelSX2, Intel Inside, Intel Inside logo, Intel NetBurst, Intel NetStructure, Intel Xeon, Intel Centrino, Intel XScale, Itanium, MMX, MMX logo, Pentium, Pentium II Xeon, Pentium III Xeon, Intel Pentium M, and VTune are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. * Other names and brands may be claimed as the property of others. Copyright © Intel Corporation 1996 - 2003. Contents About This Manual Related Publications............................................................. xxiv Notational Conventions.......................................................... xxv Chapter 1 Introduction to Intel® Fortran Compiler New Features in Fortran 95 .................................................. 1-2 Source Format .................................................................. 1-2 Data Types........................................................................ 1-2 Operators.......................................................................... 1-3 Control Constructs ............................................................ 1-3 Arrays................................................................................ 1-3 Procedures........................................................................ 1-4 Pointers............................................................................. 1-5 Modules ............................................................................ 1-5 Non-advancing I/O............................................................ 1-5 Namelist I/O ...................................................................... 1-6 Chapter 2 Language Elements Character Set ........................................................................ 2-1 Lexical Tokens ....................................................................... 2-2 Names ................................................................................... 2-2 Program Structure ................................................................. 2-3 Statement Labels................................................................... 2-3 v IntelFortranProgrammer’s Reference Construct Names................................................................... 2-4 Statements............................................................................. 2-4 Statement Order................................................................ 2-6 Source Program Forms ......................................................... 2-8 Fixed Source Form ........................................................... 2-8 Initial Line ..................................................................... 2-9 Continuation Line ......................................................... 2-9 Comment Line............................................................ 2-10 Tab-format Lines ........................................................ 2-10 Free Source Form........................................................... 2-10 Source Lines .............................................................. 2-10 Statement Labels........................................................ 2-11 Spaces ....................................................................... 2-11 Examples Using Spaces ............................................ 2-11 Comments.................................................................. 2-12 Statement Continuation.............................................. 2-12 Example of Statement Continuation........................... 2-13 Intersection Source Form................................................ 2-13 INCLUDE Line ..................................................................... 2-14 Example of INCLUDE Lines....................................... 2-15 Chapter 3 Data Types and Data Objects Terminology........................................................................... 3-1 Intrinsic Data Types ............................................................... 3-2 Derived Types........................................................................ 3-4 Type Declarations.................................................................. 3-5 Examples of Type Declarations ........................................ 3-7 Alternative Form of Intrinsic Type Spec Declaration ......... 3-8 Alternative Form of Initialization Within Declaration..... 3-9 Increasing Default Sizes .............................................. 3-9 Intrinsic InquiryFunctions ................................................. 3-9 Attributes......................................................................... 3-10 vi Contents Representation of Literal Constants ..................................... 3-11 Integer Constants ............................................................ 3-11 BOZ Constants .......................................................... 3-12 Real Constants............................................................... 3-13 Complex Constants ........................................................ 3-14 Character Constants....................................................... 3-14 Logical Constants ........................................................... 3-16 Typeless Constants ........................................................ 3-16 Extended Use of BOZ Constants............................... 3-17 Hollerith Constants .................................................... 3-18 Character Substrings .......................................................... 3-19 Derived-type Definition........................................................ 3-20 Structure Constructor ..................................................... 3-22 Implicit and Explicit Typing .................................................. 3-22 IMPLICIT Statement .................................................. 3-23 Data Initialization................................................................. 3-24 Storage Association and Alignment .................................... 3-25 Storage Association Alignment Rule .............................. 3-25 Dynamic Data Objects......................................................... 3-26 Allocatable Arrays........................................................... 3-27 Pointers .......................................................................... 3-27 CRAY*-StylePointers................................................3-27 Automatic Objects .......................................................... 3-28 Records and Structures....................................................... 3-28 Chapter 4 Arrays New Features........................................................................ 4-1 ArrayProperties .................................................................... 4-3 ArrayDeclaration .................................................................. 4-4 Syntax............................................................................... 4-5 Examples of ArraySpecifiers ........................................... 4-5 ArrayElement Storage Order ........................................... 4-6 vii IntelFortranProgrammer’s Reference ArrayCategories.................................................................... 4-7 Explicit-shape Arrays ........................................................ 4-7 Assumed-shape Arrays..................................................... 4-9 Deferred-shape Arrays.................................................... 4-12 Pointer Arrays ............................................................ 4-12 Allocatable Arrays ...................................................... 4-13 Assumed-size Arrays ...................................................... 4-15 Whole Arrays and Array Subobjects...................................