HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
STATIC (statement, attribute, extension)
Chapter 10462
STATIC (statement, attribute, extension)
Gives variables and arrays static storage.
Syntax
The syntax of a type declaration statement with the STATIC attribute is:
type
,
attribute-list
::
entity-list
type
is a valid type specification (INTEGER, REAL, LOGICAL, CHARACTER, TYPE (
name
), etc.), as described in Chapter 5, “Data types and data objects,” on
page 105.
attribute-list
is a comma-separated list of attributes including STATIC and optionally
those attributes compatible with it, namely:
entity-list
is a comma-separated list of variables and arrays.
The syntax of the STATIC statement is:
STATIC [::]
entity-list
Description
The STATIC statement and attribute is an HP Fortran extension. Variables possessing the
STATIC attribute retain their storage location for the duration of the program. A STATIC
variable declared within a procedure will therefore retain its value between calls of the
procedure.
The STATIC statement and attribute has the same functionality as the SAVE statement and
attribute; it is provided for compatibility with other vendors’ Fortran 90.
Examples
SUBROUTINE work_out(first_call)
LOGICAL first_call
INTEGER, STATIC :: ncalls
Table 10-50
ALLOCATABLE PRIVATE VOLATILE
DIMENSION SAVE
POINTER TARGET