# Explanation of certain terms

The array in a subprogram has a variable dimension just as in Fortran 77 through that both the array name and the dimension (all dimensions) are dummy arguments. The actual shape is therefore passed from the actual arguments.
```               SUBROUTINE SUB (A, NA)
REAL, DIMENSION (NA) :: A
```
• allocatable array
An array specified as ALLOCATABLE with a certain type and rank. It can later be allocated a certain extent with the ALLOCATE statement. The corresponding storage area can be released with the DEALLOCATE statement.

• array
Dimensioned quantity (variable or constant).

• array assignment
Assignment of a whole array to another one is permitted provided they have the same shape, and also if the expression on the right hand side is a scalar, in which case all the elements on the left hand side will be assigned this same value. Array sections can be used here instead of arrays.

• array function
A function which operates on an array and returns an array or a scalar, or a function which operates on a scalar and returns an array. An array valued function is an array function which returns an array.

• array section
Part of an array (the part can have a rank greater than one, but array sections with rank one are the most common cases).

• assumed-shape array
An array in a subprogram which is not local and has a certain data type and a certain rank.
```	       SUBROUTINE SUB (A)
REAL, DIMENSION (:, :, :) :: A
```
The extent is determined from an explicit INTERFACE in the calling program unit, and an explicit specification of the shape of A there (including the extent).
```               INTERFACE
SUBROUTINE SUB (A)
REAL, DIMENSION (:, :, :) :: A
END SUBROUTINE SUB
END INTERFACE
```
• assumed-size array
The array has a variable dimension, like in Fortran 77, through that both the array name and the parameters of the dimension are dummy arguments, except the last dimension, which is given by a *
```                SUBROUTINE SUB (A, NA1, NA2)
REAL, DIMENSION (NA1, NA2,*) :: A
```

In Fortran 66 the concept "assumed-size array" was not defined, but it was simulated by placing the digit "1" where the "*" is in Fortran 77. This custom violates the index check and is of course forbidden by modern compilers, for example the NAG Fortran 90 compiler. Many old programs still use this way of simulating dynamic memory allocation.

• attribute
At the specification of a variable the additional properties PARAMETER, PUBLIC, PRIVATE, INTENT, DIMENSION, SAVE, OPTIONAL, POINTER, TARGET, ALLOCATABLE, EXTERNAL and INTRINSIC are called attributes. They can also be given by statements.

• automatic array
Array in a subprogram where the array is local but the parameters for the dimensions are among the dummy arguments.
```                 SUBROUTINE SUB (I, J, K)
REAL, DIMENSION (I, J, K) :: X
```
• BLOCK DATA
A BLOCK DATA program unit contains definitions (initial values) which are to be used in the other program units. BLOCK DATA is now being replaced with the more powerful module.

• deferred-shape array
The array is an array pointer or an allocatable array.

• extent
The number of elements along the various dimensions.

• EXTERNAL
The functions and subroutines you write or obtain from application libraries. The opposite is INTRINSIC. When external functions or subroutines are used as actual parameters at the reference of another subprogram they have to be specified as EXTERNAL.

• function
A program unit which returns a function value (or several, if array valued) in its name and has a number of arguments. Functions without arguments are permitted, it is also permitted but not advisable that a function changes any of its arguments.

• generic
A generic function can have the property that the data type of the argument gives the same data type to the function. The value SIN(1.0D0) is also more accurate (calculated to a higher precision) than that of SIN(1.0). In addition, there exist intrinsic functions, for example REAL() which can have arguments of various data types, but always returns a value of a certain data type. For generic subroutines only the arguments are adjusted.

• interface
Since all the different program units in a Fortran program are compiled completely independent all information on the arguments have to be transferred manually. In Fortran 77 this was done with very long and cumbersome argument lists. In Fortran 90 an INTERFACE can be used. This has to be used in the following cases

1. modules that use user defined data types
2. call with keyword arguments or optional arguments
3. user defined generic routines
4. use of assumed-shape arrays
5. use of arrays specified with pointers
6. at the definition of a new interpretation of an OPERATOR
7. to increase the chance that INTENT has any effect (implementation dependent case)
8. call of an array valued function
9. If IMPLICIT NONE is being used, an INTERFACE may be required at the use of a subprogram as the actual argument

• internal function
A function which is local to a certain program unit, and is after a CONTAINS statement. All the variables in the program unit are directly available. An internal function can not be used outside the program unit where it is defined. This can be useful in order to avoid name conflicts between functions and subroutines from different libraries. An internal function can not be used as an argument! It also exists internal subroutines.

• intrinsic
Those functions and subroutines that are delivered together with the compiler are called intrinsic, and have some special properties, they do not usually have to be specified. Since Fortran 90 has so many intrinsic functions, some manufacturers may choose to let some of them instead be available in a usual library, and thus be external. The opposite to intrinsic is external. If intrinsic functions or subroutines are used as arguments at the call of some other subprogram they must be specified as INTRINSIC. Note the very important difference between an intrinsic and an internal subprogram.

• loop
With a loop we mean a number of executable statements that are repeated a number of times, the usual case is a DO-loop, but also an IF-statement (arithmetic or logical or the newer IF...THEN...ELSE...ENDIF or a CASE construct) can be called a loop.

• main program
Each Fortran program has to consist of exactly one main program and and any number of subroutines, functions, modules and BLOCK DATA program units. A main program may start with the statement PROGRAM name and must be terminated with a statement END PROGRAM name or END PROGRAM or the simpler END.

• module
A module contains specifications and definitions to be used in other program units. Replaces BLOCK DATA.

• nested
Inside a DO-loop can be further DO-loops, inside an IF...THEN...ELSE...ENDIF or CASE can also be additional constructs. Sometimes also IF and CASE constructs are called loops.

• program unit
The collective reference to a main program, a subroutine, a function, a module or a BLOCK DATA program unit.

• rank
The number of dimensions. WARNING: Not the mathematical rank.

• recursive
A function or a subroutine that calls itself. Permitted from Fortran 90.

• result variable
A function is called by its function name, and on return that name contains the value of the function. If the function is recursive a special result variable has to be used inside the function in order to store the result temporarily, but it is still returned in the usual way via the function name. The result variable is also useful for array functions, even in the non-recursive case. It is always permitted in a function specification to use the result variable.

• shape
The shape of an array consists of its rank and extent.

• statement function
A function local to a program unit, is located between the ordinary specifications and the executable statements. Very simple, available already in FORTRAN I. A more general concept is the internal function after a CONTAINS statement. A statement function may not be used as an argument!

• subroutine
A program unit which does not return any value through its name and has a number of arguments. It is permitted for a subroutine to change the values of its arguments. A subroutine can however have other tasks to perform, quite often related to input and output. A subroutine does not have a data type.