# Declarations for Arrays

An array declaration (or array declarator) declares the shape of an array. It takes the following form:

(a-spec)

a-spec | Is one of the following array specifications: Explicit-shape Assumed-shape Assumed-size Deferred-shape Assumed-rank Implied-shape

The array specification can be appended to the name of the array when the array is declared.

## Examples

The following examples show array declarations:

    SUBROUTINE SUB(N, C, D, Z)
      REAL, DIMENSION(N, 15) :: IARRY       ! An explicit-shape array
      REAL C(:), D(0:)                      ! An assumed-shape array
      REAL, POINTER :: B(:,:)               ! A deferred-shape array pointer
      REAL, ALLOCATABLE, DIMENSION(:) :: K  ! A deferred-shape allocatable array
      REAL :: Z(N,*)                        ! An assumed-size array
      INTEGER, PARAMETER :: R(*) = [1,2,3]  ! An implied-shape constant array

Parent topic: Type Declarations

- Explicit-Shape Specifications
- Assumed-Shape Specifications
- Assumed-Size Specifications
- Assumed-Rank Specifications
- Deferred-Shape Specifications
- Implied-Shape Specifications
  Short Description

## See Also

Type Declarations for details on the general form and rules for type declaration statements