HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
AUTOMATIC (extension)
Chapter 10280
AUTOMATIC (extension)
Makes procedure variables and arrays automatic.
Syntax
AUTOMATIC
var-name-list
var-name-list
is a comma-separated list of names of variables and arrays to be declared as
automatic. Array names may be followed by an optional
explicit-shape-spec
.
Description
The AUTOMATIC statement is provided as an HP extension.
If a variable or array declared within a procedure is declared as automatic, then there is one
copy of it for each invocation of the procedure. Space is allocated on entry to the procedure and
deallocated on exit. This is also the default for variables that do not have the SAVE or STATIC
attribute, unless the +save option has been specified.
If it is required to have the
same
copy of a variable available to each invocation of the routine
(for example, to keep a record of the depth of recursion), then the variable should have the
SAVE attribute.
Note the following:
The AUTOMATIC statement may only be used within a procedure.
Local variables are AUTOMATIC by default.
Arguments and function values are AUTOMATIC.
Automatic variables may not appear in EQUIVALENCE, DATA or SAVE statements.
The AUTOMATIC attribute is not the same as automatic arrays and automatic character
strings.
Examples
AUTOMATIC r, s, u, v, w(10)
Related statements
SAVE and STATIC