fortran reference guide - of a fortran program unit ... 2.8. fortran binary, octal and hexadecimal...

Download Fortran Reference Guide - of a Fortran Program Unit ... 2.8. Fortran Binary, Octal and Hexadecimal Constants…

Post on 24-Jun-2018

214 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • FORTRAN REFERENCE GUIDE

    Version2018

  • Fortran Reference Guide Version2018|ii

    TABLE OF CONTENTS

    Preface............................................................................................................ xvAudience Description......................................................................................... xvCompatibility and Conformance to Standards............................................................ xvOrganization................................................................................................... xviHardware and Software Constraints...................................................................... xviiConventions................................................................................................... xviiRelated Publications........................................................................................ xviii

    Chapter1.Language Overview............................................................................... 11.1.Elements of a Fortran Program Unit.................................................................. 1

    1.1.1.Fortran Statements................................................................................. 11.1.2.Free and Fixed Source............................................................................. 21.1.3.Statement Ordering................................................................................. 2

    1.2.The Fortran Character Set.............................................................................. 31.3.Free Form Formatting................................................................................... 41.4.Fixed Formatting..........................................................................................5

    1.4.1.Column Formatting..................................................................................51.4.2.Fixed Format Label Field.......................................................................... 51.4.3.Fixed Format Continuation Field................................................................. 51.4.4.Fixed Format Statement Field.................................................................... 61.4.5.Fixed Format Debug Statements..................................................................61.4.6.Tab Formatting.......................................................................................61.4.7.Fixed Input File Format Summary................................................................ 6

    1.5. Include Fortran Source Files............................................................................ 71.6.Components of Fortran Statements................................................................... 7

    1.6.1.Symbolic Names..................................................................................... 81.7.Expressions.................................................................................................8

    1.7.1.Forming Expressions.................................................................................81.7.2.Expression Precedence Rules...................................................................... 91.7.3.Arithmetic Expressions............................................................................. 91.7.4.Relational Expressions.............................................................................111.7.5.Logical Expressions................................................................................ 121.7.6.Character Expressions............................................................................. 121.7.7.Character Concatenation......................................................................... 12

    1.8.Symbolic Name Scope.................................................................................. 131.9.Assignment Statements.................................................................................13

    1.9.1.Arithmetic Assignment............................................................................ 131.9.2.Logical Assignment.................................................................................141.9.3.Character Assignment............................................................................. 14

    1.10.Listing Controls.........................................................................................151.11.OpenMP Directives..................................................................................... 15

  • Fortran Reference Guide Version2018|iii

    Chapter2.Fortran Data Types.............................................................................. 162.1. Intrinsic Data Types..................................................................................... 16

    2.1.1.Kind Parameter..................................................................................... 162.1.2.Number of Bytes Specification.................................................................. 17

    2.2.Constants................................................................................................. 192.2.1. Integer Constants.................................................................................. 192.2.2.Binary, Octal and Hexadecimal Constants..................................................... 202.2.3.Real Constants......................................................................................202.2.4.Double Precision Constants.......................................................................202.2.5.Complex Constants................................................................................ 212.2.6.Double Complex Constants....................................................................... 212.2.7.Logical Constants.................................................................................. 212.2.8.Character Constants............................................................................... 222.2.9.Parameter Constants.............................................................................. 22

    2.3.Structure Constructors................................................................................. 222.4.Derived Types............................................................................................ 242.5.Deferred Type Parameters............................................................................. 25

    2.5.1.Typed Allocation................................................................................... 252.6.Arrays......................................................................................................25

    2.6.1.Array Declaration Element....................................................................... 262.6.2.Deferred Shape Arrays............................................................................ 262.6.3. Subscripts............................................................................................272.6.4.Character Substring................................................................................272.6.5.Array Constructor Syntax......................................................................... 27

    2.7.Fortran Pointers and Targets.......................................................................... 282.8.Fortran Binary, Octal and Hexadecimal Constants.................................................28

    2.8.1.Octal and Hexadecimal Constants - Alternate Forms........................................ 292.9.Hollerith Constants......................................................................................302.10. Structures............................................................................................... 31

    2.10.1.Records............................................................................................. 322.10.2.UNION and MAP Declarations................................................................... 332.10.3.Data Initialization................................................................................ 34

    2.11.Pointer Variables....................................................................................... 352.11.1.Restrictions........................................................................................ 352.11.2.Pointer Assignment............................................................................... 36

    Chapter3.Fortran Statements.............................................................................. 373.1.Statement Format Overview.......................................................................... 37

    3.1.1.Definition of Statement-related Terms.........................................................373.1.2.Origin of Statement............................................................................... 383.1.3.List-related Notation.............................................................................. 38

    3.2.Fortran Statement Summary Table................................................................... 383.3.ACCEPT....................................................................................................433.4.ARRAY......................................................................................................44

  • Fortran Reference Guide Version2018|iv

    3.5. BYTE....................................................................................................... 453.6.DECODE....................................................................................................463.7.DOUBLE COMPLEX....................................................................................... 473.8.DOUBLE PRECISION...................................................................................... 483.9. ENCODE................................................................................................... 493.10.END MAP...............................................................

Recommended

View more >