HP Fortran Programmer's Reference (September 2007)

Data types and data objects
Intrinsic data types
Chapter 5112
The following are examples of type declaration statements:
! Default, KIND=4, integers i j k.
INTEGER i, j, k
! Using optional separator.
INTEGER :: i,j,k
! An 8-byte initialized integer.
INTEGER(KIND=8) :: i=2**40
! 10 element array of 8-byte integers.
INTEGER(8),DIMENSION(10) :: i
! Using an array constructor for initialization.
REAL, DIMENSION(2,2):: a = RESHAPE((/1.,2.,3.,4./),(/2,2/))
! Initialized complex.
COMPLEX :: z=(1.0,2.0)
! SYNTAX ERROR - no :: present.
COMPLEX z=(1.0,2.0) ! ILLEGAL
! Initialization using the HP slash extension
INTEGER i/1/,j/2/
REAL a(2,2)/1.1,2.1,1.2,2.2/ ! a(i,j)=i.j
! One character (default length).
CHARACTER(KIND=1) :: c
! A 10-byte character string.
CHARACTER(LEN=10) :: c
! Length can be * for a named constant; title is a 13-byte
! character string
CHARACTER(*),PARAMETER :: title=’Ftn 90 MANUAL’
! next four declarations are all equivalent, but only the last
! is standard-conforming
REAL*8 r8(10)
REAL r8*8(10)
REAL r8(10)*8
REAL(8), DIMENSION(10) :: r8
! If the statement is in a subprogram, n must be known at entry;
! otherwise, it must be a constant.
CHARACTER(LEN=n) :: c
VOLATILE Provides for data sharing between asynchronous processes
(extension).
Table 5-2 Attributes in type declaration statement (Continued)
Attribute Description