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.

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

ALLOCATE<br />

ALLOCATE<br />

Provides storage space for allocatable arrays and pointer targets.<br />

Syntax<br />

ALLOCATE (allocation-list[, STAT= scalar-integer-variable])<br />

allocation-list<br />

allocation<br />

allocate-object<br />

allocate-shape-spec-list<br />

allocate-shape-spec<br />

STAT=scalar-integer-variable<br />

242<br />

is a comma-separated list of allocation.<br />

is allocate-object [(allocate-shape-spec-list)].<br />

is variable-name or derived-type-component. Eachallocate-object<br />

must be an allocatable array or a pointer.<br />

is a comma-separated list of allocate-shape-spec.<br />

is [lower-bound:]upper-bound. The bounds in an allocate-shape-spec<br />

must be scalar integer expressions.<br />

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

zero if the statement successfully executed, and to one of the following<br />

nonzero values if an error occurred:<br />

1 Error occurred after the array was allocated; for example,<br />

an attempt to allocate a previously allocated array.<br />

2 Dynamic memory allocation failure (memory not<br />

available) or invalid size (array too large).<br />

3 Errors of both types 1 and 2 have occurred. This kind of an<br />

error can only occur if the same ALLOCATE statement is<br />

used to allocate more than one array, and both kinds of<br />

errors occur.<br />

If there is no scalar-integer-variable, the occurrence of an error causes<br />

the program to terminate.<br />

Chapter 10

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

Saved successfully!

Ooh no, something went wrong!