Intel® Fortran Compiler XE 13.1 User and Reference Guides
Before the introduction of the Standard Fortran interoperability features, extensions provided by Intel® Fortran were used to facilitate programming using code written in Fortran and C. The Fortran 2003 standard defined new language features for C interoperability; in many cases, these features can be used instead of existing Intel® Fortran extensions. The following table lists the legacy Intel® Fortran extensions and shows their Standard Fortran equivalents.
Existing code using legacy extensions will continue to work; however, if you are writing new code, you should use the standard syntax.
|
Legacy Extension |
Standard Fortran Interoperability Equivalent |
|
ATTRIBUTES ALIAS |
Use BIND(C,NAME="alias-name"). The BIND(C) syntax also implies ATTRIBUTES DECORATE; the compiler applies whatever name decoration (leading or trailing underscores) that C would use for the name. If the NAME= clause is omitted, Fortran will use the Fortran name converted to lowercase on all platforms. If the procedure has no arguments, you must indicate that with () when adding BIND. All arguments to a routine specified as "interoperable" (with BIND(C)) must themselves be interoperable. You can also specify BIND(C) on module variables and COMMON blocks. |
|
ATTRIBUTES C |
Use BIND(C) (see ALIAS above), which has a similar effect to ATTRIBUTES C except that it does not change the argument passing mechanism to be by-value. Use the Fortran standard VALUE attribute if you need to pass by value. BIND(C) also specifies that small records are passed and returned as function value results the same way C would, which may be different from the Intel® Fortran default. Like ATTRIBUTES C, BIND(C) downcases the external name and adds any necessary name decoration. |
|
ATTRIBUTES DECORATE |
Typically used with ATTRIBUTES ALIAS. See ATTRIBUTES ALIAS above. |
|
ATTRIBUTES DEFAULT |
Not needed when using BIND(C); the compiler always uses the semantics of the C compiler regardless of the setting of command-line options such as iface. |
|
ATTRIBUTES EXTERN |
Use BIND(C) with a module variable. |
|
ATTRIBUTES REFERENCE |
Not needed when using BIND(C). Typically used with character arguments, or to override the implicit pass-by-value of ATTRIBUTES C. |
|
ATTRIBUTES STDCALL |
No equivalent. Use of STDCALL with BIND(C) is not supported in Intel® Fortran. If you are interfacing to STDCALL routines (Windows* OS on IA-32 architecture only), you must continue to use the ATTRIBUTES extension, along with ALIAS and DECORATE as required. |
|
ATTRIBUTES VALUE |
Use the Fortran-standard VALUE attribute . This has an additional effect when used with a Fortran procedure; the dummy argument is received by value and then copied to a temporary variable that can be modified within the procedure. Once the procedure exits, the temporary value is discarded. |
|
ATTRIBUTES VARYING |
No equivalent. |
|
%LOC function |
Use the C_LOC function from intrinsic module ISO_C_BINDING, which may be an appropriate substitute for variables. C_FUNLOC is the corresponding function for procedures. |
|
%VAL function |
Declare the argument with the VALUE attribute. |
|
%REF function |
No equivalent; this is the default when BIND(C) is used. |