The GNU Fortran compiler front end was
designed initially as a free replacement for,
or alternative to, the unix @command{f95} command;
-@command{gfortran} is the command you'll use to invoke the compiler.
+@command{gfortran} is the command you will use to invoke the compiler.
@menu
* About GNU Fortran:: What you should know about the GNU Fortran compiler.
@dfn{machine code},
code designed to be efficiently translated and processed
by a machine such as your computer.
-Humans usually aren't as good writing machine code
+Humans usually are not as good writing machine code
as they are at writing Fortran (or C++, Ada, or Java),
because it is easy to make tiny mistakes writing machine code.
@ref{Fortran 2008 status} sections of the documentation.
Additionally, the GNU Fortran compilers supports the OpenMP specification
-(version 3.0, @url{http://openmp.org/@/wp/@/openmp-specifications/}).
+(version 3.1, @url{http://openmp.org/@/wp/@/openmp-specifications/}).
@node Varying Length Character Strings
@subsection Varying Length Character Strings
* GFORTRAN_STDOUT_UNIT:: Unit number for standard output
* GFORTRAN_STDERR_UNIT:: Unit number for standard error
* GFORTRAN_TMPDIR:: Directory for scratch files
-* GFORTRAN_UNBUFFERED_ALL:: Don't buffer I/O for all units.
-* GFORTRAN_UNBUFFERED_PRECONNECTED:: Don't buffer I/O for preconnected units.
+* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units.
+* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
* GFORTRAN_SHOW_LOCUS:: Show location for runtime errors
* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
* GFORTRAN_DEFAULT_RECL:: Default record length for new files
If these are missing, the default is @file{/tmp}.
@node GFORTRAN_UNBUFFERED_ALL
-@section @env{GFORTRAN_UNBUFFERED_ALL}---Don't buffer I/O on all units
+@section @env{GFORTRAN_UNBUFFERED_ALL}---Do not buffer I/O on all units
This environment variable controls whether all I/O is unbuffered. If
the first letter is @samp{y}, @samp{Y} or @samp{1}, all I/O is
This is the default.
@node GFORTRAN_UNBUFFERED_PRECONNECTED
-@section @env{GFORTRAN_UNBUFFERED_PRECONNECTED}---Don't buffer I/O on preconnected units
+@section @env{GFORTRAN_UNBUFFERED_PRECONNECTED}---Do not buffer I/O on preconnected units
The environment variable named @env{GFORTRAN_UNBUFFERED_PRECONNECTED} controls
whether I/O on a preconnected unit (i.e.@: STDOUT or STDERR) is unbuffered. If
If the first letter is @samp{y}, @samp{Y} or @samp{1}, filename and
line numbers for runtime errors are printed. If the first letter is
-@samp{n}, @samp{N} or @samp{0}, don't print filename and line numbers
+@samp{n}, @samp{N} or @samp{0}, do not print filename and line numbers
for runtime errors. The default is to print the location.
@node GFORTRAN_OPTIONAL_PLUS
@menu
* Fortran 2003 status::
* Fortran 2008 status::
+* TS 29113 status::
@end menu
@node Fortran 2003 status
Electrotechnical Commission (IEC). This group is known as
@uref{http://www.nag.co.uk/sc22wg5/, WG5}.
-The GNU Fortran supports several of the new features of Fortran 2008; the
-@uref{http://gcc.gnu.org/wiki/Fortran2008Status, wiki} has some information
+The GNU Fortran compiler supports several of the new features of Fortran 2008;
+the @uref{http://gcc.gnu.org/wiki/Fortran2008Status, wiki} has some information
about the current Fortran 2008 implementation status. In particular, the
following is implemented.
@code{ISO_C_BINDINGS} and @code{COMPILER_VERSION} and @code{COMPILER_OPTIONS}
of @code{ISO_FORTRAN_ENV}.
-@item Experimental coarray support (for one image only), use the
-@option{-fcoarray=single} flag to enable it.
+@item Coarray support for serial programs with @option{-fcoarray=single} flag
+and experimental support for multiple images with the @option{-fcoarray=lib}
+flag.
+
+@item The @code{DO CONCURRENT} construct is supported.
@item The @code{BLOCK} construct is supported.
+@node TS 29113 status
+@section Technical Specification 29113 Status
+
+GNU Fortran supports some of the new features of the Technical
+Specification (TS) 29113 on Further Interoperability of Fortran with C.
+The @uref{http://gcc.gnu.org/wiki/TS29113Status, wiki} has some information
+about the current TS 29113 implementation status. In particular, the
+following is implemented.
+
+@itemize
+@item The @option{-std=f2008ts} option.
+
+@item The @code{OPTIONAL} attribute is allowed for dummy arguments
+of @code{BIND(C) procedures.}
+
+@item The RANK intrinsic is supported.
+
+@item GNU Fortran's implementation for variables with @code{ASYNCHRONOUS}
+attribute is compatible with TS 29113.
+@end itemize
+
+
+
@c ---------------------------------------------------------------------
@c Compiler Characteristics
@c ---------------------------------------------------------------------
and environment variables that influence run-time behavior.
GNU Fortran strives to be compatible to the
-@uref{http://www.openmp.org/mp-documents/spec30.pdf,
-OpenMP Application Program Interface v3.0}.
+@uref{http://www.openmp.org/mp-documents/spec31.pdf,
+OpenMP Application Program Interface v3.1}.
To enable the processing of the OpenMP directive @code{!$omp} in
free-form source code; the @code{c$omp}, @code{*$omp} and @code{!$omp}
store_catalog(7)%description = "milk bottle"
store_catalog(7)%price = 1.2
-! Assignments of a whole variable don't change
+! Assignments of a whole variable do not change
store_catalog(12) = pear
print *, store_catalog(12)
@end example
@cindex @code{ENCODE}
@cindex @code{DECODE}
-GNU Fortran doesn't support the @code{ENCODE} and @code{DECODE}
+GNU Fortran does not support the @code{ENCODE} and @code{DECODE}
statements. These statements are best replaced by @code{READ} and
@code{WRITE} statements involving internal files (@code{CHARACTER}
variables and arrays), which have been part of the Fortran standard since
@code{TYPE(C_FUNPTR)} and the intrinsic conversion procedures are
@code{C_F_PROCPOINTER} and @code{C_FUNLOC}.
-Let's consider two examples of actually passing a procedure pointer from
+Let us consider two examples of actually passing a procedure pointer from
C to Fortran and vice versa. Note that these examples are also very
-similar to passing ordinary pointers between both languages.
-First, consider this code in C:
+similar to passing ordinary pointers between both languages. First,
+consider this code in C:
@smallexample
/* Procedure implemented in Fortran. */
Assumed-shape and allocatable arrays are passed using an array descriptor
(dope vector). The internal structure of the array descriptor used
by GNU Fortran is not yet documented and will change. There will also be
-a Technical Report (TR 29113) which standardizes an interoperable
+a Technical Specification (TS 29113) which standardizes an interoperable
array descriptor. Until then, you can use the Chasm Language
Interoperability Tools, @url{http://chasm-interop.sourceforge.net/},
which provide an interface to GNU Fortran's array descriptor.
-The technical report 29113 will presumably also include support for
-C-interoperable @code{OPTIONAL} and for assumed-rank and assumed-type
-dummy arguments. However, the TR has neither been approved nor implemented
-in GNU Fortran; therefore, these features are not yet available.
+GNU Fortran already supports the C-interoperable @code{OPTIONAL}
+attribute; for absent arguments, a @code{NULL} pointer is passed.
@node GNU Fortran Compiler Directives
@section GNU Fortran Compiler Directives
-The Fortran standard standard describes how a conforming program shall
+The Fortran standard describes how a conforming program shall
behave; however, the exact implementation is not standardized. In order
to allow the user to choose specific implementation details, compiler
directives can be used to set attributes of variables and procedures
Possible values are (bitwise or-ed) @code{GFC_STD_F77} (1),
@code{GFC_STD_F95_OBS} (2), @code{GFC_STD_F95_DEL} (4), @code{GFC_STD_F95}
(8), @code{GFC_STD_F2003} (16), @code{GFC_STD_GNU} (32),
-@code{GFC_STD_LEGACY} (64), @code{GFC_STD_F2008} (128), and
-@code{GFC_STD_F2008_OBS} (256). Default: @code{GFC_STD_F95_OBS
-| GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008
-| GFC_STD_F2008_OBS | GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY}.
+@code{GFC_STD_LEGACY} (64), @code{GFC_STD_F2008} (128),
+@code{GFC_STD_F2008_OBS} (256) and GFC_STD_F2008_TS (512). Default:
+@code{GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003
+| GFC_STD_F2008 | GFC_STD_F2008_TS | GFC_STD_F2008_OBS | GFC_STD_F77
+| GFC_STD_GNU | GFC_STD_LEGACY}.
@item @var{option}[1] @tab Standard-warning flag; prints a warning to
standard error. Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}.
@item @var{option}[2] @tab If non zero, enable pedantic checking.
@item @emph{Example}:
@smallexample
/* Use gfortran 4.7 default options. */
- static int options[] = @{68, 255, 0, 0, 1, 1, 0, 1@};
+ static int options[] = @{68, 511, 0, 0, 1, 1, 0, 1@};
_gfortran_set_options (8, &options);
@end smallexample
@end table
@node _gfortran_set_fpe
-@subsection @code{_gfortran_set_fpe} --- Set when a Floating Point Exception should be raised
+@subsection @code{_gfortran_set_fpe} --- Enable floating point exception traps
@fnindex _gfortran_set_fpe
@cindex libgfortran initialization, set_fpe
@table @asis
@item @emph{Description}:
-@code{_gfortran_set_fpe} sets the IEEE exceptions for which a
-Floating Point Exception (FPE) should be raised. On most systems,
-this will result in a SIGFPE signal being sent and the program
-being interrupted.
+@code{_gfortran_set_fpe} enables floating point exception traps for
+the specified exceptions. On most systems, this will result in a
+SIGFPE signal being sent and the program being aborted.
@item @emph{Syntax}:
@code{void _gfortran_set_fpe (int val)}
(bitwise or-ed) zero (0, default) no trapping,
@code{GFC_FPE_INVALID} (1), @code{GFC_FPE_DENORMAL} (2),
@code{GFC_FPE_ZERO} (4), @code{GFC_FPE_OVERFLOW} (8),
-@code{GFC_FPE_UNDERFLOW} (16), and @code{GFC_FPE_PRECISION} (32).
+@code{GFC_FPE_UNDERFLOW} (16), and @code{GFC_FPE_INEXACT} (32).
@end multitable
@item @emph{Example}:
happening on GNU Fortran,
but others are ``mainstream'' projects in need of enthusiastic hackers.
All of these projects are important!
-We'll eventually get around to the things here,
+We will eventually get around to the things here,
but they are also things doable by someone who is willing and able.
@menu