12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

For an ALLOCATABLE array, the array is allocated with the executable ALLOCATE statement.ExamplesCOMMON P, N, MPOINTER (P, A(N,M))COMMON, ALLOCATABLE /ALL/X(10), YALLOCATE (/ALL/, A, STAT=IS)PRINT *, ISX(5) = A(2, 1)DEALLOCATE (A)DEALLOCATE (A, STAT=IS)PRINT *, 'should be 1', ISDEALLOCATE (/ALL/)For a deferred shape array, the allocate must include the bounds of the array.REAL, ALLOCATABLE :: A(:), B(:)ALLOCATE (A(10), B(SIZE(A)))REAL A(:,:)N=3M=1ALLOCATE (A(1:11, M:N))INTEGER FLAG, NREAL, ALLOCATABLE:: B(:,:)ALLOCATE (B(N,N),STAT=FLAG)ARRAYCMFThe ARRAY attribute defines the number of dimensions in an array that may be defined and thenumber of elements and bounds in each dimension.SyntaxARRAY [::] array-name (array-spec)[, array-name (array-spec) ] ...array-namearray-specis the symbolic name of an array.is a valid array specification, either explicit-shape, assumed-shape,deferred-shape, or assumed size (refer to Chapter 4, Fortran Arrays fordetails on array specifications).Fortran Statements 57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!