 |
» |
|
|
 |
Compile-time
data initialization can be carried out using type declaration statements
and DATA statements.
The format of the DATA
statement is fully described in Chapter 10, where the initialization
formats for each of the intrinsic type declarations are also specified. In the following example, data is declared and then initialized,
using DATA statements: CHARACTER(LEN=10):: string |
REAL,DIMENSION(2,4) :: array |
COMPLEX,DIMENSION(3) :: zz |
DATA i,test,string/21,.TRUE.,'10 letters'/ |
DATA zz/3*(1.0,2.0)/ ! Using a repeat factor. |
DATA ((array(i,j),i=1,2),j=1,4)/1.0,2*2.0,5*3.0/ |
! Using an implied DO loop. |
! All elements of zz = (1.0,2.0) |
! The 8 elements of array are |
|