The FORTRAN extension options allow you to specify various extensions found in many contemporary compilers. If you are using a compiler not supported by name in the FORTRAN vendor list, then you can configure FOR_STUDY for much of the compiler's extensions by choosing the appropriate option here.
In general, the FORTRAN Vendor option should be set to "Custom" in order to specify your compiler with these options. Otherwise, enabling any extensions here will add to any options already enabled with a given vendor option.
The FORTRAN extension sub-options are:
The default size of FORTRAN INTEGER and LOGICAL types (with no length specifier) is 16 bits (2 bytes). INTEGER becomes INTEGER*2, integer constants are typed as 16-bit quantities, and LOGICAL becomes LOGICAL*2. It also selects the INTEGER*2 built-in intrinsic table and affects the offsets produced from the equivalence analysis. Names typed with length specifiers override the option setting. Set this options if your FORTRAN was developed with a 16-bit compiler.
When this options is not set, the default INTEGER and LOGICAL type size is 32 bits (4 bytes); INTEGER Maps to INTEGER*4 and LOGICAL maps to LOGICAL*4. All integer constants are also assumed to be 32-bit quantities by default. Names declared with length specifiers following the type keywords (INTEGER*1) explicitly define the type and override the default typing.
All local variables and arrays are saved. DO loops are assumed to always execute at least once, and multi-dimensioned arrays can be treated as vectors in equivalence statements.
Adds support for new Fortran-90 syntax; in general, Fortran-90 features grandfathered from contemporary code are specified as other extension options. Currently, only a subset of new Fortran-90 code is supported. The statements or attributes included with this option are:
ALLOCATE ( [STAT=i,] name_list ) ALLOCATABLE [::] name_list DEALLOCATE ( [STAT=i,] name_list ) CYCLE [construct_name] EXIT [construct_name] RECURSIVE [construct_name] SELECT CASE(expr) CASE (const_list) [construct_name] CASE DEFAULT [construct_name] END SELECT [construct_name] <, <="," /=",">, >= relational operators plus: construct names on IF, ELSEIF, ELSE, ENDIF, DO, DOWHILE, ENDDO infinite DO loop
To test for Fortran-90 compatibility, while including existing extensions, just set this option along with items grandfathered into Fortran-90 (such as the MILSPEC extensions, NAMELIST, REAL*16, COMPLEX*16, length specifiers, and double quoted strings).
Specifies an additional alternate return character; the standard '*' character can still be used. The most typical alternate return character extension is '&' (used by VAX and others). This character cannot be an alpha, digit, or any of the following characters: +-/=:,().'"
The BYTE type is treated as equivalent to INTEGER*1. No length specifier should be used with the BYTE statement.
Allow a CALL to a FUNCTION as though it were a SUBROUTINE (with only a warning produced). Normally, this condition results in an error. NOTE: Even though treated as a SUBROUTINE with this option, the routine remains a FUNCTION; hence, alternate returns should not be used in the FUNCTION call frame.
Maps a 'D' or 'd' in column 1 into a space to process debug lines. Since 'D' is turned into a space, the remainder of the line must be card image and is treated like any other statement. Columns 2 through 5 may contain a statement label if the debug line is also an initial line. When this option is turned off, debug lines are treated as comments. The VAX FORTRAN D-Lines extion option must be on to allow the 'D' in column 1 - else an error results.
Tolerate the old ENCODE and DECODE statements. They are basically ignored due to the number of differences in these statements among older compilers. Warning messages are output when encountered suggesting alternative use of internal READ and WRITE.
Allow constant intrinsic calls in parameter definitions. Because of the variation in support among different vendors, no check is made to determine if it is an allowable intrinsic call for the vendor (at this time).
Support for multiple assignments, (e.g., x = y = z).
Numerous I/O extensions are allowed with this option. Most of these take the form of I/O specifier extensions. Unique I/O statements are enabled with specific options.
SAVE all local variables; this is equivalent to placing a sole SAVE statement (without any name list) in each routine. NOTE: Use of the SAVE statement per the FORTRAN-77 standard is preferred. This option is turned on with several vendor options, (e.g., MS, Sun, and VAX) plus the FORTRAN-IV/66 option.
Allow various type mismatches in assignments, expressions, intrinsic calls, etc. Standard FORTRAN-77 allows only arithmetic expressions to be assigned to arithmetic types and logical expressions to logical types, etc. It disallows the use of integers as logicals and vice versa, and many FORTRAN compilers have extended the standard to allow mixed types. Specific mixed types allowed with this option are:
a) Integers can be used as logicals, and logicals as integers in their respective expressions and assignments. When integers are used with logical operators), logical bit operations are assumed (per VAX and other extensions).
b) Floating point expressions used as subscripts are assumed to be implicitly converted to integers.
c) Mixed characters and integer expressions are allowed, along with mixed character and floating point assignments and comparisons.
d) Greater tolerance of mixed argument types in intrinsic function calls (e.g., REAL*4 mixed with *8, and INTEGER*2 mixed with *4).
plus other type mismatches as normally allowed in contemporary compilers.
If you need to mix any other types in expressions, introduce a function call which returns the proper type.
The MILSPEC-1753 extensions were defined by the US Air Force in 1978. These extensions are very widely supported, hence very portable, and have all been grandfathered into Fortran-90. The MILSPEC extensions include:
DOWHILE( expr ) ENDDO IMPLICIT NONE INCLUDE 'filename' octal constants: O'777' hex constants: Z'fff' and the bit functions: ior(), iand(), not(), ishft(), ishftc(), ibits(), btest(), ibset), ibclr()
The bit functions are added to the built-in intrinsic table whenever this option is selected.
If VAX FORTRAN, the "/[NO]LIST" construct is accepted in the INCLUDE statement, but is ignored. If analyzing VAX FORTRAN source on a non VMS machine, the VMS style pathname will usually cause the include to fail. The pathname given must be valid for the host operating system, hence its best to use only the primary filename in the include, (i.e., don't use any directory reference).
The NAMELIST statement and the use of namelist group names in READ, PRINT, and WRITE statements (along with the extensions TYPE and ACCEPT when also enabled) are enabled with this option. Namelist has been grandfathered into Fortran-90. Although there can be variations in the Namelist file format, the statement itself is relatively portable.
Older compilers often typed parameters according to their definition type - this option is mimics that behavior. (A warning is issued if it disagrees with the parameter implicit type.)
If the loose type option is on, untyped parameters are implicitly typed and the definition coerced to the parameter's type when different. If standard (strict) typing applies and the parameter and its definition are different types, then an error results.
The quad precision type, i.e., REAL*16, is supported with this option. A series of specific intrinsic extensions are added to the built-in intrinsic table when this option is set. Additionally, a 'Q' is allowed for the exponent to designate quad precision constants.
Length specifiers following arithmetic and logical type keywords, as well as after the names in the type statement list are allowed with this option. For example,
REAL*8 x, y*4
is permitted with this option on. These extensions have been grandfathered into Fortran-90.
This option permits initialization in type statements using slashes (as in a DATA statement). Only variables and entire arrays may be initialized in this manner. This extension is supported by several vendors (including Lahey, MS, Sun, and VAX), but unfortunately this syntax differs from that added in Fortran-90 which uses an '=' for the same initialization capability.
Allow virtually unlimited line continuations for card image and tab format source (actually the limit is set to 1024 continuations). Depending on the statement, other limits may also be exceeded, however, long specification statements can normally be read with this option. (If more than 100 inline or interceding comments are associated with the specification statement, an error will result.) The default number of line continuations is 19 (the FORTRAN-77 standard).
Specify the inline comment character for FORTRAN sources not using the default '!'. The character cannot be an alpha, digit, or any character associated with a standard FORTRAN-77 operator.
Permits .XOR. to be used as an alias for .EQV.
Permits long card image lines - up to 255 characters. The sequence field, columns 73-80, is ignored, thus extending the statement field.
Enable support for double precision complex types, (i.e., COMPLEX*16 and DOUBLE COMPLEX). When set, this option also adds additional specific intrinsics functions to the built-in intrinsic table to support this data type.
This option allows double quotes to delineate string constants in addition to single quotes. When enabled, the syntax rules for double quoted strings are the same as for single quoted strings, but a double quote takes the place of a single one. For example, the constants
"don't" // """pull that pin!"""
are the same as,
'don''t' // '"pull that pin!"'
when using this option.