TYPE triplet REAL, DIMENSION(3) :: vertex END TYPE triplet TYPE(triplet), DIMENSION(4) :: t so that t(2) is a scalar (a structure) t(2)%vertex is an array component of a scalar Data initialization Variables can be given initial values as specified in a specification statement: REAL, DIMENSION(3) :: a = (/ 0.1, 0.2, 0.3 /) and a default initial value can be given to the component of a derived data type: TYPE triplet REAL, DIMENSION(3) :: vertex = 0.0 END TYPE triplet When local variables are initialized within a procedure they implicitly acquire the SAVE attribute: REAL, DIMENSION(3) :: point = (/ 0.0, 1.0, -1.0 /) This declaration is equivalent to REAL, DIMENSION(3), SAVE :: point = (/ 0.0, 1.0, -1.0 /) for local variables within a subroutine or function. The SAVE attribute causes local variables to retain their value after a procedure call and then to initialize the variable to the saved value upon returning to the procedure. PARAMETER attribute A named constant can be specified directly by adding the PARAMETER attribute and the constant values to a type statement: REAL, DIMENSION(3), PARAMETER :: field = (/ 0., 1., 2. /) TYPE(triplet), PARAMETER :: t = triplet( (/ 0., 0., 0. /) ) DATA statement The DATA statement can be used for scalars and also for arrays and variables of derived type. It is also the only way to initialise just parts of such objects, as well as to initialise to binary, octal or hexadecimal values: TYPE(triplet) :: t1, t2 DATA t1/triplet( (/ 0., 1., 2. /) )/, t2%vertex(1)/123./ DATA array(1:64) / 64*0/ DATA i, j, k/ B'01010101', O'77', Z'ff'/ Initialization expressions The values used in DATA and PARAMETER statements, or with these attributes, are constant expressions that may include references to: array and structure constructors, elemental intrinsic functions with integer or character arguments and results, and the six transformational functions REPEAT, SELECTED_INT_KIND, TRIM, SELECTED_REAL_KIND, RESHAPE and TRANSFER (see Intrinsic procedures): INTEGER, PARAMETER :: long = SELECTED_REAL_KIND(12), & array(3) = (/ 1, 2, 3 /) Specification expressions It is possible to specify details of variables using any non-constant, scalar, integer expression that may also include inquiry function references: SUBROUTINE s(b, m, c) USE mod ! contains a REAL, DIMENSION(:, :) :: b REAL, DIMENSION(UBOUND(b, 1) + 5) :: x INTEGER :: m CHARACTER(LEN=*) :: c CHARACTER(LEN= m + LEN(c)) :: cc REAL (SELECTED_REAL_KIND(2*PRECISION(a))) :: z Expressions and assignments Scalar numeric The