XL Fortran for AIX 8.1

User's Guide


Common Industry Extensions That XL Fortran Supports

XL Fortran allows many of the same FORTRAN 77 extensions as other popular compilers, including:


Extension Refer to XL Fortran for AIX Language Reference Section(s)
Typeless constants Typeless Literal Constants
*len length specifiers for types The Data Types
BYTE data type BYTE
Long variable names Names
Lower case Names
Mixing integers and logicals (with -qintlog option) Evaluation of Expressions
Character-count Q edit descriptor (with -qqcount option) Q (Character Count) Editing
64-bit data types (INTEGER(8), REAL(8), COMPLEX(8), and LOGICAL(8)), including support for default 64-bit types (with -qintsize and -qrealsize options) Integer, Real, Complex, Logical
Integer POINTERs, similar to those supported by CRAY and Sun compilers. (XL Fortran integer pointer arithmetic uses increments of one byte, while the increment on CRAY computers is eight bytes. You may need to multiply pointer increments and decrements by eight to make programs ported from CRAY computers work properly.) POINTER(integer)
Conditional vector merge (CVMGx) intrinsic functions CVMGx (TSOURCE, FSOURCE, MASK)
Date and time service and utility functions (rtc, irtc, jdate, clock_, timef, and date) Service and Utility Procedures

STRUCTURE, UNION, and MAP constructs Structure Components, Union and Map

Mixing Data Types in Statements

The -qctyplss option lets you use character constant expressions in the same places that you use typeless constants. The -qintlog option lets you use integer expressions where you can use logicals, and vice versa. A kind type parameter must not be replaced with a logical constant even if -qintlog is on, nor by a character constant even if -qctyplss is on, nor can it be a typeless constant.

Date and Time Routines

Date and time routines, such as dtime, etime, and jdate, are accessible as Fortran subroutines.

Other libc Routines

A number of other popular routines from the libc library, such as flush, getenv, and system, are also accessible as Fortran subroutines.

Changing the Default Sizes of Data Types

For porting from machines with larger or smaller word sizes, the -qintsize option lets you specify the default size for integers and logicals. The -qrealsize option lets you specify the default size for reals and complex components.

Name Conflicts Between Your Procedures and XL Fortran Intrinsic Procedures

If you have procedures with the same names as any XL Fortran intrinsic procedures, the program calls the intrinsic procedure. (This situation is more likely with the addition of the many new Fortran 90 and Fortran 95 intrinsic procedures.)

If you still want to call your procedure, add explicit interfaces or EXTERNAL statements for any procedures with conflicting names, or use the -qextern option when compiling.

Reproducing Results from Other Systems

XL Fortran provides settings through the -qfloat option that help make floating-point results consistent with those from other IEEE systems; this subject is discussed in Duplicating the Floating-Point Results of Other Systems.

Finding Nonstandard Extensions

XL Fortran supports a number of extensions to various language standards. Many of these extensions are so common that you need to keep in mind, when you port programs to other systems, that not all compilers have them. To find such extensions in your XL Fortran programs before beginning a porting effort, use the -qlanglvl option:


$ # -qnoobject stops the compiler after parsing all the source,
$ # giving a fast way to check for errors.
$ # Look for anything above the base F77 standard.
$ xlf  -qnoobject -qlanglvl=77std f77prog.f
  ...
$ # Look for anything above the F90 standard.
$ xlf90 -qnoobject -qlanglvl=90std use_in_2000.f
  ...
$ # Look for anything above the F95 standard.
$ xlf95 -qnoobject -qlanglvl=95std use_in_2000.f
  ...
Related Information:
See -qlanglvl Option.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]