Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

auto

Causes all local, non-SAVEd variables to be allocated to the runtime stack.

Syntax

Linux:

-auto

-noauto

Windows:

/auto

/noauto

Arguments

None

Default

varies

Items that are declared in a main program are not necessarily allocated on the stack, but anything declared inside a function or subroutine (unless it's initialized) is always on the stack.

The default is also auto if one of the following options are specified:

  • recursive

  • [q or Q]openmp

Description

This option places local variables (scalars and arrays of all types), except those declared as SAVE, on the runtime stack. It is as if the variables were declared with the AUTOMATIC attribute.

It does not affect variables that have the SAVE attribute or ALLOCATABLE attribute, or variables that 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.

If you want to cause variables to be placed in static memory, specify option [Q]save. If you want only scalar variables of certain intrinsic types to be placed on the runtime stack, specify option auto-scalar.

IDE Equivalent

Visual Studio: Data > Local Variable Storage

Alternate Options

auto

Linux: None

Windows: /Qauto, /4Ya

noauto

Linux: -save

Windows: /Qsave, /4Na

See Also