These options can be divided into two major groups discussed below. See a summary of these options.
-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 variables, except local variables within a recursive routine, 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. Opposite of -auto. To disable -save, set -auto. Setting -save turns off both -auto and -auto-scalar.
The -zero
option presets uninitialized variables to zero. It is most commonly used
in conjunction with
-save.
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 set IMPLICIT NONE as the default.
Option -safe_cray_ptr specifies that the CRAY* pointers do not alias with other variables. The default is OFF.
Consider the following example.
pointer (pb, b) |
When -safe_cray_ptr is not specified (default), the compiler assumes that b and a are aliased. To prevent such an assumption, specify this option, and the compiler will treat b(i) and a(i) as independent of each other.
However, if the variables are intended to be aliased with CRAY pointers, using the -safe_cray_ptr option produces incorrect result. For the code example below, -safe_cray_ptr should not be used.
pb = loc(a(2)) |