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.

Derived type objects<br />

Records<br />

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

SAVE (statement and attribute)<br />

If the name of a common block appears in save-list, it must be delimited by slashes (for<br />

example, /my_block/); all variables in the named common block are saved. If a common block<br />

is saved in one program unit, it must be saved in all program units (except main) where it<br />

appears.<br />

<strong>HP</strong><strong>Fortran</strong>alwayssavesallcommonblocks.<br />

The following must not appear in save-list:<br />

Formal argument names<br />

Procedure names<br />

Selected items in a common block<br />

Variables declared with the AUTOMATIC statement or attribute<br />

Function results<br />

Automatic data objects (such as automatic arrays, allocatable arrays, automatic character<br />

strings, and <strong>Fortran</strong> 90 pointers)<br />

Initializing a variable in a DATA statement or in a type declaration statement implies that the<br />

variable has the SAVE attribute, unless the variable is in a named common block in a block<br />

data subprogram.<br />

A SAVE statement in a main program unit has no effect.<br />

Examples<br />

The SAVE statement in the following example saves the variables a, b, andc, aswellasthe<br />

variables in the common block dot:<br />

SUBROUTINE matrix<br />

SAVE a, b, c, /dot/<br />

RETURN<br />

The SAVE statement in the next example saves the values of all of the variables in the<br />

subroutine fixit:<br />

SUBROUTINE fixit<br />

SAVE<br />

RETURN<br />

Related statements<br />

AUTOMATIC and STATIC<br />

Chapter 10 423

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

Saved successfully!

Ooh no, something went wrong!