1-
2- ## Language elements
1+ # Language elements
32
43Fortran is <a href="case-insensitive" class="wikilink"
54title="case-insensitive">case-insensitive</a >. The convention of writing
@@ -11,7 +10,7 @@ transfer</a> and
1110<a href="#Operations_on_external_files" class="wikilink"
1211title="Operations on external files">Operations on external files</a >).
1312
14- ### Basics
13+ ## Basics
1514
1615The basic component of the Fortran language is its * character set* . Its
1716members are
6463
6564a leading ` & ` on the continued line is also required.
6665
67- ### Intrinsic data types
66+ ## Intrinsic data types
6867
6968Fortran has five * intrinsic data types* : ` INTEGER ` , ` REAL ` , ` COMPLEX ` ,
7069` LOGICAL ` and ` CHARACTER ` . Each of those types can be additionally
@@ -81,9 +80,9 @@ corresponding form of *literal constant*. The numeric types `INTEGER`
8180and ` REAL ` can only be signed (there is no concept of sign for type
8281` COMPLEX ` ).
8382
84- #### Literal constants and kinds
83+ ### Literal constants and kinds
8584
86- ##### INTEGER
85+ #### INTEGER
8786
8887Integer literal constants of the default kind take the form
8988
@@ -137,7 +136,7 @@ constants"):
137136B'01010101' O'01234567' Z'10fa'
138137```
139138
140- ##### REAL
139+ #### REAL
141140
142141There are at least two real kindsthe default and one with greater
143142precision (this replaces
@@ -175,15 +174,15 @@ KIND(1.7_long) PRECISION(1.7_long) RANGE(1.7_long)
175174that give in turn the kind type value, the actual precision (here at
176175least 9), and the actual range (here at least 99).
177176
178- ##### COMPLEX
177+ #### COMPLEX
179178
180179` COMPLEX ` data type is built of two integer or real components:
181180
182181``` f90
183182(1, 3.7_long)
184183```
185184
186- ##### LOGICAL
185+ #### LOGICAL
187186
188187There are only two basic values of logical constants: ` .TRUE. ` and
189188` .FALSE. ` . Here, there may also be different kinds. Logicals don't have
@@ -200,7 +199,7 @@ and the `KIND` function operates as expected:
200199KIND(.TRUE.)
201200```
202201
203- ##### CHARACTER
202+ #### CHARACTER
204203
205204The forms of literal constants for ` CHARACTER ` data type are
206205
@@ -219,7 +218,7 @@ the `KIND` function:
219218KIND('ASCII')
220219```
221220
222- #### Number model and intrinsic functions
221+ ### Number model and intrinsic functions
223222
224223The numeric types are based on number models with associated inquiry
225224functions (whose values are independent of the values of their
@@ -238,7 +237,7 @@ important for portable numerical software:
238237| ` RANGE(X) ` | Decimal exponent range |
239238| ` TINY(X) ` | Smallest positive number (real) |
240239
241- ### Scalar variables
240+ ## Scalar variables
242241
243242Scalar <a href="Variable_ (programming)" class="wikilink"
244243title="variables">variables</a > corresponding to the five intrinsic
@@ -306,7 +305,7 @@ Finally, there is a set of intrinsic character functions, examples being
306305| ` REPEAT ` | ` SCAN ` (for one of a set) |
307306| ` TRIM ` | ` VERIFY ` (for all of a set) |
308307
309- ### Derived data types
308+ ## Derived data types
310309
311310For derived data types, the form of the type must be defined first:
312311
@@ -369,7 +368,7 @@ t%a%x t%a%y t%b%x etc.
369368(Note that the ` % ` qualifier was chosen rather than dot (` . ` ) because of
370369potential ambiguity with operator notation, like ` .OR. ` ).
371370
372- ### Implicit and explicit typing
371+ ## Implicit and explicit typing
373372
374373Unless specified otherwise, all variables starting with letters I, J, K,
375374L, M and N are default ` INTEGER ` s, and all others are default ` REAL ` ;
@@ -392,7 +391,7 @@ IMPLICIT NONE
392391
393392at the beginning of each program unit.
394393
395- ### Arrays
394+ ## Arrays
396395
397396Arrays are considered to be variables in their own right. Every array is
398397characterized by its
@@ -467,7 +466,7 @@ so that
467466
468467 is an array component of a scalar
469468
470- ### Data initialization
469+ ## Data initialization
471470
472471Variables can be given initial values as specified in a specification
473472statement:
@@ -503,7 +502,7 @@ causes local variables to retain their value after a procedure call and
503502then to initialize the variable to the saved value upon returning to the
504503procedure.
505504
506- #### PARAMETER attribute
505+ ### PARAMETER attribute
507506
508507A named constant can be specified directly by adding the ` PARAMETER `
509508attribute and the constant values to a type statement:
@@ -513,7 +512,7 @@ REAL, DIMENSION(3), PARAMETER :: field = (/ 0., 1., 2. /)
513512TYPE(triplet), PARAMETER :: t = triplet( (/ 0., 0., 0. /) )
514513```
515514
516- #### DATA statement
515+ ### DATA statement
517516
518517The ` DATA ` statement can be used for scalars and also for arrays and
519518variables of derived type. It is also the only way to initialise just
@@ -527,7 +526,7 @@ DATA array(1:64) / 64*0/
527526DATA i, j, k/ B'01010101', O'77', Z'ff'/
528527```
529528
530- #### Initialization expressions
529+ ### Initialization expressions
531530
532531The values used in ` DATA ` and ` PARAMETER ` statements, or with these
533532attributes, are constant expressions that may include references to:
@@ -542,7 +541,7 @@ INTEGER, PARAMETER :: long = SELECTED_REAL_KIND(12), &
542541 array(3) = (/ 1, 2, 3 /)
543542```
544543
545- ### Specification expressions
544+ ## Specification expressions
546545
547546It is possible to specify details of variables using any non-constant,
548547scalar, integer expression that may also include inquiry function
0 commit comments