next up previous contents
Next: Implicit SAVE Attribute and Up: Program Units Previous: Scope of Names

SAVE Statement

Local objects:

A local variable with the SAVE attribute will retain its value and allocation status between calls. For example,

   SUBROUTINE sub1
    REAL, SAVE :: keep
    REAL       :: chuck
    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: X
     ...  
    IF (.NOT.ALLOCATED(X)) ALLOCATE(X(20,20))

For more information, click here gif


next up previous contents
Next: Implicit SAVE Attribute and Up: Program Units Previous: Scope of Names

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.