FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-99
SAVE Statement
SAVE Statement
The SAVE statement saves the status of specified entities after the termination of a
subprogram.
name
is a common block name enclosed in slashes, a variable name, array name, or
RECORD name.
Considerations
All entities defined in a subprogram unit become undefined when a RETURN or
END statement executes except for the following:
°
Entities named in a SAVE statement
°
Entities in any common block
°
Entities declared in a DATA statement
If the SAVE statement specifies an entity local to the subprogram, FORTRAN
saves the current value of that entity when the subprogram terminates and makes
it available to the subprogram the next time it executes.
If you omit the name list, the SAVE statement saves all the allowable entities
defined by the subprogram.
The SAVE statement cannot include dummy argument names, procedure names,
or names of entities in common blocks.
To save anything in a common block, you must save everything in it by specifying
the common block name as follows:
SAVE /customers/
Saving common blocks has no effect in HP FORTRAN because all common blocks
are always saved, but SAVE is supported for ANSI standard conformance.
Example
SAVE personnel, payroll, /employee/
SAVE [ name [, name ]... ]