Cover....1
Half Title....2
Title Page....4
Copyright Page....5
Dedication....6
Table of Contents....8
Preface....24
Acknowledgments....26
Author....28
1: Preliminaries....30
1.1 Character Set....31
1.2 Identifiers....32
1.3 Intrinsic Data Types....33
1.4 Constants and Variables....33
1.5 Integer Constants....33
1.6 Real Constants....34
1.7 Double Precision Constants....35
1.8 Complex Constants....35
1.9 Double Precision Complex Constants....36
1.10 Quadruple (Quad) Precision Constants....36
1.11 Logical Constants....36
1.12 Character Constants....36
1.13 Literal Constants....37
1.14 Variables....37
1.15 Variable Declarations....37
1.16 Meaning of a Declaration....38
1.17 Assignment Operator....39
1.18 Named Constants....39
1.19 Keywords....40
1.20 Lexical Tokens....41
1.21 Delimiters....41
1.22 Source Form....42
1.23 Free Form....42
1.24 Continuation of Character Strings....44
1.25 Structure of a Program....45
1.26 IMPLICIT NONE....45
1.27 IMPLICIT....46
1.28 Rules of IMPLICIT....47
1.29 Type Declarations....47
1.30 Comments on IMPLICIT Statement....48
1.31 PROGRAM Statement....48
1.32 END Statement....48
1.33 Initialization....49
1.34 Number System....49
1.35 Binary Numbers....50
1.36 Octal Numbers....50
1.37 Hexadecimal Numbers....50
1.38 Initialization Using DATA Statement....50
1.39 BOZ Numbers....51
1.40 Integer Variables and BOZ Numbers....51
1.41 Executable and Non-Executable Statements....52
1.42 INCLUDE Directive....52
1.43 Statement Ordering....53
1.44 Processor Dependencies....53
1.45 Compilation and Execution of Fortran Programs....53
2: Arithmetic, Relational and Logical Operators and Expressions....54
2.1 Arithmetic Operators....54
2.2 Arithmetic Expressions....55
2.3 Assignment Sign....55
2.4 Rules for Arithmetic Expressions....56
2.5 Precedence of the Arithmetic Operators....57
2.6 Multiple Statements....58
2.7 Mixed-Mode Operations....59
2.8 Integer Division....61
2.9 List-Directed Input/Output Statement....62
2.10 Variable Assignment—Comparative Study....62
2.11 Library Functions....64
2.12 Memory Requirement of Intrinsic Data Types....65
2.13 Programming Examples....65
2.14 BLOCK Construct....66
2.15 Assignment of BOZ Numbers....67
2.16 Initialization and Library Functions....68
2.17 Relational Operators....68
2.18 Precedence Rule of Relational Operators....69
2.19 Relational Operators and Complex Numbers....69
2.20 Logical Operators....69
2.21 Precedence Rule of Logical Operators....71
2.22 Precedence of the Operators Discussed So Far....71
3: Branch and Loop Statements....72
3.1 GO TO Statement....72
3.2 Block IF....73
3.3 IF-THEN-ELSE....73
3.4 ELSE-IF....75
3.5 Nested IF....77
3.6 Nested IF without ELSE....78
3.7 Rules of Block IF....78
3.8 CASE Statement....80
3.9 CASE DEFAULT....82
3.10 CASE and LOGICAL....83
3.11 Nested CASE....83
3.12 EXIT Statement and CASE....83
3.13 Rules of CASE....84
3.14 Programming Example....85
3.15 DO Statement....86
3.16 Negative Increment....88
3.17 Infinite Loop....88
3.18 EXIT Statement....89
3.19 CYCLE Statement....89
3.20 DO WHILE....90
3.21 Nested DO....92
3.22 CYCLE, EXIT and the Nested Loop....94
3.23 Termination of DO Loop....95
3.24 Rules of DO Statement....95
3.25 Remark about Loop Statements....99
4: Handling of Characters....100
4.1 Assignment....100
4.2 Concatenation....100
4.3 Collating Sequence....101
4.4 Character Comparison....102
4.5 Comparison of Character Strings....102
4.6 Lexical Comparison Functions....103
4.7 Length of a String....104
4.8 Trimming and Adjusting a String....104
4.9 REPEAT....105
4.10 Character–Integer Conversion....106
4.11 Character Substring....106
4.12 Programming Examples....108
4.13 Library Functions INDEX, SCAN and VERIFY....110
4.14 CASE and CHARACTER....113
4.15 NEW LINE....114
5: Precision and Range....116
5.1 SELECTED_INT_KIND....117
5.2 Precision and Range of Real Numbers....119
5.3 SELECTED_REAL_KIND....119
5.4 SELECTED_CHAR_KIND....121
5.5 KIND Intrinsic....121
5.6 KIND and COMPLEX Constants....123
5.7 KIND and Character Handling Intrinsics....123
5.8 Quadruple (Quad) Precision....124
5.9 DOUBLE COMPLEX....124
5.10 IMPLICIT and SELECTED KIND....125
5.11 Type Parameter Inquiry....126
5.12 Named Kind Constants....126
6: Array and Array-Handling Intrinsics....128
6.1 Array Declaration....128
6.2 Multidimensional Array....130
6.3 Storage Arrangement of Two dimensional Array....130
6.4 Characteristics of Array....131
6.5 Array Constants....133
6.6 Initialization....134
6.7 Initialization with DATA Statement....134
6.8 Repeat Factor and Initialization....135
6.9 DATA Statement and Implied DO Loop....136
6.10 Named Array Constant....137
6.11 Character Variable and Array Constructors....137
6.12 Array Elements....138
6.13 Array Assignment and Array Arithmetic....138
6.14 Array Section....140
6.15 Array Input....143
6.16 Array Output....143
6.17 Programming Examples....144
6.18 Array Bounds....148
6.19 LBOUND....149
6.20 UBOUND....149
6.21 RESHAPE....150
6.22 Vector Subscripts....153
6.23 WHERE Statement....155
6.24 DO CONCURRENT....158
6.25 FORALL Statement....161
6.26 Rules for FORALL....162
6.27 EQUIVALENCE Statement....163
6.28 EQUIVALENCE and Character Variables....165
6.29 Programming Examples....167
6.30 Array-Handling Intrinsics....170
6.31 Maximum, Minimum and Finding Location....170
6.32 SUM and PRODUCT....175
6.33 Handling of Arrays of More than Two Dimensions....176
6.34 DOT_PRODUCT....178
6.35 Matrix Multiplication....178
6.36 TRANSPOSE of a Matrix....179
6.37 Array Shift....180
6.38 Euclidian Norm....184
6.39 Parity of Logical Array....185
6.40 Locating and Counting Array Elements....185
6.41 Packing and Unpacking....187
6.42 MERGE....190
6.43 REDUCE....191
7: User Defined Data Type....192
7.1 Derived Type....192
7.2 Assignment....193
7.3 Initialization....194
7.4 Named Constant and Derived Type....194
7.5 Keywords and Derived Types....195
7.6 IMPLICIT and Derived Types....195
7.7 Input and Output....195
7.8 Substrings....196
7.9 Array and Derived Types....197
7.10 Nested Derived Types....198
7.11 Arrays as Elementary Items....199
7.12 SEQUENCE....200
7.13 Derived Types and EQUIVALENCE Statement....200
7.14 Parameterized Derived Types....201
8: Format Statement....204
8.1 Edit Descriptors....204
8.2 Input/Output Lists....205
8.3 General Form of Format Statement....206
8.4 Carriage Control....207
8.5 Summary of Edit Descriptors....207
8.6 Descriptor for Integer....207
8.7 Descriptors for Real Number....209
8.8 Insufficient Width....212
8.9 Format and List Elements....213
8.10 Descriptors for Complex Number....214
8.11 Descriptors for BOZ Numbers....214
8.12 Descriptor for Logical....215
8.13 Descriptor for Character....215
8.14 General Edit Descriptor....216
8.15 Unlimited Repeat Factor....218
8.16 Scale Factor....218
8.17 Leading Signs....219
8.18 Tab Descriptors....220
8.19 X Descriptor....221
8.20 Slash Descriptor....221
8.21 Embedded Blanks....222
8.22 Apostrophe and Quote Descriptors....223
8.23 Colon Descriptor....224
8.24 Decimal Editing....224
8.25 Rounding Modes....224
8.26 Variable Format....225
8.27 Memory to Memory Input/Output....226
8.28 NAMELIST....226
8.29 NAMELIST Comment....230
8.30 Rules for NAMELIST....230
8.31 Processor Dependency....231
9: Auxiliary Storage....232
9.1 Record....232
9.2 File....232
9.3 Formatted Record....232
9.4 Unformatted Record....233
9.5 Endfile Record....233
9.6 Sequential File....233
9.7 Direct File....233
9.8 Stream File....233
9.9 Unit Number....233
9.10 Scratch and Saved Files....234
9.11 OPEN, CLOSE and INQUIRE Statements....234
9.12 Optional Specifiers....234
9.13 Kind Type Parameters of Integer Specifiers....244
9.14 ENDFILE Statement....244
9.15 REWIND Statement....244
9.16 BACKSPACE Statement....244
9.17 Data Transfer Statement....245
9.18 READ/WRITE Statement....245
9.19 Asynchronous Input/Output....248
9.20 FLUSH Statement....250
9.21 Rules for Input/Output Control List....250
9.22 IS_IOSTAT_END....251
9.23 IS_IOSTAT_EOR....251
9.24 Examples of File Operations....251
9.25 Stream Input/Output....253
9.26 Storage Unit of Stream Input/Output....253
9.27 Stream Input/Output Type....254
9.28 Stream File Opening....254
9.29 Unformatted Stream File....254
9.30 Formatted Stream I/O....255
9.31 Rule of Thumb....256
9.32 Recursive Input/Output....257
9.33 Processor Dependencies....257
10: Numerical Model....258
10.1 Numerical Model for Integers....258
10.2 BASE....258
10.3 Largest Integer....259
10.4 DIGITS for Integers....259
10.5 RANGE for Integers....259
10.6 Real Numbers....260
10.7 FRACTION and EXPONENT....260
10.8 MAXEXPONENT and MINEXPONENT....260
10.9 Largest and Smallest Real Numbers....261
10.10 DIGITS for Real Numbers....261
10.11 RANGE for Real Numbers....261
10.12 PRECISION....262
10.13 SCALE....262
10.14 SET_EXPONENT....262
10.15 EPSILON....262
10.16 NEAREST....263
10.17 SPACING....263
10.18 RRSPACING....263
10.19 Programming Example....264
11: Library Functions....266
11.1 Generic Names....266
11.2 Intrinsic Procedures....266
11.3 Pure Procedures....266
11.4 Elemental Procedures....266
11.5 Enquiry Functions....267
11.6 Transformational Functions....267
11.7 Non-elemental Procedures....267
11.8 Argument Keywords....267
11.9 Variable Number of Arguments....268
11.10 Optional Arguments....268
11.11 Types of Available Intrinsics....268
11.12 Intrinsic Statement....269
11.13 Processor Dependencies....269
11.14 Final Word....269
12: Subprograms....270
12.1 FUNCTION Subprogram....271
12.2 SUBROUTINE Subprogram....274
12.3 CALL Statement....275
12.4 INTENT....277
12.5 Internal Procedure....278
12.6 Character Type Argument....281
12.7 Argument Types....284
12.8 Call by Reference....284
12.9 Call by Value....284
12.10 RETURN Statement....285
12.11 INTERFACE Block....286
12.12 Array as Arguments....287
12.13 User Defined Type as Argument....289
12.14 MODULE....290
12.15 MODULE PROCEDURE....292
12.16 PUBLIC and PRIVATE Attributes....294
12.17 PROTECTED Attribute....299
12.18 Scope Rules....301
12.19 Generic Subprograms....303
12.20 ABSTRACT Interface....305
12.21 Keyword Arguments....307
12.22 Operator Overloading....308
12.23 Overloading of Assignment Operator....312
12.24 Overloading of Standard Library Functions....313
12.25 User Defined Operators....314
12.26 Use Statement and Renaming Operators....316
12.27 Precedence of Overloaded Operators....317
12.28 Precedence of User Defined Operators....317
12.29 OPTIONAL Arguments....318
12.30 PRESENT Intrinsic....319
12.31 Assumed Rank of Dummy Arguments....320
12.32 Array-Valued Functions....321
12.33 SAVE Variables....321
12.34 COMMON Statement....323
12.35 BLOCK DATA....324
12.36 COMMON and DIMENSION....326
12.37 COMMON and User Defined Type....326
12.38 COMMON and EQUIVALENCE....326
12.39 EXTERNAL Statement....327
12.40 Recursion....330
12.41 RECURSIVE FUNCTION....330
12.42 RECURSIVE SUBROUTINE....332
12.43 PURE Procedure....334
12.44 Rules for PURE Procedure....334
12.45 ELEMENTAL Procedure....335
12.46 IMPURE ELEMENTAL Procedure....336
12.47 SUBMODULE....337
12.48 EQUIVALENCE and MODULE....340
12.49 Function Calls and Side Effects....340
12.50 Mechanism of a Subprogram Call....341
12.51 Recursive Input/Output....341
12.52 Programming Examples....342
13: String with Variable Length....348
13.1 Assignment....348
13.2 Concatenation....350
13.3 Comparison....350
13.4 Extended Meaning of Intrinsics....351
13.5 PUT....351
13.6 PUT_LINE....351
13.7 GET....352
13.8 EXTRACT....353
13.9 REMOVE....353
13.10 REPLACE....353
13.11 SPLIT....354
14: IEEE Floating Point Arithmetic and Exceptions....356
14.1 Representation of Floating Point Numbers (IEEE Standard)....356
14.2 Single Precision 32-Bit Floating Point Numbers (IEEE Standard)....356
14.3 Denormal (Subnormal) Numbers....359
14.4 Representation of Zero....359
14.5 Representation of Infinity....360
14.6 Representation of NaN (Not a Number)....361
14.7 Summary of IEEE “Numbers”....361
14.8 Divide by Zero....363
14.9 Overflow....363
14.10 Underflow....363
14.11 Inexact Computation....363
14.12 Invalid Arithmetic Operation....363
14.13 IEEE Modules....363
14.14 IEEE Features....364
14.15 IEEE FLAGS....364
14.16 Derived Types and Constants Defined in the Modules....365
14.17 IEEE Operators....365
14.18 Inquiry Functions (Arithmetic Module)....366
14.19 IEEE_CLASS....367
14.20 IEEE_COPY_SIGN....368
14.21 IEEE_VALUE....368
14.22 IEEE_IS_FINITE....369
14.23 IEEE_IS_NAN....369
14.24 IEEE_IS_NEGATIVE....369
14.25 IEEE_IS_NORMAL....369
14.26 IEEE_INT....369
14.27 IEEE_REAL....370
14.28 IEEE_SIGNBIT....370
14.29 IEEE_MAX_NUM and IEEE_MIN_NUM....370
14.30 IEEE_MAX_NUM_MAG and IEEE_MIN_NUM_MAG....370
14.31 IEEE_FMA....370
14.32 IEEE_LOGB....371
14.33 IEEE_NEXT_AFTER, IEEE_NEXT_DOWN and IEEE_NEXT_UP....371
14.34 IEEE_REM....372
14.35 IEEE_SCALB....372
14.36 IEEE_GET_ROUNDING_MODE....372
14.37 IEEE_SET_ROUNDING_MODE....373
14.38 IEEE_RINT....373
14.39 IEEE_UNORDERED....374
14.40 IEEE_GET_HALTING_MODE....374
14.41 IEEE_SET_HALTING_MODE....374
14.42 IEEE_GET_MODES and IEEE_SET_MODES....375
14.43 IEEE_GET_STATUS and IEEE_SET_STATUS....375
14.44 IEEE_GET_FLAG and IEEE_SET_FLAG....376
14.45 IEEE_GET_UNDERFLOW_MODE....376
14.46 IEEE_SET_UNDERFLOW_MODE....377
14.47 IEEE_SELECTED_REAL_KIND....377
14.48 Arithmetic IF and IEEE_VALUE....378
14.49 IEEE_QUIET Compare Routines....378
14.50 IEEE_SIGNALING Compare Routines....378
14.51 NaN, Infinity and Format....378
14.52 Relational Operators, Infinity and NaN....379
14.53 Exception within a Procedure....380
14.54 Exception Outside a Procedure....381
14.55 Programming Examples....382
14.56 Out of Range....384
14.57 Processor Dependencies....384
15: Dynamic Memory Management....386
15.1 ALLOCATABLE Arrays....386
15.2 DEALLOCATE Statement....389
15.3 ALLOCATED Intrinsic....390
15.4 Derived Type and ALLOCATE....390
15.5 Allocated Array and Subprogram....391
15.6 ALLOCATE and Dummy Parameter....394
15.7 Allocatable Character Length....395
15.8 Character and Allocatable Arrays....396
15.9 Allocatable Scalar....396
15.10 Allocatable Function....397
15.11 Allocation Transfer....398
15.12 Restriction on Allocatable Arrays....399
15.13 Programming Example....399
16: Pointers....402
16.1 POINTER Declaration....402
16.2 TARGET....402
16.3 POINTER Status....403
16.4 POINTER Initialization....403
16.5 POINTER Assignment....403
16.6 NULLIFY....405
16.7 POINTER and Array....405
16.8 POINTER as Alias....406
16.9 ALLOCATE and POINTER....407
16.10 POINTER and ALLOCATABLE Array....408
16.11 DEALLOCATE....410
16.12 Unreferenced Storage....411
16.13 ASSOCIATED Intrinsic....411
16.14 Dangling Pointer....411
16.15 POINTER within Subprogram....412
16.16 POINTER and Derived Type....412
16.17 Self-Referencing Pointer....413
16.18 FUNCTION and POINTER....413
16.19 POINTER and Subprogram....414
16.20 POINTER INTENT....415
16.21 PROCEDURE and POINTER....415
16.22 ALLOCATE with SOURCE....418
16.23 ALLOCATE with MOLD....419
16.24 CONTIGUOUS....419
16.25 IS_CONTIGUOUS....420
16.26 Programming Example....420
17: Bit Handling....426
17.1 BIT_SIZE....426
17.2 BTEST....426
17.3 IBSET....428
17.4 IBCLR....429
17.5 IBITS....430
17.6 LEADZ and TRAILZ....432
17.7 POPCNT....433
17.8 POPPAR....433
17.9 MASKL....433
17.10 MASKR....434
17.11 IAND....434
17.12 IOR....436
17.13 IEOR....437
17.14 NOT....439
17.15 Bit Sequence Comparison....439
17.16 Programming Example....440
17.17 ISHFT....441
17.18 SHIFTL....442
17.19 SHIFTR....442
17.20 SHIFTA....442
17.21 MERGE_BITS....442
17.22 ISHFTC....443
17.23 DSHIFTL....445
17.24 DSHIFTR....445
17.25 Logical Operations with Array Elements....445
17.26 MVBITS....447
17.27 TRANSFER....449
18: C–Fortran Interoperability....452
18.1 Interoperability of Intrinsic Types....452
18.2 C Procedure and Interface Block....454
18.3 Function, Subroutine and C Procedure....454
18.4 Interoperability with a C Pointer....454
18.5 Procedures in the Module ISO_C_BINDING....454
18.6 Compilation and Linking....456
18.7 IMPORT Statement....456
18.8 Fortran and C Interoperability—Examples....456
18.9 Interoperation with Global Variables....465
18.10 C–Fortran Interoperation....468
18.11 ENUMERATOR....469
19: Object-Oriented Programming....472
19.1 Object and Its Properties....472
19.2 Inheritance....473
19.3 ASSOCIATE....474
19.4 Rules of ASSOCIATE....476
19.5 Polymorphic Variables....477
19.6 SELECT TYPE Construct....479
19.7 Allocation and Polymorphic Variables....485
19.8 Type Bound Procedure....486
19.9 Generic Binding....491
19.10 Overriding Type Bound Procedures....493
19.11 Deferred Binding....495
19.12 Finalization....496
19.13 SAME_TYPE_AS....499
19.14 EXTENDS_TYPE_OF....500
19.15 Derived Type Input and Output....501
20: Parallel Programming Using Coarray....510
20.1 Parallel Computing....510
20.2 Coarray....511
20.3 Compilation of Fortran Program with Coarray....511
20.4 Declaration....512
20.5 Initialization....513
20.6 Input and Output with Coarray....513
20.7 THIS_IMAGE....513
20.8 NUM_IMAGES....515
20.9 SYNC ALL....515
20.10 Array of Coarray....516
20.11 Multidimensional Coarray....516
20.12 Upper Bound of the Last CODIMENSION....517
20.13 Properties of Coarray....518
20.14 LCOBOUND....518
20.15 UCOBOUND....519
20.16 COSHAPE....519
20.17 THIS_IMAGE with Argument....520
20.18 IMAGE_INDEX....520
20.19 Synchronization....521
20.20 CRITICAL Section....523
20.21 ALLOCATABLE Coarray....525
20.22 CO Routines....525
20.23 CO_MAX....526
20.24 CO_MIN....527
20.25 CO_SUM....527
20.26 CO_REDUCE....528
20.27 CO_BROADCAST....529
20.28 Coarray and Subprogram....530
20.29 Coarray and Function....533
20.30 Coarray and Floating Point Status....534
20.31 User Defined Type and Coarray....534
20.32 COARRAY and POINTER....538
20.33 Operator Overloading and Coarray....539
20.34 Atomic Variables and Subroutines....540
20.35 ATOMIC_DEFINE....541
20.36 ATOMIC_REF....541
20.37 ATOMIC_ADD....541
20.38 ATOMIC_FETCH_ADD....541
20.39 ATOMIC_AND....542
20.40 ATOMIC_FETCH_AND....542
20.41 ATOMIC_OR....542
20.42 ATOMIC_FETCH_OR....542
20.43 ATOMIC_XOR....543
20.44 ATOMIC_FETCH_XOR....543
20.45 ATOMIC_CAS....543
20.46 LOCK and UNLOCK....544
20.47 Status Specifiers....545
20.48 ERROR STOP....545
20.49 Coarray and Interoperability....545
20.50 COMMON, EQUIVALENCE and Coarray....545
20.51 VOLATILE Variable....545
20.52 EVENT....546
20.53 EVENT POST....546
20.54 EVENT WAIT....547
20.55 EVENT_QUERY....548
20.56 Programming Examples Using Coarray....548
21: Parallel Programming Using OpenMP....552
21.1 Thread....552
21.2 Structured Block....552
21.3 Parallelism....553
21.4 Memory Management....553
21.5 Application Program Interface (API)....553
21.6 Compiler Support....553
21.7 Compilation of Program Containing Openmp Directives....554
21.8 Structure of Compiler Directives....554
21.9 Parallel Region....555
21.10 Parallelization Directives....555
21.11 Clauses Associated with the Directives....556
21.12 Parallel Directive....557
21.13 Lexical and Dynamic Region....558
21.14 Three Runtime Routines....558
21.15 Nested Parallel....559
21.16 Clauses Associated with Parallel Construct....560
21.17 IF Clause....560
21.18 NUM_THREADS....561
21.19 PRIVATE....561
21.20 SHARED....562
21.21 DEFAULT NONE....562
21.22 DEFAULT PRIVATE....562
21.23 DEFAULT SHARED....562
21.24 FIRSTPRIVATE....563
21.25 Rules for OMP PARALLEL Directive....563
21.26 Workshare Construct....565
21.27 OMP DO/OMP END DO....565
21.28 Rules of OMP DO/OMP END DO....566
21.29 OMP SECTIONS/OMP END SECTIONS....566
21.30 OMP WORKSHARE....568
21.31 OMP SINGLE/OMP END SINGLE....570
21.32 OMP MASTER/OMP END MASTER....571
21.33 REDUCTION....572
21.34 CRITICAL/END CRITICAL....575
21.35 LASTPRIVATE....576
21.36 ATOMIC....578
21.37 OMP BARRIER....579
21.38 THREADPRIVATE....580
21.39 Rules for THREADPRIVATE....582
21.40 COPYIN....582
21.41 ORDERED....584
21.42 COPYPRIVATE....584
21.43 NOWAIT....585
21.44 FLASH....586
21.45 Openmp LOCK....586
21.46 SCHEDULE....589
21.47 STATIC SCHEDULE....590
21.48 DYNAMIC SCHEDULE....591
21.49 GUIDED SCHEDULE....592
21.50 RUNTIME SCHEDULE....593
21.51 AUTO SCHEDULE....593
21.52 Openmp Runtime Library Routines....593
21.53 Runtime Time Routines....595
21.54 Environment Control....596
21.55 Environment Variables....596
21.56 Programming Examples....597
21.57 Final Word....599
22: Parallel Programming Using Message Passing Interface (MPI)....600
22.1 MPI Module....600
22.2 Compilation....600
22.3 Error Parameter of MPI Routines....601
22.4 MPI Version....601
22.5 MPI_INIT....602
22.6 MPI_INITIALIZED....602
22.7 MPI_FINALIZE....602
22.8 MPI Handles....603
22.9 About This Chapter....603
22.10 Structure of a MPI Program....603
22.11 MPI_COMM_RANK....604
22.12 MPI_COMM_SIZE....604
22.13 Use of Rank in Controlling the Flow of the MPI Program....605
22.14 MPI_BARRIER....605
22.15 Basic MPI Datatype in Fortran....606
22.16 Point-to-Point Communication....606
22.17 Communication Modes....606
22.18 Message Sent and Received....607
22.19 MPI_SEND and MPI_RECV....607
22.20 MPI_SSEND....610
22.21 MPI_BSEND....610
22.22 MPI_RSEND....611
22.23 Deadlock....611
22.24 Non-blocking Send and Receive....612
22.25 Send Function-Naming Conventions in Blocking and Non-blocking Forms....614
22.26 MPI_ANY_TAG and MPI_ANY_SOURCE....614
22.27 REDUCTION....615
22.28 MPI_SCAN....621
22.29 MPI_ALLREDUCE....622
22.30 MPI_REDUCE_SCATTER_BLOCK....624
22.31 MPI_REDUCE_SCATTER....625
22.32 MPI_BROADCAST....626
22.33 MPI_GATHER....627
22.34 MPI_ALLGATHER....628
22.35 MPI_SCATTER....629
22.36 MPI_SCATTERV....630
22.37 MPI_ALLTOALL....632
22.38 Derived Data Types....633
22.39 MPI_TYPE_CONTIGUOUS....633
22.40 MPI_TYPE_VECTOR....635
22.41 MPI_TYPE_CREATE_HVECTOR....636
22.42 MPI_TYPE_INDEXED....637
22.43 MPI_TYPE_CREATE_HINDEXED....638
22.44 MPI_TYPE_CREATE_INDEXED_BLOCK....638
22.45 MPI_TYPE_CREATE_HINDEXED_BLOCK....639
22.46 MPI_TYPE_CREATE_STRUCT....639
22.47 MPI_PACK and MPI_UNPACK....641
22.48 MPI_COMM_SPLIT....642
22.49 Timing Routines....644
22.50 Programming Examples....644
22.51 Final Word....649
Appendix A....650
Appendix B....652
Appendix C....654
Appendix D....662
Appendix E....664
Appendix F....666
Appendix G....668
Appendix H....670
Appendix I....672
References....674
Index....676
The programming language Fortran dates back to 1957 when a team of IBM engineers released the first Fortran Compiler. During the past 60 years, the language had been revised and updated several times to incorporate more features to enable writing clean and structured computer programs. The present version is Fortran 2018. Since the dawn of the computer era, there had been a constant demand for a “larger” and “faster” machine. To increase the speed there are three hurdles. The density of the active components on a VLSI chip cannot be increased indefinitely and with the increase of the density heat dissipation becomes a major problem. Finally, the speed of any signal cannot exceed the velocity of the light. However, by using several inexpensive processors in parallel coupled with specialized software and hardware, programmers can achieve computing speed similar to a supercomputer.
This book can be used to learn the modern Fortran from the beginning and the technique of developing parallel programs using Fortran. It is for anyone who wants to learn Fortran. Knowledge beyond high school mathematics is not required. There is not another book on the market yet which deals with Fortran 2018 as well as parallel programming.