02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

DEALLOCATE<br />

Deallocates allocatable arrays and pointer targets.<br />

Syntax<br />

DEALLOCATE (alloc-obj-list[, STAT=scalar-int-var])<br />

alloc-obj-list<br />

STAT=scalar-int-var<br />

Description<br />

is a comma-separated list of pointers or allocatable arrays.<br />

<strong>HP</strong> <strong>Fortran</strong> statements<br />

DEALLOCATE<br />

returns the error status after the statement executes. If given, it is set to a<br />

positive value if an error is detected, and to zero otherwise. If there is no<br />

status variable, the occurrence of an error causes the program to terminate.<br />

The DEALLOCATE statement deallocates allocatable arrays and pointer targets, making the<br />

memory available for reuse. A specified allocatable array then becomes not allocated (as<br />

reported by the ALLOCATED intrinsic), while a specified pointer becomes disassociated (as<br />

reported by the ASSOCIATED intrinsic).<br />

An error occurs if an attempt is made to deallocate an allocatable array that is not currently<br />

allocated or a pointer that is not associated. Errors in the operation of DEALLOCATE can be<br />

reported by means of the optional STAT= specifier.<br />

You can deallocate an allocatable array by specifying the name of the array with the<br />

DEALLOCATE statement. You cannot deallocate a pointer that points to an object that was not<br />

allocated.<br />

Some or all of a target associated with a pointer by means of the ALLOCATE statement can also<br />

be associated subsequently with other pointers. However, it is not permitted to deallocate a<br />

pointer that is not currently associated with the whole of an allocated target object.<br />

Deallocation of a pointer target causes the association status of any other pointer associated<br />

with all or part of the target to become undefined. When a pointer is deallocated, its<br />

association status becomes disassociated, as if a NULLIFY statement had been executed.<br />

Chapter 10 283

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

Saved successfully!

Ooh no, something went wrong!