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.

DEALLOCATE 77The DEALLOCATE statement causes the memory allocated for each pointer-based variable orallocatable array that appears in the statement to be deallocated (freed). Deallocate also deallocatesstorage for deferred-shape arrays.SyntaxWhere:DEALLOCATE ( allocate-object-list [ , STAT= var ] )allocate-object-listalvaris a variable name or a structure component.is a pointer-based variable or the name of an allocatableCOMMON block enclosed in slashes.is the status indicator, an integer variable, integer array element oran integer member of a structure.DescriptionAn attempt to deallocate a pointer-based variable or an allocatable COMMON block which wasnot created by an ALLOCATE statement results in an error condition.If the specifier STAT= is present, successful execution of the statement causes var to be definedwith the value of zero. If an error occurs during the execution of the statement and the specifierSTAT= is present, the status variable is defined to have the integer value one. If an error occursand the specifier STAT= is not present, program execution is terminated.ExamplesREAL, ALLOCATABLE :: X(:,:)ALLOCATE (X(10,2))X=0DEALLOCATE (X)COMMON 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)72 Chapter 3

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

Saved successfully!

Ooh no, something went wrong!