02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

SAVE (statement and attribute)<br />

SAVE (statement and attribute)<br />

Stores variables in static memory.<br />

Syntax<br />

A type declaration statement with the SAVE attribute is:<br />

type , attrib-list :: save-list<br />

type is a valid type specification (INTEGER, REAL, LOGICAL, CHARACTER, TYPE<br />

(name), etc.).<br />

attrib-list A comma-separated list of attributes including SAVE and optionally those<br />

attributes compatible with it, namely:<br />

Table 10-49<br />

ALLOCATABLE PRIVATE TARGET<br />

DIMENSION PUBLIC VOLATILE<br />

POINTER STATIC<br />

save-list is a comma-separated list of names of objects to save.<br />

The syntax of the SAVE statement is:<br />

SAVE [[::] save-list]<br />

Description<br />

The SAVE statement and attribute cause objects in a subroutine or function to be stored in<br />

static memory, instead of being dynamically allocated whenever the procedure is invoked (the<br />

default case). A saved object retains its value and definition, association, and allocation status<br />

between invocations of the program unit in which the saved object is declared.<br />

If save-list is omitted, everything in the scoping unit that can be saved is saved. No other<br />

explicit occurrences of the SAVE attribute or the SAVE statement are allowed.<br />

The names of the following may appear in save-list:<br />

422<br />

Scalar variables<br />

Arrays<br />

Named common blocks<br />

Chapter 10

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

Saved successfully!

Ooh no, something went wrong!