Specifies the default storage class for local variables.
>>- -q--+-nosave-----------------------+----------------------->< '-save--+--------------------+-' '-=--+-all---------+-' '-defaultinit-'
@PROCESS:
@PROCESS SAVE[({ALL | DEFAULTINIT})] | NOSAVE
The -qsave suboptions include:
The all and defaultinit suboptions are mutually exclusive.
The -qnosave option sets the default storage class to AUTOMATIC. This usage is usually necessary for multithreaded applications and subprograms that are compiled with the -qrecur option.
You can specify the -qsave option to duplicate the behavior of FORTRAN 77 programs. The xlf, f77 and fort77 commands have -qsave listed as a default option in the configuration file to preserve the previous behavior. The default configuration file path is /opt/IBM/xlf/15.1.0/etc/xlf.cfg.nn
The following example illustrates the impact of the -qsave option on derived data type:
PROGRAM P
CALL SUB
CALL SUB
END PROGRAM P
SUBROUTINE SUB
LOGICAL, SAVE :: FIRST_TIME = .TRUE.
STRUCTURE /S/
INTEGER I/17/
END STRUCTURE
RECORD /S/ LOCAL_STRUCT
INTEGER LOCAL_VAR
IF (FIRST_TIME) THEN
LOCAL_STRUCT.I = 13
LOCAL_VAR = 19
FIRST_TIME = .FALSE.
ELSE
! Prints " 13" if compiled with -qsave or -qsave=all
! Prints " 13" if compiled with -qsave=defaultinit
! Prints " 17" if compiled with -qnosave
PRINT *, LOCAL_STRUCT
! Prints " 19" if compiled with -qsave or -qsave=all
! Value of LOCAL_VAR is undefined otherwise
PRINT *, LOCAL_VAR
END IF
END SUBROUTINE SUB