Setting Arguments and Variables

These options can be divided into two major groups discussed below. See a summary of these options.

Automatic Allocation of Variables to Stacks

-auto

This option makes all local variables AUTOMATIC. Causes all variables to be allocated on the stack, rather than in local static storage. Variables defined in a procedure are otherwise allocated to the stack only if they appear in an AUTOMATIC statement, or if the procedure is recursive and the variables do not have the SAVE or ALLOCATABLE attributes. The option does not affect variables that appear in an EQUIVALENCE or SAVE statement, or those that are in COMMON. 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.

-auto_scalar

This option causes scalar variables of rank 0, except for variables of the COMPLEX or CHARACTER types, to be allocated on the stack, rather than in local static storage. Does not affect variables that appear in an EQUIVALENCE or SAVE statement, or those that are in COMMON. -auto_scalar 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. This option is similar to
-auto
, which causes all local variables to be allocated on the stack. The difference is that
-auto_scalar
, allocates only variables of rank 0 on the stack.

 -auto_scalar enables the compiler to make better choices about which variables should be kept in registers during program execution. This option is on by default.

-save and -zero

Forces the allocation of all variables in static storage. If a routine is invoked more than once, this option forces the local variables to retain their values from the last invocation terminated. This may cause a performance degradation and may change the output of your program for floating-point values as it forces operations to be carried out in memory rather than in registers which in turn causes more frequent rounding of your results.The default (with -O2 ON) corresponds to -auto_scalar-. Opposite of -auto. To disable -save, set -auto.

The -zero option presets uninitialized variables to zero. It is most commonly used in conjunction with
-save
.

Alignment, Aliases, Implicit None

Alignment

The -align option is a front-end option that changes alignment of variables in a COMMON block.

Example:

COMMON /BLOCK1/CH,DOUB,CH1,INT
INTEGER INT
CHARACTER(LEN=1) CH,CH1
DOUBLE PRECISION DOUB
END

The -align option enables padding inserted to assure alignment of DOUB and INT on natural alignment boundaries. The -noalign option disables padding.

Aliases

The -common_args option assumes that the "by-reference" subprogram arguments may have aliases of one another.

Implicit None

The -u and -implicitnone options enable the default IMPLICIT NONE.