1 \input texinfo @c -*-texinfo-*-
3 @setfilename gfortran.info
4 @set copyrights-gfortran 1999-2007
6 @include gcc-common.texi
8 @settitle The GNU Fortran Compiler
10 @c Create a separate index for command line options
12 @c Merge the standard indexes into a single one.
19 @c TODO: The following "Part" definitions are included here temporarily
20 @c until they are incorporated into the official Texinfo distribution.
21 @c They borrow heavily from Texinfo's \unnchapentry definitions.
28 \vglue\titlepagetopglue
30 \leftline{Part #1:@* #2}
31 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
33 \writetocentry{part}{#2}{#1}
36 \writetocentry{blankpart}{}{}
38 % Part TOC-entry definition for summary contents.
39 \gdef\dosmallpartentry#1#2#3#4{%
40 \vskip .5\baselineskip plus.2\baselineskip
43 \tocentry{Part #2: #1}{\doshortpageno\bgroup#4\egroup}
46 \gdef\dosmallblankpartentry#1#2#3#4{%
47 \vskip .5\baselineskip plus.2\baselineskip
49 % Part TOC-entry definition for regular contents. This has to be
50 % equated to an existing entry to not cause problems when the PDF
52 \gdef\dopartentry#1#2#3#4{%
53 \unnchapentry{Part #2: #1}{}{#3}{#4}
55 \gdef\doblankpartentry#1#2#3#4{}
60 @c Use with @@smallbook.
62 @c %** start of document
64 @c Cause even numbered pages to be printed on the left hand side of
65 @c the page and odd numbered pages to be printed on the right hand
66 @c side of the page. Using this, you can print on both sides of a
67 @c sheet of paper and have the text on the same part of the sheet.
69 @c The text on right hand pages is pushed towards the right hand
70 @c margin and the text on left hand pages is pushed toward the left
72 @c (To provide the reverse effect, set bindingoffset to -0.75in.)
75 @c \global\bindingoffset=0.75in
76 @c \global\normaloffset =0.75in
80 Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
82 Permission is granted to copy, distribute and/or modify this document
83 under the terms of the GNU Free Documentation License, Version 1.1 or
84 any later version published by the Free Software Foundation; with the
85 Invariant Sections being ``GNU General Public License'' and ``Funding
86 Free Software'', the Front-Cover
87 texts being (a) (see below), and with the Back-Cover Texts being (b)
88 (see below). A copy of the license is included in the section entitled
89 ``GNU Free Documentation License''.
91 (a) The FSF's Front-Cover Text is:
95 (b) The FSF's Back-Cover Text is:
97 You have freedom to copy and modify this GNU Manual, like GNU
98 software. Copies published by the Free Software Foundation raise
99 funds for GNU development.
103 @dircategory Software development
105 * gfortran: (gfortran). The GNU Fortran Compiler.
107 This file documents the use and the internals of
108 the GNU Fortran compiler, (@command{gfortran}).
110 Published by the Free Software Foundation
111 51 Franklin Street, Fifth Floor
112 Boston, MA 02110-1301 USA
118 @setchapternewpage odd
120 @title Using GNU Fortran
122 @author The @t{gfortran} team
124 @vskip 0pt plus 1filll
125 Published by the Free Software Foundation@*
126 51 Franklin Street, Fifth Floor@*
127 Boston, MA 02110-1301, USA@*
128 @c Last printed ??ber, 19??.@*
129 @c Printed copies are available for $? each.@*
135 @c TODO: The following "Part" definitions are included here temporarily
136 @c until they are incorporated into the official Texinfo distribution.
139 \global\let\partentry=\dosmallpartentry
140 \global\let\blankpartentry=\dosmallblankpartentry
145 \global\let\partentry=\dopartentry
146 \global\let\blankpartentry=\doblankpartentry
152 @c ---------------------------------------------------------------------
153 @c TexInfo table of contents.
154 @c ---------------------------------------------------------------------
161 This manual documents the use of @command{gfortran},
162 the GNU Fortran compiler. You can find in this manual how to invoke
163 @command{gfortran}, as well as its features and incompatibilities.
166 @emph{Warning:} This document, and the compiler it describes, are still
167 under development. While efforts are made to keep it up-to-date, it might
168 not accurately reflect the status of the most recent GNU Fortran compiler.
172 @comment When you add a new menu item, please keep the right hand
173 @comment aligned to the same column. Do not use tabs. This provides
174 @comment better formatting.
179 Part I: Invoking GNU Fortran
180 * Invoking GNU Fortran:: Command options supported by @command{gfortran}.
181 * Runtime:: Influencing runtime behavior with environment variables.
183 Part II: Language Reference
184 * Fortran 2003 status:: Fortran 2003 features supported by GNU Fortran.
185 * Extensions:: Language extensions implemented by GNU Fortran.
186 * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran.
188 * Contributing:: How you can help.
189 * Copying:: GNU General Public License says
190 how you can copy and share GNU Fortran.
191 * GNU Free Documentation License::
192 How you can copy and share this manual.
193 * Funding:: How to help assure continued work for free software.
194 * Option Index:: Index of command line options
195 * Keyword Index:: Index of concepts
199 @c ---------------------------------------------------------------------
201 @c ---------------------------------------------------------------------
204 @chapter Introduction
206 @c The following duplicates the text on the TexInfo table of contents.
208 This manual documents the use of @command{gfortran}, the GNU Fortran
209 compiler. You can find in this manual how to invoke @command{gfortran},
210 as well as its features and incompatibilities.
213 @emph{Warning:} This document, and the compiler it describes, are still
214 under development. While efforts are made to keep it up-to-date, it
215 might not accurately reflect the status of the most recent GNU Fortran
220 The GNU Fortran compiler front end was
221 designed initially as a free replacement for,
222 or alternative to, the unix @command{f95} command;
223 @command{gfortran} is the command you'll use to invoke the compiler.
226 * About GNU Fortran:: What you should know about the GNU Fortran compiler.
227 * GNU Fortran and GCC:: You can compile Fortran, C, or other programs.
228 * Preprocessing and conditional compilation:: The Fortran preprocessor
229 * GNU Fortran and G77:: Why we chose to start from scratch.
230 * Project Status:: Status of GNU Fortran, roadmap, proposed extensions.
231 * Standards:: Standards supported by GNU Fortran.
235 @c ---------------------------------------------------------------------
237 @c ---------------------------------------------------------------------
239 @node About GNU Fortran
240 @section About GNU Fortran
242 The GNU Fortran compiler is still in an early state of development.
243 It can generate code for most constructs and expressions,
244 but much work remains to be done.
246 When the GNU Fortran compiler is finished,
247 it will do everything you expect from any decent compiler:
251 Read a user's program,
252 stored in a file and containing instructions written
253 in Fortran 77, Fortran 90, Fortran 95 or Fortran 2003.
254 This file contains @dfn{source code}.
257 Translate the user's program into instructions a computer
258 can carry out more quickly than it takes to translate the
259 instructions in the first
260 place. The result after compilation of a program is
262 code designed to be efficiently translated and processed
263 by a machine such as your computer.
264 Humans usually aren't as good writing machine code
265 as they are at writing Fortran (or C++, Ada, or Java),
266 because is easy to make tiny mistakes writing machine code.
269 Provide the user with information about the reasons why
270 the compiler is unable to create a binary from the source code.
271 Usually this will be the case if the source code is flawed.
272 When writing Fortran, it is easy to make big mistakes.
273 The Fortran 90 requires that the compiler can point out
274 mistakes to the user.
275 An incorrect usage of the language causes an @dfn{error message}.
277 The compiler will also attempt to diagnose cases where the
278 user's program contains a correct usage of the language,
279 but instructs the computer to do something questionable.
280 This kind of diagnostics message is called a @dfn{warning message}.
283 Provide optional information about the translation passes
284 from the source code to machine code.
285 This can help a user of the compiler to find the cause of
286 certain bugs which may not be obvious in the source code,
287 but may be more easily found at a lower level compiler output.
288 It also helps developers to find bugs in the compiler itself.
291 Provide information in the generated machine code that can
292 make it easier to find bugs in the program (using a debugging tool,
293 called a @dfn{debugger}, such as the GNU Debugger @command{gdb}).
296 Locate and gather machine code already generated to
297 perform actions requested by statements in the user's program.
298 This machine code is organized into @dfn{modules} and is located
299 and @dfn{linked} to the user program.
302 The GNU Fortran compiler consists of several components:
306 A version of the @command{gcc} command
307 (which also might be installed as the system's @command{cc} command)
308 that also understands and accepts Fortran source code.
309 The @command{gcc} command is the @dfn{driver} program for
310 all the languages in the GNU Compiler Collection (GCC);
312 you can compile the source code of any language for
313 which a front end is available in GCC.
316 The @command{gfortran} command itself,
317 which also might be installed as the
318 system's @command{f95} command.
319 @command{gfortran} is just another driver program,
320 but specifically for the Fortran compiler only.
321 The difference with @command{gcc} is that @command{gfortran}
322 will automatically link the correct libraries to your program.
325 A collection of run-time libraries.
326 These libraries contain the machine code needed to support
327 capabilities of the Fortran language that are not directly
328 provided by the machine code generated by the
329 @command{gfortran} compilation phase,
330 such as intrinsic functions and subroutines,
331 and routines for interaction with files and the operating system.
332 @c and mechanisms to spawn,
333 @c unleash and pause threads in parallelized code.
336 The Fortran compiler itself, (@command{f951}).
337 This is the GNU Fortran parser and code generator,
338 linked to and interfaced with the GCC backend library.
339 @command{f951} ``translates'' the source code to
340 assembler code. You would typically not use this
342 instead, the @command{gcc} or @command{gfortran} driver
343 programs will call it for you.
347 @c ---------------------------------------------------------------------
348 @c GNU Fortran and GCC
349 @c ---------------------------------------------------------------------
351 @node GNU Fortran and GCC
352 @section GNU Fortran and GCC
353 @cindex GNU Compiler Collection
356 GNU Fortran is a part of GCC, the @dfn{GNU Compiler Collection}. GCC
357 consists of a collection of front ends for various languages, which
358 translate the source code into a language-independent form called
359 @dfn{GENERIC}. This is then processed by a common middle end which
360 provides optimization, and then passed to one of a collection of back
361 ends which generate code for different computer architectures and
364 Functionally, this is implemented with a driver program (@command{gcc})
365 which provides the command-line interface for the compiler. It calls
366 the relevant compiler front-end program (e.g., @command{f951} for
367 Fortran) for each file in the source code, and then calls the assembler
368 and linker as appropriate to produce the compiled output. In a copy of
369 GCC which has been compiled with Fortran language support enabled,
370 @command{gcc} will recognize files with @file{.f}, @file{.f90}, @file{.f95},
371 and @file{.f03} extensions as Fortran source code, and compile it
372 accordingly. A @command{gfortran} driver program is also provided,
373 which is identical to @command{gcc} except that it automatically links
374 the Fortran runtime libraries into the compiled program.
376 This manual specifically documents the Fortran front end, which handles
377 the programming language's syntax and semantics. The aspects of GCC
378 which relate to the optimization passes and the back-end code generation
379 are documented in the GCC manual; see
380 @ref{Top,,Introduction,gcc,Using the GNU Compiler Collection (GCC)}.
381 The two manuals together provide a complete reference for the GNU
385 @c ---------------------------------------------------------------------
386 @c Preprocessing and conditional compilation
387 @c ---------------------------------------------------------------------
389 @node Preprocessing and conditional compilation
390 @section Preprocessing and conditional compilation
393 @cindex Conditional compilation
394 @cindex Preprocessing
396 Many Fortran compilers including GNU Fortran allow to pass the source code
397 through a C preprocessor (CPP; sometimes also called Fortran preprocessor,
398 FPP) to allow for conditional compilation. In case of GNU Fortran
399 this is the GNU C Preprocessor in the traditional mode. On systems with
400 case-preserving file names, the preprocessor is automatically invoked if the
401 file extension is @code{.F}, @code{.F90}, @code{.F95} or @code{.F03};
402 otherwise use for fixed-format code the option @code{-x f77-cpp-input}
403 and for free-format code @code{-x f95-cpp-input}. Invocation of the
404 preprocessor can be suppressed using @code{-x f77} or @code{-x f95}.
406 If the GNU Fortran invoked the preprocessor, @code{__GFORTRAN__}
407 is defined and @code{__GNUC__}, @code{__GNUC_MINOR__} and
408 @code{__GNUC_PATCHLEVEL__} can be used to determine the version of the
409 compiler. See @ref{Top,,Overview,cpp,The C Preprocessor} for details.
411 While CPP is the de-facto standard for preprocessing Fortran code,
412 Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
413 Conditional Compilation, which is not widely used and not directly
414 supported by the GNU Fortran compiler. You can use the program coco
415 to preprocess such files (@uref{http://users.erols.com/dnagle/coco.html}).
418 @c ---------------------------------------------------------------------
419 @c GNU Fortran and G77
420 @c ---------------------------------------------------------------------
422 @node GNU Fortran and G77
423 @section GNU Fortran and G77
425 @cindex @command{g77}
427 The GNU Fortran compiler is the successor to @command{g77}, the Fortran
428 77 front end included in GCC prior to version 4. It is an entirely new
429 program that has been designed to provide Fortran 95 support and
430 extensibility for future Fortran language standards, as well as providing
431 backwards compatibility for Fortran 77 and nearly all of the GNU language
432 extensions supported by @command{g77}.
435 @c ---------------------------------------------------------------------
437 @c ---------------------------------------------------------------------
440 @section Project Status
443 As soon as @command{gfortran} can parse all of the statements correctly,
444 it will be in the ``larva'' state.
445 When we generate code, the ``puppa'' state.
446 When @command{gfortran} is done,
447 we'll see if it will be a beautiful butterfly,
448 or just a big bug....
450 --Andy Vaught, April 2000
453 The start of the GNU Fortran 95 project was announced on
454 the GCC homepage in March 18, 2000
455 (even though Andy had already been working on it for a while,
458 The GNU Fortran compiler is able to compile nearly all
459 standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
460 including a number of standard and non-standard extensions, and can be
461 used on real-world programs. In particular, the supported extensions
462 include OpenMP, Cray-style pointers, and several Fortran 2003 features
463 such as enumeration, stream I/O, and some of the enhancements to
464 allocatable array support from TR 15581. However, it is still under
465 development and has a few remaining rough edges.
467 At present, the GNU Fortran compiler passes the
468 @uref{http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html,
469 NIST Fortran 77 Test Suite}, and produces acceptable results on the
470 @uref{http://www.netlib.org/lapack/faq.html#1.21, LAPACK Test Suite}.
471 It also provides respectable performance on
472 the @uref{http://www.polyhedron.com/pb05.html, Polyhedron Fortran
473 compiler benchmarks} and the
474 @uref{http://www.llnl.gov/asci_benchmarks/asci/limited/lfk/README.html,
475 Livermore Fortran Kernels test}. It has been used to compile a number of
476 large real-world programs, including
477 @uref{http://mysite.verizon.net/serveall/moene.pdf, the HIRLAM
478 weather-forecasting code} and
479 @uref{http://www.theochem.uwa.edu.au/tonto/, the Tonto quantum
480 chemistry package}; see @url{http://gcc.gnu.org/wiki/GfortranApps} for an
483 Among other things, the GNU Fortran compiler is intended as a replacement
484 for G77. At this point, nearly all programs that could be compiled with
485 G77 can be compiled with GNU Fortran, although there are a few minor known
488 The primary work remaining to be done on GNU Fortran falls into three
489 categories: bug fixing (primarily regarding the treatment of invalid code
490 and providing useful error messages), improving the compiler optimizations
491 and the performance of compiled code, and extending the compiler to support
492 future standards---in particular, Fortran 2003.
495 @c ---------------------------------------------------------------------
497 @c ---------------------------------------------------------------------
503 The GNU Fortran compiler implements
504 ISO/IEC 1539:1997 (Fortran 95). As such, it can also compile essentially all
505 standard-compliant Fortran 90 and Fortran 77 programs. It also supports
506 the ISO/IEC TR-15581 enhancements to allocatable arrays, and
507 the @uref{http://www.openmp.org/drupal/mp-documents/spec25.pdf,
508 OpenMP Application Program Interface v2.5} specification.
510 In the future, the GNU Fortran compiler may also support other standard
511 variants of and extensions to the Fortran language. These include
512 ISO/IEC 1539-1:2004 (Fortran 2003).
515 @c =====================================================================
516 @c PART I: INVOCATION REFERENCE
517 @c =====================================================================
520 \part{I}{Invoking GNU Fortran}
523 @c ---------------------------------------------------------------------
525 @c ---------------------------------------------------------------------
530 @c ---------------------------------------------------------------------
532 @c ---------------------------------------------------------------------
535 @chapter Runtime: Influencing runtime behavior with environment variables
536 @cindex environment variable
538 The behavior of the @command{gfortran} can be influenced by
539 environment variables.
541 Malformed environment variables are silently ignored.
544 * GFORTRAN_STDIN_UNIT:: Unit number for standard input
545 * GFORTRAN_STDOUT_UNIT:: Unit number for standard output
546 * GFORTRAN_STDERR_UNIT:: Unit number for standard error
547 * GFORTRAN_USE_STDERR:: Send library output to standard error
548 * GFORTRAN_TMPDIR:: Directory for scratch files
549 * GFORTRAN_UNBUFFERED_n:: Don't buffer I/O for specific unit.
550 * GFORTRAN_UNBUFFERED_ALL:: Don't buffer I/O for all units.
551 * GFORTRAN_SHOW_LOCUS:: Show location for runtime errors
552 * GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
553 * GFORTRAN_DEFAULT_RECL:: Default record length for new files
554 * GFORTRAN_LIST_SEPARATOR:: Separator for list output
555 * GFORTRAN_CONVERT_UNIT:: Set endianness for unformatted I/O
556 * GFORTRAN_ERROR_DUMPCORE:: Dump core on run-time errors
557 * GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
560 @node GFORTRAN_STDIN_UNIT
561 @section @env{GFORTRAN_STDIN_UNIT}---Unit number for standard input
563 This environment variable can be used to select the unit number
564 preconnected to standard input. This must be a positive integer.
565 The default value is 5.
567 @node GFORTRAN_STDOUT_UNIT
568 @section @env{GFORTRAN_STDOUT_UNIT}---Unit number for standard output
570 This environment variable can be used to select the unit number
571 preconnected to standard output. This must be a positive integer.
572 The default value is 6.
574 @node GFORTRAN_STDERR_UNIT
575 @section @env{GFORTRAN_STDERR_UNIT}---Unit number for standard error
577 This environment variable can be used to select the unit number
578 preconnected to standard error. This must be a positive integer.
579 The default value is 0.
581 @node GFORTRAN_USE_STDERR
582 @section @env{GFORTRAN_USE_STDERR}---Send library output to standard error
584 This environment variable controls where library output is sent.
585 If the first letter is @samp{y}, @samp{Y} or @samp{1}, standard
586 error is used. If the first letter is @samp{n}, @samp{N} or
587 @samp{0}, standard output is used.
589 @node GFORTRAN_TMPDIR
590 @section @env{GFORTRAN_TMPDIR}---Directory for scratch files
592 This environment variable controls where scratch files are
593 created. If this environment variable is missing,
594 GNU Fortran searches for the environment variable @env{TMP}. If
595 this is also missing, the default is @file{/tmp}.
597 @node GFORTRAN_UNBUFFERED_n
598 @section @env{GFORTRAN_UNBUFFERED_n}---Don't buffer I/O on unit n
600 Environment variables named @env{GFORTRAN_UNBUFFERED_n}, where
601 @samp{n} is an integer, control whether I/O on unit @samp{n} is
602 unbuffered. If the first letter is @samp{y}, @samp{Y} or @samp{1},
603 I/O is unbuffered. This will slow down small sequential reads and
604 writes. If the first letter is @samp{n}, @samp{N} or @samp{0}, I/O is
605 buffered. This is the default.
607 @node GFORTRAN_UNBUFFERED_ALL
608 @section @env{GFORTRAN_UNBUFFERED_ALL}---Don't buffer I/O on all units
610 This environment variable controls whether all I/O is unbuffered. If
611 the first letter is @samp{y}, @samp{Y} or @samp{1}, all I/O is
612 unbuffered. This will slow down small sequential reads and writes. If
613 the first letter is @samp{n}, @samp{N} or @samp{0}, I/O is buffered.
616 @node GFORTRAN_SHOW_LOCUS
617 @section @env{GFORTRAN_SHOW_LOCUS}---Show location for runtime errors
619 If the first letter is @samp{y}, @samp{Y} or @samp{1}, filename and
620 line numbers for runtime errors are printed. If the first letter is
621 @samp{n}, @samp{N} or @samp{0}, don't print filename and line numbers
622 for runtime errors. The default is to print the location.
624 @node GFORTRAN_OPTIONAL_PLUS
625 @section @env{GFORTRAN_OPTIONAL_PLUS}---Print leading + where permitted
627 If the first letter is @samp{y}, @samp{Y} or @samp{1},
628 a plus sign is printed
629 where permitted by the Fortran standard. If the first letter
630 is @samp{n}, @samp{N} or @samp{0}, a plus sign is not printed
631 in most cases. Default is not to print plus signs.
633 @node GFORTRAN_DEFAULT_RECL
634 @section @env{GFORTRAN_DEFAULT_RECL}---Default record length for new files
636 This environment variable specifies the default record length, in
637 bytes, for files which are opened without a @code{RECL} tag in the
638 @code{OPEN} statement. This must be a positive integer. The
639 default value is 1073741824 bytes (1 GB).
641 @node GFORTRAN_LIST_SEPARATOR
642 @section @env{GFORTRAN_LIST_SEPARATOR}---Separator for list output
644 This environment variable specifies the separator when writing
645 list-directed output. It may contain any number of spaces and
646 at most one comma. If you specify this on the command line,
647 be sure to quote spaces, as in
649 $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out
651 when @command{a.out} is the compiled Fortran program that you want to run.
652 Default is a single space.
654 @node GFORTRAN_CONVERT_UNIT
655 @section @env{GFORTRAN_CONVERT_UNIT}---Set endianness for unformatted I/O
657 By setting the @env{GFORTRAN_CONVERT_UNIT} variable, it is possible
658 to change the representation of data for unformatted files.
659 The syntax for the @env{GFORTRAN_CONVERT_UNIT} variable is:
661 GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
662 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
663 exception: mode ':' unit_list | unit_list ;
664 unit_list: unit_spec | unit_list unit_spec ;
665 unit_spec: INTEGER | INTEGER '-' INTEGER ;
667 The variable consists of an optional default mode, followed by
668 a list of optional exceptions, which are separated by semicolons
669 from the preceding default and each other. Each exception consists
670 of a format and a comma-separated list of units. Valid values for
671 the modes are the same as for the @code{CONVERT} specifier:
674 @item @code{NATIVE} Use the native format. This is the default.
675 @item @code{SWAP} Swap between little- and big-endian.
676 @item @code{LITTLE_ENDIAN} Use the little-endian format
677 for unformatted files.
678 @item @code{BIG_ENDIAN} Use the big-endian format for unformatted files.
680 A missing mode for an exception is taken to mean @code{BIG_ENDIAN}.
681 Examples of values for @env{GFORTRAN_CONVERT_UNIT} are:
683 @item @code{'big_endian'} Do all unformatted I/O in big_endian mode.
684 @item @code{'little_endian;native:10-20,25'} Do all unformatted I/O
685 in little_endian mode, except for units 10 to 20 and 25, which are in
687 @item @code{'10-20'} Units 10 to 20 are big-endian, the rest is native.
690 Setting the environment variables should be done on the command
691 line or via the @command{export}
692 command for @command{sh}-compatible shells and via @command{setenv}
693 for @command{csh}-compatible shells.
695 Example for @command{sh}:
698 $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
701 Example code for @command{csh}:
704 % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
708 Using anything but the native representation for unformatted data
709 carries a significant speed overhead. If speed in this area matters
710 to you, it is best if you use this only for data that needs to be
713 @xref{CONVERT specifier}, for an alternative way to specify the
714 data representation for unformatted files. @xref{Runtime Options}, for
715 setting a default data representation for the whole program. The
716 @code{CONVERT} specifier overrides the @option{-fconvert} compile options.
718 @emph{Note that the values specified via the GFORTRAN_CONVERT_UNIT
719 environment variable will override the CONVERT specifier in the
720 open statement}. This is to give control over data formats to
721 users who do not have the source code of their program available.
723 @node GFORTRAN_ERROR_DUMPCORE
724 @section @env{GFORTRAN_ERROR_DUMPCORE}---Dump core on run-time errors
726 If the @env{GFORTRAN_ERROR_DUMPCORE} variable is set to
727 @samp{y}, @samp{Y} or @samp{1} (only the first letter is relevant)
728 then library run-time errors cause core dumps. To disable the core
729 dumps, set the variable to @samp{n}, @samp{N}, @samp{0}. Default
730 is not to core dump unless the @option{-fdump-core} compile option
733 @node GFORTRAN_ERROR_BACKTRACE
734 @section @env{GFORTRAN_ERROR_BACKTRACE}---Show backtrace on run-time errors
736 If the @env{GFORTRAN_ERROR_BACKTRACE} variable is set to
737 @samp{y}, @samp{Y} or @samp{1} (only the first letter is relevant)
738 then a backtrace is printed when a run-time error occurs.
739 To disable the backtracing, set the variable to
740 @samp{n}, @samp{N}, @samp{0}. Default is not to print a backtrace
741 unless the @option{-fbacktrace} compile option
744 @c =====================================================================
745 @c PART II: LANGUAGE REFERENCE
746 @c =====================================================================
749 \part{II}{Language Reference}
752 @c ---------------------------------------------------------------------
753 @c Fortran 2003 Status
754 @c ---------------------------------------------------------------------
756 @node Fortran 2003 status
757 @chapter Fortran 2003 Status
759 Although GNU Fortran focuses on implementing the Fortran 95
760 standard for the time being, a few Fortran 2003 features are currently
765 Intrinsics @code{command_argument_count}, @code{get_command},
766 @code{get_command_argument}, @code{get_environment_variable}, and
770 @cindex array, constructors
772 Array constructors using square brackets. That is, @code{[...]} rather
776 @cindex @code{FLUSH} statement
777 @cindex statement, @code{FLUSH}
778 @code{FLUSH} statement.
781 @cindex @code{IOMSG=} specifier
782 @code{IOMSG=} specifier for I/O statements.
785 @cindex @code{ENUM} statement
786 @cindex @code{ENUMERATOR} statement
787 @cindex statement, @code{ENUM}
788 @cindex statement, @code{ENUMERATOR}
789 @opindex @code{fshort-enums}
790 Support for the declaration of enumeration constants via the
791 @code{ENUM} and @code{ENUMERATOR} statements. Interoperability with
792 @command{gcc} is guaranteed also for the case where the
793 @command{-fshort-enums} command line option is given.
800 @cindex @code{ALLOCATABLE} dummy arguments
801 @code{ALLOCATABLE} dummy arguments.
803 @cindex @code{ALLOCATABLE} function results
804 @code{ALLOCATABLE} function results
806 @cindex @code{ALLOCATABLE} components of derived types
807 @code{ALLOCATABLE} components of derived types
811 @cindex @code{STREAM} I/O
812 @cindex @code{ACCESS='STREAM'} I/O
813 The @code{OPEN} statement supports the @code{ACCESS='STREAM'} specifier,
814 allowing I/O without any record structure.
817 Namelist input/output for internal files.
820 @cindex @code{PROTECTED} statement
821 @cindex statement, @code{PROTECTED}
822 The @code{PROTECTED} statement and attribute.
825 @cindex @code{VALUE} statement
826 @cindex statement, @code{VALUE}
827 The @code{VALUE} statement and attribute.
830 @cindex @code{VOLATILE} statement
831 @cindex statement, @code{VOLATILE}
832 The @code{VOLATILE} statement and attribute.
835 @cindex @code{IMPORT} statement
836 @cindex statement, @code{IMPORT}
837 The @code{IMPORT} statement, allowing to import
838 host-associated derived types.
841 @cindex @code{USE, INTRINSIC} statement
842 @cindex statement, @code{USE, INTRINSIC}
843 @cindex @code{ISO_FORTRAN_ENV} statement
844 @cindex statement, @code{ISO_FORTRAN_ENV}
845 @code{USE} statement with @code{INTRINSIC} and @code{NON_INTRINSIC}
846 attribute; supported intrinsic modules: @code{ISO_FORTRAN_ENV},
847 @code{OMP_LIB} and @code{OMP_LIB_KINDS}.
850 Renaming of operators in the @code{USE} statement.
853 @cindex ISO C Bindings
854 Interoperability with C (ISO C Bindings)
859 @c ---------------------------------------------------------------------
861 @c ---------------------------------------------------------------------
863 @c Maybe this chapter should be merged with the 'Standards' section,
864 @c whenever that is written :-)
870 GNU Fortran implements a number of extensions over standard
871 Fortran. This chapter contains information on their syntax and
872 meaning. There are currently two categories of GNU Fortran
873 extensions, those that provide functionality beyond that provided
874 by any standard, and those that are supported by GNU Fortran
875 purely for backward compatibility with legacy compilers. By default,
876 @option{-std=gnu} allows the compiler to accept both types of
877 extensions, but to warn about the use of the latter. Specifying
878 either @option{-std=f95} or @option{-std=f2003} disables both types
879 of extensions, and @option{-std=legacy} allows both without warning.
882 * Old-style kind specifications::
883 * Old-style variable initialization::
884 * Extensions to namelist::
885 * X format descriptor without count field::
886 * Commas in FORMAT specifications::
887 * Missing period in FORMAT specifications::
889 * BOZ literal constants::
890 * Real array indices::
892 * Implicitly convert LOGICAL and INTEGER values::
893 * Hollerith constants support::
895 * CONVERT specifier::
897 * Argument list functions::
900 @node Old-style kind specifications
901 @section Old-style kind specifications
902 @cindex kind, old-style
904 GNU Fortran allows old-style kind specifications in declarations. These
910 where @code{TYPESPEC} is a basic type (@code{INTEGER}, @code{REAL},
911 etc.), and where @code{size} is a byte count corresponding to the
912 storage size of a valid kind for that type. (For @code{COMPLEX}
913 variables, @code{size} is the total size of the real and imaginary
914 parts.) The statement then declares @code{x}, @code{y} and @code{z} to
915 be of type @code{TYPESPEC} with the appropriate kind. This is
916 equivalent to the standard-conforming declaration
921 where @code{k} is equal to @code{size} for most types, but is equal to
922 @code{size/2} for the @code{COMPLEX} type.
924 @node Old-style variable initialization
925 @section Old-style variable initialization
927 GNU Fortran allows old-style initialization of variables of the
931 REAL x(2,2) /3*0.,1./
933 The syntax for the initializers is as for the @code{DATA} statement, but
934 unlike in a @code{DATA} statement, an initializer only applies to the
935 variable immediately preceding the initialization. In other words,
936 something like @code{INTEGER I,J/2,3/} is not valid. This style of
937 initialization is only allowed in declarations without double colons
938 (@code{::}); the double colons were introduced in Fortran 90, which also
939 introduced a standard syntax for initializing variables in type
942 Examples of standard-conforming code equivalent to the above example
946 INTEGER :: i = 1, j = 2
947 REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
951 DATA i/1/, j/2/, x/3*0.,1./
954 Note that variables which are explicitly initialized in declarations
955 or in @code{DATA} statements automatically acquire the @code{SAVE}
958 @node Extensions to namelist
959 @section Extensions to namelist
962 GNU Fortran fully supports the Fortran 95 standard for namelist I/O
963 including array qualifiers, substrings and fully qualified derived types.
964 The output from a namelist write is compatible with namelist read. The
965 output has all names in upper case and indentation to column 1 after the
966 namelist name. Two extensions are permitted:
968 Old-style use of @samp{$} instead of @samp{&}
971 X(:)%Y(2) = 1.0 2.0 3.0
976 It should be noted that the default terminator is @samp{/} rather than
979 Querying of the namelist when inputting from stdin. After at least
980 one space, entering @samp{?} sends to stdout the namelist name and the names of
981 the variables in the namelist:
992 Entering @samp{=?} outputs the namelist to stdout, as if
993 @code{WRITE(*,NML = mynml)} had been called:
998 X(1)%Y= 0.000000 , 1.000000 , 0.000000 ,
999 X(2)%Y= 0.000000 , 2.000000 , 0.000000 ,
1000 X(3)%Y= 0.000000 , 3.000000 , 0.000000 ,
1004 To aid this dialog, when input is from stdin, errors send their
1005 messages to stderr and execution continues, even if @code{IOSTAT} is set.
1007 @code{PRINT} namelist is permitted. This causes an error if
1008 @option{-std=f95} is used.
1011 REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/)
1014 END PROGRAM test_print
1017 Expanded namelist reads are permitted. This causes an error if
1018 @option{-std=f95} is used. In the following example, the first element
1019 of the array will be given the value 0.00 and the two succeeding
1020 elements will be given the values 1.00 and 2.00.
1023 X(1,1) = 0.00 , 1.00 , 2.00
1027 @node X format descriptor without count field
1028 @section @code{X} format descriptor without count field
1030 To support legacy codes, GNU Fortran permits the count field of the
1031 @code{X} edit descriptor in @code{FORMAT} statements to be omitted.
1032 When omitted, the count is implicitly assumed to be one.
1036 10 FORMAT (I1, X, I1)
1039 @node Commas in FORMAT specifications
1040 @section Commas in @code{FORMAT} specifications
1042 To support legacy codes, GNU Fortran allows the comma separator
1043 to be omitted immediately before and after character string edit
1044 descriptors in @code{FORMAT} statements.
1048 10 FORMAT ('FOO='I1' BAR='I2)
1052 @node Missing period in FORMAT specifications
1053 @section Missing period in @code{FORMAT} specifications
1055 To support legacy codes, GNU Fortran allows missing periods in format
1056 specifications if and only if @option{-std=legacy} is given on the
1057 command line. This is considered non-conforming code and is
1066 @node I/O item lists
1067 @section I/O item lists
1068 @cindex I/O item lists
1070 To support legacy codes, GNU Fortran allows the input item list
1071 of the @code{READ} statement, and the output item lists of the
1072 @code{WRITE} and @code{PRINT} statements, to start with a comma.
1074 @node BOZ literal constants
1075 @section BOZ literal constants
1076 @cindex BOZ literal constants
1078 As an extension, GNU Fortran allows hexadecimal BOZ literal constants to
1079 be specified using the X prefix, in addition to the standard Z prefix.
1080 BOZ literal constants can also be specified by adding a suffix to the
1081 string. For example, @code{Z'ABC'} and @code{'ABC'Z} are equivalent.
1083 The Fortran standard restricts the appearance of a BOZ literal constant
1084 to the @code{DATA} statement, and it is expected to be assigned to an
1085 @code{INTEGER} variable. GNU Fortran permits a BOZ literal to appear in
1086 any initialization expression as well as assignment statements.
1088 Attempts to use a BOZ literal constant to do a bitwise initialization of
1089 a variable can lead to confusion. A BOZ literal constant is converted
1090 to an @code{INTEGER} value with the kind type with the largest decimal
1091 representation, and this value is then converted numerically to the type
1092 and kind of the variable in question. Thus, one should not expect a
1093 bitwise copy of the BOZ literal constant to be assigned to a @code{REAL}
1096 Similarly, initializing an @code{INTEGER} variable with a statement such
1097 as @code{DATA i/Z'FFFFFFFF'/} will produce an integer overflow rather
1098 than the desired result of @math{-1} when @code{i} is a 32-bit integer
1099 on a system that supports 64-bit integers. The @samp{-fno-range-check}
1100 option can be used as a workaround for legacy code that initializes
1101 integers in this manner.
1103 @node Real array indices
1104 @section Real array indices
1105 @cindex array, indices of type real
1107 As an extension, GNU Fortran allows the use of @code{REAL} expressions
1108 or variables as array indices.
1110 @node Unary operators
1111 @section Unary operators
1112 @cindex operators, unary
1114 As an extension, GNU Fortran allows unary plus and unary minus operators
1115 to appear as the second operand of binary arithmetic operators without
1116 the need for parenthesis.
1122 @node Implicitly convert LOGICAL and INTEGER values
1123 @section Implicitly convert @code{LOGICAL} and @code{INTEGER} values
1124 @cindex conversion, to integer
1125 @cindex conversion, to logical
1127 As an extension for backwards compatibility with other compilers, GNU
1128 Fortran allows the implicit conversion of @code{LOGICAL} values to
1129 @code{INTEGER} values and vice versa. When converting from a
1130 @code{LOGICAL} to an @code{INTEGER}, @code{.FALSE.} is interpreted as
1131 zero, and @code{.TRUE.} is interpreted as one. When converting from
1132 @code{INTEGER} to @code{LOGICAL}, the value zero is interpreted as
1133 @code{.FALSE.} and any nonzero value is interpreted as @code{.TRUE.}.
1137 IF (i) PRINT *, 'True'
1140 @node Hollerith constants support
1141 @section Hollerith constants support
1142 @cindex Hollerith constants
1144 GNU Fortran supports Hollerith constants in assignments, function
1145 arguments, and @code{DATA} and @code{ASSIGN} statements. A Hollerith
1146 constant is written as a string of characters preceded by an integer
1147 constant indicating the character count, and the letter @code{H} or
1148 @code{h}, and stored in bytewise fashion in a numeric (@code{INTEGER},
1149 @code{REAL}, or @code{complex}) or @code{LOGICAL} variable. The
1150 constant will be padded or truncated to fit the size of the variable in
1153 Examples of valid uses of Hollerith constants:
1156 data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
1157 x(1) = 16HABCDEFGHIJKLMNOP
1161 Invalid Hollerith constants examples:
1164 a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
1165 a = 0H ! At least one character is needed.
1168 In general, Hollerith constants were used to provide a rudimentary
1169 facility for handling character strings in early Fortran compilers,
1170 prior to the introduction of @code{CHARACTER} variables in Fortran 77;
1171 in those cases, the standard-compliant equivalent is to convert the
1172 program to use proper character strings. On occasion, there may be a
1173 case where the intent is specifically to initialize a numeric variable
1174 with a given byte sequence. In these cases, the same result can be
1175 obtained by using the @code{TRANSFER} statement, as in this example.
1177 INTEGER(KIND=4) :: a
1178 a = TRANSFER ("abcd", a) ! equivalent to: a = 4Habcd
1183 @section Cray pointers
1184 @cindex pointer, cray
1186 Cray pointers are part of a non-standard extension that provides a
1187 C-like pointer in Fortran. This is accomplished through a pair of
1188 variables: an integer "pointer" that holds a memory address, and a
1189 "pointee" that is used to dereference the pointer.
1191 Pointer/pointee pairs are declared in statements of the form:
1193 pointer ( <pointer> , <pointee> )
1197 pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
1199 The pointer is an integer that is intended to hold a memory address.
1200 The pointee may be an array or scalar. A pointee can be an assumed
1201 size array---that is, the last dimension may be left unspecified by
1202 using a @code{*} in place of a value---but a pointee cannot be an
1203 assumed shape array. No space is allocated for the pointee.
1205 The pointee may have its type declared before or after the pointer
1206 statement, and its array specification (if any) may be declared
1207 before, during, or after the pointer statement. The pointer may be
1208 declared as an integer prior to the pointer statement. However, some
1209 machines have default integer sizes that are different than the size
1210 of a pointer, and so the following code is not portable:
1215 If a pointer is declared with a kind that is too small, the compiler
1216 will issue a warning; the resulting binary will probably not work
1217 correctly, because the memory addresses stored in the pointers may be
1218 truncated. It is safer to omit the first line of the above example;
1219 if explicit declaration of ipt's type is omitted, then the compiler
1220 will ensure that ipt is an integer variable large enough to hold a
1223 Pointer arithmetic is valid with Cray pointers, but it is not the same
1224 as C pointer arithmetic. Cray pointers are just ordinary integers, so
1225 the user is responsible for determining how many bytes to add to a
1226 pointer in order to increment it. Consider the following example:
1230 pointer (ipt, pointee)
1234 The last statement does not set @code{ipt} to the address of
1235 @code{target(1)}, as it would in C pointer arithmetic. Adding @code{1}
1236 to @code{ipt} just adds one byte to the address stored in @code{ipt}.
1238 Any expression involving the pointee will be translated to use the
1239 value stored in the pointer as the base address.
1241 To get the address of elements, this extension provides an intrinsic
1242 function @code{LOC()}. The @code{LOC()} function is equivalent to the
1243 @code{&} operator in C, except the address is cast to an integer type:
1246 pointer(ipt, arpte(10))
1248 ipt = loc(ar) ! Makes arpte is an alias for ar
1249 arpte(1) = 1.0 ! Sets ar(1) to 1.0
1251 The pointer can also be set by a call to the @code{MALLOC} intrinsic
1254 Cray pointees often are used to alias an existing variable. For
1262 As long as @code{ipt} remains unchanged, @code{iarr} is now an alias for
1263 @code{target}. The optimizer, however, will not detect this aliasing, so
1264 it is unsafe to use @code{iarr} and @code{target} simultaneously. Using
1265 a pointee in any way that violates the Fortran aliasing rules or
1266 assumptions is illegal. It is the user's responsibility to avoid doing
1267 this; the compiler works under the assumption that no such aliasing
1270 Cray pointers will work correctly when there is no aliasing (i.e., when
1271 they are used to access a dynamically allocated block of memory), and
1272 also in any routine where a pointee is used, but any variable with which
1273 it shares storage is not used. Code that violates these rules may not
1274 run as the user intends. This is not a bug in the optimizer; any code
1275 that violates the aliasing rules is illegal. (Note that this is not
1276 unique to GNU Fortran; any Fortran compiler that supports Cray pointers
1277 will ``incorrectly'' optimize code with illegal aliasing.)
1279 There are a number of restrictions on the attributes that can be applied
1280 to Cray pointers and pointees. Pointees may not have the
1281 @code{ALLOCATABLE}, @code{INTENT}, @code{OPTIONAL}, @code{DUMMY},
1282 @code{TARGET}, @code{INTRINSIC}, or @code{POINTER} attributes. Pointers
1283 may not have the @code{DIMENSION}, @code{POINTER}, @code{TARGET},
1284 @code{ALLOCATABLE}, @code{EXTERNAL}, or @code{INTRINSIC} attributes.
1285 Pointees may not occur in more than one pointer statement. A pointee
1286 cannot be a pointer. Pointees cannot occur in equivalence, common, or
1289 A Cray pointer may also point to a function or a subroutine. For
1290 example, the following excerpt is valid:
1294 pointer (subptr,subpte)
1304 A pointer may be modified during the course of a program, and this
1305 will change the location to which the pointee refers. However, when
1306 pointees are passed as arguments, they are treated as ordinary
1307 variables in the invoked function. Subsequent changes to the pointer
1308 will not change the base address of the array that was passed.
1310 @node CONVERT specifier
1311 @section CONVERT specifier
1312 @cindex CONVERT specifier
1314 GNU Fortran allows the conversion of unformatted data between little-
1315 and big-endian representation to facilitate moving of data
1316 between different systems. The conversion can be indicated with
1317 the @code{CONVERT} specifier on the @code{OPEN} statement.
1318 @xref{GFORTRAN_CONVERT_UNIT}, for an alternative way of specifying
1319 the data format via an environment variable.
1321 Valid values for @code{CONVERT} are:
1323 @item @code{CONVERT='NATIVE'} Use the native format. This is the default.
1324 @item @code{CONVERT='SWAP'} Swap between little- and big-endian.
1325 @item @code{CONVERT='LITTLE_ENDIAN'} Use the little-endian representation
1326 for unformatted files.
1327 @item @code{CONVERT='BIG_ENDIAN'} Use the big-endian representation for
1331 Using the option could look like this:
1333 open(file='big.dat',form='unformatted',access='sequential', &
1334 convert='big_endian')
1337 The value of the conversion can be queried by using
1338 @code{INQUIRE(CONVERT=ch)}. The values returned are
1339 @code{'BIG_ENDIAN'} and @code{'LITTLE_ENDIAN'}.
1341 @code{CONVERT} works between big- and little-endian for
1342 @code{INTEGER} values of all supported kinds and for @code{REAL}
1343 on IEEE systems of kinds 4 and 8. Conversion between different
1344 ``extended double'' types on different architectures such as
1345 m68k and x86_64, which GNU Fortran
1346 supports as @code{REAL(KIND=10)} and @code{REAL(KIND=16)}, will
1349 @emph{Note that the values specified via the GFORTRAN_CONVERT_UNIT
1350 environment variable will override the CONVERT specifier in the
1351 open statement}. This is to give control over data formats to
1352 users who do not have the source code of their program available.
1354 Using anything but the native representation for unformatted data
1355 carries a significant speed overhead. If speed in this area matters
1356 to you, it is best if you use this only for data that needs to be
1363 GNU Fortran attempts to be OpenMP Application Program Interface v2.5
1364 compatible when invoked with the @option{-fopenmp} option. GNU Fortran
1365 then generates parallelized code according to the OpenMP directives
1366 used in the source. The OpenMP Fortran runtime library
1367 routines are provided both in a form of a Fortran 90 module named
1368 @code{omp_lib} and in a form of a Fortran @code{include} file named
1371 For details refer to the actual
1372 @uref{http://www.openmp.org/drupal/mp-documents/spec25.pdf,
1373 OpenMP Application Program Interface v2.5} specification.
1375 @node Argument list functions
1376 @section Argument list functions %VAL, %REF and %LOC
1377 @cindex argument list functions
1382 GNU Fortran supports argument list functions @code{%VAL}, @code{%REF}
1383 and @code{%LOC} statements, for backward compatibility with g77.
1384 It is recommended that these should be used only for code that is
1385 accessing facilities outside of GNU Fortran, such as operating system
1386 or windowing facilities. It is best to constrain such uses to isolated
1387 portions of a program--portions that deal specifically and exclusively
1388 with low-level, system-dependent facilities. Such portions might well
1389 provide a portable interface for use by the program as a whole, but are
1390 themselves not portable, and should be thoroughly tested each time they
1391 are rebuilt using a new compiler or version of a compiler.
1393 @code{%VAL} passes a scalar argument by value, @code{%REF} passes it by
1394 reference and @code{%LOC} passes its memory location. Since gfortran
1395 already passes scalar arguments by reference, @code{%REF} is in effect
1396 a do-nothing. @code{%LOC} has the same effect as a fortran pointer.
1398 An example of passing an argument by value to a C subroutine foo.:
1401 C prototype void foo_ (float x);
1410 For details refer to the g77 manual
1411 @uref{http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top}.
1413 Also, the gfortran testsuite c_by_val.f and its partner c_by_val.c are
1416 @c ---------------------------------------------------------------------
1417 @c Intrinsic Procedures
1418 @c ---------------------------------------------------------------------
1420 @include intrinsic.texi
1427 @c ---------------------------------------------------------------------
1429 @c ---------------------------------------------------------------------
1432 @unnumbered Contributing
1433 @cindex Contributing
1435 Free software is only possible if people contribute to efforts
1437 We're always in need of more people helping out with ideas
1438 and comments, writing documentation and contributing code.
1440 If you want to contribute to GNU Fortran,
1441 have a look at the long lists of projects you can take on.
1442 Some of these projects are small,
1443 some of them are large;
1444 some are completely orthogonal to the rest of what is
1445 happening on GNU Fortran,
1446 but others are ``mainstream'' projects in need of enthusiastic hackers.
1447 All of these projects are important!
1448 We'll eventually get around to the things here,
1449 but they are also things doable by someone who is willing and able.
1454 * Proposed Extensions::
1459 @section Contributors to GNU Fortran
1460 @cindex Contributors
1464 Most of the parser was hand-crafted by @emph{Andy Vaught}, who is
1465 also the initiator of the whole project. Thanks Andy!
1466 Most of the interface with GCC was written by @emph{Paul Brook}.
1468 The following individuals have contributed code and/or
1469 ideas and significant help to the GNU Fortran project
1470 (in no particular order):
1474 @item Katherine Holcomb
1475 @item Tobias Schl@"uter
1476 @item Steven Bosscher
1479 @item Niels Kristian Bech Jensen
1480 @item Steven Johnson
1485 @item Fran@,{c}ois-Xavier Coudert
1486 @item Steven G. Kargl
1488 @item Janne Blomqvist
1495 @item Richard Henderson
1496 @item Richard Sandiford
1497 @item Richard Guenther
1498 @item Bernhard Fischer
1501 The following people have contributed bug reports,
1502 smaller or larger patches,
1503 and much needed feedback and encouragement for the
1504 GNU Fortran project:
1507 @item Erik Schnetter
1512 Many other individuals have helped debug,
1513 test and improve the GNU Fortran compiler over the past few years,
1514 and we welcome you to do the same!
1515 If you already have done so,
1516 and you would like to see your name listed in the
1517 list above, please contact us.
1525 @item Help build the test suite
1526 Solicit more code for donation to the test suite.
1527 We can keep code private on request.
1529 @item Bug hunting/squishing
1530 Find bugs and write more test cases!
1531 Test cases are especially very welcome,
1532 because it allows us to concentrate on fixing bugs
1533 instead of isolating them.
1535 @item Smaller projects (``bug'' fixes):
1537 @item Allow init exprs to be numbers raised to integer powers.
1538 @item Implement correct rounding.
1539 @item Implement F restrictions on Fortran 95 syntax.
1540 @item See about making Emacs-parsable error messages.
1544 If you wish to work on the runtime libraries,
1545 please contact a project maintainer.
1549 @node Proposed Extensions
1550 @section Proposed Extensions
1552 Here's a list of proposed extensions for the GNU Fortran compiler, in no particular
1553 order. Most of these are necessary to be fully compatible with
1554 existing Fortran compilers, but they are not part of the official
1555 J3 Fortran 95 standard.
1557 @subsection Compiler extensions:
1560 User-specified alignment rules for structures.
1563 Flag to generate @code{Makefile} info.
1566 Automatically extend single precision constants to double.
1569 Compile code that conserves memory by dynamically allocating common and
1570 module storage either on stack or heap.
1573 Compile flag to generate code for array conformance checking (suggest -CC).
1576 User control of symbol names (underscores, etc).
1579 Compile setting for maximum size of stack frame size before spilling
1580 parts to static or heap.
1583 Flag to force local variables into static space.
1586 Flag to force local variables onto stack.
1589 Flag for maximum errors before ending compile.
1592 Option to initialize otherwise uninitialized integer and floating
1597 @subsection Environment Options
1600 Pluggable library modules for random numbers, linear algebra.
1601 LA should use BLAS calling conventions.
1604 Environment variables controlling actions on arithmetic exceptions like
1605 overflow, underflow, precision loss---Generate NaN, abort, default.
1609 Set precision for fp units that support it (i387).
1612 Variable for setting fp rounding mode.
1615 Variable to fill uninitialized variables with a user-defined bit
1619 Environment variable controlling filename that is opened for that unit
1623 Environment variable to clear/trash memory being freed.
1626 Environment variable to control tracing of allocations and frees.
1629 Environment variable to display allocated memory at normal program end.
1632 Environment variable for filename for * IO-unit.
1635 Environment variable for temporary file directory.
1638 Environment variable forcing standard output to be line buffered (unix).
1643 @c ---------------------------------------------------------------------
1644 @c GNU General Public License
1645 @c ---------------------------------------------------------------------
1651 @c ---------------------------------------------------------------------
1652 @c GNU Free Documentation License
1653 @c ---------------------------------------------------------------------
1659 @c ---------------------------------------------------------------------
1660 @c Funding Free Software
1661 @c ---------------------------------------------------------------------
1663 @include funding.texi
1665 @c ---------------------------------------------------------------------
1667 @c ---------------------------------------------------------------------
1670 @unnumbered Option Index
1671 @command{gfortran}'s command line options are indexed here without any
1672 initial @samp{-} or @samp{--}. Where an option has both positive and
1673 negative forms (such as -foption and -fno-option), relevant entries in
1674 the manual are indexed under the most appropriate form; it may sometimes
1675 be useful to look up both forms.
1679 @unnumbered Keyword Index