auto-scalar, Qauto-scalar

Causes allocation of scalar variables of intrinsic types INTEGER, REAL, COMPLEX, and LOGICAL to the run-time stack.

IDE Equivalent

Windows: Data > Local Variable Storage
Linux: None

Architectures

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture

Syntax

Linux: -auto-scalar
Windows:  /Qauto-scalar

Arguments

None

Default

ON  Scalar variables of intrinsic types INTEGER, REAL, COMPLEX, and LOGICAL are allocated to the run-time stack. Note that if option recursive, -openmp (Linux), or /Qopenmp (Windows) is specified, the default is automatic.

Description

This option causes allocation of scalar variables of intrinsic types INTEGER, REAL, COMPLEX, and LOGICAL to the run-time stack. It is as if they were declared with the AUTOMATIC attribute.

It does not affect variables that have the SAVE attribute or appear in an EQUIVALENCE statement or in a common block.

This option may provide a performance gain for your program, but if your program depends on variables having the same value as the last time the routine was invoked, your program may not function properly. Variables that need to retain their values across subroutine calls should appear in a SAVE statement.

You cannot specify option save, auto, or automatic with this option.

Note

On Windows NT* systems, there is a performance penalty for addressing a stack frame that is too large. This penalty may be incurred with /automatic, /auto, or /Qauto because arrays are allocated on the stack along with scalars. However, with /Qauto-scalar, you would have to have more than 32K bytes of local scalar variables before you incurred the performance penalty. /Qauto-scalar enables the compiler to make better choices about which variables should be kept in registers during program execution.

Alternate Options

Linux: -auto_scalar
Windows: /Qauto_scalar