This document is for anyone who wants to work with the XL Fortran compiler, who
is familiar with the Linux operating system, and who has some previous Fortran
programming experience.
This document can help you understand what the features of the compiler are,
especially the options, and how to use them for effective software
development.
This document is not the place to find help on:
- Installation,
- which is covered in the IBM XL Fortran Advanced Edition V9.1 for Linux
Installation Guide.
- Writing Fortran programs,
- which is covered in the XL Fortran Language
Reference.
The first part of this document is organized according to the steps necessary to compile, link, and
run a program, followed by information on particular features of the XL
Fortran compiler and the programs it produces.
The second part discusses more general software-development topics.
Depending on your level of experience and what you want to do, you may need
to start reading at a particular point or read in a particular
sequence. If you want to:
- Set up the compiler for yourself or someone else,
- read Where to Find Installation Instructions.
- Create customized compiler defaults,
- read Customizing the Configuration File.
- Understand what all the compiler options are for and how they relate to
each other,
- browse through Summary of the XL Fortran Compiler Options.
- Look up a particular option by name,
- scan alphabetically through Detailed Descriptions of the XL Fortran Compiler Options.
- Port a program to XL Fortran,
- read Options for Compatibility to see what options you may need; then read Porting Programs to XL Fortran for other porting information.
This document uses notation often referred to as "railroad tracks" to
illustrate syntax for Fortran statements and Linux commands. Syntax for
compiler options is illustrated through statements using notation often
referred to as "braces and brackets".
Fortran keywords are shown in uppercase: for example, OPEN,
COMMON, and END. You must spell them exactly as they
are shown, although they are not case-sensitive.
Variable names and user-specified names appear in lowercase italics;
for example, array_element_name.
If a variable or user-specified name ends in _list, it means that
you can provide a list of terms that are separated by commas.
You must enter punctuation marks, parentheses, arithmetic operators, and
other special characters as part of the syntax.
- Read syntax diagrams from left to right and from top to bottom, following
the path of the line:
- The >>--- symbol indicates the beginning of a
command.
- The ---> symbol indicates that the command syntax
continues on the next line.
- The >--- symbol indicates that a command is continued
from the previous line.
- The --->< symbol indicates the end of a
command.
- Diagrams of syntactical units smaller than complete statements start with
the >--- symbol and end with the --->
symbol.
- Constructs, interface blocks and derived type definitions consist of
several individual statements. For such items, individual syntax
diagrams show the required order for the equivalent Fortran statements.
- Required items appear on the horizontal line (the main path):
>>-command_name--required_argument-----------------------------><
- Optional items appear below the main path:
>>-command_name--+-------------------+-------------------------><
'-optional_argument-'
- If you can choose from two or more items, they appear vertically, in a
stack.
If you must choose one of the items, one item of the stack
appears on the main path:
>>-command_name--+-required_argument-+-------------------------><
'-required_argument-'
If choosing one of the items is optional, the entire stack appears below
the main path:
>>-command_name--+-------------------+-------------------------><
+-optional_argument-+
'-optional_argument-'
- An arrow returning to the left above the main line (a "repeat arrow")
indicates an item that can be repeated and the separator character if it is
other than a blank:
.-:-------------------.
V |
>>-command_name----repeatable_argument-+-----------------------><
A repeat arrow above a stack indicates that you can make more than one
choice from the stacked items.
.-,-. .-,-------------.
V | V |
>>-EXAMPLE--char_constant--+-a-+--+---+----e-+----+-----------+-+-><
'-b-' +-c-+ '-name_list-'
'-d-'
Interpret the diagram as follows:
- Enter the keyword EXAMPLE.
- Enter a value for char_constant.
- Enter a value for a or b, but not for both.
- Optionally, enter a value for c or d.
- Enter at least one value for e. If you enter more than one
value, you must put a comma between each.
- Optionally, enter the value of at least one name for
name_list. If you enter more than one value, you must put a
comma between each name.
Syntax statements are read from left to right:
- Individual required arguments are shown with no special notation.
- When you must make a choice between a set of alternatives, they are
enclosed by { and } symbols.
- Optional arguments are enclosed by [ and ] symbols.
- When you can select from a group of choices, they are separated by |
characters.
- Arguments that you can repeat are followed by ellipses (...).
EXAMPLE char_constant {a|b}[c|d]e[,e]... name_list{name_list}...
The following list explains the syntax statement:
- Enter the keyword EXAMPLE.
- Enter a value for char_constant.
- Enter a value for a or b, but not for both.
- Optionally, enter a value for c or d.
- Enter at least one value for e. If you enter more
than one value, you must put a comma between each.
- Optionally, enter the value of at least one name for
name_list. If you enter more than one value, you must put a
comma between each name.
- Note:
- The same example is used in both the syntax-statement and
syntax-diagram representations.
- The examples in this document are coded in a simple style that does not try to conserve storage,
check for errors, achieve fast performance, or demonstrate all possible ways
to do something.
- The examples in this document use the xlf90, xlf90_r, xlf95,
xlf95_r, xlf, xlf_r, f77, fort77, f90, and f95 compiler invocation commands interchangeably. For more
substantial source files, one of these commands may be more suitable than the
others, as explained in Compiling XL Fortran Programs.
- Some sample programs from this document and some other programs that illustrate ideas presented in this
document are in the directory /opt/ibmcmp/xlf/9.1/samples.
The path names shown in this document assume the default installation path for the XL Fortran
compiler. By default, XL Fortran will be installed in the following
directory on the selected disk:
/opt/ibmcmp/xlf/9.1
You can select a different destination (relocation-path) for the
compiler. If you choose a different path, the compiler will be
installed in the following directory:
relocation-path/opt/ibmcmp/xlf/9.1
Some of the terminology in this document is shortened, as follows:
- The term free source form format will often appear as free source form.
- The term fixed source form format will often appear as fixed source form.
- The term XL Fortran will often appear as XLF.
This document uses the following methods to differentiate text:
- Fortran keywords, commands, statements, directives, intrinsic procedures,
compiler options, and filenames are shown in bold. For
example, COMMON, END, and OPEN.
- References to other sources of information appear in
italics.
- Variable names and user-specified names appear in lowercase
italics. For example, array_element_name.
