1This is doc/gfortran.info, produced by makeinfo version 4.12 from
2/space/rguenther/gcc-5.4.0/gcc-5.4.0/gcc/fortran/gfortran.texi.
3
4Copyright (C) 1999-2015 Free Software Foundation, Inc.
5
6   Permission is granted to copy, distribute and/or modify this document
7under the terms of the GNU Free Documentation License, Version 1.3 or
8any later version published by the Free Software Foundation; with the
9Invariant Sections being "Funding Free Software", the Front-Cover Texts
10being (a) (see below), and with the Back-Cover Texts being (b) (see
11below).  A copy of the license is included in the section entitled "GNU
12Free Documentation License".
13
14   (a) The FSF's Front-Cover Text is:
15
16   A GNU Manual
17
18   (b) The FSF's Back-Cover Text is:
19
20   You have freedom to copy and modify this GNU Manual, like GNU
21software.  Copies published by the Free Software Foundation raise
22funds for GNU development.
23
24INFO-DIR-SECTION Software development
25START-INFO-DIR-ENTRY
26* gfortran: (gfortran).                  The GNU Fortran Compiler.
27END-INFO-DIR-ENTRY
28   This file documents the use and the internals of the GNU Fortran
29compiler, (`gfortran').
30
31   Published by the Free Software Foundation 51 Franklin Street, Fifth
32Floor Boston, MA 02110-1301 USA
33
34   Copyright (C) 1999-2015 Free Software Foundation, Inc.
35
36   Permission is granted to copy, distribute and/or modify this document
37under the terms of the GNU Free Documentation License, Version 1.3 or
38any later version published by the Free Software Foundation; with the
39Invariant Sections being "Funding Free Software", the Front-Cover Texts
40being (a) (see below), and with the Back-Cover Texts being (b) (see
41below).  A copy of the license is included in the section entitled "GNU
42Free Documentation License".
43
44   (a) The FSF's Front-Cover Text is:
45
46   A GNU Manual
47
48   (b) The FSF's Back-Cover Text is:
49
50   You have freedom to copy and modify this GNU Manual, like GNU
51software.  Copies published by the Free Software Foundation raise
52funds for GNU development.
53
54
55File: gfortran.info,  Node: Top,  Next: Introduction,  Up: (dir)
56
57Introduction
58************
59
60This manual documents the use of `gfortran', the GNU Fortran compiler.
61You can find in this manual how to invoke `gfortran', as well as its
62features and incompatibilities.
63
64* Menu:
65
66* Introduction::
67
68Part I: Invoking GNU Fortran
69* Invoking GNU Fortran:: Command options supported by `gfortran'.
70* Runtime::              Influencing runtime behavior with environment variables.
71
72Part II: Language Reference
73* Fortran 2003 and 2008 status::  Fortran 2003 and 2008 features supported by GNU Fortran.
74* Compiler Characteristics::      User-visible implementation details.
75* Extensions::                    Language extensions implemented by GNU Fortran.
76* Mixed-Language Programming::    Interoperability with C
77* Coarray Programming::
78* Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran.
79* Intrinsic Modules::    Intrinsic modules supported by GNU Fortran.
80
81* Contributing::         How you can help.
82* Copying::              GNU General Public License says
83                         how you can copy and share GNU Fortran.
84* GNU Free Documentation License::
85                         How you can copy and share this manual.
86* Funding::              How to help assure continued work for free software.
87* Option Index::         Index of command line options
88* Keyword Index::        Index of concepts
89
90
91File: gfortran.info,  Node: Introduction,  Next: Invoking GNU Fortran,  Prev: Top,  Up: Top
92
931 Introduction
94**************
95
96The GNU Fortran compiler front end was designed initially as a free
97replacement for, or alternative to, the Unix `f95' command; `gfortran'
98is the command you will use to invoke the compiler.
99
100* Menu:
101
102* About GNU Fortran::    What you should know about the GNU Fortran compiler.
103* GNU Fortran and GCC::  You can compile Fortran, C, or other programs.
104* Preprocessing and conditional compilation:: The Fortran preprocessor
105* GNU Fortran and G77::  Why we chose to start from scratch.
106* Project Status::       Status of GNU Fortran, roadmap, proposed extensions.
107* Standards::            Standards supported by GNU Fortran.
108
109
110File: gfortran.info,  Node: About GNU Fortran,  Next: GNU Fortran and GCC,  Up: Introduction
111
1121.1 About GNU Fortran
113=====================
114
115The GNU Fortran compiler supports the Fortran 77, 90 and 95 standards
116completely, parts of the Fortran 2003 and Fortran 2008 standards, and
117several vendor extensions.  The development goal is to provide the
118following features:
119
120   * Read a user's program, stored in a file and containing
121     instructions written in Fortran 77, Fortran 90, Fortran 95,
122     Fortran 2003 or Fortran 2008.  This file contains "source code".
123
124   * Translate the user's program into instructions a computer can
125     carry out more quickly than it takes to translate the instructions
126     in the first place.  The result after compilation of a program is
127     "machine code", code designed to be efficiently translated and
128     processed by a machine such as your computer.  Humans usually are
129     not as good writing machine code as they are at writing Fortran
130     (or C++, Ada, or Java), because it is easy to make tiny mistakes
131     writing machine code.
132
133   * Provide the user with information about the reasons why the
134     compiler is unable to create a binary from the source code.
135     Usually this will be the case if the source code is flawed.  The
136     Fortran 90 standard requires that the compiler can point out
137     mistakes to the user.  An incorrect usage of the language causes
138     an "error message".
139
140     The compiler will also attempt to diagnose cases where the user's
141     program contains a correct usage of the language, but instructs
142     the computer to do something questionable.  This kind of
143     diagnostics message is called a "warning message".
144
145   * Provide optional information about the translation passes from the
146     source code to machine code.  This can help a user of the compiler
147     to find the cause of certain bugs which may not be obvious in the
148     source code, but may be more easily found at a lower level
149     compiler output.  It also helps developers to find bugs in the
150     compiler itself.
151
152   * Provide information in the generated machine code that can make it
153     easier to find bugs in the program (using a debugging tool, called
154     a "debugger", such as the GNU Debugger `gdb').
155
156   * Locate and gather machine code already generated to perform
157     actions requested by statements in the user's program.  This
158     machine code is organized into "modules" and is located and
159     "linked" to the user program.
160
161   The GNU Fortran compiler consists of several components:
162
163   * A version of the `gcc' command (which also might be installed as
164     the system's `cc' command) that also understands and accepts
165     Fortran source code.  The `gcc' command is the "driver" program for
166     all the languages in the GNU Compiler Collection (GCC); With `gcc',
167     you can compile the source code of any language for which a front
168     end is available in GCC.
169
170   * The `gfortran' command itself, which also might be installed as the
171     system's `f95' command.  `gfortran' is just another driver program,
172     but specifically for the Fortran compiler only.  The difference
173     with `gcc' is that `gfortran' will automatically link the correct
174     libraries to your program.
175
176   * A collection of run-time libraries.  These libraries contain the
177     machine code needed to support capabilities of the Fortran
178     language that are not directly provided by the machine code
179     generated by the `gfortran' compilation phase, such as intrinsic
180     functions and subroutines, and routines for interaction with files
181     and the operating system.
182
183   * The Fortran compiler itself, (`f951').  This is the GNU Fortran
184     parser and code generator, linked to and interfaced with the GCC
185     backend library.  `f951' "translates" the source code to assembler
186     code.  You would typically not use this program directly; instead,
187     the `gcc' or `gfortran' driver programs will call it for you.
188
189
190File: gfortran.info,  Node: GNU Fortran and GCC,  Next: Preprocessing and conditional compilation,  Prev: About GNU Fortran,  Up: Introduction
191
1921.2 GNU Fortran and GCC
193=======================
194
195GNU Fortran is a part of GCC, the "GNU Compiler Collection".  GCC
196consists of a collection of front ends for various languages, which
197translate the source code into a language-independent form called
198"GENERIC".  This is then processed by a common middle end which
199provides optimization, and then passed to one of a collection of back
200ends which generate code for different computer architectures and
201operating systems.
202
203   Functionally, this is implemented with a driver program (`gcc')
204which provides the command-line interface for the compiler.  It calls
205the relevant compiler front-end program (e.g., `f951' for Fortran) for
206each file in the source code, and then calls the assembler and linker
207as appropriate to produce the compiled output.  In a copy of GCC which
208has been compiled with Fortran language support enabled, `gcc' will
209recognize files with `.f', `.for', `.ftn', `.f90', `.f95', `.f03' and
210`.f08' extensions as Fortran source code, and compile it accordingly.
211A `gfortran' driver program is also provided, which is identical to
212`gcc' except that it automatically links the Fortran runtime libraries
213into the compiled program.
214
215   Source files with `.f', `.for', `.fpp', `.ftn', `.F', `.FOR',
216`.FPP', and `.FTN' extensions are treated as fixed form.  Source files
217with `.f90', `.f95', `.f03', `.f08', `.F90', `.F95', `.F03' and `.F08'
218extensions are treated as free form.  The capitalized versions of
219either form are run through preprocessing.  Source files with the lower
220case `.fpp' extension are also run through preprocessing.
221
222   This manual specifically documents the Fortran front end, which
223handles the programming language's syntax and semantics.  The aspects
224of GCC which relate to the optimization passes and the back-end code
225generation are documented in the GCC manual; see *note Introduction:
226(gcc)Top.  The two manuals together provide a complete reference for
227the GNU Fortran compiler.
228
229
230File: gfortran.info,  Node: Preprocessing and conditional compilation,  Next: GNU Fortran and G77,  Prev: GNU Fortran and GCC,  Up: Introduction
231
2321.3 Preprocessing and conditional compilation
233=============================================
234
235Many Fortran compilers including GNU Fortran allow passing the source
236code through a C preprocessor (CPP; sometimes also called the Fortran
237preprocessor, FPP) to allow for conditional compilation.  In the case
238of GNU Fortran, this is the GNU C Preprocessor in the traditional mode.
239On systems with case-preserving file names, the preprocessor is
240automatically invoked if the filename extension is `.F', `.FOR',
241`.FTN', `.fpp', `.FPP', `.F90', `.F95', `.F03' or `.F08'.  To manually
242invoke the preprocessor on any file, use `-cpp', to disable
243preprocessing on files where the preprocessor is run automatically, use
244`-nocpp'.
245
246   If a preprocessed file includes another file with the Fortran
247`INCLUDE' statement, the included file is not preprocessed.  To
248preprocess included files, use the equivalent preprocessor statement
249`#include'.
250
251   If GNU Fortran invokes the preprocessor, `__GFORTRAN__' is defined
252and `__GNUC__', `__GNUC_MINOR__' and `__GNUC_PATCHLEVEL__' can be used
253to determine the version of the compiler.  See *note Overview:
254(cpp)Top. for details.
255
256   While CPP is the de-facto standard for preprocessing Fortran code,
257Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
258Conditional Compilation, which is not widely used and not directly
259supported by the GNU Fortran compiler.  You can use the program coco to
260preprocess such files (`http://www.daniellnagle.com/coco.html').
261
262
263File: gfortran.info,  Node: GNU Fortran and G77,  Next: Project Status,  Prev: Preprocessing and conditional compilation,  Up: Introduction
264
2651.4 GNU Fortran and G77
266=======================
267
268The GNU Fortran compiler is the successor to `g77', the Fortran 77
269front end included in GCC prior to version 4.  It is an entirely new
270program that has been designed to provide Fortran 95 support and
271extensibility for future Fortran language standards, as well as
272providing backwards compatibility for Fortran 77 and nearly all of the
273GNU language extensions supported by `g77'.
274
275
276File: gfortran.info,  Node: Project Status,  Next: Standards,  Prev: GNU Fortran and G77,  Up: Introduction
277
2781.5 Project Status
279==================
280
281     As soon as `gfortran' can parse all of the statements correctly,
282     it will be in the "larva" state.  When we generate code, the
283     "puppa" state.  When `gfortran' is done, we'll see if it will be a
284     beautiful butterfly, or just a big bug....
285
286     -Andy Vaught, April 2000
287
288   The start of the GNU Fortran 95 project was announced on the GCC
289homepage in March 18, 2000 (even though Andy had already been working
290on it for a while, of course).
291
292   The GNU Fortran compiler is able to compile nearly all
293standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
294including a number of standard and non-standard extensions, and can be
295used on real-world programs.  In particular, the supported extensions
296include OpenMP, Cray-style pointers, and several Fortran 2003 and
297Fortran 2008 features, including TR 15581.  However, it is still under
298development and has a few remaining rough edges.  There also is initial
299support for OpenACC.  Note that this is an experimental feature,
300incomplete, and subject to change in future versions of GCC.  See
301`https://gcc.gnu.org/wiki/OpenACC' for more information.
302
303   At present, the GNU Fortran compiler passes the NIST Fortran 77 Test
304Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and
305produces acceptable results on the LAPACK Test Suite
306(http://www.netlib.org/lapack/faq.html#1.21).  It also provides
307respectable performance on the Polyhedron Fortran compiler benchmarks
308(http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite)
309and the Livermore Fortran Kernels test
310(http://www.netlib.org/benchmark/livermore).  It has been used to
311compile a number of large real-world programs, including the HARMONIE
312and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto
313quantum chemistry package
314(http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page);
315see `https://gcc.gnu.org/wiki/GfortranApps' for an extended list.
316
317   Among other things, the GNU Fortran compiler is intended as a
318replacement for G77.  At this point, nearly all programs that could be
319compiled with G77 can be compiled with GNU Fortran, although there are
320a few minor known regressions.
321
322   The primary work remaining to be done on GNU Fortran falls into three
323categories: bug fixing (primarily regarding the treatment of invalid
324code and providing useful error messages), improving the compiler
325optimizations and the performance of compiled code, and extending the
326compiler to support future standards--in particular, Fortran 2003 and
327Fortran 2008.
328
329
330File: gfortran.info,  Node: Standards,  Prev: Project Status,  Up: Introduction
331
3321.6 Standards
333=============
334
335* Menu:
336
337* Varying Length Character Strings::
338
339   The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95).
340As such, it can also compile essentially all standard-compliant Fortran
34190 and Fortran 77 programs.   It also supports the ISO/IEC TR-15581
342enhancements to allocatable arrays.
343
344   GNU Fortran also have a partial support for ISO/IEC 1539-1:2004
345(Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical
346Specification `Further Interoperability of Fortran with C' (ISO/IEC TS
34729113:2012).  Full support of those standards and future Fortran
348standards is planned.  The current status of the support is can be
349found in the *note Fortran 2003 status::, *note Fortran 2008 status::
350and *note TS 29113 status:: sections of the documentation.
351
352   Additionally, the GNU Fortran compilers supports the OpenMP
353specification (version 4.0,
354`http://openmp.org/wp/openmp-specifications/').  There also is initial
355support for the OpenACC specification (targeting version 2.0,
356`http://www.openacc.org/').  Note that this is an experimental feature,
357incomplete, and subject to change in future versions of GCC.  See
358`https://gcc.gnu.org/wiki/OpenACC' for more information.
359
360
361File: gfortran.info,  Node: Varying Length Character Strings,  Up: Standards
362
3631.6.1 Varying Length Character Strings
364--------------------------------------
365
366The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
367varying length character strings.  While GNU Fortran currently does not
368support such strings directly, there exist two Fortran implementations
369for them, which work with GNU Fortran.  They can be found at
370`http://www.fortran.com/iso_varying_string.f95' and at
371`ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/'.
372
373   Deferred-length character strings of Fortran 2003 supports part of
374the features of `ISO_VARYING_STRING' and should be considered as
375replacement. (Namely, allocatable or pointers of the type
376`character(len=:)'.)
377
378
379File: gfortran.info,  Node: Invoking GNU Fortran,  Next: Runtime,  Prev: Introduction,  Up: Top
380
3812 GNU Fortran Command Options
382*****************************
383
384The `gfortran' command supports all the options supported by the `gcc'
385command.  Only options specific to GNU Fortran are documented here.
386
387   *Note GCC Command Options: (gcc)Invoking GCC, for information on the
388non-Fortran-specific aspects of the `gcc' command (and, therefore, the
389`gfortran' command).
390
391   All GCC and GNU Fortran options are accepted both by `gfortran' and
392by `gcc' (as well as any other drivers built at the same time, such as
393`g++'), since adding GNU Fortran to the GCC distribution enables
394acceptance of GNU Fortran options by all of the relevant drivers.
395
396   In some cases, options have positive and negative forms; the
397negative form of `-ffoo' would be `-fno-foo'.  This manual documents
398only one of these two forms, whichever one is not the default.
399
400* Menu:
401
402* Option Summary::      Brief list of all `gfortran' options,
403                        without explanations.
404* Fortran Dialect Options::  Controlling the variant of Fortran language
405                             compiled.
406* Preprocessing Options::  Enable and customize preprocessing.
407* Error and Warning Options::     How picky should the compiler be?
408* Debugging Options::   Symbol tables, measurements, and debugging dumps.
409* Directory Options::   Where to find module files
410* Link Options ::       Influencing the linking step
411* Runtime Options::     Influencing runtime behavior
412* Code Gen Options::    Specifying conventions for function calls, data layout
413                        and register usage.
414* Environment Variables:: Environment variables that affect `gfortran'.
415
416
417File: gfortran.info,  Node: Option Summary,  Next: Fortran Dialect Options,  Up: Invoking GNU Fortran
418
4192.1 Option summary
420==================
421
422Here is a summary of all the options specific to GNU Fortran, grouped
423by type.  Explanations are in the following sections.
424
425_Fortran Language Options_
426     *Note Options controlling Fortran dialect: Fortran Dialect Options.
427          -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code
428          -fd-lines-as-comments -fdefault-double-8 -fdefault-integer-8
429          -fdefault-real-8 -fdollar-ok -ffixed-line-length-N
430          -ffixed-line-length-none -ffree-form -ffree-line-length-N
431          -ffree-line-length-none -fimplicit-none -finteger-4-integer-8
432          -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check
433          -fopenacc -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8
434          -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=STD
435
436_Preprocessing Options_
437     *Note Enable and customize preprocessing: Preprocessing Options.
438          -A-QUESTION[=ANSWER]
439          -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
440          -H -P
441          -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
442          -imultilib DIR
443          -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
444          -nostdinc
445          -undef
446
447_Error and Warning Options_
448     *Note Options to request or suppress errors and warnings: Error
449     and Warning Options.
450          -Waliasing -Wall -Wampersand -Warray-bounds
451          -Wc-binding-type -Wcharacter-truncation
452          -Wconversion -Wfunction-elimination -Wimplicit-interface
453          -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std
454          -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant
455          -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all
456          -Wtarget-lifetime -fmax-errors=N -fsyntax-only -pedantic -pedantic-errors
457
458_Debugging Options_
459     *Note Options for debugging your program or GNU Fortran: Debugging
460     Options.
461          -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
462          -fdump-parse-tree -ffpe-trap=LIST -ffpe-summary=LIST
463
464_Directory Options_
465     *Note Options for directory search: Directory Options.
466          -IDIR  -JDIR -fintrinsic-modules-path DIR
467
468_Link Options_
469     *Note Options for influencing the linking step: Link Options.
470          -static-libgfortran
471
472_Runtime Options_
473     *Note Options for influencing runtime behavior: Runtime Options.
474          -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
475          -frecord-marker=LENGTH -fsign-zero
476
477_Code Generation Options_
478     *Note Options for code generation conventions: Code Gen Options.
479          -faggressive-function-elimination -fblas-matmul-limit=N
480          -fbounds-check -fcheck-array-temporaries
481          -fcheck=<ALL|ARRAY-TEMPS|BOUNDS|DO|MEM|POINTER|RECURSION>
482          -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
483          -ffrontend-optimize
484          -finit-character=N -finit-integer=N -finit-local-zero
485          -finit-logical=<TRUE|FALSE>
486          -finit-real=<ZERO|INF|-INF|NAN|SNAN>
487          -fmax-array-constructor=N -fmax-stack-var-size=N
488          -fno-align-commons
489          -fno-automatic -fno-protect-parens -fno-underscoring
490          -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive
491          -frepack-arrays -fshort-enums -fstack-arrays
492
493
494
495File: gfortran.info,  Node: Fortran Dialect Options,  Next: Preprocessing Options,  Prev: Option Summary,  Up: Invoking GNU Fortran
496
4972.2 Options controlling Fortran dialect
498=======================================
499
500The following options control the details of the Fortran dialect
501accepted by the compiler:
502
503`-ffree-form'
504`-ffixed-form'
505     Specify the layout used by the source file.  The free form layout
506     was introduced in Fortran 90.  Fixed form was traditionally used in
507     older Fortran programs.  When neither option is specified, the
508     source form is determined by the file extension.
509
510`-fall-intrinsics'
511     This option causes all intrinsic procedures (including the
512     GNU-specific extensions) to be accepted.  This can be useful with
513     `-std=f95' to force standard-compliance but get access to the full
514     range of intrinsics available with `gfortran'.  As a consequence,
515     `-Wintrinsics-std' will be ignored and no user-defined procedure
516     with the same name as any intrinsic will be called except when it
517     is explicitly declared `EXTERNAL'.
518
519`-fd-lines-as-code'
520`-fd-lines-as-comments'
521     Enable special treatment for lines beginning with `d' or `D' in
522     fixed form sources.  If the `-fd-lines-as-code' option is given
523     they are treated as if the first column contained a blank.  If the
524     `-fd-lines-as-comments' option is given, they are treated as
525     comment lines.
526
527`-fdollar-ok'
528     Allow `$' as a valid non-first character in a symbol name. Symbols
529     that start with `$' are rejected since it is unclear which rules to
530     apply to implicit typing as different vendors implement different
531     rules.  Using `$' in `IMPLICIT' statements is also rejected.
532
533`-fbackslash'
534     Change the interpretation of backslashes in string literals from a
535     single backslash character to "C-style" escape characters. The
536     following combinations are expanded `\a', `\b', `\f', `\n', `\r',
537     `\t', `\v', `\\', and `\0' to the ASCII characters alert,
538     backspace, form feed, newline, carriage return, horizontal tab,
539     vertical tab, backslash, and NUL, respectively.  Additionally,
540     `\x'NN, `\u'NNNN and `\U'NNNNNNNN (where each N is a hexadecimal
541     digit) are translated into the Unicode characters corresponding to
542     the specified code points. All other combinations of a character
543     preceded by \ are unexpanded.
544
545`-fmodule-private'
546     Set the default accessibility of module entities to `PRIVATE'.
547     Use-associated entities will not be accessible unless they are
548     explicitly declared as `PUBLIC'.
549
550`-ffixed-line-length-N'
551     Set column after which characters are ignored in typical fixed-form
552     lines in the source file, and through which spaces are assumed (as
553     if padded to that length) after the ends of short fixed-form lines.
554
555     Popular values for N include 72 (the standard and the default), 80
556     (card image), and 132 (corresponding to "extended-source" options
557     in some popular compilers).  N may also be `none', meaning that
558     the entire line is meaningful and that continued character
559     constants never have implicit spaces appended to them to fill out
560     the line.  `-ffixed-line-length-0' means the same thing as
561     `-ffixed-line-length-none'.
562
563`-ffree-line-length-N'
564     Set column after which characters are ignored in typical free-form
565     lines in the source file. The default value is 132.  N may be
566     `none', meaning that the entire line is meaningful.
567     `-ffree-line-length-0' means the same thing as
568     `-ffree-line-length-none'.
569
570`-fmax-identifier-length=N'
571     Specify the maximum allowed identifier length. Typical values are
572     31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
573
574`-fimplicit-none'
575     Specify that no implicit typing is allowed, unless overridden by
576     explicit `IMPLICIT' statements.  This is the equivalent of adding
577     `implicit none' to the start of every procedure.
578
579`-fcray-pointer'
580     Enable the Cray pointer extension, which provides C-like pointer
581     functionality.
582
583`-fopenacc'
584     Enable the OpenACC extensions.  This includes OpenACC `!$acc'
585     directives in free form and `c$acc', `*$acc' and `!$acc'
586     directives in fixed form, `!$' conditional compilation sentinels
587     in free form and `c$', `*$' and `!$' sentinels in fixed form, and
588     when linking arranges for the OpenACC runtime library to be linked
589     in.
590
591     Note that this is an experimental feature, incomplete, and subject
592     to change in future versions of GCC.  See
593     `https://gcc.gnu.org/wiki/OpenACC' for more information.
594
595`-fopenmp'
596     Enable the OpenMP extensions.  This includes OpenMP `!$omp'
597     directives in free form and `c$omp', `*$omp' and `!$omp'
598     directives in fixed form, `!$' conditional compilation sentinels
599     in free form and `c$', `*$' and `!$' sentinels in fixed form, and
600     when linking arranges for the OpenMP runtime library to be linked
601     in.  The option `-fopenmp' implies `-frecursive'.
602
603`-fno-range-check'
604     Disable range checking on results of simplification of constant
605     expressions during compilation.  For example, GNU Fortran will give
606     an error at compile time when simplifying `a = 1. / 0'.  With this
607     option, no error will be given and `a' will be assigned the value
608     `+Infinity'.  If an expression evaluates to a value outside of the
609     relevant range of [`-HUGE()':`HUGE()'], then the expression will
610     be replaced by `-Inf' or `+Inf' as appropriate.  Similarly, `DATA
611     i/Z'FFFFFFFF'/' will result in an integer overflow on most
612     systems, but with `-fno-range-check' the value will "wrap around"
613     and `i' will be initialized to -1 instead.
614
615`-fdefault-integer-8'
616     Set the default integer and logical types to an 8 byte wide type.
617     This option also affects the kind of integer constants like `42'.
618     Unlike `-finteger-4-integer-8', it does not promote variables with
619     explicit kind declaration.
620
621`-fdefault-real-8'
622     Set the default real type to an 8 byte wide type. This option also
623     affects the kind of non-double real constants like `1.0', and does
624     promote the default width of `DOUBLE PRECISION' to 16 bytes if
625     possible, unless `-fdefault-double-8' is given, too. Unlike
626     `-freal-4-real-8', it does not promote variables with explicit
627     kind declaration.
628
629`-fdefault-double-8'
630     Set the `DOUBLE PRECISION' type to an 8 byte wide type.  Do
631     nothing if this is already the default.  If `-fdefault-real-8' is
632     given, `DOUBLE PRECISION' would instead be promoted to 16 bytes if
633     possible, and `-fdefault-double-8' can be used to prevent this.
634     The kind of real constants like `1.d0' will not be changed by
635     `-fdefault-real-8' though, so also `-fdefault-double-8' does not
636     affect it.
637
638`-finteger-4-integer-8'
639     Promote all `INTEGER(KIND=4)' entities to an `INTEGER(KIND=8)'
640     entities.  If `KIND=8' is unavailable, then an error will be
641     issued.  This option should be used with care and may not be
642     suitable for your codes.  Areas of possible concern include calls
643     to external procedures, alignment in `EQUIVALENCE' and/or
644     `COMMON', generic interfaces, BOZ literal constant conversion, and
645     I/O.  Inspection of the intermediate representation of the
646     translated Fortran code, produced by `-fdump-tree-original', is
647     suggested.
648
649`-freal-4-real-8'
650`-freal-4-real-10'
651`-freal-4-real-16'
652`-freal-8-real-4'
653`-freal-8-real-10'
654`-freal-8-real-16'
655     Promote all `REAL(KIND=M)' entities to `REAL(KIND=N)' entities.
656     If `REAL(KIND=N)' is unavailable, then an error will be issued.
657     All other real kind types are unaffected by this option.  These
658     options should be used with care and may not be suitable for your
659     codes.  Areas of possible concern include calls to external
660     procedures, alignment in `EQUIVALENCE' and/or `COMMON', generic
661     interfaces, BOZ literal constant conversion, and I/O.  Inspection
662     of the intermediate representation of the translated Fortran code,
663     produced by `-fdump-tree-original', is suggested.
664
665`-std=STD'
666     Specify the standard to which the program is expected to conform,
667     which may be one of `f95', `f2003', `f2008', `gnu', or `legacy'.
668     The default value for STD is `gnu', which specifies a superset of
669     the Fortran 95 standard that includes all of the extensions
670     supported by GNU Fortran, although warnings will be given for
671     obsolete extensions not recommended for use in new code.  The
672     `legacy' value is equivalent but without the warnings for obsolete
673     extensions, and may be useful for old non-standard programs.  The
674     `f95', `f2003' and `f2008' values specify strict conformance to
675     the Fortran 95, Fortran 2003 and Fortran 2008 standards,
676     respectively; errors are given for all extensions beyond the
677     relevant language standard, and warnings are given for the Fortran
678     77 features that are permitted but obsolescent in later standards.
679     `-std=f2008ts' allows the Fortran 2008 standard including the
680     additions of the Technical Specification (TS) 29113 on Further
681     Interoperability of Fortran with C and TS 18508 on Additional
682     Parallel Features in Fortran.
683
684
685
686File: gfortran.info,  Node: Preprocessing Options,  Next: Error and Warning Options,  Prev: Fortran Dialect Options,  Up: Invoking GNU Fortran
687
6882.3 Enable and customize preprocessing
689======================================
690
691Preprocessor related options. See section *note Preprocessing and
692conditional compilation:: for more detailed information on
693preprocessing in `gfortran'.
694
695`-cpp'
696`-nocpp'
697     Enable preprocessing. The preprocessor is automatically invoked if
698     the file extension is `.fpp', `.FPP',  `.F', `.FOR', `.FTN',
699     `.F90', `.F95', `.F03' or `.F08'. Use this option to manually
700     enable preprocessing of any kind of Fortran file.
701
702     To disable preprocessing of files with any of the above listed
703     extensions, use the negative form: `-nocpp'.
704
705     The preprocessor is run in traditional mode. Any restrictions of
706     the file-format, especially the limits on line length, apply for
707     preprocessed output as well, so it might be advisable to use the
708     `-ffree-line-length-none' or `-ffixed-line-length-none' options.
709
710`-dM'
711     Instead of the normal output, generate a list of `'#define''
712     directives for all the macros defined during the execution of the
713     preprocessor, including predefined macros. This gives you a way of
714     finding out what is predefined in your version of the preprocessor.
715     Assuming you have no file `foo.f90', the command
716            touch foo.f90; gfortran -cpp -E -dM foo.f90
717     will show all the predefined macros.
718
719`-dD'
720     Like `-dM' except in two respects: it does not include the
721     predefined macros, and it outputs both the `#define' directives
722     and the result of preprocessing. Both kinds of output go to the
723     standard output file.
724
725`-dN'
726     Like `-dD', but emit only the macro names, not their expansions.
727
728`-dU'
729     Like `dD' except that only macros that are expanded, or whose
730     definedness is tested in preprocessor directives, are output; the
731     output is delayed until the use or test of the macro; and
732     `'#undef'' directives are also output for macros tested but
733     undefined at the time.
734
735`-dI'
736     Output `'#include'' directives in addition to the result of
737     preprocessing.
738
739`-fworking-directory'
740     Enable generation of linemarkers in the preprocessor output that
741     will let the compiler know the current working directory at the
742     time of preprocessing. When this option is enabled, the
743     preprocessor will emit, after the initial linemarker, a second
744     linemarker with the current working directory followed by two
745     slashes. GCC will use this directory, when it is present in the
746     preprocessed input, as the directory emitted as the current
747     working directory in some debugging information formats.  This
748     option is implicitly enabled if debugging information is enabled,
749     but this can be inhibited with the negated form
750     `-fno-working-directory'. If the `-P' flag is present in the
751     command line, this option has no effect, since no `#line'
752     directives are emitted whatsoever.
753
754`-idirafter DIR'
755     Search DIR for include files, but do it after all directories
756     specified with `-I' and the standard system directories have been
757     exhausted. DIR is treated as a system include directory.  If dir
758     begins with `=', then the `=' will be replaced by the sysroot
759     prefix; see `--sysroot' and `-isysroot'.
760
761`-imultilib DIR'
762     Use DIR as a subdirectory of the directory containing
763     target-specific C++ headers.
764
765`-iprefix PREFIX'
766     Specify PREFIX as the prefix for subsequent `-iwithprefix'
767     options. If the PREFIX represents a directory, you should include
768     the final `'/''.
769
770`-isysroot DIR'
771     This option is like the `--sysroot' option, but applies only to
772     header files. See the `--sysroot' option for more information.
773
774`-iquote DIR'
775     Search DIR only for header files requested with `#include "file"';
776     they are not searched for `#include <file>', before all directories
777     specified by `-I' and before the standard system directories. If
778     DIR begins with `=', then the `=' will be replaced by the sysroot
779     prefix; see `--sysroot' and `-isysroot'.
780
781`-isystem DIR'
782     Search DIR for header files, after all directories specified by
783     `-I' but before the standard system directories. Mark it as a
784     system directory, so that it gets the same special treatment as is
785     applied to the standard system directories. If DIR begins with
786     `=', then the `=' will be replaced by the sysroot prefix; see
787     `--sysroot' and `-isysroot'.
788
789`-nostdinc'
790     Do not search the standard system directories for header files.
791     Only the directories you have specified with `-I' options (and the
792     directory of the current file, if appropriate) are searched.
793
794`-undef'
795     Do not predefine any system-specific or GCC-specific macros.  The
796     standard predefined macros remain defined.
797
798`-APREDICATE=ANSWER'
799     Make an assertion with the predicate PREDICATE and answer ANSWER.
800     This form is preferred to the older form -A predicate(answer),
801     which is still supported, because it does not use shell special
802     characters.
803
804`-A-PREDICATE=ANSWER'
805     Cancel an assertion with the predicate PREDICATE and answer ANSWER.
806
807`-C'
808     Do not discard comments. All comments are passed through to the
809     output file, except for comments in processed directives, which
810     are deleted along with the directive.
811
812     You should be prepared for side effects when using `-C'; it causes
813     the preprocessor to treat comments as tokens in their own right.
814     For example, comments appearing at the start of what would be a
815     directive line have the effect of turning that line into an
816     ordinary source line, since the first token on the line is no
817     longer a `'#''.
818
819     Warning: this currently handles C-Style comments only. The
820     preprocessor does not yet recognize Fortran-style comments.
821
822`-CC'
823     Do not discard comments, including during macro expansion. This is
824     like `-C', except that comments contained within macros are also
825     passed through to the output file where the macro is expanded.
826
827     In addition to the side-effects of the `-C' option, the `-CC'
828     option causes all C++-style comments inside a macro to be
829     converted to C-style comments. This is to prevent later use of
830     that macro from inadvertently commenting out the remainder of the
831     source line. The `-CC' option is generally used to support lint
832     comments.
833
834     Warning: this currently handles C- and C++-Style comments only. The
835     preprocessor does not yet recognize Fortran-style comments.
836
837`-DNAME'
838     Predefine name as a macro, with definition `1'.
839
840`-DNAME=DEFINITION'
841     The contents of DEFINITION are tokenized and processed as if they
842     appeared during translation phase three in a `'#define'' directive.
843     In particular, the definition will be truncated by embedded newline
844     characters.
845
846     If you are invoking the preprocessor from a shell or shell-like
847     program you may need to use the shell's quoting syntax to protect
848     characters such as spaces that have a meaning in the shell syntax.
849
850     If you wish to define a function-like macro on the command line,
851     write its argument list with surrounding parentheses before the
852     equals sign (if any). Parentheses are meaningful to most shells,
853     so you will need to quote the option. With sh and csh,
854     `-D'name(args...)=definition'' works.
855
856     `-D' and `-U' options are processed in the order they are given on
857     the command line. All -imacros file and -include file options are
858     processed after all -D and -U options.
859
860`-H'
861     Print the name of each header file used, in addition to other
862     normal activities. Each name is indented to show how deep in the
863     `'#include'' stack it is.
864
865`-P'
866     Inhibit generation of linemarkers in the output from the
867     preprocessor.  This might be useful when running the preprocessor
868     on something that is not C code, and will be sent to a program
869     which might be confused by the linemarkers.
870
871`-UNAME'
872     Cancel any previous definition of NAME, either built in or provided
873     with a `-D' option.
874
875
876File: gfortran.info,  Node: Error and Warning Options,  Next: Debugging Options,  Prev: Preprocessing Options,  Up: Invoking GNU Fortran
877
8782.4 Options to request or suppress errors and warnings
879======================================================
880
881Errors are diagnostic messages that report that the GNU Fortran compiler
882cannot compile the relevant piece of source code.  The compiler will
883continue to process the program in an attempt to report further errors
884to aid in debugging, but will not produce any compiled output.
885
886   Warnings are diagnostic messages that report constructions which are
887not inherently erroneous but which are risky or suggest there is likely
888to be a bug in the program.  Unless `-Werror' is specified, they do not
889prevent compilation of the program.
890
891   You can request many specific warnings with options beginning `-W',
892for example `-Wimplicit' to request warnings on implicit declarations.
893Each of these specific warning options also has a negative form
894beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
895This manual lists only one of the two forms, whichever is not the
896default.
897
898   These options control the amount and kinds of errors and warnings
899produced by GNU Fortran:
900
901`-fmax-errors=N'
902     Limits the maximum number of error messages to N, at which point
903     GNU Fortran bails out rather than attempting to continue
904     processing the source code.  If N is 0, there is no limit on the
905     number of error messages produced.
906
907`-fsyntax-only'
908     Check the code for syntax errors, but do not actually compile it.
909     This will generate module files for each module present in the
910     code, but no other output file.
911
912`-pedantic'
913     Issue warnings for uses of extensions to Fortran 95.  `-pedantic'
914     also applies to C-language constructs where they occur in GNU
915     Fortran source files, such as use of `\e' in a character constant
916     within a directive like `#include'.
917
918     Valid Fortran 95 programs should compile properly with or without
919     this option.  However, without this option, certain GNU extensions
920     and traditional Fortran features are supported as well.  With this
921     option, many of them are rejected.
922
923     Some users try to use `-pedantic' to check programs for
924     conformance.  They soon find that it does not do quite what they
925     want--it finds some nonstandard practices, but not all.  However,
926     improvements to GNU Fortran in this area are welcome.
927
928     This should be used in conjunction with `-std=f95', `-std=f2003'
929     or `-std=f2008'.
930
931`-pedantic-errors'
932     Like `-pedantic', except that errors are produced rather than
933     warnings.
934
935`-Wall'
936     Enables commonly used warning options pertaining to usage that we
937     recommend avoiding and that we believe are easy to avoid.  This
938     currently includes `-Waliasing', `-Wampersand', `-Wconversion',
939     `-Wsurprising', `-Wc-binding-type', `-Wintrinsics-std', `-Wtabs',
940     `-Wintrinsic-shadow', `-Wline-truncation', `-Wtarget-lifetime',
941     `-Wreal-q-constant' and `-Wunused'.
942
943`-Waliasing'
944     Warn about possible aliasing of dummy arguments. Specifically, it
945     warns if the same actual argument is associated with a dummy
946     argument with `INTENT(IN)' and a dummy argument with `INTENT(OUT)'
947     in a call with an explicit interface.
948
949     The following example will trigger the warning.
950            interface
951              subroutine bar(a,b)
952                integer, intent(in) :: a
953                integer, intent(out) :: b
954              end subroutine
955            end interface
956            integer :: a
957
958            call bar(a,a)
959
960`-Wampersand'
961     Warn about missing ampersand in continued character constants. The
962     warning is given with `-Wampersand', `-pedantic', `-std=f95',
963     `-std=f2003' and `-std=f2008'. Note: With no ampersand given in a
964     continued character constant, GNU Fortran assumes continuation at
965     the first non-comment, non-whitespace character after the ampersand
966     that initiated the continuation.
967
968`-Warray-temporaries'
969     Warn about array temporaries generated by the compiler.  The
970     information generated by this warning is sometimes useful in
971     optimization, in order to avoid such temporaries.
972
973`-Wc-binding-type'
974     Warn if the a variable might not be C interoperable.  In
975     particular, warn if the variable has been declared using an
976     intrinsic type with default kind instead of using a kind parameter
977     defined for C interoperability in the intrinsic `ISO_C_Binding'
978     module.  This option is implied by `-Wall'.
979
980`-Wcharacter-truncation'
981     Warn when a character assignment will truncate the assigned string.
982
983`-Wline-truncation'
984     Warn when a source code line will be truncated.  This option is
985     implied by `-Wall'.  For free-form source code, the default is
986     `-Werror=line-truncation' such that truncations are reported as
987     error.
988
989`-Wconversion'
990     Warn about implicit conversions that are likely to change the
991     value of the expression after conversion. Implied by `-Wall'.
992
993`-Wconversion-extra'
994     Warn about implicit conversions between different types and kinds.
995     This option does _not_ imply `-Wconversion'.
996
997`-Wextra'
998     Enables some warning options for usages of language features which
999     may be problematic. This currently includes `-Wcompare-reals' and
1000     `-Wunused-parameter'.
1001
1002`-Wimplicit-interface'
1003     Warn if a procedure is called without an explicit interface.  Note
1004     this only checks that an explicit interface is present.  It does
1005     not check that the declared interfaces are consistent across
1006     program units.
1007
1008`-Wimplicit-procedure'
1009     Warn if a procedure is called that has neither an explicit
1010     interface nor has been declared as `EXTERNAL'.
1011
1012`-Wintrinsics-std'
1013     Warn if `gfortran' finds a procedure named like an intrinsic not
1014     available in the currently selected standard (with `-std') and
1015     treats it as `EXTERNAL' procedure because of this.
1016     `-fall-intrinsics' can be used to never trigger this behavior and
1017     always link to the intrinsic regardless of the selected standard.
1018
1019`-Wreal-q-constant'
1020     Produce a warning if a real-literal-constant contains a `q'
1021     exponent-letter.
1022
1023`-Wsurprising'
1024     Produce a warning when "suspicious" code constructs are
1025     encountered.  While technically legal these usually indicate that
1026     an error has been made.
1027
1028     This currently produces a warning under the following
1029     circumstances:
1030
1031        * An INTEGER SELECT construct has a CASE that can never be
1032          matched as its lower value is greater than its upper value.
1033
1034        * A LOGICAL SELECT construct has three CASE statements.
1035
1036        * A TRANSFER specifies a source that is shorter than the
1037          destination.
1038
1039        * The type of a function result is declared more than once with
1040          the same type.  If `-pedantic' or standard-conforming mode is
1041          enabled, this is an error.
1042
1043        * A `CHARACTER' variable is declared with negative length.
1044
1045`-Wtabs'
1046     By default, tabs are accepted as whitespace, but tabs are not
1047     members of the Fortran Character Set.  For continuation lines, a
1048     tab followed by a digit between 1 and 9 is supported.  `-Wtabs'
1049     will cause a warning to be issued if a tab is encountered. Note,
1050     `-Wtabs' is active for `-pedantic', `-std=f95', `-std=f2003',
1051     `-std=f2008', `-std=f2008ts' and `-Wall'.
1052
1053`-Wunderflow'
1054     Produce a warning when numerical constant expressions are
1055     encountered, which yield an UNDERFLOW during compilation. Enabled
1056     by default.
1057
1058`-Wintrinsic-shadow'
1059     Warn if a user-defined procedure or module procedure has the same
1060     name as an intrinsic; in this case, an explicit interface or
1061     `EXTERNAL' or `INTRINSIC' declaration might be needed to get calls
1062     later resolved to the desired intrinsic/procedure.  This option is
1063     implied by `-Wall'.
1064
1065`-Wuse-without-only'
1066     Warn if a `USE' statement has no `ONLY' qualifier and thus
1067     implicitly imports all public entities of the used module.
1068
1069`-Wunused-dummy-argument'
1070     Warn about unused dummy arguments. This option is implied by
1071     `-Wall'.
1072
1073`-Wunused-parameter'
1074     Contrary to `gcc''s meaning of `-Wunused-parameter', `gfortran''s
1075     implementation of this option does not warn about unused dummy
1076     arguments (see `-Wunused-dummy-argument'), but about unused
1077     `PARAMETER' values. `-Wunused-parameter' is implied by `-Wextra'
1078     if also `-Wunused' or `-Wall' is used.
1079
1080`-Walign-commons'
1081     By default, `gfortran' warns about any occasion of variables being
1082     padded for proper alignment inside a `COMMON' block. This warning
1083     can be turned off via `-Wno-align-commons'. See also
1084     `-falign-commons'.
1085
1086`-Wfunction-elimination'
1087     Warn if any calls to functions are eliminated by the optimizations
1088     enabled by the `-ffrontend-optimize' option.
1089
1090`-Wrealloc-lhs'
1091     Warn when the compiler might insert code to for allocation or
1092     reallocation of an allocatable array variable of intrinsic type in
1093     intrinsic assignments.  In hot loops, the Fortran 2003
1094     reallocation feature may reduce the performance.  If the array is
1095     already allocated with the correct shape, consider using a
1096     whole-array array-spec (e.g. `(:,:,:)') for the variable on the
1097     left-hand side to prevent the reallocation check. Note that in
1098     some cases the warning is shown, even if the compiler will
1099     optimize reallocation checks away.  For instance, when the
1100     right-hand side contains the same variable multiplied by a scalar.
1101     See also `-frealloc-lhs'.
1102
1103`-Wrealloc-lhs-all'
1104     Warn when the compiler inserts code to for allocation or
1105     reallocation of an allocatable variable; this includes scalars and
1106     derived types.
1107
1108`-Wcompare-reals'
1109     Warn when comparing real or complex types for equality or
1110     inequality.  This option is implied by `-Wextra'.
1111
1112`-Wtarget-lifetime'
1113     Warn if the pointer in a pointer assignment might be longer than
1114     the its target. This option is implied by `-Wall'.
1115
1116`-Wzerotrip'
1117     Warn if a `DO' loop is known to execute zero times at compile
1118     time.  This option is implied by `-Wall'.
1119
1120`-Werror'
1121     Turns all warnings into errors.
1122
1123   *Note Options to Request or Suppress Errors and Warnings:
1124(gcc)Warning Options, for information on more options offered by the
1125GBE shared by `gfortran', `gcc' and other GNU compilers.
1126
1127   Some of these have no effect when compiling programs written in
1128Fortran.
1129
1130
1131File: gfortran.info,  Node: Debugging Options,  Next: Directory Options,  Prev: Error and Warning Options,  Up: Invoking GNU Fortran
1132
11332.5 Options for debugging your program or GNU Fortran
1134=====================================================
1135
1136GNU Fortran has various special options that are used for debugging
1137either your program or the GNU Fortran compiler.
1138
1139`-fdump-fortran-original'
1140     Output the internal parse tree after translating the source program
1141     into internal representation.  Only really useful for debugging the
1142     GNU Fortran compiler itself.
1143
1144`-fdump-fortran-optimized'
1145     Output the parse tree after front-end optimization.  Only really
1146     useful for debugging the GNU Fortran compiler itself.
1147
1148`-fdump-parse-tree'
1149     Output the internal parse tree after translating the source program
1150     into internal representation.  Only really useful for debugging the
1151     GNU Fortran compiler itself.  This option is deprecated; use
1152     `-fdump-fortran-original' instead.
1153
1154`-ffpe-trap=LIST'
1155     Specify a list of floating point exception traps to enable.  On
1156     most systems, if a floating point exception occurs and the trap
1157     for that exception is enabled, a SIGFPE signal will be sent and
1158     the program being aborted, producing a core file useful for
1159     debugging.  LIST is a (possibly empty) comma-separated list of the
1160     following exceptions: `invalid' (invalid floating point operation,
1161     such as `SQRT(-1.0)'), `zero' (division by zero), `overflow'
1162     (overflow in a floating point operation), `underflow' (underflow
1163     in a floating point operation), `inexact' (loss of precision
1164     during operation), and `denormal' (operation performed on a
1165     denormal value).  The first five exceptions correspond to the five
1166     IEEE 754 exceptions, whereas the last one (`denormal') is not part
1167     of the IEEE 754 standard but is available on some common
1168     architectures such as x86.
1169
1170     The first three exceptions (`invalid', `zero', and `overflow')
1171     often indicate serious errors, and unless the program has
1172     provisions for dealing with these exceptions, enabling traps for
1173     these three exceptions is probably a good idea.
1174
1175     Many, if not most, floating point operations incur loss of
1176     precision due to rounding, and hence the `ffpe-trap=inexact' is
1177     likely to be uninteresting in practice.
1178
1179     By default no exception traps are enabled.
1180
1181`-ffpe-summary=LIST'
1182     Specify a list of floating-point exceptions, whose flag status is
1183     printed to `ERROR_UNIT' when invoking `STOP' and `ERROR STOP'.
1184     LIST can be either `none', `all' or a comma-separated list of the
1185     following exceptions: `invalid', `zero', `overflow', `underflow',
1186     `inexact' and `denormal'. (See `-ffpe-trap' for a description of
1187     the exceptions.)
1188
1189     By default, a summary for all exceptions but `inexact' is shown.
1190
1191`-fno-backtrace'
1192     When a serious runtime error is encountered or a deadly signal is
1193     emitted (segmentation fault, illegal instruction, bus error,
1194     floating-point exception, and the other POSIX signals that have the
1195     action `core'), the Fortran runtime library tries to output a
1196     backtrace of the error. `-fno-backtrace' disables the backtrace
1197     generation. This option only has influence for compilation of the
1198     Fortran main program.
1199
1200
1201   *Note Options for Debugging Your Program or GCC: (gcc)Debugging
1202Options, for more information on debugging options.
1203
1204
1205File: gfortran.info,  Node: Directory Options,  Next: Link Options,  Prev: Debugging Options,  Up: Invoking GNU Fortran
1206
12072.6 Options for directory search
1208================================
1209
1210These options affect how GNU Fortran searches for files specified by
1211the `INCLUDE' directive and where it searches for previously compiled
1212modules.
1213
1214   It also affects the search paths used by `cpp' when used to
1215preprocess Fortran source.
1216
1217`-IDIR'
1218     These affect interpretation of the `INCLUDE' directive (as well as
1219     of the `#include' directive of the `cpp' preprocessor).
1220
1221     Also note that the general behavior of `-I' and `INCLUDE' is
1222     pretty much the same as of `-I' with `#include' in the `cpp'
1223     preprocessor, with regard to looking for `header.gcc' files and
1224     other such things.
1225
1226     This path is also used to search for `.mod' files when previously
1227     compiled modules are required by a `USE' statement.
1228
1229     *Note Options for Directory Search: (gcc)Directory Options, for
1230     information on the `-I' option.
1231
1232`-JDIR'
1233     This option specifies where to put `.mod' files for compiled
1234     modules.  It is also added to the list of directories to searched
1235     by an `USE' statement.
1236
1237     The default is the current directory.
1238
1239`-fintrinsic-modules-path DIR'
1240     This option specifies the location of pre-compiled intrinsic
1241     modules, if they are not in the default location expected by the
1242     compiler.
1243
1244
1245File: gfortran.info,  Node: Link Options,  Next: Runtime Options,  Prev: Directory Options,  Up: Invoking GNU Fortran
1246
12472.7 Influencing the linking step
1248================================
1249
1250These options come into play when the compiler links object files into
1251an executable output file. They are meaningless if the compiler is not
1252doing a link step.
1253
1254`-static-libgfortran'
1255     On systems that provide `libgfortran' as a shared and a static
1256     library, this option forces the use of the static version. If no
1257     shared version of `libgfortran' was built when the compiler was
1258     configured, this option has no effect.
1259
1260
1261File: gfortran.info,  Node: Runtime Options,  Next: Code Gen Options,  Prev: Link Options,  Up: Invoking GNU Fortran
1262
12632.8 Influencing runtime behavior
1264================================
1265
1266These options affect the runtime behavior of programs compiled with GNU
1267Fortran.
1268
1269`-fconvert=CONVERSION'
1270     Specify the representation of data for unformatted files.  Valid
1271     values for conversion are: `native', the default; `swap', swap
1272     between big- and little-endian; `big-endian', use big-endian
1273     representation for unformatted files; `little-endian', use
1274     little-endian representation for unformatted files.
1275
1276     _This option has an effect only when used in the main program.
1277     The `CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
1278     variable override the default specified by `-fconvert'._
1279
1280`-frecord-marker=LENGTH'
1281     Specify the length of record markers for unformatted files.  Valid
1282     values for LENGTH are 4 and 8.  Default is 4.  _This is different
1283     from previous versions of `gfortran'_, which specified a default
1284     record marker length of 8 on most systems.  If you want to read or
1285     write files compatible with earlier versions of `gfortran', use
1286     `-frecord-marker=8'.
1287
1288`-fmax-subrecord-length=LENGTH'
1289     Specify the maximum length for a subrecord.  The maximum permitted
1290     value for length is 2147483639, which is also the default.  Only
1291     really useful for use by the gfortran testsuite.
1292
1293`-fsign-zero'
1294     When enabled, floating point numbers of value zero with the sign
1295     bit set are written as negative number in formatted output and
1296     treated as negative in the `SIGN' intrinsic.  `-fno-sign-zero'
1297     does not print the negative sign of zero values (or values rounded
1298     to zero for I/O) and regards zero as positive number in the `SIGN'
1299     intrinsic for compatibility with Fortran 77. The default is
1300     `-fsign-zero'.
1301
1302
1303File: gfortran.info,  Node: Code Gen Options,  Next: Environment Variables,  Prev: Runtime Options,  Up: Invoking GNU Fortran
1304
13052.9 Options for code generation conventions
1306===========================================
1307
1308These machine-independent options control the interface conventions
1309used in code generation.
1310
1311   Most of them have both positive and negative forms; the negative form
1312of `-ffoo' would be `-fno-foo'.  In the table below, only one of the
1313forms is listed--the one which is not the default.  You can figure out
1314the other form by either removing `no-' or adding it.
1315
1316`-fno-automatic'
1317     Treat each program unit (except those marked as RECURSIVE) as if
1318     the `SAVE' statement were specified for every local variable and
1319     array referenced in it. Does not affect common blocks. (Some
1320     Fortran compilers provide this option under the name `-static' or
1321     `-save'.)  The default, which is `-fautomatic', uses the stack for
1322     local variables smaller than the value given by
1323     `-fmax-stack-var-size'.  Use the option `-frecursive' to use no
1324     static memory.
1325
1326`-ff2c'
1327     Generate code designed to be compatible with code generated by
1328     `g77' and `f2c'.
1329
1330     The calling conventions used by `g77' (originally implemented in
1331     `f2c') require functions that return type default `REAL' to
1332     actually return the C type `double', and functions that return
1333     type `COMPLEX' to return the values via an extra argument in the
1334     calling sequence that points to where to store the return value.
1335     Under the default GNU calling conventions, such functions simply
1336     return their results as they would in GNU C--default `REAL'
1337     functions return the C type `float', and `COMPLEX' functions
1338     return the GNU C type `complex'.  Additionally, this option
1339     implies the `-fsecond-underscore' option, unless
1340     `-fno-second-underscore' is explicitly requested.
1341
1342     This does not affect the generation of code that interfaces with
1343     the `libgfortran' library.
1344
1345     _Caution:_ It is not a good idea to mix Fortran code compiled with
1346     `-ff2c' with code compiled with the default `-fno-f2c' calling
1347     conventions as, calling `COMPLEX' or default `REAL' functions
1348     between program parts which were compiled with different calling
1349     conventions will break at execution time.
1350
1351     _Caution:_ This will break code which passes intrinsic functions
1352     of type default `REAL' or `COMPLEX' as actual arguments, as the
1353     library implementations use the `-fno-f2c' calling conventions.
1354
1355`-fno-underscoring'
1356     Do not transform names of entities specified in the Fortran source
1357     file by appending underscores to them.
1358
1359     With `-funderscoring' in effect, GNU Fortran appends one
1360     underscore to external names with no underscores.  This is done to
1361     ensure compatibility with code produced by many UNIX Fortran
1362     compilers.
1363
1364     _Caution_: The default behavior of GNU Fortran is incompatible
1365     with `f2c' and `g77', please use the `-ff2c' option if you want
1366     object files compiled with GNU Fortran to be compatible with
1367     object code created with these tools.
1368
1369     Use of `-fno-underscoring' is not recommended unless you are
1370     experimenting with issues such as integration of GNU Fortran into
1371     existing system environments (vis-a`-vis existing libraries, tools,
1372     and so on).
1373
1374     For example, with `-funderscoring', and assuming that `j()' and
1375     `max_count()' are external functions while `my_var' and `lvar' are
1376     local variables, a statement like
1377          I = J() + MAX_COUNT (MY_VAR, LVAR)
1378     is implemented as something akin to:
1379          i = j_() + max_count__(&my_var__, &lvar);
1380
1381     With `-fno-underscoring', the same statement is implemented as:
1382
1383          i = j() + max_count(&my_var, &lvar);
1384
1385     Use of `-fno-underscoring' allows direct specification of
1386     user-defined names while debugging and when interfacing GNU Fortran
1387     code with other languages.
1388
1389     Note that just because the names match does _not_ mean that the
1390     interface implemented by GNU Fortran for an external name matches
1391     the interface implemented by some other language for that same
1392     name.  That is, getting code produced by GNU Fortran to link to
1393     code produced by some other compiler using this or any other
1394     method can be only a small part of the overall solution--getting
1395     the code generated by both compilers to agree on issues other than
1396     naming can require significant effort, and, unlike naming
1397     disagreements, linkers normally cannot detect disagreements in
1398     these other areas.
1399
1400     Also, note that with `-fno-underscoring', the lack of appended
1401     underscores introduces the very real possibility that a
1402     user-defined external name will conflict with a name in a system
1403     library, which could make finding unresolved-reference bugs quite
1404     difficult in some cases--they might occur at program run time, and
1405     show up only as buggy behavior at run time.
1406
1407     In future versions of GNU Fortran we hope to improve naming and
1408     linking issues so that debugging always involves using the names
1409     as they appear in the source, even if the names as seen by the
1410     linker are mangled to prevent accidental linking between
1411     procedures with incompatible interfaces.
1412
1413`-fsecond-underscore'
1414     By default, GNU Fortran appends an underscore to external names.
1415     If this option is used GNU Fortran appends two underscores to
1416     names with underscores and one underscore to external names with
1417     no underscores.  GNU Fortran also appends two underscores to
1418     internal names with underscores to avoid naming collisions with
1419     external names.
1420
1421     This option has no effect if `-fno-underscoring' is in effect.  It
1422     is implied by the `-ff2c' option.
1423
1424     Otherwise, with this option, an external name such as `MAX_COUNT'
1425     is implemented as a reference to the link-time external symbol
1426     `max_count__', instead of `max_count_'.  This is required for
1427     compatibility with `g77' and `f2c', and is implied by use of the
1428     `-ff2c' option.
1429
1430`-fcoarray=<KEYWORD>'
1431
1432    `none'
1433          Disable coarray support; using coarray declarations and
1434          image-control statements will produce a compile-time error.
1435          (Default)
1436
1437    `single'
1438          Single-image mode, i.e. `num_images()' is always one.
1439
1440    `lib'
1441          Library-based coarray parallelization; a suitable GNU Fortran
1442          coarray library needs to be linked.
1443
1444`-fcheck=<KEYWORD>'
1445     Enable the generation of run-time checks; the argument shall be a
1446     comma-delimited list of the following keywords.
1447
1448    `all'
1449          Enable all run-time test of `-fcheck'.
1450
1451    `array-temps'
1452          Warns at run time when for passing an actual argument a
1453          temporary array had to be generated. The information
1454          generated by this warning is sometimes useful in
1455          optimization, in order to avoid such temporaries.
1456
1457          Note: The warning is only printed once per location.
1458
1459    `bounds'
1460          Enable generation of run-time checks for array subscripts and
1461          against the declared minimum and maximum values.  It also
1462          checks array indices for assumed and deferred shape arrays
1463          against the actual allocated bounds and ensures that all
1464          string lengths are equal for character array constructors
1465          without an explicit typespec.
1466
1467          Some checks require that `-fcheck=bounds' is set for the
1468          compilation of the main program.
1469
1470          Note: In the future this may also include other forms of
1471          checking, e.g., checking substring references.
1472
1473    `do'
1474          Enable generation of run-time checks for invalid modification
1475          of loop iteration variables.
1476
1477    `mem'
1478          Enable generation of run-time checks for memory allocation.
1479          Note: This option does not affect explicit allocations using
1480          the `ALLOCATE' statement, which will be always checked.
1481
1482    `pointer'
1483          Enable generation of run-time checks for pointers and
1484          allocatables.
1485
1486    `recursion'
1487          Enable generation of run-time checks for recursively called
1488          subroutines and functions which are not marked as recursive.
1489          See also `-frecursive'.  Note: This check does not work for
1490          OpenMP programs and is disabled if used together with
1491          `-frecursive' and `-fopenmp'.
1492
1493`-fbounds-check'
1494     Deprecated alias for `-fcheck=bounds'.
1495
1496`-fcheck-array-temporaries'
1497     Deprecated alias for `-fcheck=array-temps'.
1498
1499`-fmax-array-constructor=N'
1500     This option can be used to increase the upper limit permitted in
1501     array constructors.  The code below requires this option to expand
1502     the array at compile time.
1503
1504          program test
1505          implicit none
1506          integer j
1507          integer, parameter :: n = 100000
1508          integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
1509          print '(10(I0,1X))', i
1510          end program test
1511
1512     _Caution:  This option can lead to long compile times and
1513     excessively large object files._
1514
1515     The default value for N is 65535.
1516
1517`-fmax-stack-var-size=N'
1518     This option specifies the size in bytes of the largest array that
1519     will be put on the stack; if the size is exceeded static memory is
1520     used (except in procedures marked as RECURSIVE). Use the option
1521     `-frecursive' to allow for recursive procedures which do not have
1522     a RECURSIVE attribute or for parallel programs. Use
1523     `-fno-automatic' to never use the stack.
1524
1525     This option currently only affects local arrays declared with
1526     constant bounds, and may not apply to all character variables.
1527     Future versions of GNU Fortran may improve this behavior.
1528
1529     The default value for N is 32768.
1530
1531`-fstack-arrays'
1532     Adding this option will make the Fortran compiler put all local
1533     arrays, even those of unknown size onto stack memory.  If your
1534     program uses very large local arrays it is possible that you will
1535     have to extend your runtime limits for stack memory on some
1536     operating systems. This flag is enabled by default at optimization
1537     level `-Ofast'.
1538
1539`-fpack-derived'
1540     This option tells GNU Fortran to pack derived type members as
1541     closely as possible.  Code compiled with this option is likely to
1542     be incompatible with code compiled without this option, and may
1543     execute slower.
1544
1545`-frepack-arrays'
1546     In some circumstances GNU Fortran may pass assumed shape array
1547     sections via a descriptor describing a noncontiguous area of
1548     memory.  This option adds code to the function prologue to repack
1549     the data into a contiguous block at runtime.
1550
1551     This should result in faster accesses to the array.  However it
1552     can introduce significant overhead to the function call,
1553     especially  when the passed data is noncontiguous.
1554
1555`-fshort-enums'
1556     This option is provided for interoperability with C code that was
1557     compiled with the `-fshort-enums' option.  It will make GNU
1558     Fortran choose the smallest `INTEGER' kind a given enumerator set
1559     will fit in, and give all its enumerators this kind.
1560
1561`-fexternal-blas'
1562     This option will make `gfortran' generate calls to BLAS functions
1563     for some matrix operations like `MATMUL', instead of using our own
1564     algorithms, if the size of the matrices involved is larger than a
1565     given limit (see `-fblas-matmul-limit').  This may be profitable
1566     if an optimized vendor BLAS library is available.  The BLAS
1567     library will have to be specified at link time.
1568
1569`-fblas-matmul-limit=N'
1570     Only significant when `-fexternal-blas' is in effect.  Matrix
1571     multiplication of matrices with size larger than (or equal to) N
1572     will be performed by calls to BLAS functions, while others will be
1573     handled by `gfortran' internal algorithms. If the matrices
1574     involved are not square, the size comparison is performed using the
1575     geometric mean of the dimensions of the argument and result
1576     matrices.
1577
1578     The default value for N is 30.
1579
1580`-frecursive'
1581     Allow indirect recursion by forcing all local arrays to be
1582     allocated on the stack. This flag cannot be used together with
1583     `-fmax-stack-var-size=' or `-fno-automatic'.
1584
1585`-finit-local-zero'
1586`-finit-integer=N'
1587`-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
1588`-finit-logical=<TRUE|FALSE>'
1589`-finit-character=N'
1590     The `-finit-local-zero' option instructs the compiler to
1591     initialize local `INTEGER', `REAL', and `COMPLEX' variables to
1592     zero, `LOGICAL' variables to false, and `CHARACTER' variables to a
1593     string of null bytes.  Finer-grained initialization options are
1594     provided by the `-finit-integer=N',
1595     `-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which also initializes the
1596     real and imaginary parts of local `COMPLEX' variables),
1597     `-finit-logical=<TRUE|FALSE>', and `-finit-character=N' (where N
1598     is an ASCII character value) options.  These options do not
1599     initialize
1600        * allocatable arrays
1601
1602        * components of derived type variables
1603
1604        * variables that appear in an `EQUIVALENCE' statement.
1605     (These limitations may be removed in future releases).
1606
1607     Note that the `-finit-real=nan' option initializes `REAL' and
1608     `COMPLEX' variables with a quiet NaN. For a signalling NaN use
1609     `-finit-real=snan'; note, however, that compile-time optimizations
1610     may convert them into quiet NaN and that trapping needs to be
1611     enabled (e.g. via `-ffpe-trap').
1612
1613     Finally, note that enabling any of the `-finit-*' options will
1614     silence warnings that would have been emitted by `-Wuninitialized'
1615     for the affected local variables.
1616
1617`-falign-commons'
1618     By default, `gfortran' enforces proper alignment of all variables
1619     in a `COMMON' block by padding them as needed. On certain
1620     platforms this is mandatory, on others it increases performance.
1621     If a `COMMON' block is not declared with consistent data types
1622     everywhere, this padding can cause trouble, and
1623     `-fno-align-commons' can be used to disable automatic alignment.
1624     The same form of this option should be used for all files that
1625     share a `COMMON' block.  To avoid potential alignment issues in
1626     `COMMON' blocks, it is recommended to order objects from largest
1627     to smallest.
1628
1629`-fno-protect-parens'
1630     By default the parentheses in expression are honored for all
1631     optimization levels such that the compiler does not do any
1632     re-association. Using `-fno-protect-parens' allows the compiler to
1633     reorder `REAL' and `COMPLEX' expressions to produce faster code.
1634     Note that for the re-association optimization `-fno-signed-zeros'
1635     and `-fno-trapping-math' need to be in effect. The parentheses
1636     protection is enabled by default, unless `-Ofast' is given.
1637
1638`-frealloc-lhs'
1639     An allocatable left-hand side of an intrinsic assignment is
1640     automatically (re)allocated if it is either unallocated or has a
1641     different shape. The option is enabled by default except when
1642     `-std=f95' is given. See also `-Wrealloc-lhs'.
1643
1644`-faggressive-function-elimination'
1645     Functions with identical argument lists are eliminated within
1646     statements, regardless of whether these functions are marked
1647     `PURE' or not. For example, in
1648            a = f(b,c) + f(b,c)
1649     there will only be a single call to `f'.  This option only works
1650     if `-ffrontend-optimize' is in effect.
1651
1652`-ffrontend-optimize'
1653     This option performs front-end optimization, based on manipulating
1654     parts the Fortran parse tree.  Enabled by default by any `-O'
1655     option.  Optimizations enabled by this option include elimination
1656     of identical function calls within expressions, removing
1657     unnecessary calls to `TRIM' in comparisons and assignments and
1658     replacing `TRIM(a)' with `a(1:LEN_TRIM(a))'.  It can be deselected
1659     by specifying `-fno-frontend-optimize'.
1660
1661   *Note Options for Code Generation Conventions: (gcc)Code Gen
1662Options, for information on more options offered by the GBE shared by
1663`gfortran', `gcc', and other GNU compilers.
1664
1665
1666File: gfortran.info,  Node: Environment Variables,  Prev: Code Gen Options,  Up: Invoking GNU Fortran
1667
16682.10 Environment variables affecting `gfortran'
1669===============================================
1670
1671The `gfortran' compiler currently does not make use of any environment
1672variables to control its operation above and beyond those that affect
1673the operation of `gcc'.
1674
1675   *Note Environment Variables Affecting GCC: (gcc)Environment
1676Variables, for information on environment variables.
1677
1678   *Note Runtime::, for environment variables that affect the run-time
1679behavior of programs compiled with GNU Fortran.
1680
1681
1682File: gfortran.info,  Node: Runtime,  Next: Fortran 2003 and 2008 status,  Prev: Invoking GNU Fortran,  Up: Top
1683
16843 Runtime:  Influencing runtime behavior with environment variables
1685*******************************************************************
1686
1687The behavior of the `gfortran' can be influenced by environment
1688variables.
1689
1690   Malformed environment variables are silently ignored.
1691
1692* Menu:
1693
1694* TMPDIR:: Directory for scratch files
1695* GFORTRAN_STDIN_UNIT:: Unit number for standard input
1696* GFORTRAN_STDOUT_UNIT:: Unit number for standard output
1697* GFORTRAN_STDERR_UNIT:: Unit number for standard error
1698* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units.
1699* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
1700* GFORTRAN_SHOW_LOCUS::  Show location for runtime errors
1701* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
1702* GFORTRAN_DEFAULT_RECL:: Default record length for new files
1703* GFORTRAN_LIST_SEPARATOR::  Separator for list output
1704* GFORTRAN_CONVERT_UNIT::  Set endianness for unformatted I/O
1705* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
1706
1707
1708File: gfortran.info,  Node: TMPDIR,  Next: GFORTRAN_STDIN_UNIT,  Up: Runtime
1709
17103.1 `TMPDIR'--Directory for scratch files
1711=========================================
1712
1713When opening a file with `STATUS='SCRATCH'', GNU Fortran tries to
1714create the file in one of the potential directories by testing each
1715directory in the order below.
1716
1717  1. The environment variable `TMPDIR', if it exists.
1718
1719  2. On the MinGW target, the directory returned by the `GetTempPath'
1720     function. Alternatively, on the Cygwin target, the `TMP' and
1721     `TEMP' environment variables, if they exist, in that order.
1722
1723  3. The `P_tmpdir' macro if it is defined, otherwise the directory
1724     `/tmp'.
1725
1726
1727File: gfortran.info,  Node: GFORTRAN_STDIN_UNIT,  Next: GFORTRAN_STDOUT_UNIT,  Prev: TMPDIR,  Up: Runtime
1728
17293.2 `GFORTRAN_STDIN_UNIT'--Unit number for standard input
1730=========================================================
1731
1732This environment variable can be used to select the unit number
1733preconnected to standard input.  This must be a positive integer.  The
1734default value is 5.
1735
1736
1737File: gfortran.info,  Node: GFORTRAN_STDOUT_UNIT,  Next: GFORTRAN_STDERR_UNIT,  Prev: GFORTRAN_STDIN_UNIT,  Up: Runtime
1738
17393.3 `GFORTRAN_STDOUT_UNIT'--Unit number for standard output
1740===========================================================
1741
1742This environment variable can be used to select the unit number
1743preconnected to standard output.  This must be a positive integer.  The
1744default value is 6.
1745
1746
1747File: gfortran.info,  Node: GFORTRAN_STDERR_UNIT,  Next: GFORTRAN_UNBUFFERED_ALL,  Prev: GFORTRAN_STDOUT_UNIT,  Up: Runtime
1748
17493.4 `GFORTRAN_STDERR_UNIT'--Unit number for standard error
1750==========================================================
1751
1752This environment variable can be used to select the unit number
1753preconnected to standard error.  This must be a positive integer.  The
1754default value is 0.
1755
1756
1757File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_ALL,  Next: GFORTRAN_UNBUFFERED_PRECONNECTED,  Prev: GFORTRAN_STDERR_UNIT,  Up: Runtime
1758
17593.5 `GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
1760=============================================================
1761
1762This environment variable controls whether all I/O is unbuffered.  If
1763the first letter is `y', `Y' or `1', all I/O is unbuffered.  This will
1764slow down small sequential reads and writes.  If the first letter is
1765`n', `N' or `0', I/O is buffered.  This is the default.
1766
1767
1768File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_PRECONNECTED,  Next: GFORTRAN_SHOW_LOCUS,  Prev: GFORTRAN_UNBUFFERED_ALL,  Up: Runtime
1769
17703.6 `GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
1771===============================================================================
1772
1773The environment variable named `GFORTRAN_UNBUFFERED_PRECONNECTED'
1774controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
1775unbuffered.  If the first letter is `y', `Y' or `1', I/O is unbuffered.
1776This will slow down small sequential reads and writes.  If the first
1777letter is `n', `N' or `0', I/O is buffered.  This is the default.
1778
1779
1780File: gfortran.info,  Node: GFORTRAN_SHOW_LOCUS,  Next: GFORTRAN_OPTIONAL_PLUS,  Prev: GFORTRAN_UNBUFFERED_PRECONNECTED,  Up: Runtime
1781
17823.7 `GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
1783===========================================================
1784
1785If the first letter is `y', `Y' or `1', filename and line numbers for
1786runtime errors are printed.  If the first letter is `n', `N' or `0', do
1787not print filename and line numbers for runtime errors.  The default is
1788to print the location.
1789
1790
1791File: gfortran.info,  Node: GFORTRAN_OPTIONAL_PLUS,  Next: GFORTRAN_DEFAULT_RECL,  Prev: GFORTRAN_SHOW_LOCUS,  Up: Runtime
1792
17933.8 `GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
1794=============================================================
1795
1796If the first letter is `y', `Y' or `1', a plus sign is printed where
1797permitted by the Fortran standard.  If the first letter is `n', `N' or
1798`0', a plus sign is not printed in most cases.  Default is not to print
1799plus signs.
1800
1801
1802File: gfortran.info,  Node: GFORTRAN_DEFAULT_RECL,  Next: GFORTRAN_LIST_SEPARATOR,  Prev: GFORTRAN_OPTIONAL_PLUS,  Up: Runtime
1803
18043.9 `GFORTRAN_DEFAULT_RECL'--Default record length for new files
1805================================================================
1806
1807This environment variable specifies the default record length, in
1808bytes, for files which are opened without a `RECL' tag in the `OPEN'
1809statement.  This must be a positive integer.  The default value is
18101073741824 bytes (1 GB).
1811
1812
1813File: gfortran.info,  Node: GFORTRAN_LIST_SEPARATOR,  Next: GFORTRAN_CONVERT_UNIT,  Prev: GFORTRAN_DEFAULT_RECL,  Up: Runtime
1814
18153.10 `GFORTRAN_LIST_SEPARATOR'--Separator for list output
1816=========================================================
1817
1818This environment variable specifies the separator when writing
1819list-directed output.  It may contain any number of spaces and at most
1820one comma.  If you specify this on the command line, be sure to quote
1821spaces, as in
1822     $ GFORTRAN_LIST_SEPARATOR='  ,  ' ./a.out
1823   when `a.out' is the compiled Fortran program that you want to run.
1824Default is a single space.
1825
1826
1827File: gfortran.info,  Node: GFORTRAN_CONVERT_UNIT,  Next: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_LIST_SEPARATOR,  Up: Runtime
1828
18293.11 `GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
1830================================================================
1831
1832By setting the `GFORTRAN_CONVERT_UNIT' variable, it is possible to
1833change the representation of data for unformatted files.  The syntax
1834for the `GFORTRAN_CONVERT_UNIT' variable is:
1835     GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
1836     mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
1837     exception: mode ':' unit_list | unit_list ;
1838     unit_list: unit_spec | unit_list unit_spec ;
1839     unit_spec: INTEGER | INTEGER '-' INTEGER ;
1840   The variable consists of an optional default mode, followed by a
1841list of optional exceptions, which are separated by semicolons from the
1842preceding default and each other.  Each exception consists of a format
1843and a comma-separated list of units.  Valid values for the modes are
1844the same as for the `CONVERT' specifier:
1845
1846     `NATIVE' Use the native format.  This is the default.
1847
1848     `SWAP' Swap between little- and big-endian.
1849
1850     `LITTLE_ENDIAN' Use the little-endian format for unformatted files.
1851
1852     `BIG_ENDIAN' Use the big-endian format for unformatted files.
1853   A missing mode for an exception is taken to mean `BIG_ENDIAN'.
1854Examples of values for `GFORTRAN_CONVERT_UNIT' are:
1855     `'big_endian''  Do all unformatted I/O in big_endian mode.
1856
1857     `'little_endian;native:10-20,25''  Do all unformatted I/O in
1858     little_endian mode, except for units 10 to 20 and 25, which are in
1859     native format.
1860
1861     `'10-20''  Units 10 to 20 are big-endian, the rest is native.
1862
1863   Setting the environment variables should be done on the command line
1864or via the `export' command for `sh'-compatible shells and via `setenv'
1865for `csh'-compatible shells.
1866
1867   Example for `sh':
1868     $ gfortran foo.f90
1869     $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
1870
1871   Example code for `csh':
1872     % gfortran foo.f90
1873     % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
1874     % ./a.out
1875
1876   Using anything but the native representation for unformatted data
1877carries a significant speed overhead.  If speed in this area matters to
1878you, it is best if you use this only for data that needs to be portable.
1879
1880   *Note CONVERT specifier::, for an alternative way to specify the
1881data representation for unformatted files.  *Note Runtime Options::, for
1882setting a default data representation for the whole program.  The
1883`CONVERT' specifier overrides the `-fconvert' compile options.
1884
1885   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
1886environment variable will override the CONVERT specifier in the open
1887statement_.  This is to give control over data formats to users who do
1888not have the source code of their program available.
1889
1890
1891File: gfortran.info,  Node: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_CONVERT_UNIT,  Up: Runtime
1892
18933.12 `GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
1894==================================================================
1895
1896If the `GFORTRAN_ERROR_BACKTRACE' variable is set to `y', `Y' or `1'
1897(only the first letter is relevant) then a backtrace is printed when a
1898serious run-time error occurs.  To disable the backtracing, set the
1899variable to `n', `N', `0'.  Default is to print a backtrace unless the
1900`-fno-backtrace' compile option was used.
1901
1902
1903File: gfortran.info,  Node: Fortran 2003 and 2008 status,  Next: Compiler Characteristics,  Prev: Runtime,  Up: Top
1904
19054 Fortran 2003 and 2008 Status
1906******************************
1907
1908* Menu:
1909
1910* Fortran 2003 status::
1911* Fortran 2008 status::
1912* TS 29113 status::
1913
1914
1915File: gfortran.info,  Node: Fortran 2003 status,  Next: Fortran 2008 status,  Up: Fortran 2003 and 2008 status
1916
19174.1 Fortran 2003 status
1918=======================
1919
1920GNU Fortran supports several Fortran 2003 features; an incomplete list
1921can be found below.  See also the wiki page
1922(https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
1923
1924   * Procedure pointers including procedure-pointer components with
1925     `PASS' attribute.
1926
1927   * Procedures which are bound to a derived type (type-bound
1928     procedures) including `PASS', `PROCEDURE' and `GENERIC', and
1929     operators bound to a type.
1930
1931   * Abstract interfaces and type extension with the possibility to
1932     override type-bound procedures or to have deferred binding.
1933
1934   * Polymorphic entities ("`CLASS'") for derived types and unlimited
1935     polymorphism ("`CLASS(*)'") - including `SAME_TYPE_AS',
1936     `EXTENDS_TYPE_OF' and `SELECT TYPE' for scalars and arrays and
1937     finalization.
1938
1939   * Generic interface names, which have the same name as derived types,
1940     are now supported. This allows one to write constructor functions.
1941     Note that Fortran does not support static constructor functions.
1942     For static variables, only default initialization or
1943     structure-constructor initialization are available.
1944
1945   * The `ASSOCIATE' construct.
1946
1947   * Interoperability with C including enumerations,
1948
1949   * In structure constructors the components with default values may be
1950     omitted.
1951
1952   * Extensions to the `ALLOCATE' statement, allowing for a
1953     type-specification with type parameter and for allocation and
1954     initialization from a `SOURCE=' expression; `ALLOCATE' and
1955     `DEALLOCATE' optionally return an error message string via
1956     `ERRMSG='.
1957
1958   * Reallocation on assignment: If an intrinsic assignment is used, an
1959     allocatable variable on the left-hand side is automatically
1960     allocated (if unallocated) or reallocated (if the shape is
1961     different). Currently, scalar deferred character length left-hand
1962     sides are correctly handled but arrays are not yet fully
1963     implemented.
1964
1965   * Deferred-length character variables and scalar deferred-length
1966     character components of derived types are supported. (Note that
1967     array-valued compoents are not yet implemented.)
1968
1969   * Transferring of allocations via `MOVE_ALLOC'.
1970
1971   * The `PRIVATE' and `PUBLIC' attributes may be given individually to
1972     derived-type components.
1973
1974   * In pointer assignments, the lower bound may be specified and the
1975     remapping of elements is supported.
1976
1977   * For pointers an `INTENT' may be specified which affect the
1978     association status not the value of the pointer target.
1979
1980   * Intrinsics `command_argument_count', `get_command',
1981     `get_command_argument', and `get_environment_variable'.
1982
1983   * Support for Unicode characters (ISO 10646) and UTF-8, including
1984     the `SELECTED_CHAR_KIND' and `NEW_LINE' intrinsic functions.
1985
1986   * Support for binary, octal and hexadecimal (BOZ) constants in the
1987     intrinsic functions `INT', `REAL', `CMPLX' and `DBLE'.
1988
1989   * Support for namelist variables with allocatable and pointer
1990     attribute and nonconstant length type parameter.
1991
1992   * Array constructors using square brackets.  That is, `[...]' rather
1993     than `(/.../)'.  Type-specification for array constructors like
1994     `(/ some-type :: ... /)'.
1995
1996   * Extensions to the specification and initialization expressions,
1997     including the support for intrinsics with real and complex
1998     arguments.
1999
2000   * Support for the asynchronous input/output syntax; however, the
2001     data transfer is currently always synchronously performed.
2002
2003   * `FLUSH' statement.
2004
2005   * `IOMSG=' specifier for I/O statements.
2006
2007   * Support for the declaration of enumeration constants via the
2008     `ENUM' and `ENUMERATOR' statements.  Interoperability with `gcc'
2009     is guaranteed also for the case where the `-fshort-enums' command
2010     line option is given.
2011
2012   * TR 15581:
2013        * `ALLOCATABLE' dummy arguments.
2014
2015        * `ALLOCATABLE' function results
2016
2017        * `ALLOCATABLE' components of derived types
2018
2019   * The `OPEN' statement supports the `ACCESS='STREAM'' specifier,
2020     allowing I/O without any record structure.
2021
2022   * Namelist input/output for internal files.
2023
2024   * Minor I/O features: Rounding during formatted output, using of a
2025     decimal comma instead of a decimal point, setting whether a plus
2026     sign should appear for positive numbers. On systems where `strtod'
2027     honours the rounding mode, the rounding mode is also supported for
2028     input.
2029
2030   * The `PROTECTED' statement and attribute.
2031
2032   * The `VALUE' statement and attribute.
2033
2034   * The `VOLATILE' statement and attribute.
2035
2036   * The `IMPORT' statement, allowing to import host-associated derived
2037     types.
2038
2039   * The intrinsic modules `ISO_FORTRAN_ENVIRONMENT' is supported,
2040     which contains parameters of the I/O units, storage sizes.
2041     Additionally, procedures for C interoperability are available in
2042     the `ISO_C_BINDING' module.
2043
2044   * `USE' statement with `INTRINSIC' and `NON_INTRINSIC' attribute;
2045     supported intrinsic modules: `ISO_FORTRAN_ENV', `ISO_C_BINDING',
2046     `OMP_LIB' and `OMP_LIB_KINDS', and `OPENACC'.
2047
2048   * Renaming of operators in the `USE' statement.
2049
2050
2051
2052File: gfortran.info,  Node: Fortran 2008 status,  Next: TS 29113 status,  Prev: Fortran 2003 status,  Up: Fortran 2003 and 2008 status
2053
20544.2 Fortran 2008 status
2055=======================
2056
2057The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
2058informally known as Fortran 2008.  The official version is available
2059from International Organization for Standardization (ISO) or its
2060national member organizations.  The the final draft (FDIS) can be
2061downloaded free of charge from
2062`http://www.nag.co.uk/sc22wg5/links.html'.  Fortran is developed by the
2063Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
2064of the International Organization for Standardization and the
2065International Electrotechnical Commission (IEC).  This group is known as
2066WG5 (http://www.nag.co.uk/sc22wg5/).
2067
2068   The GNU Fortran compiler supports several of the new features of
2069Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
2070some information about the current Fortran 2008 implementation status.
2071In particular, the following is implemented.
2072
2073   * The `-std=f2008' option and support for the file extensions `.f08'
2074     and `.F08'.
2075
2076   * The `OPEN' statement now supports the `NEWUNIT=' option, which
2077     returns a unique file unit, thus preventing inadvertent use of the
2078     same unit in different parts of the program.
2079
2080   * The `g0' format descriptor and unlimited format items.
2081
2082   * The mathematical intrinsics `ASINH', `ACOSH', `ATANH', `ERF',
2083     `ERFC', `GAMMA', `LOG_GAMMA', `BESSEL_J0', `BESSEL_J1',
2084     `BESSEL_JN', `BESSEL_Y0', `BESSEL_Y1', `BESSEL_YN', `HYPOT',
2085     `NORM2', and `ERFC_SCALED'.
2086
2087   * Using complex arguments with `TAN', `SINH', `COSH', `TANH',
2088     `ASIN', `ACOS', and `ATAN' is now possible; `ATAN'(Y,X) is now an
2089     alias for `ATAN2'(Y,X).
2090
2091   * Support of the `PARITY' intrinsic functions.
2092
2093   * The following bit intrinsics: `LEADZ' and `TRAILZ' for counting
2094     the number of leading and trailing zero bits, `POPCNT' and
2095     `POPPAR' for counting the number of one bits and returning the
2096     parity; `BGE', `BGT', `BLE', and `BLT' for bitwise comparisons;
2097     `DSHIFTL' and `DSHIFTR' for combined left and right shifts,
2098     `MASKL' and `MASKR' for simple left and right justified masks,
2099     `MERGE_BITS' for a bitwise merge using a mask, `SHIFTA', `SHIFTL'
2100     and `SHIFTR' for shift operations, and the transformational bit
2101     intrinsics `IALL', `IANY' and `IPARITY'.
2102
2103   * Support of the `EXECUTE_COMMAND_LINE' intrinsic subroutine.
2104
2105   * Support for the `STORAGE_SIZE' intrinsic inquiry function.
2106
2107   * The `INT{8,16,32}' and `REAL{32,64,128}' kind type parameters and
2108     the array-valued named constants `INTEGER_KINDS', `LOGICAL_KINDS',
2109     `REAL_KINDS' and `CHARACTER_KINDS' of the intrinsic module
2110     `ISO_FORTRAN_ENV'.
2111
2112   * The module procedures `C_SIZEOF' of the intrinsic module
2113     `ISO_C_BINDINGS' and `COMPILER_VERSION' and `COMPILER_OPTIONS' of
2114     `ISO_FORTRAN_ENV'.
2115
2116   * Coarray support for serial programs with `-fcoarray=single' flag
2117     and experimental support for multiple images with the
2118     `-fcoarray=lib' flag.
2119
2120   * The `DO CONCURRENT' construct is supported.
2121
2122   * The `BLOCK' construct is supported.
2123
2124   * The `STOP' and the new `ERROR STOP' statements now support all
2125     constant expressions. Both show the signals which were signaling
2126     at termination.
2127
2128   * Support for the `CONTIGUOUS' attribute.
2129
2130   * Support for `ALLOCATE' with `MOLD'.
2131
2132   * Support for the `IMPURE' attribute for procedures, which allows
2133     for `ELEMENTAL' procedures without the restrictions of `PURE'.
2134
2135   * Null pointers (including `NULL()') and not-allocated variables can
2136     be used as actual argument to optional non-pointer, non-allocatable
2137     dummy arguments, denoting an absent argument.
2138
2139   * Non-pointer variables with `TARGET' attribute can be used as
2140     actual argument to `POINTER' dummies with `INTENT(IN)'.
2141
2142   * Pointers including procedure pointers and those in a derived type
2143     (pointer components) can now be initialized by a target instead of
2144     only by `NULL'.
2145
2146   * The `EXIT' statement (with construct-name) can be now be used to
2147     leave not only the `DO' but also the `ASSOCIATE', `BLOCK', `IF',
2148     `SELECT CASE' and `SELECT TYPE' constructs.
2149
2150   * Internal procedures can now be used as actual argument.
2151
2152   * Minor features: obsolesce diagnostics for `ENTRY' with
2153     `-std=f2008'; a line may start with a semicolon; for internal and
2154     module procedures `END' can be used instead of `END SUBROUTINE'
2155     and `END FUNCTION'; `SELECTED_REAL_KIND' now also takes a `RADIX'
2156     argument; intrinsic types are supported for
2157     `TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
2158     declared in a single `PROCEDURE' statement; implied-shape arrays
2159     are supported for named constants (`PARAMETER').
2160
2161
2162File: gfortran.info,  Node: TS 29113 status,  Prev: Fortran 2008 status,  Up: Fortran 2003 and 2008 status
2163
21644.3 Technical Specification 29113 Status
2165========================================
2166
2167GNU Fortran supports some of the new features of the Technical
2168Specification (TS) 29113 on Further Interoperability of Fortran with C.
2169The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
2170about the current TS 29113 implementation status.  In particular, the
2171following is implemented.
2172
2173   See also *note Further Interoperability of Fortran with C::.
2174
2175   * The `-std=f2008ts' option.
2176
2177   * The `OPTIONAL' attribute is allowed for dummy arguments of
2178     `BIND(C) procedures.'
2179
2180   * The `RANK' intrinsic is supported.
2181
2182   * GNU Fortran's implementation for variables with `ASYNCHRONOUS'
2183     attribute is compatible with TS 29113.
2184
2185   * Assumed types (`TYPE(*)'.
2186
2187   * Assumed-rank (`DIMENSION(..)'). However, the array descriptor of
2188     the TS is not yet supported.
2189
2190
2191File: gfortran.info,  Node: Compiler Characteristics,  Next: Extensions,  Prev: Fortran 2003 and 2008 status,  Up: Top
2192
21935 Compiler Characteristics
2194**************************
2195
2196This chapter describes certain characteristics of the GNU Fortran
2197compiler, that are not specified by the Fortran standard, but which
2198might in some way or another become visible to the programmer.
2199
2200* Menu:
2201
2202* KIND Type Parameters::
2203* Internal representation of LOGICAL variables::
2204* Thread-safety of the runtime library::
2205* Data consistency and durability::
2206* Files opened without an explicit ACTION= specifier::
2207
2208
2209File: gfortran.info,  Node: KIND Type Parameters,  Next: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2210
22115.1 KIND Type Parameters
2212========================
2213
2214The `KIND' type parameters supported by GNU Fortran for the primitive
2215data types are:
2216
2217`INTEGER'
2218     1, 2, 4, 8*, 16*, default: 4**
2219
2220`LOGICAL'
2221     1, 2, 4, 8*, 16*, default: 4**
2222
2223`REAL'
2224     4, 8, 10*, 16*, default: 4***
2225
2226`COMPLEX'
2227     4, 8, 10*, 16*, default: 4***
2228
2229`DOUBLE PRECISION'
2230     4, 8, 10*, 16*, default: 8***
2231
2232`CHARACTER'
2233     1, 4, default: 1
2234
2235
2236* not available on all systems
2237** unless `-fdefault-integer-8' is used
2238*** unless `-fdefault-real-8' is used (see *note Fortran Dialect
2239Options::)
2240
2241The `KIND' value matches the storage size in bytes, except for
2242`COMPLEX' where the storage size is twice as much (or both real and
2243imaginary part are a real value of the given size).  It is recommended
2244to use the *note SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and
2245*note SELECTED_REAL_KIND:: intrinsics or the `INT8', `INT16', `INT32',
2246`INT64', `REAL32', `REAL64', and `REAL128' parameters of the
2247`ISO_FORTRAN_ENV' module instead of the concrete values.  The available
2248kind parameters can be found in the constant arrays `CHARACTER_KINDS',
2249`INTEGER_KINDS', `LOGICAL_KINDS' and `REAL_KINDS' in the *note
2250ISO_FORTRAN_ENV:: module.  For C interoperability, the kind parameters
2251of the *note ISO_C_BINDING:: module should be used.
2252
2253
2254File: gfortran.info,  Node: Internal representation of LOGICAL variables,  Next: Thread-safety of the runtime library,  Prev: KIND Type Parameters,  Up: Compiler Characteristics
2255
22565.2 Internal representation of LOGICAL variables
2257================================================
2258
2259The Fortran standard does not specify how variables of `LOGICAL' type
2260are represented, beyond requiring that `LOGICAL' variables of default
2261kind have the same storage size as default `INTEGER' and `REAL'
2262variables.  The GNU Fortran internal representation is as follows.
2263
2264   A `LOGICAL(KIND=N)' variable is represented as an `INTEGER(KIND=N)'
2265variable, however, with only two permissible values: `1' for `.TRUE.'
2266and `0' for `.FALSE.'.  Any other integer value results in undefined
2267behavior.
2268
2269   See also *note Argument passing conventions:: and *note
2270Interoperability with C::.
2271
2272
2273File: gfortran.info,  Node: Thread-safety of the runtime library,  Next: Data consistency and durability,  Prev: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2274
22755.3 Thread-safety of the runtime library
2276========================================
2277
2278GNU Fortran can be used in programs with multiple threads, e.g. by
2279using OpenMP, by calling OS thread handling functions via the
2280`ISO_C_BINDING' facility, or by GNU Fortran compiled library code being
2281called from a multi-threaded program.
2282
2283   The GNU Fortran runtime library, (`libgfortran'), supports being
2284called concurrently from multiple threads with the following exceptions.
2285
2286   During library initialization, the C `getenv' function is used,
2287which need not be thread-safe.  Similarly, the `getenv' function is
2288used to implement the `GET_ENVIRONMENT_VARIABLE' and `GETENV'
2289intrinsics.  It is the responsibility of the user to ensure that the
2290environment is not being updated concurrently when any of these actions
2291are taking place.
2292
2293   The `EXECUTE_COMMAND_LINE' and `SYSTEM' intrinsics are implemented
2294with the `system' function, which need not be thread-safe.  It is the
2295responsibility of the user to ensure that `system' is not called
2296concurrently.
2297
2298   For platforms not supporting thread-safe POSIX functions, further
2299functionality might not be thread-safe.  For details, please consult
2300the documentation for your operating system.
2301
2302   The GNU Fortran runtime library uses various C library functions that
2303depend on the locale, such as `strtod' and `snprintf'.  In order to
2304work correctly in locale-aware programs that set the locale using
2305`setlocale', the locale is reset to the default "C" locale while
2306executing a formatted `READ' or `WRITE' statement.  On targets
2307supporting the POSIX 2008 per-thread locale functions (e.g.
2308`newlocale', `uselocale', `freelocale'), these are used and thus the
2309global locale set using `setlocale' or the per-thread locales in other
2310threads are not affected.  However, on targets lacking this
2311functionality, the global LC_NUMERIC locale is set to "C" during the
2312formatted I/O.  Thus, on such targets it's not safe to call `setlocale'
2313concurrently from another thread while a Fortran formatted I/O
2314operation is in progress.  Also, other threads doing something
2315dependent on the LC_NUMERIC locale might not work correctly if a
2316formatted I/O operation is in progress in another thread.
2317
2318
2319File: gfortran.info,  Node: Data consistency and durability,  Next: Files opened without an explicit ACTION= specifier,  Prev: Thread-safety of the runtime library,  Up: Compiler Characteristics
2320
23215.4 Data consistency and durability
2322===================================
2323
2324This section contains a brief overview of data and metadata consistency
2325and durability issues when doing I/O.
2326
2327   With respect to durability, GNU Fortran makes no effort to ensure
2328that data is committed to stable storage. If this is required, the GNU
2329Fortran programmer can use the intrinsic `FNUM' to retrieve the low
2330level file descriptor corresponding to an open Fortran unit. Then,
2331using e.g. the `ISO_C_BINDING' feature, one can call the underlying
2332system call to flush dirty data to stable storage, such as `fsync' on
2333POSIX, `_commit' on MingW, or `fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
2334The following example shows how to call fsync:
2335
2336       ! Declare the interface for POSIX fsync function
2337       interface
2338         function fsync (fd) bind(c,name="fsync")
2339         use iso_c_binding, only: c_int
2340           integer(c_int), value :: fd
2341           integer(c_int) :: fsync
2342         end function fsync
2343       end interface
2344
2345       ! Variable declaration
2346       integer :: ret
2347
2348       ! Opening unit 10
2349       open (10,file="foo")
2350
2351       ! ...
2352       ! Perform I/O on unit 10
2353       ! ...
2354
2355       ! Flush and sync
2356       flush(10)
2357       ret = fsync(fnum(10))
2358
2359       ! Handle possible error
2360       if (ret /= 0) stop "Error calling FSYNC"
2361
2362   With respect to consistency, for regular files GNU Fortran uses
2363buffered I/O in order to improve performance. This buffer is flushed
2364automatically when full and in some other situations, e.g. when closing
2365a unit. It can also be explicitly flushed with the `FLUSH' statement.
2366Also, the buffering can be turned off with the
2367`GFORTRAN_UNBUFFERED_ALL' and `GFORTRAN_UNBUFFERED_PRECONNECTED'
2368environment variables. Special files, such as terminals and pipes, are
2369always unbuffered. Sometimes, however, further things may need to be
2370done in order to allow other processes to see data that GNU Fortran has
2371written, as follows.
2372
2373   The Windows platform supports a relaxed metadata consistency model,
2374where file metadata is written to the directory lazily. This means
2375that, for instance, the `dir' command can show a stale size for a file.
2376One can force a directory metadata update by closing the unit, or by
2377calling `_commit' on the file descriptor. Note, though, that `_commit'
2378will force all dirty data to stable storage, which is often a very slow
2379operation.
2380
2381   The Network File System (NFS) implements a relaxed consistency model
2382called open-to-close consistency. Closing a file forces dirty data and
2383metadata to be flushed to the server, and opening a file forces the
2384client to contact the server in order to revalidate cached data.
2385`fsync' will also force a flush of dirty data and metadata to the
2386server. Similar to `open' and `close', acquiring and releasing `fcntl'
2387file locks, if the server supports them, will also force cache
2388validation and flushing dirty data and metadata.
2389
2390
2391File: gfortran.info,  Node: Files opened without an explicit ACTION= specifier,  Prev: Data consistency and durability,  Up: Compiler Characteristics
2392
23935.5 Files opened without an explicit ACTION= specifier
2394======================================================
2395
2396The Fortran standard says that if an `OPEN' statement is executed
2397without an explicit `ACTION=' specifier, the default value is processor
2398dependent.  GNU Fortran behaves as follows:
2399
2400  1. Attempt to open the file with `ACTION='READWRITE''
2401
2402  2. If that fails, try to open with `ACTION='READ''
2403
2404  3. If that fails, try to open with `ACTION='WRITE''
2405
2406  4. If that fails, generate an error
2407
2408
2409File: gfortran.info,  Node: Extensions,  Next: Mixed-Language Programming,  Prev: Compiler Characteristics,  Up: Top
2410
24116 Extensions
2412************
2413
2414The two sections below detail the extensions to standard Fortran that
2415are implemented in GNU Fortran, as well as some of the popular or
2416historically important extensions that are not (or not yet) implemented.
2417For the latter case, we explain the alternatives available to GNU
2418Fortran users, including replacement by standard-conforming code or GNU
2419extensions.
2420
2421* Menu:
2422
2423* Extensions implemented in GNU Fortran::
2424* Extensions not implemented in GNU Fortran::
2425
2426
2427File: gfortran.info,  Node: Extensions implemented in GNU Fortran,  Next: Extensions not implemented in GNU Fortran,  Up: Extensions
2428
24296.1 Extensions implemented in GNU Fortran
2430=========================================
2431
2432GNU Fortran implements a number of extensions over standard Fortran.
2433This chapter contains information on their syntax and meaning.  There
2434are currently two categories of GNU Fortran extensions, those that
2435provide functionality beyond that provided by any standard, and those
2436that are supported by GNU Fortran purely for backward compatibility
2437with legacy compilers.  By default, `-std=gnu' allows the compiler to
2438accept both types of extensions, but to warn about the use of the
2439latter.  Specifying either `-std=f95', `-std=f2003' or `-std=f2008'
2440disables both types of extensions, and `-std=legacy' allows both
2441without warning.
2442
2443* Menu:
2444
2445* Old-style kind specifications::
2446* Old-style variable initialization::
2447* Extensions to namelist::
2448* X format descriptor without count field::
2449* Commas in FORMAT specifications::
2450* Missing period in FORMAT specifications::
2451* I/O item lists::
2452* `Q' exponent-letter::
2453* BOZ literal constants::
2454* Real array indices::
2455* Unary operators::
2456* Implicitly convert LOGICAL and INTEGER values::
2457* Hollerith constants support::
2458* Cray pointers::
2459* CONVERT specifier::
2460* OpenMP::
2461* OpenACC::
2462* Argument list functions::
2463* Read/Write after EOF marker::
2464
2465
2466File: gfortran.info,  Node: Old-style kind specifications,  Next: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2467
24686.1.1 Old-style kind specifications
2469-----------------------------------
2470
2471GNU Fortran allows old-style kind specifications in declarations.  These
2472look like:
2473           TYPESPEC*size x,y,z
2474   where `TYPESPEC' is a basic type (`INTEGER', `REAL', etc.), and
2475where `size' is a byte count corresponding to the storage size of a
2476valid kind for that type.  (For `COMPLEX' variables, `size' is the
2477total size of the real and imaginary parts.)  The statement then
2478declares `x', `y' and `z' to be of type `TYPESPEC' with the appropriate
2479kind.  This is equivalent to the standard-conforming declaration
2480           TYPESPEC(k) x,y,z
2481   where `k' is the kind parameter suitable for the intended precision.
2482As kind parameters are implementation-dependent, use the `KIND',
2483`SELECTED_INT_KIND' and `SELECTED_REAL_KIND' intrinsics to retrieve the
2484correct value, for instance `REAL*8 x' can be replaced by:
2485     INTEGER, PARAMETER :: dbl = KIND(1.0d0)
2486     REAL(KIND=dbl) :: x
2487
2488
2489File: gfortran.info,  Node: Old-style variable initialization,  Next: Extensions to namelist,  Prev: Old-style kind specifications,  Up: Extensions implemented in GNU Fortran
2490
24916.1.2 Old-style variable initialization
2492---------------------------------------
2493
2494GNU Fortran allows old-style initialization of variables of the form:
2495           INTEGER i/1/,j/2/
2496           REAL x(2,2) /3*0.,1./
2497   The syntax for the initializers is as for the `DATA' statement, but
2498unlike in a `DATA' statement, an initializer only applies to the
2499variable immediately preceding the initialization.  In other words,
2500something like `INTEGER I,J/2,3/' is not valid.  This style of
2501initialization is only allowed in declarations without double colons
2502(`::'); the double colons were introduced in Fortran 90, which also
2503introduced a standard syntax for initializing variables in type
2504declarations.
2505
2506   Examples of standard-conforming code equivalent to the above example
2507are:
2508     ! Fortran 90
2509           INTEGER :: i = 1, j = 2
2510           REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
2511     ! Fortran 77
2512           INTEGER i, j
2513           REAL x(2,2)
2514           DATA i/1/, j/2/, x/3*0.,1./
2515
2516   Note that variables which are explicitly initialized in declarations
2517or in `DATA' statements automatically acquire the `SAVE' attribute.
2518
2519
2520File: gfortran.info,  Node: Extensions to namelist,  Next: X format descriptor without count field,  Prev: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2521
25226.1.3 Extensions to namelist
2523----------------------------
2524
2525GNU Fortran fully supports the Fortran 95 standard for namelist I/O
2526including array qualifiers, substrings and fully qualified derived
2527types.  The output from a namelist write is compatible with namelist
2528read.  The output has all names in upper case and indentation to column
25291 after the namelist name.  Two extensions are permitted:
2530
2531   Old-style use of `$' instead of `&'
2532     $MYNML
2533      X(:)%Y(2) = 1.0 2.0 3.0
2534      CH(1:4) = "abcd"
2535     $END
2536
2537   It should be noted that the default terminator is `/' rather than
2538`&END'.
2539
2540   Querying of the namelist when inputting from stdin.  After at least
2541one space, entering `?' sends to stdout the namelist name and the names
2542of the variables in the namelist:
2543      ?
2544
2545     &mynml
2546      x
2547      x%y
2548      ch
2549     &end
2550
2551   Entering `=?' outputs the namelist to stdout, as if `WRITE(*,NML =
2552mynml)' had been called:
2553     =?
2554
2555     &MYNML
2556      X(1)%Y=  0.000000    ,  1.000000    ,  0.000000    ,
2557      X(2)%Y=  0.000000    ,  2.000000    ,  0.000000    ,
2558      X(3)%Y=  0.000000    ,  3.000000    ,  0.000000    ,
2559      CH=abcd,  /
2560
2561   To aid this dialog, when input is from stdin, errors send their
2562messages to stderr and execution continues, even if `IOSTAT' is set.
2563
2564   `PRINT' namelist is permitted.  This causes an error if `-std=f95'
2565is used.
2566     PROGRAM test_print
2567       REAL, dimension (4)  ::  x = (/1.0, 2.0, 3.0, 4.0/)
2568       NAMELIST /mynml/ x
2569       PRINT mynml
2570     END PROGRAM test_print
2571
2572   Expanded namelist reads are permitted.  This causes an error if
2573`-std=f95' is used.  In the following example, the first element of the
2574array will be given the value 0.00 and the two succeeding elements will
2575be given the values 1.00 and 2.00.
2576     &MYNML
2577       X(1,1) = 0.00 , 1.00 , 2.00
2578     /
2579
2580   When writing a namelist, if no `DELIM=' is specified, by default a
2581double quote is used to delimit character strings. If -std=F95, F2003,
2582or F2008, etc, the delim status is set to 'none'.  Defaulting to quotes
2583ensures that namelists with character strings can be subsequently read
2584back in accurately.
2585
2586
2587File: gfortran.info,  Node: X format descriptor without count field,  Next: Commas in FORMAT specifications,  Prev: Extensions to namelist,  Up: Extensions implemented in GNU Fortran
2588
25896.1.4 `X' format descriptor without count field
2590-----------------------------------------------
2591
2592To support legacy codes, GNU Fortran permits the count field of the `X'
2593edit descriptor in `FORMAT' statements to be omitted.  When omitted,
2594the count is implicitly assumed to be one.
2595
2596            PRINT 10, 2, 3
2597     10     FORMAT (I1, X, I1)
2598
2599
2600File: gfortran.info,  Node: Commas in FORMAT specifications,  Next: Missing period in FORMAT specifications,  Prev: X format descriptor without count field,  Up: Extensions implemented in GNU Fortran
2601
26026.1.5 Commas in `FORMAT' specifications
2603---------------------------------------
2604
2605To support legacy codes, GNU Fortran allows the comma separator to be
2606omitted immediately before and after character string edit descriptors
2607in `FORMAT' statements.
2608
2609            PRINT 10, 2, 3
2610     10     FORMAT ('FOO='I1' BAR='I2)
2611
2612
2613File: gfortran.info,  Node: Missing period in FORMAT specifications,  Next: I/O item lists,  Prev: Commas in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
2614
26156.1.6 Missing period in `FORMAT' specifications
2616-----------------------------------------------
2617
2618To support legacy codes, GNU Fortran allows missing periods in format
2619specifications if and only if `-std=legacy' is given on the command
2620line.  This is considered non-conforming code and is discouraged.
2621
2622            REAL :: value
2623            READ(*,10) value
2624     10     FORMAT ('F4')
2625
2626
2627File: gfortran.info,  Node: I/O item lists,  Next: `Q' exponent-letter,  Prev: Missing period in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
2628
26296.1.7 I/O item lists
2630--------------------
2631
2632To support legacy codes, GNU Fortran allows the input item list of the
2633`READ' statement, and the output item lists of the `WRITE' and `PRINT'
2634statements, to start with a comma.
2635
2636
2637File: gfortran.info,  Node: `Q' exponent-letter,  Next: BOZ literal constants,  Prev: I/O item lists,  Up: Extensions implemented in GNU Fortran
2638
26396.1.8 `Q' exponent-letter
2640-------------------------
2641
2642GNU Fortran accepts real literal constants with an exponent-letter of
2643`Q', for example, `1.23Q45'.  The constant is interpreted as a
2644`REAL(16)' entity on targets that support this type.  If the target
2645does not support `REAL(16)' but has a `REAL(10)' type, then the
2646real-literal-constant will be interpreted as a `REAL(10)' entity.  In
2647the absence of `REAL(16)' and `REAL(10)', an error will occur.
2648
2649
2650File: gfortran.info,  Node: BOZ literal constants,  Next: Real array indices,  Prev: `Q' exponent-letter,  Up: Extensions implemented in GNU Fortran
2651
26526.1.9 BOZ literal constants
2653---------------------------
2654
2655Besides decimal constants, Fortran also supports binary (`b'), octal
2656(`o') and hexadecimal (`z') integer constants.  The syntax is: `prefix
2657quote digits quote', were the prefix is either `b', `o' or `z', quote
2658is either `'' or `"' and the digits are for binary `0' or `1', for
2659octal between `0' and `7', and for hexadecimal between `0' and `F'.
2660(Example: `b'01011101''.)
2661
2662   Up to Fortran 95, BOZ literals were only allowed to initialize
2663integer variables in DATA statements.  Since Fortran 2003 BOZ literals
2664are also allowed as argument of `REAL', `DBLE', `INT' and `CMPLX'; the
2665result is the same as if the integer BOZ literal had been converted by
2666`TRANSFER' to, respectively, `real', `double precision', `integer' or
2667`complex'.  As GNU Fortran extension the intrinsic procedures `FLOAT',
2668`DFLOAT', `COMPLEX' and `DCMPLX' are treated alike.
2669
2670   As an extension, GNU Fortran allows hexadecimal BOZ literal
2671constants to be specified using the `X' prefix, in addition to the
2672standard `Z' prefix.  The BOZ literal can also be specified by adding a
2673suffix to the string, for example, `Z'ABC'' and `'ABC'Z' are equivalent.
2674
2675   Furthermore, GNU Fortran allows using BOZ literal constants outside
2676DATA statements and the four intrinsic functions allowed by Fortran
26772003.  In DATA statements, in direct assignments, where the right-hand
2678side only contains a BOZ literal constant, and for old-style
2679initializers of the form `integer i /o'0173'/', the constant is
2680transferred as if `TRANSFER' had been used; for `COMPLEX' numbers, only
2681the real part is initialized unless `CMPLX' is used.  In all other
2682cases, the BOZ literal constant is converted to an `INTEGER' value with
2683the largest decimal representation.  This value is then converted
2684numerically to the type and kind of the variable in question.  (For
2685instance, `real :: r = b'0000001' + 1' initializes `r' with `2.0'.) As
2686different compilers implement the extension differently, one should be
2687careful when doing bitwise initialization of non-integer variables.
2688
2689   Note that initializing an `INTEGER' variable with a statement such
2690as `DATA i/Z'FFFFFFFF'/' will give an integer overflow error rather
2691than the desired result of -1 when `i' is a 32-bit integer on a system
2692that supports 64-bit integers.  The `-fno-range-check' option can be
2693used as a workaround for legacy code that initializes integers in this
2694manner.
2695
2696
2697File: gfortran.info,  Node: Real array indices,  Next: Unary operators,  Prev: BOZ literal constants,  Up: Extensions implemented in GNU Fortran
2698
26996.1.10 Real array indices
2700-------------------------
2701
2702As an extension, GNU Fortran allows the use of `REAL' expressions or
2703variables as array indices.
2704
2705
2706File: gfortran.info,  Node: Unary operators,  Next: Implicitly convert LOGICAL and INTEGER values,  Prev: Real array indices,  Up: Extensions implemented in GNU Fortran
2707
27086.1.11 Unary operators
2709----------------------
2710
2711As an extension, GNU Fortran allows unary plus and unary minus operators
2712to appear as the second operand of binary arithmetic operators without
2713the need for parenthesis.
2714
2715            X = Y * -Z
2716
2717
2718File: gfortran.info,  Node: Implicitly convert LOGICAL and INTEGER values,  Next: Hollerith constants support,  Prev: Unary operators,  Up: Extensions implemented in GNU Fortran
2719
27206.1.12 Implicitly convert `LOGICAL' and `INTEGER' values
2721--------------------------------------------------------
2722
2723As an extension for backwards compatibility with other compilers, GNU
2724Fortran allows the implicit conversion of `LOGICAL' values to `INTEGER'
2725values and vice versa.  When converting from a `LOGICAL' to an
2726`INTEGER', `.FALSE.' is interpreted as zero, and `.TRUE.' is
2727interpreted as one.  When converting from `INTEGER' to `LOGICAL', the
2728value zero is interpreted as `.FALSE.' and any nonzero value is
2729interpreted as `.TRUE.'.
2730
2731             LOGICAL :: l
2732             l = 1
2733
2734             INTEGER :: i
2735             i = .TRUE.
2736
2737   However, there is no implicit conversion of `INTEGER' values in
2738`if'-statements, nor of `LOGICAL' or `INTEGER' values in I/O operations.
2739
2740
2741File: gfortran.info,  Node: Hollerith constants support,  Next: Cray pointers,  Prev: Implicitly convert LOGICAL and INTEGER values,  Up: Extensions implemented in GNU Fortran
2742
27436.1.13 Hollerith constants support
2744----------------------------------
2745
2746GNU Fortran supports Hollerith constants in assignments, function
2747arguments, and `DATA' and `ASSIGN' statements.  A Hollerith constant is
2748written as a string of characters preceded by an integer constant
2749indicating the character count, and the letter `H' or `h', and stored
2750in bytewise fashion in a numeric (`INTEGER', `REAL', or `complex') or
2751`LOGICAL' variable.  The constant will be padded or truncated to fit
2752the size of the variable in which it is stored.
2753
2754   Examples of valid uses of Hollerith constants:
2755           complex*16 x(2)
2756           data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
2757           x(1) = 16HABCDEFGHIJKLMNOP
2758           call foo (4h abc)
2759
2760   Invalid Hollerith constants examples:
2761           integer*4 a
2762           a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
2763           a = 0H         ! At least one character is needed.
2764
2765   In general, Hollerith constants were used to provide a rudimentary
2766facility for handling character strings in early Fortran compilers,
2767prior to the introduction of `CHARACTER' variables in Fortran 77; in
2768those cases, the standard-compliant equivalent is to convert the
2769program to use proper character strings.  On occasion, there may be a
2770case where the intent is specifically to initialize a numeric variable
2771with a given byte sequence.  In these cases, the same result can be
2772obtained by using the `TRANSFER' statement, as in this example.
2773           INTEGER(KIND=4) :: a
2774           a = TRANSFER ("abcd", a)     ! equivalent to: a = 4Habcd
2775
2776
2777File: gfortran.info,  Node: Cray pointers,  Next: CONVERT specifier,  Prev: Hollerith constants support,  Up: Extensions implemented in GNU Fortran
2778
27796.1.14 Cray pointers
2780--------------------
2781
2782Cray pointers are part of a non-standard extension that provides a
2783C-like pointer in Fortran.  This is accomplished through a pair of
2784variables: an integer "pointer" that holds a memory address, and a
2785"pointee" that is used to dereference the pointer.
2786
2787   Pointer/pointee pairs are declared in statements of the form:
2788             pointer ( <pointer> , <pointee> )
2789   or,
2790             pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
2791   The pointer is an integer that is intended to hold a memory address.
2792The pointee may be an array or scalar.  A pointee can be an assumed
2793size array--that is, the last dimension may be left unspecified by
2794using a `*' in place of a value--but a pointee cannot be an assumed
2795shape array.  No space is allocated for the pointee.
2796
2797   The pointee may have its type declared before or after the pointer
2798statement, and its array specification (if any) may be declared before,
2799during, or after the pointer statement.  The pointer may be declared as
2800an integer prior to the pointer statement.  However, some machines have
2801default integer sizes that are different than the size of a pointer,
2802and so the following code is not portable:
2803             integer ipt
2804             pointer (ipt, iarr)
2805   If a pointer is declared with a kind that is too small, the compiler
2806will issue a warning; the resulting binary will probably not work
2807correctly, because the memory addresses stored in the pointers may be
2808truncated.  It is safer to omit the first line of the above example; if
2809explicit declaration of ipt's type is omitted, then the compiler will
2810ensure that ipt is an integer variable large enough to hold a pointer.
2811
2812   Pointer arithmetic is valid with Cray pointers, but it is not the
2813same as C pointer arithmetic.  Cray pointers are just ordinary
2814integers, so the user is responsible for determining how many bytes to
2815add to a pointer in order to increment it.  Consider the following
2816example:
2817             real target(10)
2818             real pointee(10)
2819             pointer (ipt, pointee)
2820             ipt = loc (target)
2821             ipt = ipt + 1
2822   The last statement does not set `ipt' to the address of `target(1)',
2823as it would in C pointer arithmetic.  Adding `1' to `ipt' just adds one
2824byte to the address stored in `ipt'.
2825
2826   Any expression involving the pointee will be translated to use the
2827value stored in the pointer as the base address.
2828
2829   To get the address of elements, this extension provides an intrinsic
2830function `LOC()'.  The `LOC()' function is equivalent to the `&'
2831operator in C, except the address is cast to an integer type:
2832             real ar(10)
2833             pointer(ipt, arpte(10))
2834             real arpte
2835             ipt = loc(ar)  ! Makes arpte is an alias for ar
2836             arpte(1) = 1.0 ! Sets ar(1) to 1.0
2837   The pointer can also be set by a call to the `MALLOC' intrinsic (see
2838*note MALLOC::).
2839
2840   Cray pointees often are used to alias an existing variable.  For
2841example:
2842             integer target(10)
2843             integer iarr(10)
2844             pointer (ipt, iarr)
2845             ipt = loc(target)
2846   As long as `ipt' remains unchanged, `iarr' is now an alias for
2847`target'.  The optimizer, however, will not detect this aliasing, so it
2848is unsafe to use `iarr' and `target' simultaneously.  Using a pointee
2849in any way that violates the Fortran aliasing rules or assumptions is
2850illegal.  It is the user's responsibility to avoid doing this; the
2851compiler works under the assumption that no such aliasing occurs.
2852
2853   Cray pointers will work correctly when there is no aliasing (i.e.,
2854when they are used to access a dynamically allocated block of memory),
2855and also in any routine where a pointee is used, but any variable with
2856which it shares storage is not used.  Code that violates these rules
2857may not run as the user intends.  This is not a bug in the optimizer;
2858any code that violates the aliasing rules is illegal.  (Note that this
2859is not unique to GNU Fortran; any Fortran compiler that supports Cray
2860pointers will "incorrectly" optimize code with illegal aliasing.)
2861
2862   There are a number of restrictions on the attributes that can be
2863applied to Cray pointers and pointees.  Pointees may not have the
2864`ALLOCATABLE', `INTENT', `OPTIONAL', `DUMMY', `TARGET', `INTRINSIC', or
2865`POINTER' attributes.  Pointers may not have the `DIMENSION',
2866`POINTER', `TARGET', `ALLOCATABLE', `EXTERNAL', or `INTRINSIC'
2867attributes, nor may they be function results.  Pointees may not occur
2868in more than one pointer statement.  A pointee cannot be a pointer.
2869Pointees cannot occur in equivalence, common, or data statements.
2870
2871   A Cray pointer may also point to a function or a subroutine.  For
2872example, the following excerpt is valid:
2873       implicit none
2874       external sub
2875       pointer (subptr,subpte)
2876       external subpte
2877       subptr = loc(sub)
2878       call subpte()
2879       [...]
2880       subroutine sub
2881       [...]
2882       end subroutine sub
2883
2884   A pointer may be modified during the course of a program, and this
2885will change the location to which the pointee refers.  However, when
2886pointees are passed as arguments, they are treated as ordinary
2887variables in the invoked function.  Subsequent changes to the pointer
2888will not change the base address of the array that was passed.
2889
2890
2891File: gfortran.info,  Node: CONVERT specifier,  Next: OpenMP,  Prev: Cray pointers,  Up: Extensions implemented in GNU Fortran
2892
28936.1.15 `CONVERT' specifier
2894--------------------------
2895
2896GNU Fortran allows the conversion of unformatted data between little-
2897and big-endian representation to facilitate moving of data between
2898different systems.  The conversion can be indicated with the `CONVERT'
2899specifier on the `OPEN' statement.  *Note GFORTRAN_CONVERT_UNIT::, for
2900an alternative way of specifying the data format via an environment
2901variable.
2902
2903   Valid values for `CONVERT' are:
2904     `CONVERT='NATIVE'' Use the native format.  This is the default.
2905
2906     `CONVERT='SWAP'' Swap between little- and big-endian.
2907
2908     `CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
2909     unformatted files.
2910
2911     `CONVERT='BIG_ENDIAN'' Use the big-endian representation for
2912     unformatted files.
2913
2914   Using the option could look like this:
2915       open(file='big.dat',form='unformatted',access='sequential', &
2916            convert='big_endian')
2917
2918   The value of the conversion can be queried by using
2919`INQUIRE(CONVERT=ch)'.  The values returned are `'BIG_ENDIAN'' and
2920`'LITTLE_ENDIAN''.
2921
2922   `CONVERT' works between big- and little-endian for `INTEGER' values
2923of all supported kinds and for `REAL' on IEEE systems of kinds 4 and 8.
2924Conversion between different "extended double" types on different
2925architectures such as m68k and x86_64, which GNU Fortran supports as
2926`REAL(KIND=10)' and `REAL(KIND=16)', will probably not work.
2927
2928   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
2929environment variable will override the CONVERT specifier in the open
2930statement_.  This is to give control over data formats to users who do
2931not have the source code of their program available.
2932
2933   Using anything but the native representation for unformatted data
2934carries a significant speed overhead.  If speed in this area matters to
2935you, it is best if you use this only for data that needs to be portable.
2936
2937
2938File: gfortran.info,  Node: OpenMP,  Next: OpenACC,  Prev: CONVERT specifier,  Up: Extensions implemented in GNU Fortran
2939
29406.1.16 OpenMP
2941-------------
2942
2943OpenMP (Open Multi-Processing) is an application programming interface
2944(API) that supports multi-platform shared memory multiprocessing
2945programming in C/C++ and Fortran on many architectures, including Unix
2946and Microsoft Windows platforms.  It consists of a set of compiler
2947directives, library routines, and environment variables that influence
2948run-time behavior.
2949
2950   GNU Fortran strives to be compatible to the OpenMP Application
2951Program Interface v4.0 (http://openmp.org/wp/openmp-specifications/).
2952
2953   To enable the processing of the OpenMP directive `!$omp' in
2954free-form source code; the `c$omp', `*$omp' and `!$omp' directives in
2955fixed form; the `!$' conditional compilation sentinels in free form;
2956and the `c$', `*$' and `!$' sentinels in fixed form, `gfortran' needs
2957to be invoked with the `-fopenmp'.  This also arranges for automatic
2958linking of the GNU Offloading and Multi Processing Runtime Library
2959*note libgomp: (libgomp)Top.
2960
2961   The OpenMP Fortran runtime library routines are provided both in a
2962form of a Fortran 90 module named `omp_lib' and in a form of a Fortran
2963`include' file named `omp_lib.h'.
2964
2965   An example of a parallelized loop taken from Appendix A.1 of the
2966OpenMP Application Program Interface v2.5:
2967     SUBROUTINE A1(N, A, B)
2968       INTEGER I, N
2969       REAL B(N), A(N)
2970     !$OMP PARALLEL DO !I is private by default
2971       DO I=2,N
2972         B(I) = (A(I) + A(I-1)) / 2.0
2973       ENDDO
2974     !$OMP END PARALLEL DO
2975     END SUBROUTINE A1
2976
2977   Please note:
2978   * `-fopenmp' implies `-frecursive', i.e., all local arrays will be
2979     allocated on the stack.  When porting existing code to OpenMP,
2980     this may lead to surprising results, especially to segmentation
2981     faults if the stacksize is limited.
2982
2983   * On glibc-based systems, OpenMP enabled applications cannot be
2984     statically linked due to limitations of the underlying
2985     pthreads-implementation.  It might be possible to get a working
2986     solution if `-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
2987     is added to the command line.  However, this is not supported by
2988     `gcc' and thus not recommended.
2989
2990
2991File: gfortran.info,  Node: OpenACC,  Next: Argument list functions,  Prev: OpenMP,  Up: Extensions implemented in GNU Fortran
2992
29936.1.17 OpenACC
2994--------------
2995
2996OpenACC is an application programming interface (API) that supports
2997offloading of code to accelerator devices.  It consists of a set of
2998compiler directives, library routines, and environment variables that
2999influence run-time behavior.
3000
3001   GNU Fortran strives to be compatible to the OpenACC Application
3002Programming Interface v2.0 (http://www.openacc.org/).
3003
3004   To enable the processing of the OpenACC directive `!$acc' in
3005free-form source code; the `c$acc', `*$acc' and `!$acc' directives in
3006fixed form; the `!$' conditional compilation sentinels in free form;
3007and the `c$', `*$' and `!$' sentinels in fixed form, `gfortran' needs
3008to be invoked with the `-fopenacc'.  This also arranges for automatic
3009linking of the GNU Offloading and Multi Processing Runtime Library
3010*note libgomp: (libgomp)Top.
3011
3012   The OpenACC Fortran runtime library routines are provided both in a
3013form of a Fortran 90 module named `openacc' and in a form of a Fortran
3014`include' file named `openacc_lib.h'.
3015
3016   Note that this is an experimental feature, incomplete, and subject to
3017change in future versions of GCC.  See
3018`https://gcc.gnu.org/wiki/OpenACC' for more information.
3019
3020
3021File: gfortran.info,  Node: Argument list functions,  Next: Read/Write after EOF marker,  Prev: OpenACC,  Up: Extensions implemented in GNU Fortran
3022
30236.1.18 Argument list functions `%VAL', `%REF' and `%LOC'
3024--------------------------------------------------------
3025
3026GNU Fortran supports argument list functions `%VAL', `%REF' and `%LOC'
3027statements, for backward compatibility with g77.  It is recommended
3028that these should be used only for code that is accessing facilities
3029outside of GNU Fortran, such as operating system or windowing
3030facilities.  It is best to constrain such uses to isolated portions of
3031a program-portions that deal specifically and exclusively with
3032low-level, system-dependent facilities.  Such portions might well
3033provide a portable interface for use by the program as a whole, but are
3034themselves not portable, and should be thoroughly tested each time they
3035are rebuilt using a new compiler or version of a compiler.
3036
3037   `%VAL' passes a scalar argument by value, `%REF' passes it by
3038reference and `%LOC' passes its memory location.  Since gfortran
3039already passes scalar arguments by reference, `%REF' is in effect a
3040do-nothing.  `%LOC' has the same effect as a Fortran pointer.
3041
3042   An example of passing an argument by value to a C subroutine foo.:
3043     C
3044     C prototype      void foo_ (float x);
3045     C
3046           external foo
3047           real*4 x
3048           x = 3.14159
3049           call foo (%VAL (x))
3050           end
3051
3052   For details refer to the g77 manual
3053`https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top'.
3054
3055   Also, `c_by_val.f' and its partner `c_by_val.c' of the GNU Fortran
3056testsuite are worth a look.
3057
3058
3059File: gfortran.info,  Node: Read/Write after EOF marker,  Prev: Argument list functions,  Up: Extensions implemented in GNU Fortran
3060
30616.1.19 Read/Write after EOF marker
3062----------------------------------
3063
3064Some legacy codes rely on allowing `READ' or `WRITE' after the EOF file
3065marker in order to find the end of a file. GNU Fortran normally rejects
3066these codes with a run-time error message and suggests the user
3067consider `BACKSPACE' or `REWIND' to properly position the file before
3068the EOF marker.  As an extension, the run-time error may be disabled
3069using -std=legacy.
3070
3071
3072File: gfortran.info,  Node: Extensions not implemented in GNU Fortran,  Prev: Extensions implemented in GNU Fortran,  Up: Extensions
3073
30746.2 Extensions not implemented in GNU Fortran
3075=============================================
3076
3077The long history of the Fortran language, its wide use and broad
3078userbase, the large number of different compiler vendors and the lack of
3079some features crucial to users in the first standards have lead to the
3080existence of a number of important extensions to the language.  While
3081some of the most useful or popular extensions are supported by the GNU
3082Fortran compiler, not all existing extensions are supported.  This
3083section aims at listing these extensions and offering advice on how
3084best make code that uses them running with the GNU Fortran compiler.
3085
3086* Menu:
3087
3088* STRUCTURE and RECORD::
3089* ENCODE and DECODE statements::
3090* Variable FORMAT expressions::
3091* Alternate complex function syntax::
3092* Volatile COMMON blocks::
3093
3094
3095File: gfortran.info,  Node: STRUCTURE and RECORD,  Next: ENCODE and DECODE statements,  Up: Extensions not implemented in GNU Fortran
3096
30976.2.1 `STRUCTURE' and `RECORD'
3098------------------------------
3099
3100Record structures are a pre-Fortran-90 vendor extension to create
3101user-defined aggregate data types.  GNU Fortran does not support record
3102structures, only Fortran 90's "derived types", which have a different
3103syntax.
3104
3105   In many cases, record structures can easily be converted to derived
3106types.  To convert, replace `STRUCTURE /'STRUCTURE-NAME`/' by `TYPE'
3107TYPE-NAME.  Additionally, replace `RECORD /'STRUCTURE-NAME`/' by
3108`TYPE('TYPE-NAME`)'. Finally, in the component access, replace the
3109period (`.') by the percent sign (`%').
3110
3111   Here is an example of code using the non portable record structure
3112syntax:
3113
3114     ! Declaring a structure named ``item'' and containing three fields:
3115     ! an integer ID, an description string and a floating-point price.
3116     STRUCTURE /item/
3117       INTEGER id
3118       CHARACTER(LEN=200) description
3119       REAL price
3120     END STRUCTURE
3121
3122     ! Define two variables, an single record of type ``item''
3123     ! named ``pear'', and an array of items named ``store_catalog''
3124     RECORD /item/ pear, store_catalog(100)
3125
3126     ! We can directly access the fields of both variables
3127     pear.id = 92316
3128     pear.description = "juicy D'Anjou pear"
3129     pear.price = 0.15
3130     store_catalog(7).id = 7831
3131     store_catalog(7).description = "milk bottle"
3132     store_catalog(7).price = 1.2
3133
3134     ! We can also manipulate the whole structure
3135     store_catalog(12) = pear
3136     print *, store_catalog(12)
3137
3138This code can easily be rewritten in the Fortran 90 syntax as following:
3139
3140     ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
3141     ! ``TYPE name ... END TYPE''
3142     TYPE item
3143       INTEGER id
3144       CHARACTER(LEN=200) description
3145       REAL price
3146     END TYPE
3147
3148     ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
3149     TYPE(item) pear, store_catalog(100)
3150
3151     ! Instead of using a dot (.) to access fields of a record, the
3152     ! standard syntax uses a percent sign (%)
3153     pear%id = 92316
3154     pear%description = "juicy D'Anjou pear"
3155     pear%price = 0.15
3156     store_catalog(7)%id = 7831
3157     store_catalog(7)%description = "milk bottle"
3158     store_catalog(7)%price = 1.2
3159
3160     ! Assignments of a whole variable do not change
3161     store_catalog(12) = pear
3162     print *, store_catalog(12)
3163
3164
3165File: gfortran.info,  Node: ENCODE and DECODE statements,  Next: Variable FORMAT expressions,  Prev: STRUCTURE and RECORD,  Up: Extensions not implemented in GNU Fortran
3166
31676.2.2 `ENCODE' and `DECODE' statements
3168--------------------------------------
3169
3170GNU Fortran does not support the `ENCODE' and `DECODE' statements.
3171These statements are best replaced by `READ' and `WRITE' statements
3172involving internal files (`CHARACTER' variables and arrays), which have
3173been part of the Fortran standard since Fortran 77.  For example,
3174replace a code fragment like
3175
3176           INTEGER*1 LINE(80)
3177           REAL A, B, C
3178     c     ... Code that sets LINE
3179           DECODE (80, 9000, LINE) A, B, C
3180      9000 FORMAT (1X, 3(F10.5))
3181
3182with the following:
3183
3184           CHARACTER(LEN=80) LINE
3185           REAL A, B, C
3186     c     ... Code that sets LINE
3187           READ (UNIT=LINE, FMT=9000) A, B, C
3188      9000 FORMAT (1X, 3(F10.5))
3189
3190   Similarly, replace a code fragment like
3191
3192           INTEGER*1 LINE(80)
3193           REAL A, B, C
3194     c     ... Code that sets A, B and C
3195           ENCODE (80, 9000, LINE) A, B, C
3196      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
3197
3198with the following:
3199
3200           CHARACTER(LEN=80) LINE
3201           REAL A, B, C
3202     c     ... Code that sets A, B and C
3203           WRITE (UNIT=LINE, FMT=9000) A, B, C
3204      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
3205
3206
3207File: gfortran.info,  Node: Variable FORMAT expressions,  Next: Alternate complex function syntax,  Prev: ENCODE and DECODE statements,  Up: Extensions not implemented in GNU Fortran
3208
32096.2.3 Variable `FORMAT' expressions
3210-----------------------------------
3211
3212A variable `FORMAT' expression is format statement which includes angle
3213brackets enclosing a Fortran expression: `FORMAT(I<N>)'.  GNU Fortran
3214does not support this legacy extension.  The effect of variable format
3215expressions can be reproduced by using the more powerful (and standard)
3216combination of internal output and string formats.  For example,
3217replace a code fragment like this:
3218
3219           WRITE(6,20) INT1
3220      20   FORMAT(I<N+1>)
3221
3222with the following:
3223
3224     c     Variable declaration
3225           CHARACTER(LEN=20) FMT
3226     c
3227     c     Other code here...
3228     c
3229           WRITE(FMT,'("(I", I0, ")")') N+1
3230           WRITE(6,FMT) INT1
3231
3232or with:
3233
3234     c     Variable declaration
3235           CHARACTER(LEN=20) FMT
3236     c
3237     c     Other code here...
3238     c
3239           WRITE(FMT,*) N+1
3240           WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
3241
3242
3243File: gfortran.info,  Node: Alternate complex function syntax,  Next: Volatile COMMON blocks,  Prev: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
3244
32456.2.4 Alternate complex function syntax
3246---------------------------------------
3247
3248Some Fortran compilers, including `g77', let the user declare complex
3249functions with the syntax `COMPLEX FUNCTION name*16()', as well as
3250`COMPLEX*16 FUNCTION name()'.  Both are non-standard, legacy
3251extensions.  `gfortran' accepts the latter form, which is more common,
3252but not the former.
3253
3254
3255File: gfortran.info,  Node: Volatile COMMON blocks,  Prev: Alternate complex function syntax,  Up: Extensions not implemented in GNU Fortran
3256
32576.2.5 Volatile `COMMON' blocks
3258------------------------------
3259
3260Some Fortran compilers, including `g77', let the user declare `COMMON'
3261with the `VOLATILE' attribute. This is invalid standard Fortran syntax
3262and is not supported by `gfortran'.  Note that `gfortran' accepts
3263`VOLATILE' variables in `COMMON' blocks since revision 4.3.
3264
3265
3266File: gfortran.info,  Node: Mixed-Language Programming,  Next: Coarray Programming,  Prev: Extensions,  Up: Top
3267
32687 Mixed-Language Programming
3269****************************
3270
3271* Menu:
3272
3273* Interoperability with C::
3274* GNU Fortran Compiler Directives::
3275* Non-Fortran Main Program::
3276* Naming and argument-passing conventions::
3277
3278   This chapter is about mixed-language interoperability, but also
3279applies if one links Fortran code compiled by different compilers.  In
3280most cases, use of the C Binding features of the Fortran 2003 standard
3281is sufficient, and their use is highly recommended.
3282
3283
3284File: gfortran.info,  Node: Interoperability with C,  Next: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
3285
32867.1 Interoperability with C
3287===========================
3288
3289* Menu:
3290
3291* Intrinsic Types::
3292* Derived Types and struct::
3293* Interoperable Global Variables::
3294* Interoperable Subroutines and Functions::
3295* Working with Pointers::
3296* Further Interoperability of Fortran with C::
3297
3298   Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized
3299way to generate procedure and derived-type declarations and global
3300variables which are interoperable with C (ISO/IEC 9899:1999).  The
3301`bind(C)' attribute has been added to inform the compiler that a symbol
3302shall be interoperable with C; also, some constraints are added.  Note,
3303however, that not all C features have a Fortran equivalent or vice
3304versa.  For instance, neither C's unsigned integers nor C's functions
3305with variable number of arguments have an equivalent in Fortran.
3306
3307   Note that array dimensions are reversely ordered in C and that
3308arrays in C always start with index 0 while in Fortran they start by
3309default with 1.  Thus, an array declaration `A(n,m)' in Fortran matches
3310`A[m][n]' in C and accessing the element `A(i,j)' matches
3311`A[j-1][i-1]'.  The element following `A(i,j)' (C: `A[j-1][i-1]';
3312assuming i < n) in memory is `A(i+1,j)' (C: `A[j-1][i]').
3313
3314
3315File: gfortran.info,  Node: Intrinsic Types,  Next: Derived Types and struct,  Up: Interoperability with C
3316
33177.1.1 Intrinsic Types
3318---------------------
3319
3320In order to ensure that exactly the same variable type and kind is used
3321in C and Fortran, the named constants shall be used which are defined
3322in the `ISO_C_BINDING' intrinsic module.  That module contains named
3323constants for kind parameters and character named constants for the
3324escape sequences in C.  For a list of the constants, see *note
3325ISO_C_BINDING::.
3326
3327   For logical types, please note that the Fortran standard only
3328guarantees interoperability between C99's `_Bool' and Fortran's
3329`C_Bool'-kind logicals and C99 defines that `true' has the value 1 and
3330`false' the value 0.  Using any other integer value with GNU Fortran's
3331`LOGICAL' (with any kind parameter) gives an undefined result.
3332(Passing other integer values than 0 and 1 to GCC's `_Bool' is also
3333undefined, unless the integer is explicitly or implicitly casted to
3334`_Bool'.)
3335
3336
3337File: gfortran.info,  Node: Derived Types and struct,  Next: Interoperable Global Variables,  Prev: Intrinsic Types,  Up: Interoperability with C
3338
33397.1.2 Derived Types and struct
3340------------------------------
3341
3342For compatibility of derived types with `struct', one needs to use the
3343`BIND(C)' attribute in the type declaration.  For instance, the
3344following type declaration
3345
3346      USE ISO_C_BINDING
3347      TYPE, BIND(C) :: myType
3348        INTEGER(C_INT) :: i1, i2
3349        INTEGER(C_SIGNED_CHAR) :: i3
3350        REAL(C_DOUBLE) :: d1
3351        COMPLEX(C_FLOAT_COMPLEX) :: c1
3352        CHARACTER(KIND=C_CHAR) :: str(5)
3353      END TYPE
3354
3355   matches the following `struct' declaration in C
3356
3357      struct {
3358        int i1, i2;
3359        /* Note: "char" might be signed or unsigned.  */
3360        signed char i3;
3361        double d1;
3362        float _Complex c1;
3363        char str[5];
3364      } myType;
3365
3366   Derived types with the C binding attribute shall not have the
3367`sequence' attribute, type parameters, the `extends' attribute, nor
3368type-bound procedures.  Every component must be of interoperable type
3369and kind and may not have the `pointer' or `allocatable' attribute.
3370The names of the components are irrelevant for interoperability.
3371
3372   As there exist no direct Fortran equivalents, neither unions nor
3373structs with bit field or variable-length array members are
3374interoperable.
3375
3376
3377File: gfortran.info,  Node: Interoperable Global Variables,  Next: Interoperable Subroutines and Functions,  Prev: Derived Types and struct,  Up: Interoperability with C
3378
33797.1.3 Interoperable Global Variables
3380------------------------------------
3381
3382Variables can be made accessible from C using the C binding attribute,
3383optionally together with specifying a binding name.  Those variables
3384have to be declared in the declaration part of a `MODULE', be of
3385interoperable type, and have neither the `pointer' nor the
3386`allocatable' attribute.
3387
3388       MODULE m
3389         USE myType_module
3390         USE ISO_C_BINDING
3391         integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
3392         type(myType), bind(C) :: tp
3393       END MODULE
3394
3395   Here, `_MyProject_flags' is the case-sensitive name of the variable
3396as seen from C programs while `global_flag' is the case-insensitive
3397name as seen from Fortran.  If no binding name is specified, as for TP,
3398the C binding name is the (lowercase) Fortran binding name.  If a
3399binding name is specified, only a single variable may be after the
3400double colon.  Note of warning: You cannot use a global variable to
3401access ERRNO of the C library as the C standard allows it to be a
3402macro.  Use the `IERRNO' intrinsic (GNU extension) instead.
3403
3404
3405File: gfortran.info,  Node: Interoperable Subroutines and Functions,  Next: Working with Pointers,  Prev: Interoperable Global Variables,  Up: Interoperability with C
3406
34077.1.4 Interoperable Subroutines and Functions
3408---------------------------------------------
3409
3410Subroutines and functions have to have the `BIND(C)' attribute to be
3411compatible with C.  The dummy argument declaration is relatively
3412straightforward.  However, one needs to be careful because C uses
3413call-by-value by default while Fortran behaves usually similar to
3414call-by-reference.  Furthermore, strings and pointers are handled
3415differently.  Note that in Fortran 2003 and 2008 only explicit size and
3416assumed-size arrays are supported but not assumed-shape or
3417deferred-shape (i.e. allocatable or pointer) arrays.  However, those
3418are allowed since the Technical Specification 29113, see *note Further
3419Interoperability of Fortran with C::
3420
3421   To pass a variable by value, use the `VALUE' attribute.  Thus, the
3422following C prototype
3423
3424     `int func(int i, int *j)'
3425
3426   matches the Fortran declaration
3427
3428       integer(c_int) function func(i,j)
3429         use iso_c_binding, only: c_int
3430         integer(c_int), VALUE :: i
3431         integer(c_int) :: j
3432
3433   Note that pointer arguments also frequently need the `VALUE'
3434attribute, see *note Working with Pointers::.
3435
3436   Strings are handled quite differently in C and Fortran.  In C a
3437string is a `NUL'-terminated array of characters while in Fortran each
3438string has a length associated with it and is thus not terminated (by
3439e.g.  `NUL').  For example, if one wants to use the following C
3440function,
3441
3442       #include <stdio.h>
3443       void print_C(char *string) /* equivalent: char string[]  */
3444       {
3445          printf("%s\n", string);
3446       }
3447
3448   to print "Hello World" from Fortran, one can call it using
3449
3450       use iso_c_binding, only: C_CHAR, C_NULL_CHAR
3451       interface
3452         subroutine print_c(string) bind(C, name="print_C")
3453           use iso_c_binding, only: c_char
3454           character(kind=c_char) :: string(*)
3455         end subroutine print_c
3456       end interface
3457       call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
3458
3459   As the example shows, one needs to ensure that the string is `NUL'
3460terminated.  Additionally, the dummy argument STRING of `print_C' is a
3461length-one assumed-size array; using `character(len=*)' is not allowed.
3462The example above uses `c_char_"Hello World"' to ensure the string
3463literal has the right type; typically the default character kind and
3464`c_char' are the same and thus `"Hello World"' is equivalent.  However,
3465the standard does not guarantee this.
3466
3467   The use of strings is now further illustrated using the C library
3468function `strncpy', whose prototype is
3469
3470       char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
3471
3472   The function `strncpy' copies at most N characters from string S2 to
3473S1 and returns S1.  In the following example, we ignore the return
3474value:
3475
3476       use iso_c_binding
3477       implicit none
3478       character(len=30) :: str,str2
3479       interface
3480         ! Ignore the return value of strncpy -> subroutine
3481         ! "restrict" is always assumed if we do not pass a pointer
3482         subroutine strncpy(dest, src, n) bind(C)
3483           import
3484           character(kind=c_char),  intent(out) :: dest(*)
3485           character(kind=c_char),  intent(in)  :: src(*)
3486           integer(c_size_t), value, intent(in) :: n
3487         end subroutine strncpy
3488       end interface
3489       str = repeat('X',30) ! Initialize whole string with 'X'
3490       call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
3491                    len(c_char_"Hello World",kind=c_size_t))
3492       print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
3493       end
3494
3495   The intrinsic procedures are described in *note Intrinsic
3496Procedures::.
3497
3498
3499File: gfortran.info,  Node: Working with Pointers,  Next: Further Interoperability of Fortran with C,  Prev: Interoperable Subroutines and Functions,  Up: Interoperability with C
3500
35017.1.5 Working with Pointers
3502---------------------------
3503
3504C pointers are represented in Fortran via the special opaque derived
3505type `type(c_ptr)' (with private components).  Thus one needs to use
3506intrinsic conversion procedures to convert from or to C pointers.
3507
3508   For some applications, using an assumed type (`TYPE(*)') can be an
3509alternative to a C pointer; see *note Further Interoperability of
3510Fortran with C::.
3511
3512   For example,
3513
3514       use iso_c_binding
3515       type(c_ptr) :: cptr1, cptr2
3516       integer, target :: array(7), scalar
3517       integer, pointer :: pa(:), ps
3518       cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
3519                               ! array is contiguous if required by the C
3520                               ! procedure
3521       cptr2 = c_loc(scalar)
3522       call c_f_pointer(cptr2, ps)
3523       call c_f_pointer(cptr2, pa, shape=[7])
3524
3525   When converting C to Fortran arrays, the one-dimensional `SHAPE'
3526argument has to be passed.
3527
3528   If a pointer is a dummy-argument of an interoperable procedure, it
3529usually has to be declared using the `VALUE' attribute.  `void*'
3530matches `TYPE(C_PTR), VALUE', while `TYPE(C_PTR)' alone matches
3531`void**'.
3532
3533   Procedure pointers are handled analogously to pointers; the C type is
3534`TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
3535`C_F_PROCPOINTER' and `C_FUNLOC'.
3536
3537   Let us consider two examples of actually passing a procedure pointer
3538from C to Fortran and vice versa.  Note that these examples are also
3539very similar to passing ordinary pointers between both languages. First,
3540consider this code in C:
3541
3542     /* Procedure implemented in Fortran.  */
3543     void get_values (void (*)(double));
3544
3545     /* Call-back routine we want called from Fortran.  */
3546     void
3547     print_it (double x)
3548     {
3549       printf ("Number is %f.\n", x);
3550     }
3551
3552     /* Call Fortran routine and pass call-back to it.  */
3553     void
3554     foobar ()
3555     {
3556       get_values (&print_it);
3557     }
3558
3559   A matching implementation for `get_values' in Fortran, that correctly
3560receives the procedure pointer from C and is able to call it, is given
3561in the following `MODULE':
3562
3563     MODULE m
3564       IMPLICIT NONE
3565
3566       ! Define interface of call-back routine.
3567       ABSTRACT INTERFACE
3568         SUBROUTINE callback (x)
3569           USE, INTRINSIC :: ISO_C_BINDING
3570           REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
3571         END SUBROUTINE callback
3572       END INTERFACE
3573
3574     CONTAINS
3575
3576       ! Define C-bound procedure.
3577       SUBROUTINE get_values (cproc) BIND(C)
3578         USE, INTRINSIC :: ISO_C_BINDING
3579         TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
3580
3581         PROCEDURE(callback), POINTER :: proc
3582
3583         ! Convert C to Fortran procedure pointer.
3584         CALL C_F_PROCPOINTER (cproc, proc)
3585
3586         ! Call it.
3587         CALL proc (1.0_C_DOUBLE)
3588         CALL proc (-42.0_C_DOUBLE)
3589         CALL proc (18.12_C_DOUBLE)
3590       END SUBROUTINE get_values
3591
3592     END MODULE m
3593
3594   Next, we want to call a C routine that expects a procedure pointer
3595argument and pass it a Fortran procedure (which clearly must be
3596interoperable!).  Again, the C function may be:
3597
3598     int
3599     call_it (int (*func)(int), int arg)
3600     {
3601       return func (arg);
3602     }
3603
3604   It can be used as in the following Fortran code:
3605
3606     MODULE m
3607       USE, INTRINSIC :: ISO_C_BINDING
3608       IMPLICIT NONE
3609
3610       ! Define interface of C function.
3611       INTERFACE
3612         INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
3613           USE, INTRINSIC :: ISO_C_BINDING
3614           TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
3615           INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
3616         END FUNCTION call_it
3617       END INTERFACE
3618
3619     CONTAINS
3620
3621       ! Define procedure passed to C function.
3622       ! It must be interoperable!
3623       INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
3624         INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
3625         double_it = arg + arg
3626       END FUNCTION double_it
3627
3628       ! Call C function.
3629       SUBROUTINE foobar ()
3630         TYPE(C_FUNPTR) :: cproc
3631         INTEGER(KIND=C_INT) :: i
3632
3633         ! Get C procedure pointer.
3634         cproc = C_FUNLOC (double_it)
3635
3636         ! Use it.
3637         DO i = 1_C_INT, 10_C_INT
3638           PRINT *, call_it (cproc, i)
3639         END DO
3640       END SUBROUTINE foobar
3641
3642     END MODULE m
3643
3644
3645File: gfortran.info,  Node: Further Interoperability of Fortran with C,  Prev: Working with Pointers,  Up: Interoperability with C
3646
36477.1.6 Further Interoperability of Fortran with C
3648------------------------------------------------
3649
3650The Technical Specification ISO/IEC TS 29113:2012 on further
3651interoperability of Fortran with C extends the interoperability support
3652of Fortran 2003 and Fortran 2008. Besides removing some restrictions
3653and constraints, it adds assumed-type (`TYPE(*)') and assumed-rank
3654(`dimension') variables and allows for interoperability of
3655assumed-shape, assumed-rank and deferred-shape arrays, including
3656allocatables and pointers.
3657
3658   Note: Currently, GNU Fortran does not support the array descriptor
3659(dope vector) as specified in the Technical Specification, but uses an
3660array descriptor with different fields. The Chasm Language
3661Interoperability Tools, `http://chasm-interop.sourceforge.net/',
3662provide an interface to GNU Fortran's array descriptor.
3663
3664   The Technical Specification adds the following new features, which
3665are supported by GNU Fortran:
3666
3667   * The `ASYNCHRONOUS' attribute has been clarified and extended to
3668     allow its use with asynchronous communication in user-provided
3669     libraries such as in implementations of the Message Passing
3670     Interface specification.
3671
3672   * Many constraints have been relaxed, in particular for the `C_LOC'
3673     and `C_F_POINTER' intrinsics.
3674
3675   * The `OPTIONAL' attribute is now allowed for dummy arguments; an
3676     absent argument matches a `NULL' pointer.
3677
3678   * Assumed types (`TYPE(*)') have been added, which may only be used
3679     for dummy arguments.  They are unlimited polymorphic but contrary
3680     to `CLASS(*)' they do not contain any type information, similar to
3681     C's `void *' pointers.  Expressions of any type and kind can be
3682     passed; thus, it can be used as replacement for `TYPE(C_PTR)',
3683     avoiding the use of `C_LOC' in the caller.
3684
3685     Note, however, that `TYPE(*)' only accepts scalar arguments,
3686     unless the `DIMENSION' is explicitly specified.  As `DIMENSION(*)'
3687     only supports array (including array elements) but no scalars, it
3688     is not a full replacement for `C_LOC'.  On the other hand,
3689     assumed-type assumed-rank dummy arguments (`TYPE(*),
3690     DIMENSION(..)') allow for both scalars and arrays, but require
3691     special code on the callee side to handle the array descriptor.
3692
3693   * Assumed-rank arrays (`DIMENSION(..)') as dummy argument allow that
3694     scalars and arrays of any rank can be passed as actual argument.
3695     As the Technical Specification does not provide for direct means
3696     to operate with them, they have to be used either from the C side
3697     or be converted using `C_LOC' and `C_F_POINTER' to scalars or
3698     arrays of a specific rank. The rank can be determined using the
3699     `RANK' intrinisic.
3700
3701   Currently unimplemented:
3702
3703   * GNU Fortran always uses an array descriptor, which does not match
3704     the one of the Technical Specification. The
3705     `ISO_Fortran_binding.h' header file and the C functions it
3706     specifies are not available.
3707
3708   * Using assumed-shape, assumed-rank and deferred-shape arrays in
3709     `BIND(C)' procedures is not fully supported. In particular, C
3710     interoperable strings of other length than one are not supported
3711     as this requires the new array descriptor.
3712
3713
3714File: gfortran.info,  Node: GNU Fortran Compiler Directives,  Next: Non-Fortran Main Program,  Prev: Interoperability with C,  Up: Mixed-Language Programming
3715
37167.2 GNU Fortran Compiler Directives
3717===================================
3718
3719The Fortran standard describes how a conforming program shall behave;
3720however, the exact implementation is not standardized.  In order to
3721allow the user to choose specific implementation details, compiler
3722directives can be used to set attributes of variables and procedures
3723which are not part of the standard.  Whether a given attribute is
3724supported and its exact effects depend on both the operating system and
3725on the processor; see *note C Extensions: (gcc)Top.  for details.
3726
3727   For procedures and procedure pointers, the following attributes can
3728be used to change the calling convention:
3729
3730   * `CDECL' - standard C calling convention
3731
3732   * `STDCALL' - convention where the called procedure pops the stack
3733
3734   * `FASTCALL' - part of the arguments are passed via registers
3735     instead using the stack
3736
3737   Besides changing the calling convention, the attributes also
3738influence the decoration of the symbol name, e.g., by a leading
3739underscore or by a trailing at-sign followed by the number of bytes on
3740the stack.  When assigning a procedure to a procedure pointer, both
3741should use the same calling convention.
3742
3743   On some systems, procedures and global variables (module variables
3744and `COMMON' blocks) need special handling to be accessible when they
3745are in a shared library.  The following attributes are available:
3746
3747   * `DLLEXPORT' - provide a global pointer to a pointer in the DLL
3748
3749   * `DLLIMPORT' - reference the function or variable using a global
3750     pointer
3751
3752   For dummy arguments, the `NO_ARG_CHECK' attribute can be used; in
3753other compilers, it is also known as `IGNORE_TKR'.  For dummy arguments
3754with this attribute actual arguments of any type and kind (similar to
3755`TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
3756standard) are accepted.  As with `TYPE(*)', the argument is unlimited
3757polymorphic and no type information is available.  Additionally, the
3758argument may only be passed to dummy arguments with the `NO_ARG_CHECK'
3759attribute and as argument to the `PRESENT' intrinsic function and to
3760`C_LOC' of the `ISO_C_BINDING' module.
3761
3762   Variables with `NO_ARG_CHECK' attribute shall be of assumed-type
3763(`TYPE(*)'; recommended) or of type `INTEGER', `LOGICAL', `REAL' or
3764`COMPLEX'. They shall not have the `ALLOCATE', `CODIMENSION',
3765`INTENT(OUT)', `POINTER' or `VALUE' attribute; furthermore, they shall
3766be either scalar or of assumed-size (`dimension(*)'). As `TYPE(*)', the
3767`NO_ARG_CHECK' attribute requires an explicit interface.
3768
3769   * `NO_ARG_CHECK' - disable the type, kind and rank checking
3770
3771   The attributes are specified using the syntax
3772
3773   `!GCC$ ATTRIBUTES' ATTRIBUTE-LIST `::' VARIABLE-LIST
3774
3775   where in free-form source code only whitespace is allowed before
3776`!GCC$' and in fixed-form source code `!GCC$', `cGCC$' or `*GCC$' shall
3777start in the first column.
3778
3779   For procedures, the compiler directives shall be placed into the body
3780of the procedure; for variables and procedure pointers, they shall be in
3781the same declaration part as the variable or procedure pointer.
3782
3783
3784File: gfortran.info,  Node: Non-Fortran Main Program,  Next: Naming and argument-passing conventions,  Prev: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
3785
37867.3 Non-Fortran Main Program
3787============================
3788
3789* Menu:
3790
3791* _gfortran_set_args:: Save command-line arguments
3792* _gfortran_set_options:: Set library option flags
3793* _gfortran_set_convert:: Set endian conversion
3794* _gfortran_set_record_marker:: Set length of record markers
3795* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
3796* _gfortran_set_max_subrecord_length:: Set subrecord length
3797
3798   Even if you are doing mixed-language programming, it is very likely
3799that you do not need to know or use the information in this section.
3800Since it is about the internal structure of GNU Fortran, it may also
3801change in GCC minor releases.
3802
3803   When you compile a `PROGRAM' with GNU Fortran, a function with the
3804name `main' (in the symbol table of the object file) is generated,
3805which initializes the libgfortran library and then calls the actual
3806program which uses the name `MAIN__', for historic reasons.  If you
3807link GNU Fortran compiled procedures to, e.g., a C or C++ program or to
3808a Fortran program compiled by a different compiler, the libgfortran
3809library is not initialized and thus a few intrinsic procedures do not
3810work properly, e.g.  those for obtaining the command-line arguments.
3811
3812   Therefore, if your `PROGRAM' is not compiled with GNU Fortran and
3813the GNU Fortran compiled procedures require intrinsics relying on the
3814library initialization, you need to initialize the library yourself.
3815Using the default options, gfortran calls `_gfortran_set_args' and
3816`_gfortran_set_options'.  The initialization of the former is needed if
3817the called procedures access the command line (and for backtracing);
3818the latter sets some flags based on the standard chosen or to enable
3819backtracing.  In typical programs, it is not necessary to call any
3820initialization function.
3821
3822   If your `PROGRAM' is compiled with GNU Fortran, you shall not call
3823any of the following functions.  The libgfortran initialization
3824functions are shown in C syntax but using C bindings they are also
3825accessible from Fortran.
3826
3827
3828File: gfortran.info,  Node: _gfortran_set_args,  Next: _gfortran_set_options,  Up: Non-Fortran Main Program
3829
38307.3.1 `_gfortran_set_args' -- Save command-line arguments
3831---------------------------------------------------------
3832
3833_Description_:
3834     `_gfortran_set_args' saves the command-line arguments; this
3835     initialization is required if any of the command-line intrinsics
3836     is called.  Additionally, it shall be called if backtracing is
3837     enabled (see `_gfortran_set_options').
3838
3839_Syntax_:
3840     `void _gfortran_set_args (int argc, char *argv[])'
3841
3842_Arguments_:
3843     ARGC       number of command line argument strings
3844     ARGV       the command-line argument strings; argv[0] is
3845                the pathname of the executable itself.
3846
3847_Example_:
3848          int main (int argc, char *argv[])
3849          {
3850            /* Initialize libgfortran.  */
3851            _gfortran_set_args (argc, argv);
3852            return 0;
3853          }
3854
3855
3856File: gfortran.info,  Node: _gfortran_set_options,  Next: _gfortran_set_convert,  Prev: _gfortran_set_args,  Up: Non-Fortran Main Program
3857
38587.3.2 `_gfortran_set_options' -- Set library option flags
3859---------------------------------------------------------
3860
3861_Description_:
3862     `_gfortran_set_options' sets several flags related to the Fortran
3863     standard to be used, whether backtracing should be enabled and
3864     whether range checks should be performed.  The syntax allows for
3865     upward compatibility since the number of passed flags is
3866     specified; for non-passed flags, the default value is used.  See
3867     also *note Code Gen Options::.  Please note that not all flags are
3868     actually used.
3869
3870_Syntax_:
3871     `void _gfortran_set_options (int num, int options[])'
3872
3873_Arguments_:
3874     NUM        number of options passed
3875     ARGV       The list of flag values
3876
3877_option flag list_:
3878     OPTION[0]  Allowed standard; can give run-time errors if
3879                e.g. an input-output edit descriptor is
3880                invalid in a given standard.  Possible values
3881                are (bitwise or-ed) `GFC_STD_F77' (1),
3882                `GFC_STD_F95_OBS' (2), `GFC_STD_F95_DEL' (4),
3883                `GFC_STD_F95' (8), `GFC_STD_F2003' (16),
3884                `GFC_STD_GNU' (32), `GFC_STD_LEGACY' (64),
3885                `GFC_STD_F2008' (128), `GFC_STD_F2008_OBS'
3886                (256) and GFC_STD_F2008_TS (512). Default:
3887                `GFC_STD_F95_OBS | GFC_STD_F95_DEL |
3888                GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008 |
3889                GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
3890                GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY'.
3891     OPTION[1]  Standard-warning flag; prints a warning to
3892                standard error.  Default: `GFC_STD_F95_DEL |
3893                GFC_STD_LEGACY'.
3894     OPTION[2]  If non zero, enable pedantic checking.
3895                Default: off.
3896     OPTION[3]  Unused.
3897     OPTION[4]  If non zero, enable backtracing on run-time
3898                errors.  Default: off. (Default in the
3899                compiler: on.)  Note: Installs a signal
3900                handler and requires command-line
3901                initialization using `_gfortran_set_args'.
3902     OPTION[5]  If non zero, supports signed zeros.  Default:
3903                enabled.
3904     OPTION[6]  Enables run-time checking.  Possible values
3905                are (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
3906                GFC_RTCHECK_ARRAY_TEMPS (2),
3907                GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO
3908                (16), GFC_RTCHECK_POINTER (32).  Default:
3909                disabled.
3910     OPTION[7]  Unused.
3911     OPTION[8]  Show a warning when invoking `STOP' and `ERROR
3912                STOP' if a floating-point exception occurred.
3913                Possible values are (bitwise or-ed)
3914                `GFC_FPE_INVALID' (1), `GFC_FPE_DENORMAL' (2),
3915                `GFC_FPE_ZERO' (4), `GFC_FPE_OVERFLOW' (8),
3916                `GFC_FPE_UNDERFLOW' (16), `GFC_FPE_INEXACT'
3917                (32). Default: None (0).  (Default in the
3918                compiler: `GFC_FPE_INVALID | GFC_FPE_DENORMAL |
3919                GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
3920                GFC_FPE_UNDERFLOW'.)
3921
3922_Example_:
3923            /* Use gfortran 4.9 default options.  */
3924            static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
3925            _gfortran_set_options (9, &options);
3926
3927
3928File: gfortran.info,  Node: _gfortran_set_convert,  Next: _gfortran_set_record_marker,  Prev: _gfortran_set_options,  Up: Non-Fortran Main Program
3929
39307.3.3 `_gfortran_set_convert' -- Set endian conversion
3931------------------------------------------------------
3932
3933_Description_:
3934     `_gfortran_set_convert' set the representation of data for
3935     unformatted files.
3936
3937_Syntax_:
3938     `void _gfortran_set_convert (int conv)'
3939
3940_Arguments_:
3941     CONV       Endian conversion, possible values:
3942                GFC_CONVERT_NATIVE (0, default),
3943                GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
3944                GFC_CONVERT_LITTLE (3).
3945
3946_Example_:
3947          int main (int argc, char *argv[])
3948          {
3949            /* Initialize libgfortran.  */
3950            _gfortran_set_args (argc, argv);
3951            _gfortran_set_convert (1);
3952            return 0;
3953          }
3954
3955
3956File: gfortran.info,  Node: _gfortran_set_record_marker,  Next: _gfortran_set_fpe,  Prev: _gfortran_set_convert,  Up: Non-Fortran Main Program
3957
39587.3.4 `_gfortran_set_record_marker' -- Set length of record markers
3959-------------------------------------------------------------------
3960
3961_Description_:
3962     `_gfortran_set_record_marker' sets the length of record markers
3963     for unformatted files.
3964
3965_Syntax_:
3966     `void _gfortran_set_record_marker (int val)'
3967
3968_Arguments_:
3969     VAL        Length of the record marker; valid values are
3970                4 and 8.  Default is 4.
3971
3972_Example_:
3973          int main (int argc, char *argv[])
3974          {
3975            /* Initialize libgfortran.  */
3976            _gfortran_set_args (argc, argv);
3977            _gfortran_set_record_marker (8);
3978            return 0;
3979          }
3980
3981
3982File: gfortran.info,  Node: _gfortran_set_fpe,  Next: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_record_marker,  Up: Non-Fortran Main Program
3983
39847.3.5 `_gfortran_set_fpe' -- Enable floating point exception traps
3985------------------------------------------------------------------
3986
3987_Description_:
3988     `_gfortran_set_fpe' enables floating point exception traps for the
3989     specified exceptions.  On most systems, this will result in a
3990     SIGFPE signal being sent and the program being aborted.
3991
3992_Syntax_:
3993     `void _gfortran_set_fpe (int val)'
3994
3995_Arguments_:
3996     OPTION[0]  IEEE exceptions.  Possible values are (bitwise
3997                or-ed) zero (0, default) no trapping,
3998                `GFC_FPE_INVALID' (1), `GFC_FPE_DENORMAL' (2),
3999                `GFC_FPE_ZERO' (4), `GFC_FPE_OVERFLOW' (8),
4000                `GFC_FPE_UNDERFLOW' (16), and
4001                `GFC_FPE_INEXACT' (32).
4002
4003_Example_:
4004          int main (int argc, char *argv[])
4005          {
4006            /* Initialize libgfortran.  */
4007            _gfortran_set_args (argc, argv);
4008            /* FPE for invalid operations such as SQRT(-1.0).  */
4009            _gfortran_set_fpe (1);
4010            return 0;
4011          }
4012
4013
4014File: gfortran.info,  Node: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_fpe,  Up: Non-Fortran Main Program
4015
40167.3.6 `_gfortran_set_max_subrecord_length' -- Set subrecord length
4017------------------------------------------------------------------
4018
4019_Description_:
4020     `_gfortran_set_max_subrecord_length' set the maximum length for a
4021     subrecord.  This option only makes sense for testing and debugging
4022     of unformatted I/O.
4023
4024_Syntax_:
4025     `void _gfortran_set_max_subrecord_length (int val)'
4026
4027_Arguments_:
4028     VAL        the maximum length for a subrecord; the
4029                maximum permitted value is 2147483639, which
4030                is also the default.
4031
4032_Example_:
4033          int main (int argc, char *argv[])
4034          {
4035            /* Initialize libgfortran.  */
4036            _gfortran_set_args (argc, argv);
4037            _gfortran_set_max_subrecord_length (8);
4038            return 0;
4039          }
4040
4041
4042File: gfortran.info,  Node: Naming and argument-passing conventions,  Prev: Non-Fortran Main Program,  Up: Mixed-Language Programming
4043
40447.4 Naming and argument-passing conventions
4045===========================================
4046
4047This section gives an overview about the naming convention of procedures
4048and global variables and about the argument passing conventions used by
4049GNU Fortran.  If a C binding has been specified, the naming convention
4050and some of the argument-passing conventions change.  If possible,
4051mixed-language and mixed-compiler projects should use the better defined
4052C binding for interoperability.  See *note Interoperability with C::.
4053
4054* Menu:
4055
4056* Naming conventions::
4057* Argument passing conventions::
4058
4059
4060File: gfortran.info,  Node: Naming conventions,  Next: Argument passing conventions,  Up: Naming and argument-passing conventions
4061
40627.4.1 Naming conventions
4063------------------------
4064
4065According the Fortran standard, valid Fortran names consist of a letter
4066between `A' to `Z', `a' to `z', digits `0', `1' to `9' and underscores
4067(`_') with the restriction that names may only start with a letter.  As
4068vendor extension, the dollar sign (`$') is additionally permitted with
4069the option `-fdollar-ok', but not as first character and only if the
4070target system supports it.
4071
4072   By default, the procedure name is the lower-cased Fortran name with
4073an appended underscore (`_'); using `-fno-underscoring' no underscore
4074is appended while `-fsecond-underscore' appends two underscores.
4075Depending on the target system and the calling convention, the
4076procedure might be additionally dressed; for instance, on 32bit Windows
4077with `stdcall', an at-sign `@' followed by an integer number is
4078appended.  For the changing the calling convention, see *note GNU
4079Fortran Compiler Directives::.
4080
4081   For common blocks, the same convention is used, i.e. by default an
4082underscore is appended to the lower-cased Fortran name.  Blank commons
4083have the name `__BLNK__'.
4084
4085   For procedures and variables declared in the specification space of a
4086module, the name is formed by `__', followed by the lower-cased module
4087name, `_MOD_', and the lower-cased Fortran name.  Note that no
4088underscore is appended.
4089
4090
4091File: gfortran.info,  Node: Argument passing conventions,  Prev: Naming conventions,  Up: Naming and argument-passing conventions
4092
40937.4.2 Argument passing conventions
4094----------------------------------
4095
4096Subroutines do not return a value (matching C99's `void') while
4097functions either return a value as specified in the platform ABI or the
4098result variable is passed as hidden argument to the function and no
4099result is returned.  A hidden result variable is used when the result
4100variable is an array or of type `CHARACTER'.
4101
4102   Arguments are passed according to the platform ABI. In particular,
4103complex arguments might not be compatible to a struct with two real
4104components for the real and imaginary part. The argument passing
4105matches the one of C99's `_Complex'.  Functions with scalar complex
4106result variables return their value and do not use a by-reference
4107argument.  Note that with the `-ff2c' option, the argument passing is
4108modified and no longer completely matches the platform ABI.  Some other
4109Fortran compilers use `f2c' semantic by default; this might cause
4110problems with interoperablility.
4111
4112   GNU Fortran passes most arguments by reference, i.e. by passing a
4113pointer to the data.  Note that the compiler might use a temporary
4114variable into which the actual argument has been copied, if required
4115semantically (copy-in/copy-out).
4116
4117   For arguments with `ALLOCATABLE' and `POINTER' attribute (including
4118procedure pointers), a pointer to the pointer is passed such that the
4119pointer address can be modified in the procedure.
4120
4121   For dummy arguments with the `VALUE' attribute: Scalar arguments of
4122the type `INTEGER', `LOGICAL', `REAL' and `COMPLEX' are passed by value
4123according to the platform ABI.  (As vendor extension and not
4124recommended, using `%VAL()' in the call to a procedure has the same
4125effect.) For `TYPE(C_PTR)' and procedure pointers, the pointer itself
4126is passed such that it can be modified without affecting the caller.
4127
4128   For Boolean (`LOGICAL') arguments, please note that GCC expects only
4129the integer value 0 and 1.  If a GNU Fortran `LOGICAL' variable
4130contains another integer value, the result is undefined.  As some other
4131Fortran compilers use -1 for `.TRUE.', extra care has to be taken -
4132such as passing the value as `INTEGER'.  (The same value restriction
4133also applies to other front ends of GCC, e.g. to GCC's C99 compiler for
4134`_Bool' or GCC's Ada compiler for `Boolean'.)
4135
4136   For arguments of `CHARACTER' type, the character length is passed as
4137hidden argument.  For deferred-length strings, the value is passed by
4138reference, otherwise by value.  The character length has the type
4139`INTEGER(kind=4)'.  Note with C binding, `CHARACTER(len=1)' result
4140variables are returned according to the platform ABI and no hidden
4141length argument is used for dummy arguments; with `VALUE', those
4142variables are passed by value.
4143
4144   For `OPTIONAL' dummy arguments, an absent argument is denoted by a
4145NULL pointer, except for scalar dummy arguments of type `INTEGER',
4146`LOGICAL', `REAL' and `COMPLEX' which have the `VALUE' attribute.  For
4147those, a hidden Boolean argument (`logical(kind=C_bool),value') is used
4148to indicate whether the argument is present.
4149
4150   Arguments which are assumed-shape, assumed-rank or deferred-rank
4151arrays or, with `-fcoarray=lib', allocatable scalar coarrays use an
4152array descriptor.  All other arrays pass the address of the first
4153element of the array.  With `-fcoarray=lib', the token and the offset
4154belonging to nonallocatable coarrays dummy arguments are passed as
4155hidden argument along the character length hidden arguments.  The token
4156is an oparque pointer identifying the coarray and the offset is a
4157passed-by-value integer of kind `C_PTRDIFF_T', denoting the byte offset
4158between the base address of the coarray and the passed scalar or first
4159element of the passed array.
4160
4161   The arguments are passed in the following order
4162   * Result variable, when the function result is passed by reference
4163
4164   * Character length of the function result, if it is a of type
4165     `CHARACTER' and no C binding is used
4166
4167   * The arguments in the order in which they appear in the Fortran
4168     declaration
4169
4170   * The the present status for optional arguments with value attribute,
4171     which are internally passed by value
4172
4173   * The character length and/or coarray token and offset for the first
4174     argument which is a `CHARACTER' or a nonallocatable coarray dummy
4175     argument, followed by the hidden arguments of the next dummy
4176     argument of such a type
4177
4178
4179File: gfortran.info,  Node: Coarray Programming,  Next: Intrinsic Procedures,  Prev: Mixed-Language Programming,  Up: Top
4180
41818 Coarray Programming
4182*********************
4183
4184* Menu:
4185
4186* Type and enum ABI Documentation::
4187* Function ABI Documentation::
4188
4189
4190File: gfortran.info,  Node: Type and enum ABI Documentation,  Next: Function ABI Documentation,  Up: Coarray Programming
4191
41928.1 Type and enum ABI Documentation
4193===================================
4194
4195* Menu:
4196
4197* caf_token_t::
4198* caf_register_t::
4199
4200
4201File: gfortran.info,  Node: caf_token_t,  Next: caf_register_t,  Up: Type and enum ABI Documentation
4202
42038.1.1 `caf_token_t'
4204-------------------
4205
4206Typedef of type `void *' on the compiler side. Can be any data type on
4207the library side.
4208
4209
4210File: gfortran.info,  Node: caf_register_t,  Prev: caf_token_t,  Up: Type and enum ABI Documentation
4211
42128.1.2 `caf_register_t'
4213----------------------
4214
4215Indicates which kind of coarray variable should be registered.
4216
4217typedef enum caf_register_t {
4218  CAF_REGTYPE_COARRAY_STATIC,
4219  CAF_REGTYPE_COARRAY_ALLOC,
4220  CAF_REGTYPE_LOCK_STATIC,
4221  CAF_REGTYPE_LOCK_ALLOC,
4222  CAF_REGTYPE_CRITICAL,
4223  CAF_REGTYPE_EVENT_STATIC,
4224  CAF_REGTYPE_EVENT_ALLOC
4225}
4226caf_register_t;
4227
4228
4229File: gfortran.info,  Node: Function ABI Documentation,  Prev: Type and enum ABI Documentation,  Up: Coarray Programming
4230
42318.2 Function ABI Documentation
4232==============================
4233
4234* Menu:
4235
4236* _gfortran_caf_init:: Initialiation function
4237* _gfortran_caf_finish:: Finalization function
4238* _gfortran_caf_this_image:: Querying the image number
4239* _gfortran_caf_num_images:: Querying the maximal number of images
4240* _gfortran_caf_register:: Registering coarrays
4241* _gfortran_caf_deregister:: Deregistering coarrays
4242* _gfortran_caf_send:: Sending data from a local image to a remote image
4243* _gfortran_caf_get:: Getting data from a remote image
4244* _gfortran_caf_sendget:: Sending data between remote images
4245* _gfortran_caf_lock:: Locking a lock variable
4246* _gfortran_caf_unlock:: Unlocking a lock variable
4247* _gfortran_caf_event_post:: Post an event
4248* _gfortran_caf_event_wait:: Wait that an event occurred
4249* _gfortran_caf_event_query:: Query event count
4250* _gfortran_caf_sync_all:: All-image barrier
4251* _gfortran_caf_sync_images:: Barrier for selected images
4252* _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
4253* _gfortran_caf_error_stop:: Error termination with exit code
4254* _gfortran_caf_error_stop_str:: Error termination with string
4255* _gfortran_caf_atomic_define:: Atomic variable assignment
4256* _gfortran_caf_atomic_ref:: Atomic variable reference
4257* _gfortran_caf_atomic_cas:: Atomic compare and swap
4258* _gfortran_caf_atomic_op:: Atomic operation
4259* _gfortran_caf_co_broadcast:: Sending data to all images
4260* _gfortran_caf_co_max:: Collective maximum reduction
4261* _gfortran_caf_co_min:: Collective minimum reduction
4262* _gfortran_caf_co_sum:: Collective summing reduction
4263* _gfortran_caf_co_reduce:: Generic collective reduction
4264
4265
4266File: gfortran.info,  Node: _gfortran_caf_init,  Next: _gfortran_caf_finish,  Up: Function ABI Documentation
4267
42688.2.1 `_gfortran_caf_init' -- Initialiation function
4269----------------------------------------------------
4270
4271_Description_:
4272     This function is called at startup of the program before the
4273     Fortran main program, if the latter has been compiled with
4274     `-fcoarray=lib'.  It takes as arguments the command-line arguments
4275     of the program.  It is permitted to pass to `NULL' pointers as
4276     argument; if non-`NULL', the library is permitted to modify the
4277     arguments.
4278
4279_Syntax_:
4280     `void _gfortran_caf_init (int *argc, char ***argv)'
4281
4282_Arguments_:
4283     ARGC       intent(inout) An integer pointer with the
4284                number of arguments passed to the program or
4285                `NULL'.
4286     ARGV       intent(inout) A pointer to an array of strings
4287                with the command-line arguments or `NULL'.
4288
4289_NOTES_
4290     The function is modelled after the initialization function of the
4291     Message Passing Interface (MPI) specification.  Due to the way
4292     coarray registration works, it might not be the first call to the
4293     libaray.  If the main program is not written in Fortran and only a
4294     library uses coarrays, it can happen that this function is never
4295     called.  Therefore, it is recommended that the library does not
4296     rely on the passed arguments and whether the call has been done.
4297
4298
4299File: gfortran.info,  Node: _gfortran_caf_finish,  Next: _gfortran_caf_this_image,  Prev: _gfortran_caf_init,  Up: Function ABI Documentation
4300
43018.2.2 `_gfortran_caf_finish' -- Finalization function
4302-----------------------------------------------------
4303
4304_Description_:
4305     This function is called at the end of the Fortran main program, if
4306     it has been compiled with the `-fcoarray=lib' option.
4307
4308_Syntax_:
4309     `void _gfortran_caf_finish (void)'
4310
4311_NOTES_
4312     For non-Fortran programs, it is recommended to call the function
4313     at the end of the main program.  To ensure that the shutdown is
4314     also performed for programs where this function is not explicitly
4315     invoked, for instance non-Fortran programs or calls to the
4316     system's exit() function, the library can use a destructor
4317     function.  Note that programs can also be terminated using the
4318     STOP and ERROR STOP statements; those use different library calls.
4319
4320
4321File: gfortran.info,  Node: _gfortran_caf_this_image,  Next: _gfortran_caf_num_images,  Prev: _gfortran_caf_finish,  Up: Function ABI Documentation
4322
43238.2.3 `_gfortran_caf_this_image' -- Querying the image number
4324-------------------------------------------------------------
4325
4326_Description_:
4327     This function returns the current image number, which is a
4328     positive number.
4329
4330_Syntax_:
4331     `int _gfortran_caf_this_image (int distance)'
4332
4333_Arguments_:
4334     DISTANCE   As specified for the `this_image' intrinsic in
4335                TS18508. Shall be a nonnegative number.
4336
4337_NOTES_
4338     If the Fortran intrinsic `this_image' is invoked without an
4339     argument, which is the only permitted form in Fortran 2008, GCC
4340     passes `0' as first argument.
4341
4342
4343File: gfortran.info,  Node: _gfortran_caf_num_images,  Next: _gfortran_caf_register,  Prev: _gfortran_caf_this_image,  Up: Function ABI Documentation
4344
43458.2.4 `_gfortran_caf_num_images' -- Querying the maximal number of images
4346-------------------------------------------------------------------------
4347
4348_Description_:
4349     This function returns the number of images in the current team, if
4350     DISTANCE is 0 or the number of images in the parent team at the
4351     specified distance. If failed is -1, the function returns the
4352     number of all images at the specified distance; if it is 0, the
4353     function returns the number of nonfailed images, and if it is 1,
4354     it returns the number of failed images.
4355
4356_Syntax_:
4357     `int _gfortran_caf_num_images(int distance, int failed)'
4358
4359_Arguments_:
4360     DISTANCE   the distance from this image to the ancestor.
4361                Shall be positive.
4362     FAILED     shall be -1, 0, or 1
4363
4364_NOTES_
4365     This function follows TS18508. If the num_image intrinsic has no
4366     arguments, the the compiler passes `distance=0' and `failed=-1' to
4367     the function.
4368
4369
4370File: gfortran.info,  Node: _gfortran_caf_register,  Next: _gfortran_caf_deregister,  Prev: _gfortran_caf_num_images,  Up: Function ABI Documentation
4371
43728.2.5 `_gfortran_caf_register' -- Registering coarrays
4373------------------------------------------------------
4374
4375_Description_:
4376     Allocates memory for a coarray and creates a token to identify the
4377     coarray. The function is called for both coarrays with `SAVE'
4378     attribute and using an explicit `ALLOCATE' statement. If an error
4379     occurs and STAT is a `NULL' pointer, the function shall abort with
4380     printing an error message and starting the error termination.  If
4381     no error occurs and STAT is present, it shall be set to zero.
4382     Otherwise, it shall be set to a positive value and, if not-`NULL',
4383     ERRMSG shall be set to a string describing the failure. The
4384     function shall return a pointer to the requested memory for the
4385     local image as a call to `malloc' would do.
4386
4387     For `CAF_REGTYPE_COARRAY_STATIC' and `CAF_REGTYPE_COARRAY_ALLOC',
4388     the passed size is the byte size requested.  For
4389     `CAF_REGTYPE_LOCK_STATIC', `CAF_REGTYPE_LOCK_ALLOC' and
4390     `CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
4391
4392_Syntax_:
4393     `void *caf_register (size_t size, caf_register_t type, caf_token_t
4394     *token, int *stat, char *errmsg, int errmsg_len)'
4395
4396_Arguments_:
4397     SIZE       For normal coarrays, the byte size of the
4398                coarray to be allocated; for lock types and
4399                event types, the number of elements.
4400     TYPE       one of the caf_register_t types.
4401     TOKEN      intent(out) An opaque pointer identifying the
4402                coarray.
4403     STAT       intent(out) For allocatable coarrays, stores
4404                the STAT=; may be NULL
4405     ERRMSG     intent(out) When an error occurs, this will be
4406                set to an error message; may be NULL
4407     ERRMSG_LEN the buffer size of errmsg.
4408
4409_NOTES_
4410     Nonalloatable coarrays have to be registered prior use from remote
4411     images.  In order to guarantee this, they have to be registered
4412     before the main program. This can be achieved by creating
4413     constructor functions. That is what GCC does such that also
4414     nonallocatable coarrays the memory is allocated and no static
4415     memory is used.  The token permits to identify the coarray; to the
4416     processor, the token is a nonaliasing pointer. The library can,
4417     for instance, store the base address of the coarray in the token,
4418     some handle or a more complicated struct.
4419
4420     For normal coarrays, the returned pointer is used for accesses on
4421     the local image. For lock types, the value shall only used for
4422     checking the allocation status. Note that for critical blocks, the
4423     locking is only required on one image; in the locking statement,
4424     the processor shall always pass always an image index of one for
4425     critical-block lock variables (`CAF_REGTYPE_CRITICAL'). For lock
4426     types and critical-block variables, the initial value shall be
4427     unlocked (or, respecitively, not in critical section) such as the
4428     value false; for event types, the initial state should be no
4429     event, e.g. zero.
4430
4431
4432File: gfortran.info,  Node: _gfortran_caf_deregister,  Next: _gfortran_caf_send,  Prev: _gfortran_caf_register,  Up: Function ABI Documentation
4433
44348.2.6 `_gfortran_caf_deregister' -- Deregistering coarrays
4435----------------------------------------------------------
4436
4437_Description_:
4438     Called to free the memory of a coarray; the processor calls this
4439     function for automatic and explicit deallocation.  In case of an
4440     error, this function shall fail with an error message, unless the
4441     STAT variable is not null.
4442
4443_Syntax_:
4444     `void caf_deregister (const caf_token_t *token, int *stat, char
4445     *errmsg, int errmsg_len)'
4446
4447_Arguments_:
4448     STAT       intent(out) Stores the STAT=; may be NULL
4449     ERRMSG     intent(out) When an error occurs, this will be
4450                set to an error message; may be NULL
4451     ERRMSG_LEN the buffer size of errmsg.
4452
4453_NOTES_
4454     For nonalloatable coarrays this function is never called.  If a
4455     cleanup is required, it has to be handled via the finish, stop and
4456     error stop functions, and via destructors.
4457
4458
4459File: gfortran.info,  Node: _gfortran_caf_send,  Next: _gfortran_caf_get,  Prev: _gfortran_caf_deregister,  Up: Function ABI Documentation
4460
44618.2.7 `_gfortran_caf_send' -- Sending data from a local image to a remote image
4462-------------------------------------------------------------------------------
4463
4464_Description_:
4465     Called to send a scalar, an array section or whole array from a
4466     local to a remote image identified by the image_index.
4467
4468_Syntax_:
4469     `void _gfortran_caf_send (caf_token_t token, size_t offset, int
4470     image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
4471     gfc_descriptor_t *src, int dst_kind, int src_kind, bool
4472     may_require_tmp)'
4473
4474_Arguments_:
4475     TOKEN      intent(in)  An opaque pointer identifying the
4476                coarray.
4477     OFFSET     By which amount of bytes the actual data is
4478                shifted compared to the base address of the
4479                coarray.
4480     IMAGE_INDEXThe ID of the remote image; must be a positive
4481                number.
4482     DEST       intent(in) Array descriptor for the remote
4483                image for the bounds and the size. The
4484                base_addr shall not be accessed.
4485     DST_VECTOR intent(int)  If not NULL, it contains the
4486                vector subscript of the destination array; the
4487                values are relative to the dimension triplet
4488                of the dest argument.
4489     SRC        intent(in) Array descriptor of the local array
4490                to be transferred to the remote image
4491     DST_KIND   Kind of the destination argument
4492     SRC_KIND   Kind of the source argument
4493     MAY_REQUIRE_TMPThe variable is false it is known at compile
4494                time that the DEST and SRC either cannot
4495                overlap or overlap (fully or partially) such
4496                that walking SRC and DEST in element wise
4497                element order (honoring the stride value) will
4498                not lead to wrong results.  Otherwise, the
4499                value is true.
4500
4501_NOTES_
4502     It is permitted to have image_id equal the current image; the
4503     memory of the send-to and the send-from might (partially) overlap
4504     in that case. The implementation has to take care that it handles
4505     this case, e.g. using `memmove' which handles (partially)
4506     overlapping memory. If MAY_REQUIRE_TMP is true, the library might
4507     additionally create a temporary variable, unless additional checks
4508     show that this is not required (e.g. because walking backward is
4509     possible or because both arrays are contiguous and `memmove' takes
4510     care of overlap issues).
4511
4512     Note that the assignment of a scalar to an array is permitted. In
4513     addition, the library has to handle numeric-type conversion and
4514     for strings, padding and different character kinds.
4515
4516
4517File: gfortran.info,  Node: _gfortran_caf_get,  Next: _gfortran_caf_sendget,  Prev: _gfortran_caf_send,  Up: Function ABI Documentation
4518
45198.2.8 `_gfortran_caf_get' -- Getting data from a remote image
4520-------------------------------------------------------------
4521
4522_Description_:
4523     Called to get an array section or whole array from a a remote,
4524     image identified by the image_index.
4525
4526_Syntax_:
4527     `void _gfortran_caf_get_desc (caf_token_t token, size_t offset,
4528     int image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
4529     gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
4530     may_require_tmp)'
4531
4532_Arguments_:
4533     TOKEN      intent(in)  An opaque pointer identifying the
4534                coarray.
4535     OFFSET     By which amount of bytes the actual data is
4536                shifted compared to the base address of the
4537                coarray.
4538     IMAGE_INDEXThe ID of the remote image; must be a positive
4539                number.
4540     DEST       intent(in) Array descriptor of the local array
4541                to be transferred to the remote image
4542     SRC        intent(in) Array descriptor for the remote
4543                image for the bounds and the size. The
4544                base_addr shall not be accessed.
4545     SRC_VECTOR intent(int)  If not NULL, it contains the
4546                vector subscript of the destination array; the
4547                values are relative to the dimension triplet
4548                of the dest argument.
4549     DST_KIND   Kind of the destination argument
4550     SRC_KIND   Kind of the source argument
4551     MAY_REQUIRE_TMPThe variable is false it is known at compile
4552                time that the DEST and SRC either cannot
4553                overlap or overlap (fully or partially) such
4554                that walking SRC and DEST in element wise
4555                element order (honoring the stride value) will
4556                not lead to wrong results.  Otherwise, the
4557                value is true.
4558
4559_NOTES_
4560     It is permitted to have image_id equal the current image; the
4561     memory of the send-to and the send-from might (partially) overlap
4562     in that case. The implementation has to take care that it handles
4563     this case, e.g. using `memmove' which handles (partially)
4564     overlapping memory. If MAY_REQUIRE_TMP is true, the library might
4565     additionally create a temporary variable, unless additional checks
4566     show that this is not required (e.g. because walking backward is
4567     possible or because both arrays are contiguous and `memmove' takes
4568     care of overlap issues).
4569
4570     Note that the library has to handle numeric-type conversion and
4571     for strings, padding and different character kinds.
4572
4573
4574File: gfortran.info,  Node: _gfortran_caf_sendget,  Next: _gfortran_caf_lock,  Prev: _gfortran_caf_get,  Up: Function ABI Documentation
4575
45768.2.9 `_gfortran_caf_sendget' -- Sending data between remote images
4577-------------------------------------------------------------------
4578
4579_Description_:
4580     Called to send a scalar, an array section or whole array from a
4581     remote image identified by the src_image_index to a remote image
4582     identified by the dst_image_index.
4583
4584_Syntax_:
4585     `void _gfortran_caf_sendget (caf_token_t dst_token, size_t
4586     dst_offset, int dst_image_index, gfc_descriptor_t *dest,
4587     caf_vector_t *dst_vector, caf_token_t src_token, size_t
4588     src_offset, int src_image_index, gfc_descriptor_t *src,
4589     caf_vector_t *src_vector, int dst_kind, int src_kind, bool
4590     may_require_tmp)'
4591
4592_Arguments_:
4593     DST_TOKEN  intent(in)  An opaque pointer identifying the
4594                destination coarray.
4595     DST_OFFSET By which amount of bytes the actual data is
4596                shifted compared to the base address of the
4597                destination coarray.
4598     DST_IMAGE_INDEXThe ID of the destination remote image; must
4599                be a positive number.
4600     DEST       intent(in) Array descriptor for the destination
4601                remote image for the bounds and the size. The
4602                base_addr shall not be accessed.
4603     DST_VECTOR intent(int)  If not NULL, it contains the
4604                vector subscript of the destination array; the
4605                values are relative to the dimension triplet
4606                of the dest argument.
4607     SRC_TOKEN  An opaque pointer identifying the source
4608                coarray.
4609     SRC_OFFSET By which amount of bytes the actual data is
4610                shifted compared to the base address of the
4611                source coarray.
4612     SRC_IMAGE_INDEXThe ID of the source remote image; must be a
4613                positive number.
4614     SRC        intent(in) Array descriptor of the local array
4615                to be transferred to the remote image.
4616     SRC_VECTOR intent(in) Array descriptor of the local array
4617                to be transferred to the remote image
4618     DST_KIND   Kind of the destination argument
4619     SRC_KIND   Kind of the source argument
4620     MAY_REQUIRE_TMPThe variable is false it is known at compile
4621                time that the DEST and SRC either cannot
4622                overlap or overlap (fully or partially) such
4623                that walking SRC and DEST in element wise
4624                element order (honoring the stride value) will
4625                not lead to wrong results.  Otherwise, the
4626                value is true.
4627
4628_NOTES_
4629     It is permitted to have image_ids equal; the memory of the send-to
4630     and the send-from might (partially) overlap in that case. The
4631     implementation has to take care that it handles this case, e.g.
4632     using `memmove' which handles (partially) overlapping memory. If
4633     MAY_REQUIRE_TMP is true, the library might additionally create a
4634     temporary variable, unless additional checks show that this is not
4635     required (e.g. because walking backward is possible or because
4636     both arrays are contiguous and `memmove' takes care of overlap
4637     issues).
4638
4639     Note that the assignment of a scalar to an array is permitted. In
4640     addition, the library has to handle numeric-type conversion and
4641     for strings, padding and different character kinds.
4642
4643
4644File: gfortran.info,  Node: _gfortran_caf_lock,  Next: _gfortran_caf_unlock,  Prev: _gfortran_caf_sendget,  Up: Function ABI Documentation
4645
46468.2.10 `_gfortran_caf_lock' -- Locking a lock variable
4647------------------------------------------------------
4648
4649_Description_:
4650     Acquire a lock on the given image on a scalar locking variable or
4651     for the given array element for an array-valued variable. If the
4652     AQUIRED_LOCK is `NULL', the function return after having obtained
4653     the lock. If it is nonnull, the result is is assigned the value
4654     true (one) when the lock could be obtained and false (zero)
4655     otherwise.  Locking a lock variable which has already been locked
4656     by the same image is an error.
4657
4658_Syntax_:
4659     `void _gfortran_caf_lock (caf_token_t token, size_t index, int
4660     image_index, int *aquired_lock, int *stat, char *errmsg, int
4661     errmsg_len)'
4662
4663_Arguments_:
4664     TOKEN      intent(in) An opaque pointer identifying the
4665                coarray.
4666     INDEX      Array index; first array index is 0. For
4667                scalars, it is always 0.
4668     IMAGE_INDEXThe ID of the remote image; must be a positive
4669                number.
4670     AQUIRED_LOCKintent(out) If not NULL, it returns whether
4671                lock could be obtained
4672     STAT       intent(out) Stores the STAT=; may be NULL
4673     ERRMSG     intent(out) When an error occurs, this will be
4674                set to an error message; may be NULL
4675     ERRMSG_LEN the buffer size of errmsg.
4676
4677_NOTES_
4678     This function is also called for critical blocks; for those, the
4679     array index is always zero and the image index is one.  Libraries
4680     are permitted to use other images for critical-block locking
4681     variables.
4682
4683
4684File: gfortran.info,  Node: _gfortran_caf_unlock,  Next: _gfortran_caf_event_post,  Prev: _gfortran_caf_lock,  Up: Function ABI Documentation
4685
46868.2.11 `_gfortran_caf_lock' -- Unlocking a lock variable
4687--------------------------------------------------------
4688
4689_Description_:
4690     Release a lock on the given image on a scalar locking variable or
4691     for the given array element for an array-valued variable.
4692     Unlocking a lock variable which is unlocked or has been locked by
4693     a different image is an error.
4694
4695_Syntax_:
4696     `void _gfortran_caf_unlock (caf_token_t token, size_t index, int
4697     image_index, int *stat, char *errmsg, int errmsg_len)'
4698
4699_Arguments_:
4700     TOKEN      intent(in) An opaque pointer identifying the
4701                coarray.
4702     INDEX      Array index; first array index is 0. For
4703                scalars, it is always 0.
4704     IMAGE_INDEXThe ID of the remote image; must be a positive
4705                number.
4706     STAT       intent(out) For allocatable coarrays, stores
4707                the STAT=; may be NULL
4708     ERRMSG     intent(out) When an error occurs, this will be
4709                set to an error message; may be NULL
4710     ERRMSG_LEN the buffer size of errmsg.
4711
4712_NOTES_
4713     This function is also called for critical block; for those, the
4714     array index is always zero and the image index is one.  Libraries
4715     are permitted to use other images for critical-block locking
4716     variables.
4717
4718
4719File: gfortran.info,  Node: _gfortran_caf_event_post,  Next: _gfortran_caf_event_wait,  Prev: _gfortran_caf_unlock,  Up: Function ABI Documentation
4720
47218.2.12 `_gfortran_caf_event_post' -- Post an event
4722--------------------------------------------------
4723
4724_Description_:
4725     Increment the event count of the specified event variable.
4726
4727_Syntax_:
4728     `void _gfortran_caf_event_post (caf_token_t token, size_t index,
4729     int image_index, int *stat, char *errmsg, int errmsg_len)'
4730
4731_Arguments_:
4732     TOKEN      intent(in) An opaque pointer identifying the
4733                coarray.
4734     INDEX      Array index; first array index is 0. For
4735                scalars, it is always 0.
4736     IMAGE_INDEXThe ID of the remote image; must be a positive
4737                number; zero indicates the current image when
4738                accessed noncoindexed.
4739     STAT       intent(out) Stores the STAT=; may be NULL
4740     ERRMSG     intent(out) When an error occurs, this will be
4741                set to an error message; may be NULL
4742     ERRMSG_LEN the buffer size of errmsg.
4743
4744_NOTES_
4745     This acts like an atomic add of one to the remote image's event
4746     variable.  The statement is an image-control statement but does
4747     not imply sync memory.  Still, all preceeding push communications
4748     of this image to the specified remote image has to be completed
4749     before `event_wait' on the remote image returns.
4750
4751
4752File: gfortran.info,  Node: _gfortran_caf_event_wait,  Next: _gfortran_caf_event_query,  Prev: _gfortran_caf_event_post,  Up: Function ABI Documentation
4753
47548.2.13 `_gfortran_caf_event_wait' -- Wait that an event occurred
4755----------------------------------------------------------------
4756
4757_Description_:
4758     Wait until the event count has reached at least the specified
4759     UNTIL_COUNT; if so, atomically decrement the event variable by this
4760     amount and return.
4761
4762_Syntax_:
4763     `void _gfortran_caf_event_wait (caf_token_t token, size_t index,
4764     int until_count, int *stat, char *errmsg, int errmsg_len)'
4765
4766_Arguments_:
4767     TOKEN      intent(in) An opaque pointer identifying the
4768                coarray.
4769     INDEX      Array index; first array index is 0. For
4770                scalars, it is always 0.
4771     UNTIL_COUNTThe number of events which have to be available
4772                before the function returns.
4773     STAT       intent(out) Stores the STAT=; may be NULL
4774     ERRMSG     intent(out) When an error occurs, this will be
4775                set to an error message; may be NULL
4776     ERRMSG_LEN the buffer size of errmsg.
4777
4778_NOTES_
4779     This function only operates on a local coarray. It acts like a
4780     loop checking atomically the value of the event variable, breaking
4781     if the value is greater or equal the requested number of counts.
4782     Before the function returns, the event variable has to be
4783     decremented by the requested UNTIL_COUNT value.  A possible
4784     implementation would be a busy loop for a certain number of spins
4785     (possibly depending on the number of threads relative to the
4786     number of available cores) followed by other waiting strategy such
4787     as a sleeping wait (possibly with an increasing number of sleep
4788     time) or, if possible, a futex wait.
4789
4790     The statement is an image-control statement but does not imply
4791     sync memory.  Still, all preceeding push communications to this
4792     image of images having issued a `event_push' have to be completed
4793     before this function returns.
4794
4795
4796File: gfortran.info,  Node: _gfortran_caf_event_query,  Next: _gfortran_caf_sync_all,  Prev: _gfortran_caf_event_wait,  Up: Function ABI Documentation
4797
47988.2.14 `_gfortran_caf_event_query' -- Query event count
4799-------------------------------------------------------
4800
4801_Description_:
4802     Return the event count of the specified event count.
4803
4804_Syntax_:
4805     `void _gfortran_caf_event_query (caf_token_t token, size_t index,
4806     int image_index, int *count, int *stat)'
4807
4808_Arguments_:
4809     TOKEN      intent(in) An opaque pointer identifying the
4810                coarray.
4811     INDEX      Array index; first array index is 0. For
4812                scalars, it is always 0.
4813     IMAGE_INDEXThe ID of the remote image; must be a positive
4814                number; zero indicates the current image when
4815                accessed noncoindexed.
4816     COUNT      intent(out) The number of events currently
4817                posted to the event variable
4818     STAT       intent(out) Stores the STAT=; may be NULL
4819
4820_NOTES_
4821     The typical use is to check the local even variable to only call
4822     `event_wait' when the data is available. However, a coindexed
4823     variable is permitted; there is no ordering or synchronization
4824     implied.  It acts like an atomic fetch of the value of the event
4825     variable.
4826
4827
4828File: gfortran.info,  Node: _gfortran_caf_sync_all,  Next: _gfortran_caf_sync_images,  Prev: _gfortran_caf_event_query,  Up: Function ABI Documentation
4829
48308.2.15 `_gfortran_caf_sync_all' -- All-image barrier
4831----------------------------------------------------
4832
4833_Description_:
4834     Synchronization of all images in the current team; the program
4835     only continues on a given image after this function has been
4836     called on all images of the current team.  Additionally, it
4837     ensures that all pending data transfers of previous segment have
4838     completed.
4839
4840_Syntax_:
4841     `void _gfortran_caf_sync_all (int *stat, char *errmsg, int
4842     errmsg_len)'
4843
4844_Arguments_:
4845     STAT       intent(out) Stores the status STAT= and may be
4846                NULL.
4847     ERRMSG     intent(out) When an error occurs, this will be
4848                set to an error message; may be NULL
4849     ERRMSG_LEN the buffer size of errmsg.
4850
4851
4852File: gfortran.info,  Node: _gfortran_caf_sync_images,  Next: _gfortran_caf_sync_memory,  Prev: _gfortran_caf_sync_all,  Up: Function ABI Documentation
4853
48548.2.16 `_gfortran_caf_sync_images' -- Barrier for selected images
4855-----------------------------------------------------------------
4856
4857_Description_:
4858     Synchronization between the specified images; the program only
4859     continues on a given image after this function has been called on
4860     all images specified for that image. Note that one image can wait
4861     for all other images in the current team (e.g. via `sync
4862     images(*)') while those only wait for that specific image.
4863     Additionally, `sync images' it ensures that all pending data
4864     transfers of previous segment have completed.
4865
4866_Syntax_:
4867     `void _gfortran_caf_sync_images (int count, int images[], int
4868     *stat, char *errmsg, int errmsg_len)'
4869
4870_Arguments_:
4871     COUNT      the number of images which are provided in the
4872                next argument.  For a zero-sized array, the
4873                value is zero.  For `sync images (*)', the
4874                value is -1.
4875     IMAGES     intent(in) an array with the images provided
4876                by the user. If COUNT is zero, a NULL pointer
4877                is passed.
4878     STAT       intent(out) Stores the status STAT= and may be
4879                NULL.
4880     ERRMSG     intent(out) When an error occurs, this will be
4881                set to an error message; may be NULL
4882     ERRMSG_LEN the buffer size of errmsg.
4883
4884
4885File: gfortran.info,  Node: _gfortran_caf_sync_memory,  Next: _gfortran_caf_error_stop,  Prev: _gfortran_caf_sync_images,  Up: Function ABI Documentation
4886
48878.2.17 `_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
4888--------------------------------------------------------------------------------------
4889
4890_Description_:
4891     Acts as optimization barrier between different segments. It also
4892     ensures that all pending memory operations of this image have been
4893     completed.
4894
4895_Syntax_:
4896     `void _gfortran_caf_sync_memory (int *stat, char *errmsg, int
4897     errmsg_len)'
4898
4899_Arguments_:
4900     STAT       intent(out) Stores the status STAT= and may be
4901                NULL.
4902     ERRMSG     intent(out) When an error occurs, this will be
4903                set to an error message; may be NULL
4904     ERRMSG_LEN the buffer size of errmsg.
4905
4906_NOTE_ A simple implementation could be
4907     `__asm__ __volatile__ ("":::"memory")' to prevent code movements.
4908
4909
4910File: gfortran.info,  Node: _gfortran_caf_error_stop,  Next: _gfortran_caf_error_stop_str,  Prev: _gfortran_caf_sync_memory,  Up: Function ABI Documentation
4911
49128.2.18 `_gfortran_caf_error_stop' -- Error termination with exit code
4913---------------------------------------------------------------------
4914
4915_Description_:
4916     Invoked for an `ERROR STOP' statement which has an integer
4917     argument.  The function should terminate the program with the
4918     specified exit code.
4919
4920_Syntax_:
4921     `void _gfortran_caf_error_stop (int32_t error)'
4922
4923_Arguments_:
4924     ERROR      the exit status to be used.
4925
4926
4927File: gfortran.info,  Node: _gfortran_caf_error_stop_str,  Next: _gfortran_caf_atomic_define,  Prev: _gfortran_caf_error_stop,  Up: Function ABI Documentation
4928
49298.2.19 `_gfortran_caf_error_stop_str' -- Error termination with string
4930----------------------------------------------------------------------
4931
4932_Description_:
4933     Invoked for an `ERROR STOP' statement which has a string as
4934     argument.  The function should terminate the program with a
4935     nonzero-exit code.
4936
4937_Syntax_:
4938     `void _gfortran_caf_error_stop (const char *string, int32_t len)'
4939
4940_Arguments_:
4941     STRING     the error message (not zero terminated)
4942     LEN        the length of the string
4943
4944
4945File: gfortran.info,  Node: _gfortran_caf_atomic_define,  Next: _gfortran_caf_atomic_ref,  Prev: _gfortran_caf_error_stop_str,  Up: Function ABI Documentation
4946
49478.2.20 `_gfortran_caf_atomic_define' -- Atomic variable assignment
4948------------------------------------------------------------------
4949
4950_Description_:
4951     Assign atomically a value to an integer or logical variable.
4952
4953_Syntax_:
4954     `void _gfortran_caf_atomic_define (caf_token_t token, size_t
4955     offset, int image_index, void *value, int *stat, int type, int
4956     kind)'
4957
4958_Arguments_:
4959     TOKEN      intent(in) An opaque pointer identifying the
4960                coarray.
4961     OFFSET     By which amount of bytes the actual data is
4962                shifted compared to the base address of the
4963                coarray.
4964     IMAGE_INDEXThe ID of the remote image; must be a positive
4965                number; zero indicates the current image when
4966                used noncoindexed.
4967     VALUE      intent(in) the value to be assigned, passed by
4968                reference.
4969     STAT       intent(out) Stores the status STAT= and may be
4970                NULL.
4971     TYPE       the data type, i.e. `BT_INTEGER' (1) or
4972                `BT_LOGICAL' (2).
4973     KIND       The kind value (only 4; always `int')
4974
4975
4976File: gfortran.info,  Node: _gfortran_caf_atomic_ref,  Next: _gfortran_caf_atomic_cas,  Prev: _gfortran_caf_atomic_define,  Up: Function ABI Documentation
4977
49788.2.21 `_gfortran_caf_atomic_ref' -- Atomic variable reference
4979--------------------------------------------------------------
4980
4981_Description_:
4982     Reference atomically a value of a kind-4 integer or logical
4983     variable.
4984
4985_Syntax_:
4986     `void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
4987     int image_index, void *value, int *stat, int type, int kind)'
4988
4989_Arguments_:
4990
4991_Arguments_:
4992     TOKEN      intent(in) An opaque pointer identifying the
4993                coarray.
4994     OFFSET     By which amount of bytes the actual data is
4995                shifted compared to the base address of the
4996                coarray.
4997     IMAGE_INDEXThe ID of the remote image; must be a positive
4998                number; zero indicates the current image when
4999                used noncoindexed.
5000     VALUE      intent(out) The variable assigned the
5001                atomically referenced variable.
5002     STAT       intent(out) Stores the status STAT= and may be
5003                NULL.
5004     TYPE       the data type, i.e. `BT_INTEGER' (1) or
5005                `BT_LOGICAL' (2).
5006     KIND       The kind value (only 4; always `int')
5007
5008
5009File: gfortran.info,  Node: _gfortran_caf_atomic_cas,  Next: _gfortran_caf_atomic_op,  Prev: _gfortran_caf_atomic_ref,  Up: Function ABI Documentation
5010
50118.2.22 `_gfortran_caf_atomic_cas' -- Atomic compare and swap
5012------------------------------------------------------------
5013
5014_Description_:
5015     Atomic compare and swap of a kind-4 integer or logical variable.
5016     Assigns atomically the specified value to the atomic variable, if
5017     the latter has the value specified by the passed condition value.
5018
5019_Syntax_:
5020     `void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
5021     int image_index, void *old, void *compare, void *new_val, int
5022     *stat, int type, int kind)'
5023
5024_Arguments_:
5025     TOKEN      intent(in) An opaque pointer identifying the
5026                coarray.
5027     OFFSET     By which amount of bytes the actual data is
5028                shifted compared to the base address of the
5029                coarray.
5030     IMAGE_INDEXThe ID of the remote image; must be a positive
5031                number; zero indicates the current image when
5032                used noncoindexed.
5033     OLD        intent(out) the value which the atomic
5034                variable had just before the cas operation.
5035     COMPARE    intent(in) The value used for comparision.
5036     NEW_VAL    intent(in) The new value for the atomic
5037                variable, assigned to the atomic variable, if
5038                `compare' equals the value of the atomic
5039                variable.
5040     STAT       intent(out) Stores the status STAT= and may be
5041                NULL.
5042     TYPE       the data type, i.e. `BT_INTEGER' (1) or
5043                `BT_LOGICAL' (2).
5044     KIND       The kind value (only 4; always `int')
5045
5046
5047File: gfortran.info,  Node: _gfortran_caf_atomic_op,  Next: _gfortran_caf_co_broadcast,  Prev: _gfortran_caf_atomic_cas,  Up: Function ABI Documentation
5048
50498.2.23 `_gfortran_caf_atomic_op' -- Atomic operation
5050----------------------------------------------------
5051
5052_Description_:
5053     Apply an operation atomically to an atomic integer or logical
5054     variable.  After the operation, OLD contains the value just before
5055     the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
5056     atomically the `value' to the atomic integer variable or does a
5057     bitwise AND, OR or exclusive OR of the between the atomic variable
5058     and VALUE; the result is then stored in the atomic variable.
5059
5060_Syntax_:
5061     `void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
5062     offset, int image_index, void *value, void *old, int *stat, int
5063     type, int kind)'
5064
5065_Arguments_:
5066     OP         the operation to be performed; possible values
5067                `GFC_CAF_ATOMIC_ADD' (1), `GFC_CAF_ATOMIC_AND'
5068                (2), `GFC_CAF_ATOMIC_OR' (3),
5069                `GFC_CAF_ATOMIC_XOR' (4).
5070     TOKEN      intent(in) An opaque pointer identifying the
5071                coarray.
5072     OFFSET     By which amount of bytes the actual data is
5073                shifted compared to the base address of the
5074                coarray.
5075     IMAGE_INDEXThe ID of the remote image; must be a positive
5076                number; zero indicates the current image when
5077                used noncoindexed.
5078     OLD        intent(out) the value which the atomic
5079                variable had just before the atomic operation.
5080     VAL        intent(in) The new value for the atomic
5081                variable, assigned to the atomic variable, if
5082                `compare' equals the value of the atomic
5083                variable.
5084     STAT       intent(out) Stores the status STAT= and may be
5085                NULL.
5086     TYPE       the data type, i.e. `BT_INTEGER' (1) or
5087                `BT_LOGICAL' (2).
5088     KIND       The kind value (only 4; always `int')
5089
5090
5091File: gfortran.info,  Node: _gfortran_caf_co_broadcast,  Next: _gfortran_caf_co_max,  Prev: _gfortran_caf_atomic_op,  Up: Function ABI Documentation
5092
50938.2.24 `_gfortran_caf_co_broadcast' -- Sending data to all images
5094-----------------------------------------------------------------
5095
5096_Description_:
5097     Distribute a value from a given image to all other images in the
5098     team. Has to be called collectively.
5099
5100_Syntax_:
5101     `void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
5102     source_image, int *stat, char *errmsg, int errmsg_len)'
5103
5104_Arguments_:
5105     A          intent(inout) And array descriptor with the
5106                data to be breoadcasted (on SOURCE_IMAGE) or
5107                to be received (other images).
5108     SOURCE_IMAGEThe ID of the image from which the data should
5109                be taken.
5110     STAT       intent(out) Stores the status STAT= and may be
5111                NULL.
5112     ERRMSG     intent(out) When an error occurs, this will be
5113                set to an error message; may be NULL
5114     ERRMSG_LEN the buffer size of errmsg.
5115
5116
5117File: gfortran.info,  Node: _gfortran_caf_co_max,  Next: _gfortran_caf_co_min,  Prev: _gfortran_caf_co_broadcast,  Up: Function ABI Documentation
5118
51198.2.25 `_gfortran_caf_co_max' -- Collective maximum reduction
5120-------------------------------------------------------------
5121
5122_Description_:
5123     Calculates the for the each array element of the variable A the
5124     maximum value for that element in the current team; if
5125     RESULT_IMAGE has the value 0, the result shall be stored on all
5126     images, otherwise, only on the specified image. This function
5127     operates on numeric values and character strings.
5128
5129_Syntax_:
5130     `void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
5131     int *stat, char *errmsg, int a_len, int errmsg_len)'
5132
5133_Arguments_:
5134     A          intent(inout) And array descriptor with the
5135                data to be breoadcasted (on SOURCE_IMAGE) or
5136                to be received (other images).
5137     RESULT_IMAGEThe ID of the image to which the reduced value
5138                should be copied to; if zero, it has to be
5139                copied to all images.
5140     STAT       intent(out) Stores the status STAT= and may be
5141                NULL.
5142     ERRMSG     intent(out) When an error occurs, this will be
5143                set to an error message; may be NULL
5144     A_LEN      The string length of argument A.
5145     ERRMSG_LEN the buffer size of errmsg.
5146
5147_NOTES_
5148     If RESULT_IMAGE is nonzero, the value on all images except of the
5149     specified one become undefined; hence, the library may make use of
5150     this.
5151
5152
5153File: gfortran.info,  Node: _gfortran_caf_co_min,  Next: _gfortran_caf_co_sum,  Prev: _gfortran_caf_co_max,  Up: Function ABI Documentation
5154
51558.2.26 `_gfortran_caf_co_min' -- Collective minimum reduction
5156-------------------------------------------------------------
5157
5158_Description_:
5159     Calculates the for the each array element of the variable A the
5160     minimum value for that element in the current team; if
5161     RESULT_IMAGE has the value 0, the result shall be stored on all
5162     images, otherwise, only on the specified image. This function
5163     operates on numeric values and character strings.
5164
5165_Syntax_:
5166     `void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
5167     int *stat, char *errmsg, int a_len, int errmsg_len)'
5168
5169_Arguments_:
5170     A          intent(inout) And array descriptor with the
5171                data to be breoadcasted (on SOURCE_IMAGE) or
5172                to be received (other images).
5173     RESULT_IMAGEThe ID of the image to which the reduced value
5174                should be copied to; if zero, it has to be
5175                copied to all images.
5176     STAT       intent(out) Stores the status STAT= and may be
5177                NULL.
5178     ERRMSG     intent(out) When an error occurs, this will be
5179                set to an error message; may be NULL
5180     A_LEN      The string length of argument A.
5181     ERRMSG_LEN the buffer size of errmsg.
5182
5183_NOTES_
5184     If RESULT_IMAGE is nonzero, the value on all images except of the
5185     specified one become undefined; hence, the library may make use of
5186     this.
5187
5188
5189File: gfortran.info,  Node: _gfortran_caf_co_sum,  Next: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_min,  Up: Function ABI Documentation
5190
51918.2.27 `_gfortran_caf_co_sum' -- Collective summing reduction
5192-------------------------------------------------------------
5193
5194_Description_:
5195     Calculates the for the each array element of the variable A the sum
5196     value for that element in the current team; if RESULT_IMAGE has the
5197     value 0, the result shall be stored on all images, otherwise, only
5198     on the specified image. This function operates on numeric values.
5199
5200_Syntax_:
5201     `void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
5202     int *stat, char *errmsg, int errmsg_len)'
5203
5204_Arguments_:
5205     A          intent(inout) And array descriptor with the
5206                data to be breoadcasted (on SOURCE_IMAGE) or
5207                to be received (other images).
5208     RESULT_IMAGEThe ID of the image to which the reduced value
5209                should be copied to; if zero, it has to be
5210                copied to all images.
5211     STAT       intent(out) Stores the status STAT= and may be
5212                NULL.
5213     ERRMSG     intent(out) When an error occurs, this will be
5214                set to an error message; may be NULL
5215     ERRMSG_LEN the buffer size of errmsg.
5216
5217_NOTES_
5218     If RESULT_IMAGE is nonzero, the value on all images except of the
5219     specified one become undefined; hence, the library may make use of
5220     this.
5221
5222
5223File: gfortran.info,  Node: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_sum,  Up: Function ABI Documentation
5224
52258.2.28 `_gfortran_caf_co_reduce' -- Generic collective reduction
5226----------------------------------------------------------------
5227
5228_Description_:
5229     Calculates the for the each array element of the variable A the
5230     reduction value for that element in the current team; if
5231     RESULT_IMAGE has the value 0, the result shall be stored on all
5232     images, otherwise, only on the specified image. The OPR is a pure
5233     function doing a mathematically commutative and associative
5234     operation.
5235
5236     The OPR_FLAGS denote the following; the values are bitwise ored.
5237     `GFC_CAF_BYREF' (1) if the result should be returned by value;
5238     `GFC_CAF_HIDDENLEN' (2) whether the result and argument string
5239     lengths shall be specified as hidden argument; `GFC_CAF_ARG_VALUE'
5240     (4) whether the arguments shall be passed by value,
5241     `GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
5242     descriptor.
5243
5244_Syntax_:
5245     `void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
5246     (void *, void *), int opr_flags, int result_image, int *stat, char
5247     *errmsg, int a_len, int errmsg_len)'
5248
5249_Arguments_:
5250     OPR        Function pointer to the reduction function.
5251     OPR_FLAGS  Flags regarding the reduction function
5252     A          intent(inout) And array descriptor with the
5253                data to be breoadcasted (on SOURCE_IMAGE) or
5254                to be received (other images).
5255     RESULT_IMAGEThe ID of the image to which the reduced value
5256                should be copied to; if zero, it has to be
5257                copied to all images.
5258     STAT       intent(out) Stores the status STAT= and may be
5259                NULL.
5260     ERRMSG     intent(out) When an error occurs, this will be
5261                set to an error message; may be NULL
5262     A_LEN      The string length of argument A.
5263     ERRMSG_LEN the buffer size of errmsg.
5264
5265_NOTES_
5266     If RESULT_IMAGE is nonzero, the value on all images except of the
5267     specified one become undefined; hence, the library may make use of
5268     this.  For character arguments, the result is passed as first
5269     argument, followed by the result string length, next come the two
5270     string arguments, followed by the two hidden arguments. With C
5271     binding, there are no hidden arguments and by-reference passing
5272     and either only a single character is passed or an array
5273     descriptor.
5274
5275
5276File: gfortran.info,  Node: Intrinsic Procedures,  Next: Intrinsic Modules,  Prev: Coarray Programming,  Up: Top
5277
52789 Intrinsic Procedures
5279**********************
5280
5281* Menu:
5282
5283* Introduction:         Introduction to Intrinsics
5284* `ABORT':         ABORT,     Abort the program
5285* `ABS':           ABS,       Absolute value
5286* `ACCESS':        ACCESS,    Checks file access modes
5287* `ACHAR':         ACHAR,     Character in ASCII collating sequence
5288* `ACOS':          ACOS,      Arccosine function
5289* `ACOSH':         ACOSH,     Inverse hyperbolic cosine function
5290* `ADJUSTL':       ADJUSTL,   Left adjust a string
5291* `ADJUSTR':       ADJUSTR,   Right adjust a string
5292* `AIMAG':         AIMAG,     Imaginary part of complex number
5293* `AINT':          AINT,      Truncate to a whole number
5294* `ALARM':         ALARM,     Set an alarm clock
5295* `ALL':           ALL,       Determine if all values are true
5296* `ALLOCATED':     ALLOCATED, Status of allocatable entity
5297* `AND':           AND,       Bitwise logical AND
5298* `ANINT':         ANINT,     Nearest whole number
5299* `ANY':           ANY,       Determine if any values are true
5300* `ASIN':          ASIN,      Arcsine function
5301* `ASINH':         ASINH,     Inverse hyperbolic sine function
5302* `ASSOCIATED':    ASSOCIATED, Status of a pointer or pointer/target pair
5303* `ATAN':          ATAN,      Arctangent function
5304* `ATAN2':         ATAN2,     Arctangent function
5305* `ATANH':         ATANH,     Inverse hyperbolic tangent function
5306* `ATOMIC_ADD':    ATOMIC_ADD, Atomic ADD operation
5307* `ATOMIC_AND':    ATOMIC_AND, Atomic bitwise AND operation
5308* `ATOMIC_CAS':    ATOMIC_CAS, Atomic compare and swap
5309* `ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
5310* `ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
5311* `ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
5312* `ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
5313* `ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
5314* `ATOMIC_OR':     ATOMIC_OR, Atomic bitwise OR operation
5315* `ATOMIC_REF':    ATOMIC_REF, Obtaining the value of a variable atomically
5316* `ATOMIC_XOR':    ATOMIC_XOR, Atomic bitwise OR operation
5317* `BACKTRACE':     BACKTRACE, Show a backtrace
5318* `BESSEL_J0':     BESSEL_J0, Bessel function of the first kind of order 0
5319* `BESSEL_J1':     BESSEL_J1, Bessel function of the first kind of order 1
5320* `BESSEL_JN':     BESSEL_JN, Bessel function of the first kind
5321* `BESSEL_Y0':     BESSEL_Y0, Bessel function of the second kind of order 0
5322* `BESSEL_Y1':     BESSEL_Y1, Bessel function of the second kind of order 1
5323* `BESSEL_YN':     BESSEL_YN, Bessel function of the second kind
5324* `BGE':           BGE,       Bitwise greater than or equal to
5325* `BGT':           BGT,       Bitwise greater than
5326* `BIT_SIZE':      BIT_SIZE,  Bit size inquiry function
5327* `BLE':           BLE,       Bitwise less than or equal to
5328* `BLT':           BLT,       Bitwise less than
5329* `BTEST':         BTEST,     Bit test function
5330* `C_ASSOCIATED':  C_ASSOCIATED, Status of a C pointer
5331* `C_F_POINTER':   C_F_POINTER, Convert C into Fortran pointer
5332* `C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
5333* `C_FUNLOC':      C_FUNLOC,  Obtain the C address of a procedure
5334* `C_LOC':         C_LOC,     Obtain the C address of an object
5335* `C_SIZEOF':      C_SIZEOF,  Size in bytes of an expression
5336* `CEILING':       CEILING,   Integer ceiling function
5337* `CHAR':          CHAR,      Integer-to-character conversion function
5338* `CHDIR':         CHDIR,     Change working directory
5339* `CHMOD':         CHMOD,     Change access permissions of files
5340* `CMPLX':         CMPLX,     Complex conversion function
5341* `CO_BROADCAST':  CO_BROADCAST, Copy a value to all images the current set of images
5342* `CO_MAX':        CO_MAX,    Maximal value on the current set of images
5343* `CO_MIN':        CO_MIN,    Minimal value on the current set of images
5344* `CO_REDUCE':     CO_REDUCE, Reduction of values on the current set of images
5345* `CO_SUM':        CO_SUM,    Sum of values on the current set of images
5346* `COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
5347* `COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
5348* `COMPILER_VERSION': COMPILER_VERSION, Compiler version string
5349* `COMPLEX':       COMPLEX,   Complex conversion function
5350* `CONJG':         CONJG,     Complex conjugate function
5351* `COS':           COS,       Cosine function
5352* `COSH':          COSH,      Hyperbolic cosine function
5353* `COUNT':         COUNT,     Count occurrences of TRUE in an array
5354* `CPU_TIME':      CPU_TIME,  CPU time subroutine
5355* `CSHIFT':        CSHIFT,    Circular shift elements of an array
5356* `CTIME':         CTIME,     Subroutine (or function) to convert a time into a string
5357* `DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
5358* `DBLE':          DBLE,      Double precision conversion function
5359* `DCMPLX':        DCMPLX,    Double complex conversion function
5360* `DIGITS':        DIGITS,    Significant digits function
5361* `DIM':           DIM,       Positive difference
5362* `DOT_PRODUCT':   DOT_PRODUCT, Dot product function
5363* `DPROD':         DPROD,     Double product function
5364* `DREAL':         DREAL,     Double real part function
5365* `DSHIFTL':       DSHIFTL,   Combined left shift
5366* `DSHIFTR':       DSHIFTR,   Combined right shift
5367* `DTIME':         DTIME,     Execution time subroutine (or function)
5368* `EOSHIFT':       EOSHIFT,   End-off shift elements of an array
5369* `EPSILON':       EPSILON,   Epsilon function
5370* `ERF':           ERF,       Error function
5371* `ERFC':          ERFC,      Complementary error function
5372* `ERFC_SCALED':   ERFC_SCALED, Exponentially-scaled complementary error function
5373* `ETIME':         ETIME,     Execution time subroutine (or function)
5374* `EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
5375* `EXIT':          EXIT,      Exit the program with status.
5376* `EXP':           EXP,       Exponential function
5377* `EXPONENT':      EXPONENT,  Exponent function
5378* `EXTENDS_TYPE_OF': EXTENDS_TYPE_OF,  Query dynamic type for extension
5379* `FDATE':         FDATE,     Subroutine (or function) to get the current time as a string
5380* `FGET':          FGET,      Read a single character in stream mode from stdin
5381* `FGETC':         FGETC,     Read a single character in stream mode
5382* `FLOOR':         FLOOR,     Integer floor function
5383* `FLUSH':         FLUSH,     Flush I/O unit(s)
5384* `FNUM':          FNUM,      File number function
5385* `FPUT':          FPUT,      Write a single character in stream mode to stdout
5386* `FPUTC':         FPUTC,     Write a single character in stream mode
5387* `FRACTION':      FRACTION,  Fractional part of the model representation
5388* `FREE':          FREE,      Memory de-allocation subroutine
5389* `FSEEK':         FSEEK,     Low level file positioning subroutine
5390* `FSTAT':         FSTAT,     Get file status
5391* `FTELL':         FTELL,     Current stream position
5392* `GAMMA':         GAMMA,     Gamma function
5393* `GERROR':        GERROR,    Get last system error message
5394* `GETARG':        GETARG,    Get command line arguments
5395* `GET_COMMAND':   GET_COMMAND, Get the entire command line
5396* `GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
5397* `GETCWD':        GETCWD,    Get current working directory
5398* `GETENV':        GETENV,    Get an environmental variable
5399* `GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
5400* `GETGID':        GETGID,    Group ID function
5401* `GETLOG':        GETLOG,    Get login name
5402* `GETPID':        GETPID,    Process ID function
5403* `GETUID':        GETUID,    User ID function
5404* `GMTIME':        GMTIME,    Convert time to GMT info
5405* `HOSTNM':        HOSTNM,    Get system host name
5406* `HUGE':          HUGE,      Largest number of a kind
5407* `HYPOT':         HYPOT,     Euclidean distance function
5408* `IACHAR':        IACHAR,    Code in ASCII collating sequence
5409* `IALL':          IALL,      Bitwise AND of array elements
5410* `IAND':          IAND,      Bitwise logical and
5411* `IANY':          IANY,      Bitwise OR of array elements
5412* `IARGC':         IARGC,     Get the number of command line arguments
5413* `IBCLR':         IBCLR,     Clear bit
5414* `IBITS':         IBITS,     Bit extraction
5415* `IBSET':         IBSET,     Set bit
5416* `ICHAR':         ICHAR,     Character-to-integer conversion function
5417* `IDATE':         IDATE,     Current local time (day/month/year)
5418* `IEOR':          IEOR,      Bitwise logical exclusive or
5419* `IERRNO':        IERRNO,    Function to get the last system error number
5420* `IMAGE_INDEX':   IMAGE_INDEX, Cosubscript to image index conversion
5421* `INDEX':         INDEX intrinsic, Position of a substring within a string
5422* `INT':           INT,       Convert to integer type
5423* `INT2':          INT2,      Convert to 16-bit integer type
5424* `INT8':          INT8,      Convert to 64-bit integer type
5425* `IOR':           IOR,       Bitwise logical or
5426* `IPARITY':       IPARITY,   Bitwise XOR of array elements
5427* `IRAND':         IRAND,     Integer pseudo-random number
5428* `IS_IOSTAT_END':  IS_IOSTAT_END, Test for end-of-file value
5429* `IS_IOSTAT_EOR':  IS_IOSTAT_EOR, Test for end-of-record value
5430* `ISATTY':        ISATTY,    Whether a unit is a terminal device
5431* `ISHFT':         ISHFT,     Shift bits
5432* `ISHFTC':        ISHFTC,    Shift bits circularly
5433* `ISNAN':         ISNAN,     Tests for a NaN
5434* `ITIME':         ITIME,     Current local time (hour/minutes/seconds)
5435* `KILL':          KILL,      Send a signal to a process
5436* `KIND':          KIND,      Kind of an entity
5437* `LBOUND':        LBOUND,    Lower dimension bounds of an array
5438* `LCOBOUND':      LCOBOUND,  Lower codimension bounds of an array
5439* `LEADZ':         LEADZ,     Number of leading zero bits of an integer
5440* `LEN':           LEN,       Length of a character entity
5441* `LEN_TRIM':      LEN_TRIM,  Length of a character entity without trailing blank characters
5442* `LGE':           LGE,       Lexical greater than or equal
5443* `LGT':           LGT,       Lexical greater than
5444* `LINK':          LINK,      Create a hard link
5445* `LLE':           LLE,       Lexical less than or equal
5446* `LLT':           LLT,       Lexical less than
5447* `LNBLNK':        LNBLNK,    Index of the last non-blank character in a string
5448* `LOC':           LOC,       Returns the address of a variable
5449* `LOG':           LOG,       Logarithm function
5450* `LOG10':         LOG10,     Base 10 logarithm function
5451* `LOG_GAMMA':     LOG_GAMMA, Logarithm of the Gamma function
5452* `LOGICAL':       LOGICAL,   Convert to logical type
5453* `LONG':          LONG,      Convert to integer type
5454* `LSHIFT':        LSHIFT,    Left shift bits
5455* `LSTAT':         LSTAT,     Get file status
5456* `LTIME':         LTIME,     Convert time to local time info
5457* `MALLOC':        MALLOC,    Dynamic memory allocation function
5458* `MASKL':         MASKL,     Left justified mask
5459* `MASKR':         MASKR,     Right justified mask
5460* `MATMUL':        MATMUL,    matrix multiplication
5461* `MAX':           MAX,       Maximum value of an argument list
5462* `MAXEXPONENT':   MAXEXPONENT, Maximum exponent of a real kind
5463* `MAXLOC':        MAXLOC,    Location of the maximum value within an array
5464* `MAXVAL':        MAXVAL,    Maximum value of an array
5465* `MCLOCK':        MCLOCK,    Time function
5466* `MCLOCK8':       MCLOCK8,   Time function (64-bit)
5467* `MERGE':         MERGE,     Merge arrays
5468* `MERGE_BITS':    MERGE_BITS, Merge of bits under mask
5469* `MIN':           MIN,       Minimum value of an argument list
5470* `MINEXPONENT':   MINEXPONENT, Minimum exponent of a real kind
5471* `MINLOC':        MINLOC,    Location of the minimum value within an array
5472* `MINVAL':        MINVAL,    Minimum value of an array
5473* `MOD':           MOD,       Remainder function
5474* `MODULO':        MODULO,    Modulo function
5475* `MOVE_ALLOC':    MOVE_ALLOC, Move allocation from one object to another
5476* `MVBITS':        MVBITS,    Move bits from one integer to another
5477* `NEAREST':       NEAREST,   Nearest representable number
5478* `NEW_LINE':      NEW_LINE,  New line character
5479* `NINT':          NINT,      Nearest whole number
5480* `NORM2':         NORM2,     Euclidean vector norm
5481* `NOT':           NOT,       Logical negation
5482* `NULL':          NULL,      Function that returns an disassociated pointer
5483* `NUM_IMAGES':    NUM_IMAGES, Number of images
5484* `OR':            OR,        Bitwise logical OR
5485* `PACK':          PACK,      Pack an array into an array of rank one
5486* `PARITY':        PARITY,    Reduction with exclusive OR
5487* `PERROR':        PERROR,    Print system error message
5488* `POPCNT':        POPCNT,    Number of bits set
5489* `POPPAR':        POPPAR,    Parity of the number of bits set
5490* `PRECISION':     PRECISION, Decimal precision of a real kind
5491* `PRESENT':       PRESENT,   Determine whether an optional dummy argument is specified
5492* `PRODUCT':       PRODUCT,   Product of array elements
5493* `RADIX':         RADIX,     Base of a data model
5494* `RAN':           RAN,       Real pseudo-random number
5495* `RAND':          RAND,      Real pseudo-random number
5496* `RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
5497* `RANDOM_SEED':   RANDOM_SEED, Initialize a pseudo-random number sequence
5498* `RANGE':         RANGE,     Decimal exponent range
5499* `RANK' :         RANK,      Rank of a data object
5500* `REAL':          REAL,      Convert to real type
5501* `RENAME':        RENAME,    Rename a file
5502* `REPEAT':        REPEAT,    Repeated string concatenation
5503* `RESHAPE':       RESHAPE,   Function to reshape an array
5504* `RRSPACING':     RRSPACING, Reciprocal of the relative spacing
5505* `RSHIFT':        RSHIFT,    Right shift bits
5506* `SAME_TYPE_AS':  SAME_TYPE_AS,  Query dynamic types for equality
5507* `SCALE':         SCALE,     Scale a real value
5508* `SCAN':          SCAN,      Scan a string for the presence of a set of characters
5509* `SECNDS':        SECNDS,    Time function
5510* `SECOND':        SECOND,    CPU time function
5511* `SELECTED_CHAR_KIND': SELECTED_CHAR_KIND,  Choose character kind
5512* `SELECTED_INT_KIND': SELECTED_INT_KIND,  Choose integer kind
5513* `SELECTED_REAL_KIND': SELECTED_REAL_KIND,  Choose real kind
5514* `SET_EXPONENT':  SET_EXPONENT, Set the exponent of the model
5515* `SHAPE':         SHAPE,     Determine the shape of an array
5516* `SHIFTA':        SHIFTA,    Right shift with fill
5517* `SHIFTL':        SHIFTL,    Left shift
5518* `SHIFTR':        SHIFTR,    Right shift
5519* `SIGN':          SIGN,      Sign copying function
5520* `SIGNAL':        SIGNAL,    Signal handling subroutine (or function)
5521* `SIN':           SIN,       Sine function
5522* `SINH':          SINH,      Hyperbolic sine function
5523* `SIZE':          SIZE,      Function to determine the size of an array
5524* `SIZEOF':        SIZEOF,    Determine the size in bytes of an expression
5525* `SLEEP':         SLEEP,     Sleep for the specified number of seconds
5526* `SPACING':       SPACING,   Smallest distance between two numbers of a given type
5527* `SPREAD':        SPREAD,    Add a dimension to an array
5528* `SQRT':          SQRT,      Square-root function
5529* `SRAND':         SRAND,     Reinitialize the random number generator
5530* `STAT':          STAT,      Get file status
5531* `STORAGE_SIZE':  STORAGE_SIZE, Storage size in bits
5532* `SUM':           SUM,       Sum of array elements
5533* `SYMLNK':        SYMLNK,    Create a symbolic link
5534* `SYSTEM':        SYSTEM,    Execute a shell command
5535* `SYSTEM_CLOCK':  SYSTEM_CLOCK, Time function
5536* `TAN':           TAN,       Tangent function
5537* `TANH':          TANH,      Hyperbolic tangent function
5538* `THIS_IMAGE':    THIS_IMAGE, Cosubscript index of this image
5539* `TIME':          TIME,      Time function
5540* `TIME8':         TIME8,     Time function (64-bit)
5541* `TINY':          TINY,      Smallest positive number of a real kind
5542* `TRAILZ':        TRAILZ,    Number of trailing zero bits of an integer
5543* `TRANSFER':      TRANSFER,  Transfer bit patterns
5544* `TRANSPOSE':     TRANSPOSE, Transpose an array of rank two
5545* `TRIM':          TRIM,      Remove trailing blank characters of a string
5546* `TTYNAM':        TTYNAM,    Get the name of a terminal device.
5547* `UBOUND':        UBOUND,    Upper dimension bounds of an array
5548* `UCOBOUND':      UCOBOUND,  Upper codimension bounds of an array
5549* `UMASK':         UMASK,     Set the file creation mask
5550* `UNLINK':        UNLINK,    Remove a file from the file system
5551* `UNPACK':        UNPACK,    Unpack an array of rank one into an array
5552* `VERIFY':        VERIFY,    Scan a string for the absence of a set of characters
5553* `XOR':           XOR,       Bitwise logical exclusive or
5554
5555
5556File: gfortran.info,  Node: Introduction to Intrinsics,  Next: ABORT,  Up: Intrinsic Procedures
5557
55589.1 Introduction to intrinsic procedures
5559========================================
5560
5561The intrinsic procedures provided by GNU Fortran include all of the
5562intrinsic procedures required by the Fortran 95 standard, a set of
5563intrinsic procedures for backwards compatibility with G77, and a
5564selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
5565standards.  Any conflict between a description here and a description in
5566either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
55672008 standard is unintentional, and the standard(s) should be considered
5568authoritative.
5569
5570   The enumeration of the `KIND' type parameter is processor defined in
5571the Fortran 95 standard.  GNU Fortran defines the default integer type
5572and default real type by `INTEGER(KIND=4)' and `REAL(KIND=4)',
5573respectively.  The standard mandates that both data types shall have
5574another kind, which have more precision.  On typical target
5575architectures supported by `gfortran', this kind type parameter is
5576`KIND=8'.  Hence, `REAL(KIND=8)' and `DOUBLE PRECISION' are equivalent.
5577In the description of generic intrinsic procedures, the kind type
5578parameter will be specified by `KIND=*', and in the description of
5579specific names for an intrinsic procedure the kind type parameter will
5580be explicitly given (e.g., `REAL(KIND=4)' or `REAL(KIND=8)').  Finally,
5581for brevity the optional `KIND=' syntax will be omitted.
5582
5583   Many of the intrinsic procedures take one or more optional arguments.
5584This document follows the convention used in the Fortran 95 standard,
5585and denotes such arguments by square brackets.
5586
5587   GNU Fortran offers the `-std=f95' and `-std=gnu' options, which can
5588be used to restrict the set of intrinsic procedures to a given
5589standard.  By default, `gfortran' sets the `-std=gnu' option, and so
5590all intrinsic procedures described here are accepted.  There is one
5591caveat.  For a select group of intrinsic procedures, `g77' implemented
5592both a function and a subroutine.  Both classes have been implemented
5593in `gfortran' for backwards compatibility with `g77'.  It is noted here
5594that these functions and subroutines cannot be intermixed in a given
5595subprogram.  In the descriptions that follow, the applicable standard
5596for each intrinsic procedure is noted.
5597
5598
5599File: gfortran.info,  Node: ABORT,  Next: ABS,  Prev: Introduction to Intrinsics,  Up: Intrinsic Procedures
5600
56019.2 `ABORT' -- Abort the program
5602================================
5603
5604_Description_:
5605     `ABORT' causes immediate termination of the program.  On operating
5606     systems that support a core dump, `ABORT' will produce a core dump.
5607     It will also print a backtrace, unless `-fno-backtrace' is given.
5608
5609_Standard_:
5610     GNU extension
5611
5612_Class_:
5613     Subroutine
5614
5615_Syntax_:
5616     `CALL ABORT'
5617
5618_Return value_:
5619     Does not return.
5620
5621_Example_:
5622          program test_abort
5623            integer :: i = 1, j = 2
5624            if (i /= j) call abort
5625          end program test_abort
5626
5627_See also_:
5628     *note EXIT::, *note KILL::, *note BACKTRACE::
5629
5630
5631
5632File: gfortran.info,  Node: ABS,  Next: ACCESS,  Prev: ABORT,  Up: Intrinsic Procedures
5633
56349.3 `ABS' -- Absolute value
5635===========================
5636
5637_Description_:
5638     `ABS(A)' computes the absolute value of `A'.
5639
5640_Standard_:
5641     Fortran 77 and later, has overloads that are GNU extensions
5642
5643_Class_:
5644     Elemental function
5645
5646_Syntax_:
5647     `RESULT = ABS(A)'
5648
5649_Arguments_:
5650     A          The type of the argument shall be an `INTEGER',
5651                `REAL', or `COMPLEX'.
5652
5653_Return value_:
5654     The return value is of the same type and kind as the argument
5655     except the return value is `REAL' for a `COMPLEX' argument.
5656
5657_Example_:
5658          program test_abs
5659            integer :: i = -1
5660            real :: x = -1.e0
5661            complex :: z = (-1.e0,0.e0)
5662            i = abs(i)
5663            x = abs(x)
5664            x = abs(z)
5665          end program test_abs
5666
5667_Specific names_:
5668     Name          Argument      Return type   Standard
5669     `ABS(A)'      `REAL(4) A'   `REAL(4)'     Fortran 77 and
5670                                               later
5671     `CABS(A)'     `COMPLEX(4)   `REAL(4)'     Fortran 77 and
5672                   A'                          later
5673     `DABS(A)'     `REAL(8) A'   `REAL(8)'     Fortran 77 and
5674                                               later
5675     `IABS(A)'     `INTEGER(4)   `INTEGER(4)'  Fortran 77 and
5676                   A'                          later
5677     `ZABS(A)'     `COMPLEX(8)   `COMPLEX(8)'  GNU extension
5678                   A'                          
5679     `CDABS(A)'    `COMPLEX(8)   `COMPLEX(8)'  GNU extension
5680                   A'                          
5681
5682
5683File: gfortran.info,  Node: ACCESS,  Next: ACHAR,  Prev: ABS,  Up: Intrinsic Procedures
5684
56859.4 `ACCESS' -- Checks file access modes
5686========================================
5687
5688_Description_:
5689     `ACCESS(NAME, MODE)' checks whether the file NAME exists, is
5690     readable, writable or executable. Except for the executable check,
5691     `ACCESS' can be replaced by Fortran 95's `INQUIRE'.
5692
5693_Standard_:
5694     GNU extension
5695
5696_Class_:
5697     Inquiry function
5698
5699_Syntax_:
5700     `RESULT = ACCESS(NAME, MODE)'
5701
5702_Arguments_:
5703     NAME       Scalar `CHARACTER' of default kind with the
5704                file name. Tailing blank are ignored unless
5705                the character `achar(0)' is present, then all
5706                characters up to and excluding `achar(0)' are
5707                used as file name.
5708     MODE       Scalar `CHARACTER' of default kind with the
5709                file access mode, may be any concatenation of
5710                `"r"' (readable), `"w"' (writable) and `"x"'
5711                (executable), or `" "' to check for existence.
5712
5713_Return value_:
5714     Returns a scalar `INTEGER', which is `0' if the file is accessible
5715     in the given mode; otherwise or if an invalid argument has been
5716     given for `MODE' the value `1' is returned.
5717
5718_Example_:
5719          program access_test
5720            implicit none
5721            character(len=*), parameter :: file  = 'test.dat'
5722            character(len=*), parameter :: file2 = 'test.dat  '//achar(0)
5723            if(access(file,' ') == 0) print *, trim(file),' is exists'
5724            if(access(file,'r') == 0) print *, trim(file),' is readable'
5725            if(access(file,'w') == 0) print *, trim(file),' is writable'
5726            if(access(file,'x') == 0) print *, trim(file),' is executable'
5727            if(access(file2,'rwx') == 0) &
5728              print *, trim(file2),' is readable, writable and executable'
5729          end program access_test
5730
5731_Specific names_:
5732
5733_See also_:
5734
5735
5736File: gfortran.info,  Node: ACHAR,  Next: ACOS,  Prev: ACCESS,  Up: Intrinsic Procedures
5737
57389.5 `ACHAR' -- Character in ASCII collating sequence
5739====================================================
5740
5741_Description_:
5742     `ACHAR(I)' returns the character located at position `I' in the
5743     ASCII collating sequence.
5744
5745_Standard_:
5746     Fortran 77 and later, with KIND argument Fortran 2003 and later
5747
5748_Class_:
5749     Elemental function
5750
5751_Syntax_:
5752     `RESULT = ACHAR(I [, KIND])'
5753
5754_Arguments_:
5755     I          The type shall be `INTEGER'.
5756     KIND       (Optional) An `INTEGER' initialization
5757                expression indicating the kind parameter of
5758                the result.
5759
5760_Return value_:
5761     The return value is of type `CHARACTER' with a length of one.  If
5762     the KIND argument is present, the return value is of the specified
5763     kind and of the default kind otherwise.
5764
5765_Example_:
5766          program test_achar
5767            character c
5768            c = achar(32)
5769          end program test_achar
5770
5771_Note_:
5772     See *note ICHAR:: for a discussion of converting between numerical
5773     values and formatted string representations.
5774
5775_See also_:
5776     *note CHAR::, *note IACHAR::, *note ICHAR::
5777
5778
5779
5780File: gfortran.info,  Node: ACOS,  Next: ACOSH,  Prev: ACHAR,  Up: Intrinsic Procedures
5781
57829.6 `ACOS' -- Arccosine function
5783================================
5784
5785_Description_:
5786     `ACOS(X)' computes the arccosine of X (inverse of `COS(X)').
5787
5788_Standard_:
5789     Fortran 77 and later, for a complex argument Fortran 2008 or later
5790
5791_Class_:
5792     Elemental function
5793
5794_Syntax_:
5795     `RESULT = ACOS(X)'
5796
5797_Arguments_:
5798     X          The type shall either be `REAL' with a
5799                magnitude that is less than or equal to one -
5800                or the type shall be `COMPLEX'.
5801
5802_Return value_:
5803     The return value is of the same type and kind as X.  The real part
5804     of the result is in radians and lies in the range 0 \leq \Re
5805     \acos(x) \leq \pi.
5806
5807_Example_:
5808          program test_acos
5809            real(8) :: x = 0.866_8
5810            x = acos(x)
5811          end program test_acos
5812
5813_Specific names_:
5814     Name          Argument      Return type   Standard
5815     `ACOS(X)'     `REAL(4) X'   `REAL(4)'     Fortran 77 and
5816                                               later
5817     `DACOS(X)'    `REAL(8) X'   `REAL(8)'     Fortran 77 and
5818                                               later
5819
5820_See also_:
5821     Inverse function: *note COS::
5822
5823
5824
5825File: gfortran.info,  Node: ACOSH,  Next: ADJUSTL,  Prev: ACOS,  Up: Intrinsic Procedures
5826
58279.7 `ACOSH' -- Inverse hyperbolic cosine function
5828=================================================
5829
5830_Description_:
5831     `ACOSH(X)' computes the inverse hyperbolic cosine of X.
5832
5833_Standard_:
5834     Fortran 2008 and later
5835
5836_Class_:
5837     Elemental function
5838
5839_Syntax_:
5840     `RESULT = ACOSH(X)'
5841
5842_Arguments_:
5843     X          The type shall be `REAL' or `COMPLEX'.
5844
5845_Return value_:
5846     The return value has the same type and kind as X. If X is complex,
5847     the imaginary part of the result is in radians and lies between  0
5848     \leq \Im \acosh(x) \leq \pi.
5849
5850_Example_:
5851          PROGRAM test_acosh
5852            REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
5853            WRITE (*,*) ACOSH(x)
5854          END PROGRAM
5855
5856_Specific names_:
5857     Name          Argument      Return type   Standard
5858     `DACOSH(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
5859
5860_See also_:
5861     Inverse function: *note COSH::
5862
5863
5864File: gfortran.info,  Node: ADJUSTL,  Next: ADJUSTR,  Prev: ACOSH,  Up: Intrinsic Procedures
5865
58669.8 `ADJUSTL' -- Left adjust a string
5867=====================================
5868
5869_Description_:
5870     `ADJUSTL(STRING)' will left adjust a string by removing leading
5871     spaces.  Spaces are inserted at the end of the string as needed.
5872
5873_Standard_:
5874     Fortran 90 and later
5875
5876_Class_:
5877     Elemental function
5878
5879_Syntax_:
5880     `RESULT = ADJUSTL(STRING)'
5881
5882_Arguments_:
5883     STRING     The type shall be `CHARACTER'.
5884
5885_Return value_:
5886     The return value is of type `CHARACTER' and of the same kind as
5887     STRING where leading spaces are removed and the same number of
5888     spaces are inserted on the end of STRING.
5889
5890_Example_:
5891          program test_adjustl
5892            character(len=20) :: str = '   gfortran'
5893            str = adjustl(str)
5894            print *, str
5895          end program test_adjustl
5896
5897_See also_:
5898     *note ADJUSTR::, *note TRIM::
5899
5900
5901File: gfortran.info,  Node: ADJUSTR,  Next: AIMAG,  Prev: ADJUSTL,  Up: Intrinsic Procedures
5902
59039.9 `ADJUSTR' -- Right adjust a string
5904======================================
5905
5906_Description_:
5907     `ADJUSTR(STRING)' will right adjust a string by removing trailing
5908     spaces.  Spaces are inserted at the start of the string as needed.
5909
5910_Standard_:
5911     Fortran 95 and later
5912
5913_Class_:
5914     Elemental function
5915
5916_Syntax_:
5917     `RESULT = ADJUSTR(STRING)'
5918
5919_Arguments_:
5920     STR        The type shall be `CHARACTER'.
5921
5922_Return value_:
5923     The return value is of type `CHARACTER' and of the same kind as
5924     STRING where trailing spaces are removed and the same number of
5925     spaces are inserted at the start of STRING.
5926
5927_Example_:
5928          program test_adjustr
5929            character(len=20) :: str = 'gfortran'
5930            str = adjustr(str)
5931            print *, str
5932          end program test_adjustr
5933
5934_See also_:
5935     *note ADJUSTL::, *note TRIM::
5936
5937
5938File: gfortran.info,  Node: AIMAG,  Next: AINT,  Prev: ADJUSTR,  Up: Intrinsic Procedures
5939
59409.10 `AIMAG' -- Imaginary part of complex number
5941================================================
5942
5943_Description_:
5944     `AIMAG(Z)' yields the imaginary part of complex argument `Z'.  The
5945     `IMAG(Z)' and `IMAGPART(Z)' intrinsic functions are provided for
5946     compatibility with `g77', and their use in new code is strongly
5947     discouraged.
5948
5949_Standard_:
5950     Fortran 77 and later, has overloads that are GNU extensions
5951
5952_Class_:
5953     Elemental function
5954
5955_Syntax_:
5956     `RESULT = AIMAG(Z)'
5957
5958_Arguments_:
5959     Z          The type of the argument shall be `COMPLEX'.
5960
5961_Return value_:
5962     The return value is of type `REAL' with the kind type parameter of
5963     the argument.
5964
5965_Example_:
5966          program test_aimag
5967            complex(4) z4
5968            complex(8) z8
5969            z4 = cmplx(1.e0_4, 0.e0_4)
5970            z8 = cmplx(0.e0_8, 1.e0_8)
5971            print *, aimag(z4), dimag(z8)
5972          end program test_aimag
5973
5974_Specific names_:
5975     Name          Argument      Return type   Standard
5976     `AIMAG(Z)'    `COMPLEX Z'   `REAL'        GNU extension
5977     `DIMAG(Z)'    `COMPLEX(8)   `REAL(8)'     GNU extension
5978                   Z'                          
5979     `IMAG(Z)'     `COMPLEX Z'   `REAL'        GNU extension
5980     `IMAGPART(Z)' `COMPLEX Z'   `REAL'        GNU extension
5981
5982
5983File: gfortran.info,  Node: AINT,  Next: ALARM,  Prev: AIMAG,  Up: Intrinsic Procedures
5984
59859.11 `AINT' -- Truncate to a whole number
5986=========================================
5987
5988_Description_:
5989     `AINT(A [, KIND])' truncates its argument to a whole number.
5990
5991_Standard_:
5992     Fortran 77 and later
5993
5994_Class_:
5995     Elemental function
5996
5997_Syntax_:
5998     `RESULT = AINT(A [, KIND])'
5999
6000_Arguments_:
6001     A          The type of the argument shall be `REAL'.
6002     KIND       (Optional) An `INTEGER' initialization
6003                expression indicating the kind parameter of
6004                the result.
6005
6006_Return value_:
6007     The return value is of type `REAL' with the kind type parameter of
6008     the argument if the optional KIND is absent; otherwise, the kind
6009     type parameter will be given by KIND.  If the magnitude of X is
6010     less than one, `AINT(X)' returns zero.  If the magnitude is equal
6011     to or greater than one then it returns the largest whole number
6012     that does not exceed its magnitude.  The sign is the same as the
6013     sign of X.
6014
6015_Example_:
6016          program test_aint
6017            real(4) x4
6018            real(8) x8
6019            x4 = 1.234E0_4
6020            x8 = 4.321_8
6021            print *, aint(x4), dint(x8)
6022            x8 = aint(x4,8)
6023          end program test_aint
6024
6025_Specific names_:
6026     Name          Argument      Return type   Standard
6027     `AINT(A)'     `REAL(4) A'   `REAL(4)'     Fortran 77 and
6028                                               later
6029     `DINT(A)'     `REAL(8) A'   `REAL(8)'     Fortran 77 and
6030                                               later
6031
6032
6033File: gfortran.info,  Node: ALARM,  Next: ALL,  Prev: AINT,  Up: Intrinsic Procedures
6034
60359.12 `ALARM' -- Execute a routine after a given delay
6036=====================================================
6037
6038_Description_:
6039     `ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
6040     HANDLER to be executed after a delay of SECONDS by using
6041     `alarm(2)' to set up a signal and `signal(2)' to catch it. If
6042     STATUS is supplied, it will be returned with the number of seconds
6043     remaining until any previously scheduled alarm was due to be
6044     delivered, or zero if there was no previously scheduled alarm.
6045
6046_Standard_:
6047     GNU extension
6048
6049_Class_:
6050     Subroutine
6051
6052_Syntax_:
6053     `CALL ALARM(SECONDS, HANDLER [, STATUS])'
6054
6055_Arguments_:
6056     SECONDS    The type of the argument shall be a scalar
6057                `INTEGER'. It is `INTENT(IN)'.
6058     HANDLER    Signal handler (`INTEGER FUNCTION' or
6059                `SUBROUTINE') or dummy/global `INTEGER'
6060                scalar. The scalar values may be either
6061                `SIG_IGN=1' to ignore the alarm generated or
6062                `SIG_DFL=0' to set the default action. It is
6063                `INTENT(IN)'.
6064     STATUS     (Optional) STATUS shall be a scalar variable
6065                of the default `INTEGER' kind. It is
6066                `INTENT(OUT)'.
6067
6068_Example_:
6069          program test_alarm
6070            external handler_print
6071            integer i
6072            call alarm (3, handler_print, i)
6073            print *, i
6074            call sleep(10)
6075          end program test_alarm
6076     This will cause the external routine HANDLER_PRINT to be called
6077     after 3 seconds.
6078
6079
6080File: gfortran.info,  Node: ALL,  Next: ALLOCATED,  Prev: ALARM,  Up: Intrinsic Procedures
6081
60829.13 `ALL' -- All values in MASK along DIM are true
6083===================================================
6084
6085_Description_:
6086     `ALL(MASK [, DIM])' determines if all the values are true in MASK
6087     in the array along dimension DIM.
6088
6089_Standard_:
6090     Fortran 95 and later
6091
6092_Class_:
6093     Transformational function
6094
6095_Syntax_:
6096     `RESULT = ALL(MASK [, DIM])'
6097
6098_Arguments_:
6099     MASK       The type of the argument shall be `LOGICAL' and
6100                it shall not be scalar.
6101     DIM        (Optional) DIM shall be a scalar integer with
6102                a value that lies between one and the rank of
6103                MASK.
6104
6105_Return value_:
6106     `ALL(MASK)' returns a scalar value of type `LOGICAL' where the
6107     kind type parameter is the same as the kind type parameter of
6108     MASK.  If DIM is present, then `ALL(MASK, DIM)' returns an array
6109     with the rank of MASK minus 1.  The shape is determined from the
6110     shape of MASK where the DIM dimension is elided.
6111
6112    (A)
6113          `ALL(MASK)' is true if all elements of MASK are true.  It
6114          also is true if MASK has zero size; otherwise, it is false.
6115
6116    (B)
6117          If the rank of MASK is one, then `ALL(MASK,DIM)' is equivalent
6118          to `ALL(MASK)'.  If the rank is greater than one, then
6119          `ALL(MASK,DIM)' is determined by applying `ALL' to the array
6120          sections.
6121
6122_Example_:
6123          program test_all
6124            logical l
6125            l = all((/.true., .true., .true./))
6126            print *, l
6127            call section
6128            contains
6129              subroutine section
6130                integer a(2,3), b(2,3)
6131                a = 1
6132                b = 1
6133                b(2,2) = 2
6134                print *, all(a .eq. b, 1)
6135                print *, all(a .eq. b, 2)
6136              end subroutine section
6137          end program test_all
6138
6139
6140File: gfortran.info,  Node: ALLOCATED,  Next: AND,  Prev: ALL,  Up: Intrinsic Procedures
6141
61429.14 `ALLOCATED' -- Status of an allocatable entity
6143===================================================
6144
6145_Description_:
6146     `ALLOCATED(ARRAY)' and `ALLOCATED(SCALAR)' check the allocation
6147     status of ARRAY and SCALAR, respectively.
6148
6149_Standard_:
6150     Fortran 95 and later.  Note, the `SCALAR=' keyword and allocatable
6151     scalar entities are available in Fortran 2003 and later.
6152
6153_Class_:
6154     Inquiry function
6155
6156_Syntax_:
6157     `RESULT = ALLOCATED(ARRAY)'
6158     `RESULT = ALLOCATED(SCALAR)'
6159
6160_Arguments_:
6161     ARRAY      The argument shall be an `ALLOCATABLE' array.
6162     SCALAR     The argument shall be an `ALLOCATABLE' scalar.
6163
6164_Return value_:
6165     The return value is a scalar `LOGICAL' with the default logical
6166     kind type parameter.  If the argument is allocated, then the
6167     result is `.TRUE.'; otherwise, it returns `.FALSE.'
6168
6169_Example_:
6170          program test_allocated
6171            integer :: i = 4
6172            real(4), allocatable :: x(:)
6173            if (.not. allocated(x)) allocate(x(i))
6174          end program test_allocated
6175
6176
6177File: gfortran.info,  Node: AND,  Next: ANINT,  Prev: ALLOCATED,  Up: Intrinsic Procedures
6178
61799.15 `AND' -- Bitwise logical AND
6180=================================
6181
6182_Description_:
6183     Bitwise logical `AND'.
6184
6185     This intrinsic routine is provided for backwards compatibility with
6186     GNU Fortran 77.  For integer arguments, programmers should consider
6187     the use of the *note IAND:: intrinsic defined by the Fortran
6188     standard.
6189
6190_Standard_:
6191     GNU extension
6192
6193_Class_:
6194     Function
6195
6196_Syntax_:
6197     `RESULT = AND(I, J)'
6198
6199_Arguments_:
6200     I          The type shall be either a scalar `INTEGER'
6201                type or a scalar `LOGICAL' type.
6202     J          The type shall be the same as the type of I.
6203
6204_Return value_:
6205     The return type is either a scalar `INTEGER' or a scalar
6206     `LOGICAL'.  If the kind type parameters differ, then the smaller
6207     kind type is implicitly converted to larger kind, and the return
6208     has the larger kind.
6209
6210_Example_:
6211          PROGRAM test_and
6212            LOGICAL :: T = .TRUE., F = .FALSE.
6213            INTEGER :: a, b
6214            DATA a / Z'F' /, b / Z'3' /
6215
6216            WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
6217            WRITE (*,*) AND(a, b)
6218          END PROGRAM
6219
6220_See also_:
6221     Fortran 95 elemental function: *note IAND::
6222
6223
6224File: gfortran.info,  Node: ANINT,  Next: ANY,  Prev: AND,  Up: Intrinsic Procedures
6225
62269.16 `ANINT' -- Nearest whole number
6227====================================
6228
6229_Description_:
6230     `ANINT(A [, KIND])' rounds its argument to the nearest whole
6231     number.
6232
6233_Standard_:
6234     Fortran 77 and later
6235
6236_Class_:
6237     Elemental function
6238
6239_Syntax_:
6240     `RESULT = ANINT(A [, KIND])'
6241
6242_Arguments_:
6243     A          The type of the argument shall be `REAL'.
6244     KIND       (Optional) An `INTEGER' initialization
6245                expression indicating the kind parameter of
6246                the result.
6247
6248_Return value_:
6249     The return value is of type real with the kind type parameter of
6250     the argument if the optional KIND is absent; otherwise, the kind
6251     type parameter will be given by KIND.  If A is greater than zero,
6252     `ANINT(A)' returns `AINT(X+0.5)'.  If A is less than or equal to
6253     zero then it returns `AINT(X-0.5)'.
6254
6255_Example_:
6256          program test_anint
6257            real(4) x4
6258            real(8) x8
6259            x4 = 1.234E0_4
6260            x8 = 4.321_8
6261            print *, anint(x4), dnint(x8)
6262            x8 = anint(x4,8)
6263          end program test_anint
6264
6265_Specific names_:
6266     Name          Argument      Return type   Standard
6267     `AINT(A)'     `REAL(4) A'   `REAL(4)'     Fortran 77 and
6268                                               later
6269     `DNINT(A)'    `REAL(8) A'   `REAL(8)'     Fortran 77 and
6270                                               later
6271
6272
6273File: gfortran.info,  Node: ANY,  Next: ASIN,  Prev: ANINT,  Up: Intrinsic Procedures
6274
62759.17 `ANY' -- Any value in MASK along DIM is true
6276=================================================
6277
6278_Description_:
6279     `ANY(MASK [, DIM])' determines if any of the values in the logical
6280     array MASK along dimension DIM are `.TRUE.'.
6281
6282_Standard_:
6283     Fortran 95 and later
6284
6285_Class_:
6286     Transformational function
6287
6288_Syntax_:
6289     `RESULT = ANY(MASK [, DIM])'
6290
6291_Arguments_:
6292     MASK       The type of the argument shall be `LOGICAL' and
6293                it shall not be scalar.
6294     DIM        (Optional) DIM shall be a scalar integer with
6295                a value that lies between one and the rank of
6296                MASK.
6297
6298_Return value_:
6299     `ANY(MASK)' returns a scalar value of type `LOGICAL' where the
6300     kind type parameter is the same as the kind type parameter of
6301     MASK.  If DIM is present, then `ANY(MASK, DIM)' returns an array
6302     with the rank of MASK minus 1.  The shape is determined from the
6303     shape of MASK where the DIM dimension is elided.
6304
6305    (A)
6306          `ANY(MASK)' is true if any element of MASK is true;
6307          otherwise, it is false.  It also is false if MASK has zero
6308          size.
6309
6310    (B)
6311          If the rank of MASK is one, then `ANY(MASK,DIM)' is equivalent
6312          to `ANY(MASK)'.  If the rank is greater than one, then
6313          `ANY(MASK,DIM)' is determined by applying `ANY' to the array
6314          sections.
6315
6316_Example_:
6317          program test_any
6318            logical l
6319            l = any((/.true., .true., .true./))
6320            print *, l
6321            call section
6322            contains
6323              subroutine section
6324                integer a(2,3), b(2,3)
6325                a = 1
6326                b = 1
6327                b(2,2) = 2
6328                print *, any(a .eq. b, 1)
6329                print *, any(a .eq. b, 2)
6330              end subroutine section
6331          end program test_any
6332
6333
6334File: gfortran.info,  Node: ASIN,  Next: ASINH,  Prev: ANY,  Up: Intrinsic Procedures
6335
63369.18 `ASIN' -- Arcsine function
6337===============================
6338
6339_Description_:
6340     `ASIN(X)' computes the arcsine of its X (inverse of `SIN(X)').
6341
6342_Standard_:
6343     Fortran 77 and later, for a complex argument Fortran 2008 or later
6344
6345_Class_:
6346     Elemental function
6347
6348_Syntax_:
6349     `RESULT = ASIN(X)'
6350
6351_Arguments_:
6352     X          The type shall be either `REAL' and a
6353                magnitude that is less than or equal to one -
6354                or be `COMPLEX'.
6355
6356_Return value_:
6357     The return value is of the same type and kind as X.  The real part
6358     of the result is in radians and lies in the range -\pi/2 \leq \Re
6359     \asin(x) \leq \pi/2.
6360
6361_Example_:
6362          program test_asin
6363            real(8) :: x = 0.866_8
6364            x = asin(x)
6365          end program test_asin
6366
6367_Specific names_:
6368     Name          Argument      Return type   Standard
6369     `ASIN(X)'     `REAL(4) X'   `REAL(4)'     Fortran 77 and
6370                                               later
6371     `DASIN(X)'    `REAL(8) X'   `REAL(8)'     Fortran 77 and
6372                                               later
6373
6374_See also_:
6375     Inverse function: *note SIN::
6376
6377
6378
6379File: gfortran.info,  Node: ASINH,  Next: ASSOCIATED,  Prev: ASIN,  Up: Intrinsic Procedures
6380
63819.19 `ASINH' -- Inverse hyperbolic sine function
6382================================================
6383
6384_Description_:
6385     `ASINH(X)' computes the inverse hyperbolic sine of X.
6386
6387_Standard_:
6388     Fortran 2008 and later
6389
6390_Class_:
6391     Elemental function
6392
6393_Syntax_:
6394     `RESULT = ASINH(X)'
6395
6396_Arguments_:
6397     X          The type shall be `REAL' or `COMPLEX'.
6398
6399_Return value_:
6400     The return value is of the same type and kind as  X. If X is
6401     complex, the imaginary part of the result is in radians and lies
6402     between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
6403
6404_Example_:
6405          PROGRAM test_asinh
6406            REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
6407            WRITE (*,*) ASINH(x)
6408          END PROGRAM
6409
6410_Specific names_:
6411     Name          Argument      Return type   Standard
6412     `DASINH(X)'   `REAL(8) X'   `REAL(8)'     GNU extension.
6413
6414_See also_:
6415     Inverse function: *note SINH::
6416
6417
6418File: gfortran.info,  Node: ASSOCIATED,  Next: ATAN,  Prev: ASINH,  Up: Intrinsic Procedures
6419
64209.20 `ASSOCIATED' -- Status of a pointer or pointer/target pair
6421===============================================================
6422
6423_Description_:
6424     `ASSOCIATED(POINTER [, TARGET])' determines the status of the
6425     pointer POINTER or if POINTER is associated with the target TARGET.
6426
6427_Standard_:
6428     Fortran 95 and later
6429
6430_Class_:
6431     Inquiry function
6432
6433_Syntax_:
6434     `RESULT = ASSOCIATED(POINTER [, TARGET])'
6435
6436_Arguments_:
6437     POINTER    POINTER shall have the `POINTER' attribute and
6438                it can be of any type.
6439     TARGET     (Optional) TARGET shall be a pointer or a
6440                target.  It must have the same type, kind type
6441                parameter, and array rank as POINTER.
6442     The association status of neither POINTER nor TARGET shall be
6443     undefined.
6444
6445_Return value_:
6446     `ASSOCIATED(POINTER)' returns a scalar value of type `LOGICAL(4)'.
6447     There are several cases:
6448    (A) When the optional TARGET is not present then
6449          `ASSOCIATED(POINTER)' is true if POINTER is associated with a
6450          target; otherwise, it returns false.
6451
6452    (B) If TARGET is present and a scalar target, the result is true if
6453          TARGET is not a zero-sized storage sequence and the target
6454          associated with POINTER occupies the same storage units.  If
6455          POINTER is disassociated, the result is false.
6456
6457    (C) If TARGET is present and an array target, the result is true if
6458          TARGET and POINTER have the same shape, are not zero-sized
6459          arrays, are arrays whose elements are not zero-sized storage
6460          sequences, and TARGET and POINTER occupy the same storage
6461          units in array element order.  As in case(B), the result is
6462          false, if POINTER is disassociated.
6463
6464    (D) If TARGET is present and an scalar pointer, the result is true
6465          if TARGET is associated with POINTER, the target associated
6466          with TARGET are not zero-sized storage sequences and occupy
6467          the same storage units.  The result is false, if either
6468          TARGET or POINTER is disassociated.
6469
6470    (E) If TARGET is present and an array pointer, the result is true if
6471          target associated with POINTER and the target associated with
6472          TARGET have the same shape, are not zero-sized arrays, are
6473          arrays whose elements are not zero-sized storage sequences,
6474          and TARGET and POINTER occupy the same storage units in array
6475          element order.  The result is false, if either TARGET or
6476          POINTER is disassociated.
6477
6478_Example_:
6479          program test_associated
6480             implicit none
6481             real, target  :: tgt(2) = (/1., 2./)
6482             real, pointer :: ptr(:)
6483             ptr => tgt
6484             if (associated(ptr)     .eqv. .false.) call abort
6485             if (associated(ptr,tgt) .eqv. .false.) call abort
6486          end program test_associated
6487
6488_See also_:
6489     *note NULL::
6490
6491
6492File: gfortran.info,  Node: ATAN,  Next: ATAN2,  Prev: ASSOCIATED,  Up: Intrinsic Procedures
6493
64949.21 `ATAN' -- Arctangent function
6495==================================
6496
6497_Description_:
6498     `ATAN(X)' computes the arctangent of X.
6499
6500_Standard_:
6501     Fortran 77 and later, for a complex argument and for two arguments
6502     Fortran 2008 or later
6503
6504_Class_:
6505     Elemental function
6506
6507_Syntax_:
6508     `RESULT = ATAN(X)'
6509     `RESULT = ATAN(Y, X)'
6510
6511_Arguments_:
6512     X          The type shall be `REAL' or `COMPLEX'; if Y is
6513                present, X shall be REAL.
6514     Y shall    
6515     be of the  
6516     same type  
6517     and kind   
6518     as X.      
6519
6520_Return value_:
6521     The return value is of the same type and kind as X.  If Y is
6522     present, the result is identical to `ATAN2(Y,X)'.  Otherwise, it
6523     the arcus tangent of X, where the real part of the result is in
6524     radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
6525
6526_Example_:
6527          program test_atan
6528            real(8) :: x = 2.866_8
6529            x = atan(x)
6530          end program test_atan
6531
6532_Specific names_:
6533     Name          Argument      Return type   Standard
6534     `ATAN(X)'     `REAL(4) X'   `REAL(4)'     Fortran 77 and
6535                                               later
6536     `DATAN(X)'    `REAL(8) X'   `REAL(8)'     Fortran 77 and
6537                                               later
6538
6539_See also_:
6540     Inverse function: *note TAN::
6541
6542
6543
6544File: gfortran.info,  Node: ATAN2,  Next: ATANH,  Prev: ATAN,  Up: Intrinsic Procedures
6545
65469.22 `ATAN2' -- Arctangent function
6547===================================
6548
6549_Description_:
6550     `ATAN2(Y, X)' computes the principal value of the argument
6551     function of the complex number X + i Y. This function can be used
6552     to transform from Cartesian into polar coordinates and allows to
6553     determine the angle in the correct quadrant.
6554
6555_Standard_:
6556     Fortran 77 and later
6557
6558_Class_:
6559     Elemental function
6560
6561_Syntax_:
6562     `RESULT = ATAN2(Y, X)'
6563
6564_Arguments_:
6565     Y          The type shall be `REAL'.
6566     X          The type and kind type parameter shall be the
6567                same as Y.  If Y is zero, then X must be
6568                nonzero.
6569
6570_Return value_:
6571     The return value has the same type and kind type parameter as Y. It
6572     is the principal value of the complex number X + i Y.  If X is
6573     nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
6574     The sign is positive if Y is positive.  If Y is zero, then the
6575     return value is zero if X is strictly positive, \pi if X is
6576     negative and Y is positive zero (or the processor does not handle
6577     signed zeros), and -\pi if X is negative and Y is negative zero.
6578     Finally, if X is zero, then the magnitude of the result is \pi/2.
6579
6580_Example_:
6581          program test_atan2
6582            real(4) :: x = 1.e0_4, y = 0.5e0_4
6583            x = atan2(y,x)
6584          end program test_atan2
6585
6586_Specific names_:
6587     Name          Argument      Return type   Standard
6588     `ATAN2(X,     `REAL(4) X,   `REAL(4)'     Fortran 77 and
6589     Y)'           Y'                          later
6590     `DATAN2(X,    `REAL(8) X,   `REAL(8)'     Fortran 77 and
6591     Y)'           Y'                          later
6592
6593
6594File: gfortran.info,  Node: ATANH,  Next: ATOMIC_ADD,  Prev: ATAN2,  Up: Intrinsic Procedures
6595
65969.23 `ATANH' -- Inverse hyperbolic tangent function
6597===================================================
6598
6599_Description_:
6600     `ATANH(X)' computes the inverse hyperbolic tangent of X.
6601
6602_Standard_:
6603     Fortran 2008 and later
6604
6605_Class_:
6606     Elemental function
6607
6608_Syntax_:
6609     `RESULT = ATANH(X)'
6610
6611_Arguments_:
6612     X          The type shall be `REAL' or `COMPLEX'.
6613
6614_Return value_:
6615     The return value has same type and kind as X. If X is complex, the
6616     imaginary part of the result is in radians and lies between -\pi/2
6617     \leq \Im \atanh(x) \leq \pi/2.
6618
6619_Example_:
6620          PROGRAM test_atanh
6621            REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
6622            WRITE (*,*) ATANH(x)
6623          END PROGRAM
6624
6625_Specific names_:
6626     Name          Argument      Return type   Standard
6627     `DATANH(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
6628
6629_See also_:
6630     Inverse function: *note TANH::
6631
6632
6633File: gfortran.info,  Node: ATOMIC_ADD,  Next: ATOMIC_AND,  Prev: ATANH,  Up: Intrinsic Procedures
6634
66359.24 `ATOMIC_ADD' -- Atomic ADD operation
6636=========================================
6637
6638_Description_:
6639     `ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
6640     variable ATOM. When STAT is present and the invokation was
6641     successful, it is assigned the value 0. If it is present and the
6642     invokation has failed, it is assigned a positive value; in
6643     particular, for a coindexed ATOM, if the remote image has stopped,
6644     it is assigned the value of `ISO_FORTRAN_ENV''s
6645     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6646     `STAT_FAILED_IMAGE'.
6647
6648_Standard_:
6649     TS 18508 or later
6650
6651_Class_:
6652     Atomic subroutine
6653
6654_Syntax_:
6655     `CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
6656
6657_Arguments_:
6658     ATOM       Scalar coarray or coindexed variable of integer
6659                type with `ATOMIC_INT_KIND' kind.
6660     VALUE      Scalar of the same type as ATOM. If the kind
6661                is different, the value is converted to the
6662                kind of ATOM.
6663     STAT       (optional) Scalar default-kind integer
6664                variable.
6665
6666_Example_:
6667          program atomic
6668            use iso_fortran_env
6669            integer(atomic_int_kind) :: atom[*]
6670            call atomic_add (atom[1], this_image())
6671          end program atomic
6672
6673_See also_:
6674     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
6675     ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
6676     ATOMIC_XOR::
6677
6678
6679File: gfortran.info,  Node: ATOMIC_AND,  Next: ATOMIC_CAS,  Prev: ATOMIC_ADD,  Up: Intrinsic Procedures
6680
66819.25 `ATOMIC_AND' -- Atomic bitwise AND operation
6682=================================================
6683
6684_Description_:
6685     `ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
6686     AND between the values of ATOM and VALUE. When STAT is present and
6687     the invokation was successful, it is assigned the value 0. If it
6688     is present and the invokation has failed, it is assigned a
6689     positive value; in particular, for a coindexed ATOM, if the remote
6690     image has stopped, it is assigned the value of `ISO_FORTRAN_ENV''s
6691     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6692     `STAT_FAILED_IMAGE'.
6693
6694_Standard_:
6695     TS 18508 or later
6696
6697_Class_:
6698     Atomic subroutine
6699
6700_Syntax_:
6701     `CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
6702
6703_Arguments_:
6704     ATOM       Scalar coarray or coindexed variable of integer
6705                type with `ATOMIC_INT_KIND' kind.
6706     VALUE      Scalar of the same type as ATOM. If the kind
6707                is different, the value is converted to the
6708                kind of ATOM.
6709     STAT       (optional) Scalar default-kind integer
6710                variable.
6711
6712_Example_:
6713          program atomic
6714            use iso_fortran_env
6715            integer(atomic_int_kind) :: atom[*]
6716            call atomic_and (atom[1], int(b'10100011101'))
6717          end program atomic
6718
6719_See also_:
6720     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
6721     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
6722     ATOMIC_XOR::
6723
6724
6725File: gfortran.info,  Node: ATOMIC_CAS,  Next: ATOMIC_DEFINE,  Prev: ATOMIC_AND,  Up: Intrinsic Procedures
6726
67279.26 `ATOMIC_CAS' -- Atomic compare and swap
6728============================================
6729
6730_Description_:
6731     `ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
6732     if the value is the same, ATOM is set to the value of NEW.
6733     Additionally, OLD is set to the value of ATOM that was used for
6734     the comparison.  When STAT is present and the invokation was
6735     successful, it is assigned the value 0. If it is present and the
6736     invokation has failed, it is assigned a positive value; in
6737     particular, for a coindexed ATOM, if the remote image has stopped,
6738     it is assigned the value of `ISO_FORTRAN_ENV''s
6739     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6740     `STAT_FAILED_IMAGE'.
6741
6742_Standard_:
6743     TS 18508 or later
6744
6745_Class_:
6746     Atomic subroutine
6747
6748_Syntax_:
6749     `CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
6750
6751_Arguments_:
6752     ATOM       Scalar coarray or coindexed variable of either
6753                integer type with `ATOMIC_INT_KIND' kind or
6754                logical type with `ATOMIC_LOGICAL_KIND' kind.
6755     OLD        Scalar of the same type and kind as ATOM.
6756     COMPARE    Scalar variable of the same type and kind as
6757                ATOM.
6758     NEW        Scalar variable of the same type as ATOM. If
6759                kind is different, the value is converted to
6760                the kind of ATOM.
6761     STAT       (optional) Scalar default-kind integer
6762                variable.
6763
6764_Example_:
6765          program atomic
6766            use iso_fortran_env
6767            logical(atomic_logical_kind) :: atom[*], prev
6768            call atomic_cas (atom[1], prev, .false., .true.))
6769          end program atomic
6770
6771_See also_:
6772     *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
6773
6774
6775File: gfortran.info,  Node: ATOMIC_DEFINE,  Next: ATOMIC_FETCH_ADD,  Prev: ATOMIC_CAS,  Up: Intrinsic Procedures
6776
67779.27 `ATOMIC_DEFINE' -- Setting a variable atomically
6778=====================================================
6779
6780_Description_:
6781     `ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
6782     value VALUE atomically. When STAT is present and the invokation was
6783     successful, it is assigned the value 0. If it is present and the
6784     invokation has failed, it is assigned a positive value; in
6785     particular, for a coindexed ATOM, if the remote image has stopped,
6786     it is assigned the value of `ISO_FORTRAN_ENV''s
6787     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6788     `STAT_FAILED_IMAGE'.
6789
6790_Standard_:
6791     Fortran 2008 and later; with STAT, TS 18508 or later
6792
6793_Class_:
6794     Atomic subroutine
6795
6796_Syntax_:
6797     `CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
6798
6799_Arguments_:
6800     ATOM       Scalar coarray or coindexed variable of either
6801                integer type with `ATOMIC_INT_KIND' kind or
6802                logical type with `ATOMIC_LOGICAL_KIND' kind.
6803     VALUE      Scalar of the same type as ATOM. If the kind
6804                is different, the value is converted to the
6805                kind of ATOM.
6806     STAT       (optional) Scalar default-kind integer
6807                variable.
6808
6809_Example_:
6810          program atomic
6811            use iso_fortran_env
6812            integer(atomic_int_kind) :: atom[*]
6813            call atomic_define (atom[1], this_image())
6814          end program atomic
6815
6816_See also_:
6817     *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
6818     *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
6819     ATOMIC_XOR::
6820
6821
6822File: gfortran.info,  Node: ATOMIC_FETCH_ADD,  Next: ATOMIC_FETCH_AND,  Prev: ATOMIC_DEFINE,  Up: Intrinsic Procedures
6823
68249.28 `ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
6825================================================================
6826
6827_Description_:
6828     `ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
6829     ATOM in OLD and adds the value of VAR to the variable ATOM. When
6830     STAT is present and the invokation was successful, it is assigned
6831     the value 0. If it is present and the invokation has failed, it is
6832     assigned a positive value; in particular, for a coindexed ATOM, if
6833     the remote image has stopped, it is assigned the value of
6834     `ISO_FORTRAN_ENV''s `STAT_STOPPED_IMAGE' and if the remote image
6835     has failed, the value `STAT_FAILED_IMAGE'.
6836
6837_Standard_:
6838     TS 18508 or later
6839
6840_Class_:
6841     Atomic subroutine
6842
6843_Syntax_:
6844     `CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
6845
6846_Arguments_:
6847     ATOM       Scalar coarray or coindexed variable of integer
6848                type with `ATOMIC_INT_KIND' kind.
6849                `ATOMIC_LOGICAL_KIND' kind.
6850     VALUE      Scalar of the same type as ATOM. If the kind
6851                is different, the value is converted to the
6852                kind of ATOM.
6853     OLD        Scalar of the same type and kind as ATOM.
6854     STAT       (optional) Scalar default-kind integer
6855                variable.
6856
6857_Example_:
6858          program atomic
6859            use iso_fortran_env
6860            integer(atomic_int_kind) :: atom[*], old
6861            call atomic_add (atom[1], this_image(), old)
6862          end program atomic
6863
6864_See also_:
6865     *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
6866     *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
6867     ATOMIC_FETCH_XOR::
6868
6869
6870File: gfortran.info,  Node: ATOMIC_FETCH_AND,  Next: ATOMIC_FETCH_OR,  Prev: ATOMIC_FETCH_ADD,  Up: Intrinsic Procedures
6871
68729.29 `ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
6873========================================================================
6874
6875_Description_:
6876     `ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
6877     OLD and defines ATOM with the bitwise AND between the values of
6878     ATOM and VALUE. When STAT is present and the invokation was
6879     successful, it is assigned the value 0. If it is present and the
6880     invokation has failed, it is assigned a positive value; in
6881     particular, for a coindexed ATOM, if the remote image has stopped,
6882     it is assigned the value of `ISO_FORTRAN_ENV''s
6883     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6884     `STAT_FAILED_IMAGE'.
6885
6886_Standard_:
6887     TS 18508 or later
6888
6889_Class_:
6890     Atomic subroutine
6891
6892_Syntax_:
6893     `CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
6894
6895_Arguments_:
6896     ATOM       Scalar coarray or coindexed variable of integer
6897                type with `ATOMIC_INT_KIND' kind.
6898     VALUE      Scalar of the same type as ATOM. If the kind
6899                is different, the value is converted to the
6900                kind of ATOM.
6901     OLD        Scalar of the same type and kind as ATOM.
6902     STAT       (optional) Scalar default-kind integer
6903                variable.
6904
6905_Example_:
6906          program atomic
6907            use iso_fortran_env
6908            integer(atomic_int_kind) :: atom[*], old
6909            call atomic_fetch_and (atom[1], int(b'10100011101'), old)
6910          end program atomic
6911
6912_See also_:
6913     *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
6914     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
6915     ATOMIC_FETCH_XOR::
6916
6917
6918File: gfortran.info,  Node: ATOMIC_FETCH_OR,  Next: ATOMIC_FETCH_XOR,  Prev: ATOMIC_FETCH_AND,  Up: Intrinsic Procedures
6919
69209.30 `ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
6921======================================================================
6922
6923_Description_:
6924     `ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in
6925     OLD and defines ATOM with the bitwise OR between the values of
6926     ATOM and VALUE. When STAT is present and the invokation was
6927     successful, it is assigned the value 0. If it is present and the
6928     invokation has failed, it is assigned a positive value; in
6929     particular, for a coindexed ATOM, if the remote image has stopped,
6930     it is assigned the value of `ISO_FORTRAN_ENV''s
6931     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6932     `STAT_FAILED_IMAGE'.
6933
6934_Standard_:
6935     TS 18508 or later
6936
6937_Class_:
6938     Atomic subroutine
6939
6940_Syntax_:
6941     `CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
6942
6943_Arguments_:
6944     ATOM       Scalar coarray or coindexed variable of integer
6945                type with `ATOMIC_INT_KIND' kind.
6946     VALUE      Scalar of the same type as ATOM. If the kind
6947                is different, the value is converted to the
6948                kind of ATOM.
6949     OLD        Scalar of the same type and kind as ATOM.
6950     STAT       (optional) Scalar default-kind integer
6951                variable.
6952
6953_Example_:
6954          program atomic
6955            use iso_fortran_env
6956            integer(atomic_int_kind) :: atom[*], old
6957            call atomic_fetch_or (atom[1], int(b'10100011101'), old)
6958          end program atomic
6959
6960_See also_:
6961     *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
6962     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
6963     ATOMIC_FETCH_XOR::
6964
6965
6966File: gfortran.info,  Node: ATOMIC_FETCH_XOR,  Next: ATOMIC_OR,  Prev: ATOMIC_FETCH_OR,  Up: Intrinsic Procedures
6967
69689.31 `ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
6969========================================================================
6970
6971_Description_:
6972     `ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
6973     OLD and defines ATOM with the bitwise XOR between the values of
6974     ATOM and VALUE. When STAT is present and the invokation was
6975     successful, it is assigned the value 0. If it is present and the
6976     invokation has failed, it is assigned a positive value; in
6977     particular, for a coindexed ATOM, if the remote image has stopped,
6978     it is assigned the value of `ISO_FORTRAN_ENV''s
6979     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
6980     `STAT_FAILED_IMAGE'.
6981
6982_Standard_:
6983     TS 18508 or later
6984
6985_Class_:
6986     Atomic subroutine
6987
6988_Syntax_:
6989     `CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
6990
6991_Arguments_:
6992     ATOM       Scalar coarray or coindexed variable of integer
6993                type with `ATOMIC_INT_KIND' kind.
6994     VALUE      Scalar of the same type as ATOM. If the kind
6995                is different, the value is converted to the
6996                kind of ATOM.
6997     OLD        Scalar of the same type and kind as ATOM.
6998     STAT       (optional) Scalar default-kind integer
6999                variable.
7000
7001_Example_:
7002          program atomic
7003            use iso_fortran_env
7004            integer(atomic_int_kind) :: atom[*], old
7005            call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
7006          end program atomic
7007
7008_See also_:
7009     *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
7010     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
7011     ATOMIC_FETCH_OR::
7012
7013
7014File: gfortran.info,  Node: ATOMIC_OR,  Next: ATOMIC_REF,  Prev: ATOMIC_FETCH_XOR,  Up: Intrinsic Procedures
7015
70169.32 `ATOMIC_OR' -- Atomic bitwise OR operation
7017===============================================
7018
7019_Description_:
7020     `ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
7021     AND between the values of ATOM and VALUE. When STAT is present and
7022     the invokation was successful, it is assigned the value 0. If it
7023     is present and the invokation has failed, it is assigned a
7024     positive value; in particular, for a coindexed ATOM, if the remote
7025     image has stopped, it is assigned the value of `ISO_FORTRAN_ENV''s
7026     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
7027     `STAT_FAILED_IMAGE'.
7028
7029_Standard_:
7030     TS 18508 or later
7031
7032_Class_:
7033     Atomic subroutine
7034
7035_Syntax_:
7036     `CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
7037
7038_Arguments_:
7039     ATOM       Scalar coarray or coindexed variable of integer
7040                type with `ATOMIC_INT_KIND' kind.
7041     VALUE      Scalar of the same type as ATOM. If the kind
7042                is different, the value is converted to the
7043                kind of ATOM.
7044     STAT       (optional) Scalar default-kind integer
7045                variable.
7046
7047_Example_:
7048          program atomic
7049            use iso_fortran_env
7050            integer(atomic_int_kind) :: atom[*]
7051            call atomic_or (atom[1], int(b'10100011101'))
7052          end program atomic
7053
7054_See also_:
7055     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
7056     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
7057     ATOMIC_XOR::
7058
7059
7060File: gfortran.info,  Node: ATOMIC_REF,  Next: ATOMIC_XOR,  Prev: ATOMIC_OR,  Up: Intrinsic Procedures
7061
70629.33 `ATOMIC_REF' -- Obtaining the value of a variable atomically
7063=================================================================
7064
7065_Description_:
7066     `ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
7067     variable ATOM to VALUE. When STAT is present and the invokation
7068     was successful, it is assigned the value 0. If it is present and
7069     the invokation has failed, it is assigned a positive value; in
7070     particular, for a coindexed ATOM, if the remote image has stopped,
7071     it is assigned the value of `ISO_FORTRAN_ENV''s
7072     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
7073     `STAT_FAILED_IMAGE'.
7074
7075_Standard_:
7076     Fortran 2008 and later; with STAT, TS 18508 or later
7077
7078_Class_:
7079     Atomic subroutine
7080
7081_Syntax_:
7082     `CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
7083
7084_Arguments_:
7085     VALUE      Scalar of the same type as ATOM. If the kind
7086                is different, the value is converted to the
7087                kind of ATOM.
7088     ATOM       Scalar coarray or coindexed variable of either
7089                integer type with `ATOMIC_INT_KIND' kind or
7090                logical type with `ATOMIC_LOGICAL_KIND' kind.
7091     STAT       (optional) Scalar default-kind integer
7092                variable.
7093
7094_Example_:
7095          program atomic
7096            use iso_fortran_env
7097            logical(atomic_logical_kind) :: atom[*]
7098            logical :: val
7099            call atomic_ref (atom, .false.)
7100            ! ...
7101            call atomic_ref (atom, val)
7102            if (val) then
7103              print *, "Obtained"
7104            end if
7105          end program atomic
7106
7107_See also_:
7108     *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
7109     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
7110     ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
7111
7112
7113File: gfortran.info,  Node: ATOMIC_XOR,  Next: BACKTRACE,  Prev: ATOMIC_REF,  Up: Intrinsic Procedures
7114
71159.34 `ATOMIC_XOR' -- Atomic bitwise OR operation
7116================================================
7117
7118_Description_:
7119     `ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
7120     XOR between the values of ATOM and VALUE. When STAT is present and
7121     the invokation was successful, it is assigned the value 0. If it
7122     is present and the invokation has failed, it is assigned a
7123     positive value; in particular, for a coindexed ATOM, if the remote
7124     image has stopped, it is assigned the value of `ISO_FORTRAN_ENV''s
7125     `STAT_STOPPED_IMAGE' and if the remote image has failed, the value
7126     `STAT_FAILED_IMAGE'.
7127
7128_Standard_:
7129     TS 18508 or later
7130
7131_Class_:
7132     Atomic subroutine
7133
7134_Syntax_:
7135     `CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
7136
7137_Arguments_:
7138     ATOM       Scalar coarray or coindexed variable of integer
7139                type with `ATOMIC_INT_KIND' kind.
7140     VALUE      Scalar of the same type as ATOM. If the kind
7141                is different, the value is converted to the
7142                kind of ATOM.
7143     STAT       (optional) Scalar default-kind integer
7144                variable.
7145
7146_Example_:
7147          program atomic
7148            use iso_fortran_env
7149            integer(atomic_int_kind) :: atom[*]
7150            call atomic_xor (atom[1], int(b'10100011101'))
7151          end program atomic
7152
7153_See also_:
7154     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
7155     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
7156     ATOMIC_XOR::
7157
7158
7159File: gfortran.info,  Node: BACKTRACE,  Next: BESSEL_J0,  Prev: ATOMIC_XOR,  Up: Intrinsic Procedures
7160
71619.35 `BACKTRACE' -- Show a backtrace
7162====================================
7163
7164_Description_:
7165     `BACKTRACE' shows a backtrace at an arbitrary place in user code.
7166     Program execution continues normally afterwards. The backtrace
7167     information is printed to the unit corresponding to `ERROR_UNIT'
7168     in `ISO_FORTRAN_ENV'.
7169
7170_Standard_:
7171     GNU Extension
7172
7173_Class_:
7174     Subroutine
7175
7176_Syntax_:
7177     `CALL BACKTRACE'
7178
7179_Arguments_:
7180     None
7181
7182_See also_:
7183     *note ABORT::
7184
7185
7186File: gfortran.info,  Node: BESSEL_J0,  Next: BESSEL_J1,  Prev: BACKTRACE,  Up: Intrinsic Procedures
7187
71889.36 `BESSEL_J0' -- Bessel function of the first kind of order 0
7189================================================================
7190
7191_Description_:
7192     `BESSEL_J0(X)' computes the Bessel function of the first kind of
7193     order 0 of X. This function is available under the name `BESJ0' as
7194     a GNU extension.
7195
7196_Standard_:
7197     Fortran 2008 and later
7198
7199_Class_:
7200     Elemental function
7201
7202_Syntax_:
7203     `RESULT = BESSEL_J0(X)'
7204
7205_Arguments_:
7206     X          The type shall be `REAL'.
7207
7208_Return value_:
7209     The return value is of type `REAL' and lies in the range  -
7210     0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X.
7211
7212_Example_:
7213          program test_besj0
7214            real(8) :: x = 0.0_8
7215            x = bessel_j0(x)
7216          end program test_besj0
7217
7218_Specific names_:
7219     Name          Argument      Return type   Standard
7220     `DBESJ0(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
7221
7222
7223File: gfortran.info,  Node: BESSEL_J1,  Next: BESSEL_JN,  Prev: BESSEL_J0,  Up: Intrinsic Procedures
7224
72259.37 `BESSEL_J1' -- Bessel function of the first kind of order 1
7226================================================================
7227
7228_Description_:
7229     `BESSEL_J1(X)' computes the Bessel function of the first kind of
7230     order 1 of X. This function is available under the name `BESJ1' as
7231     a GNU extension.
7232
7233_Standard_:
7234     Fortran 2008
7235
7236_Class_:
7237     Elemental function
7238
7239_Syntax_:
7240     `RESULT = BESSEL_J1(X)'
7241
7242_Arguments_:
7243     X          The type shall be `REAL'.
7244
7245_Return value_:
7246     The return value is of type `REAL' and lies in the range  -
7247     0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as
7248     X.
7249
7250_Example_:
7251          program test_besj1
7252            real(8) :: x = 1.0_8
7253            x = bessel_j1(x)
7254          end program test_besj1
7255
7256_Specific names_:
7257     Name          Argument      Return type   Standard
7258     `DBESJ1(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
7259
7260
7261File: gfortran.info,  Node: BESSEL_JN,  Next: BESSEL_Y0,  Prev: BESSEL_J1,  Up: Intrinsic Procedures
7262
72639.38 `BESSEL_JN' -- Bessel function of the first kind
7264=====================================================
7265
7266_Description_:
7267     `BESSEL_JN(N, X)' computes the Bessel function of the first kind of
7268     order N of X. This function is available under the name `BESJN' as
7269     a GNU extension.  If N and X are arrays, their ranks and shapes
7270     shall conform.
7271
7272     `BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
7273     of the first kind of the orders N1 to N2.
7274
7275_Standard_:
7276     Fortran 2008 and later, negative N is allowed as GNU extension
7277
7278_Class_:
7279     Elemental function, except for the transformational function
7280     `BESSEL_JN(N1, N2, X)'
7281
7282_Syntax_:
7283     `RESULT = BESSEL_JN(N, X)'
7284     `RESULT = BESSEL_JN(N1, N2, X)'
7285
7286_Arguments_:
7287     N          Shall be a scalar or an array of type
7288                `INTEGER'.
7289     N1         Shall be a non-negative scalar of type
7290                `INTEGER'.
7291     N2         Shall be a non-negative scalar of type
7292                `INTEGER'.
7293     X          Shall be a scalar or an array of type  `REAL';
7294                for `BESSEL_JN(N1, N2, X)' it shall be scalar.
7295
7296_Return value_:
7297     The return value is a scalar of type `REAL'. It has the same kind
7298     as X.
7299
7300_Note_:
7301     The transformational function uses a recurrence algorithm which
7302     might, for some values of X, lead to different results than calls
7303     to the elemental function.
7304
7305_Example_:
7306          program test_besjn
7307            real(8) :: x = 1.0_8
7308            x = bessel_jn(5,x)
7309          end program test_besjn
7310
7311_Specific names_:
7312     Name          Argument      Return type   Standard
7313     `DBESJN(N,    `INTEGER N'   `REAL(8)'     GNU extension
7314     X)'                                       
7315                   `REAL(8) X'                 
7316
7317
7318File: gfortran.info,  Node: BESSEL_Y0,  Next: BESSEL_Y1,  Prev: BESSEL_JN,  Up: Intrinsic Procedures
7319
73209.39 `BESSEL_Y0' -- Bessel function of the second kind of order 0
7321=================================================================
7322
7323_Description_:
7324     `BESSEL_Y0(X)' computes the Bessel function of the second kind of
7325     order 0 of X. This function is available under the name `BESY0' as
7326     a GNU extension.
7327
7328_Standard_:
7329     Fortran 2008 and later
7330
7331_Class_:
7332     Elemental function
7333
7334_Syntax_:
7335     `RESULT = BESSEL_Y0(X)'
7336
7337_Arguments_:
7338     X          The type shall be `REAL'.
7339
7340_Return value_:
7341     The return value is of type `REAL'. It has the same kind as X.
7342
7343_Example_:
7344          program test_besy0
7345            real(8) :: x = 0.0_8
7346            x = bessel_y0(x)
7347          end program test_besy0
7348
7349_Specific names_:
7350     Name          Argument      Return type   Standard
7351     `DBESY0(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
7352
7353
7354File: gfortran.info,  Node: BESSEL_Y1,  Next: BESSEL_YN,  Prev: BESSEL_Y0,  Up: Intrinsic Procedures
7355
73569.40 `BESSEL_Y1' -- Bessel function of the second kind of order 1
7357=================================================================
7358
7359_Description_:
7360     `BESSEL_Y1(X)' computes the Bessel function of the second kind of
7361     order 1 of X. This function is available under the name `BESY1' as
7362     a GNU extension.
7363
7364_Standard_:
7365     Fortran 2008 and later
7366
7367_Class_:
7368     Elemental function
7369
7370_Syntax_:
7371     `RESULT = BESSEL_Y1(X)'
7372
7373_Arguments_:
7374     X          The type shall be `REAL'.
7375
7376_Return value_:
7377     The return value is of type `REAL'. It has the same kind as X.
7378
7379_Example_:
7380          program test_besy1
7381            real(8) :: x = 1.0_8
7382            x = bessel_y1(x)
7383          end program test_besy1
7384
7385_Specific names_:
7386     Name          Argument      Return type   Standard
7387     `DBESY1(X)'   `REAL(8) X'   `REAL(8)'     GNU extension
7388
7389
7390File: gfortran.info,  Node: BESSEL_YN,  Next: BGE,  Prev: BESSEL_Y1,  Up: Intrinsic Procedures
7391
73929.41 `BESSEL_YN' -- Bessel function of the second kind
7393======================================================
7394
7395_Description_:
7396     `BESSEL_YN(N, X)' computes the Bessel function of the second kind
7397     of order N of X. This function is available under the name `BESYN'
7398     as a GNU extension.  If N and X are arrays, their ranks and shapes
7399     shall conform.
7400
7401     `BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
7402     of the first kind of the orders N1 to N2.
7403
7404_Standard_:
7405     Fortran 2008 and later, negative N is allowed as GNU extension
7406
7407_Class_:
7408     Elemental function, except for the transformational function
7409     `BESSEL_YN(N1, N2, X)'
7410
7411_Syntax_:
7412     `RESULT = BESSEL_YN(N, X)'
7413     `RESULT = BESSEL_YN(N1, N2, X)'
7414
7415_Arguments_:
7416     N          Shall be a scalar or an array of type
7417                `INTEGER' .
7418     N1         Shall be a non-negative scalar of type
7419                `INTEGER'.
7420     N2         Shall be a non-negative scalar of type
7421                `INTEGER'.
7422     X          Shall be a scalar or an array of type  `REAL';
7423                for `BESSEL_YN(N1, N2, X)' it shall be scalar.
7424
7425_Return value_:
7426     The return value is a scalar of type `REAL'. It has the same kind
7427     as X.
7428
7429_Note_:
7430     The transformational function uses a recurrence algorithm which
7431     might, for some values of X, lead to different results than calls
7432     to the elemental function.
7433
7434_Example_:
7435          program test_besyn
7436            real(8) :: x = 1.0_8
7437            x = bessel_yn(5,x)
7438          end program test_besyn
7439
7440_Specific names_:
7441     Name          Argument      Return type   Standard
7442     `DBESYN(N,X)' `INTEGER N'   `REAL(8)'     GNU extension
7443                   `REAL(8) X'                 
7444
7445
7446File: gfortran.info,  Node: BGE,  Next: BGT,  Prev: BESSEL_YN,  Up: Intrinsic Procedures
7447
74489.42 `BGE' -- Bitwise greater than or equal to
7449==============================================
7450
7451_Description_:
7452     Determines whether an integral is a bitwise greater than or equal
7453     to another.
7454
7455_Standard_:
7456     Fortran 2008 and later
7457
7458_Class_:
7459     Elemental function
7460
7461_Syntax_:
7462     `RESULT = BGE(I, J)'
7463
7464_Arguments_:
7465     I          Shall be of `INTEGER' type.
7466     J          Shall be of `INTEGER' type, and of the same
7467                kind as I.
7468
7469_Return value_:
7470     The return value is of type `LOGICAL' and of the default kind.
7471
7472_See also_:
7473     *note BGT::, *note BLE::, *note BLT::
7474
7475
7476File: gfortran.info,  Node: BGT,  Next: BIT_SIZE,  Prev: BGE,  Up: Intrinsic Procedures
7477
74789.43 `BGT' -- Bitwise greater than
7479==================================
7480
7481_Description_:
7482     Determines whether an integral is a bitwise greater than another.
7483
7484_Standard_:
7485     Fortran 2008 and later
7486
7487_Class_:
7488     Elemental function
7489
7490_Syntax_:
7491     `RESULT = BGT(I, J)'
7492
7493_Arguments_:
7494     I          Shall be of `INTEGER' type.
7495     J          Shall be of `INTEGER' type, and of the same
7496                kind as I.
7497
7498_Return value_:
7499     The return value is of type `LOGICAL' and of the default kind.
7500
7501_See also_:
7502     *note BGE::, *note BLE::, *note BLT::
7503
7504
7505File: gfortran.info,  Node: BIT_SIZE,  Next: BLE,  Prev: BGT,  Up: Intrinsic Procedures
7506
75079.44 `BIT_SIZE' -- Bit size inquiry function
7508============================================
7509
7510_Description_:
7511     `BIT_SIZE(I)' returns the number of bits (integer precision plus
7512     sign bit) represented by the type of I.  The result of
7513     `BIT_SIZE(I)' is independent of the actual value of I.
7514
7515_Standard_:
7516     Fortran 95 and later
7517
7518_Class_:
7519     Inquiry function
7520
7521_Syntax_:
7522     `RESULT = BIT_SIZE(I)'
7523
7524_Arguments_:
7525     I          The type shall be `INTEGER'.
7526
7527_Return value_:
7528     The return value is of type `INTEGER'
7529
7530_Example_:
7531          program test_bit_size
7532              integer :: i = 123
7533              integer :: size
7534              size = bit_size(i)
7535              print *, size
7536          end program test_bit_size
7537
7538
7539File: gfortran.info,  Node: BLE,  Next: BLT,  Prev: BIT_SIZE,  Up: Intrinsic Procedures
7540
75419.45 `BLE' -- Bitwise less than or equal to
7542===========================================
7543
7544_Description_:
7545     Determines whether an integral is a bitwise less than or equal to
7546     another.
7547
7548_Standard_:
7549     Fortran 2008 and later
7550
7551_Class_:
7552     Elemental function
7553
7554_Syntax_:
7555     `RESULT = BLE(I, J)'
7556
7557_Arguments_:
7558     I          Shall be of `INTEGER' type.
7559     J          Shall be of `INTEGER' type, and of the same
7560                kind as I.
7561
7562_Return value_:
7563     The return value is of type `LOGICAL' and of the default kind.
7564
7565_See also_:
7566     *note BGT::, *note BGE::, *note BLT::
7567
7568
7569File: gfortran.info,  Node: BLT,  Next: BTEST,  Prev: BLE,  Up: Intrinsic Procedures
7570
75719.46 `BLT' -- Bitwise less than
7572===============================
7573
7574_Description_:
7575     Determines whether an integral is a bitwise less than another.
7576
7577_Standard_:
7578     Fortran 2008 and later
7579
7580_Class_:
7581     Elemental function
7582
7583_Syntax_:
7584     `RESULT = BLT(I, J)'
7585
7586_Arguments_:
7587     I          Shall be of `INTEGER' type.
7588     J          Shall be of `INTEGER' type, and of the same
7589                kind as I.
7590
7591_Return value_:
7592     The return value is of type `LOGICAL' and of the default kind.
7593
7594_See also_:
7595     *note BGE::, *note BGT::, *note BLE::
7596
7597
7598File: gfortran.info,  Node: BTEST,  Next: C_ASSOCIATED,  Prev: BLT,  Up: Intrinsic Procedures
7599
76009.47 `BTEST' -- Bit test function
7601=================================
7602
7603_Description_:
7604     `BTEST(I,POS)' returns logical `.TRUE.' if the bit at POS in I is
7605     set.  The counting of the bits starts at 0.
7606
7607_Standard_:
7608     Fortran 95 and later
7609
7610_Class_:
7611     Elemental function
7612
7613_Syntax_:
7614     `RESULT = BTEST(I, POS)'
7615
7616_Arguments_:
7617     I          The type shall be `INTEGER'.
7618     POS        The type shall be `INTEGER'.
7619
7620_Return value_:
7621     The return value is of type `LOGICAL'
7622
7623_Example_:
7624          program test_btest
7625              integer :: i = 32768 + 1024 + 64
7626              integer :: pos
7627              logical :: bool
7628              do pos=0,16
7629                  bool = btest(i, pos)
7630                  print *, pos, bool
7631              end do
7632          end program test_btest
7633
7634
7635File: gfortran.info,  Node: C_ASSOCIATED,  Next: C_F_POINTER,  Prev: BTEST,  Up: Intrinsic Procedures
7636
76379.48 `C_ASSOCIATED' -- Status of a C pointer
7638============================================
7639
7640_Description_:
7641     `C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
7642     pointer C_PTR_1 or if C_PTR_1 is associated with the target
7643     C_PTR_2.
7644
7645_Standard_:
7646     Fortran 2003 and later
7647
7648_Class_:
7649     Inquiry function
7650
7651_Syntax_:
7652     `RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
7653
7654_Arguments_:
7655     C_PTR_1    Scalar of the type `C_PTR' or `C_FUNPTR'.
7656     C_PTR_2    (Optional) Scalar of the same type as C_PTR_1.
7657
7658_Return value_:
7659     The return value is of type `LOGICAL'; it is `.false.' if either
7660     C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
7661     different addresses.
7662
7663_Example_:
7664          subroutine association_test(a,b)
7665            use iso_c_binding, only: c_associated, c_loc, c_ptr
7666            implicit none
7667            real, pointer :: a
7668            type(c_ptr) :: b
7669            if(c_associated(b, c_loc(a))) &
7670               stop 'b and a do not point to same target'
7671          end subroutine association_test
7672
7673_See also_:
7674     *note C_LOC::, *note C_FUNLOC::
7675
7676
7677File: gfortran.info,  Node: C_F_POINTER,  Next: C_F_PROCPOINTER,  Prev: C_ASSOCIATED,  Up: Intrinsic Procedures
7678
76799.49 `C_F_POINTER' -- Convert C into Fortran pointer
7680====================================================
7681
7682_Description_:
7683     `C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
7684     pointer CPTR to the Fortran pointer FPTR and specifies its shape.
7685
7686_Standard_:
7687     Fortran 2003 and later
7688
7689_Class_:
7690     Subroutine
7691
7692_Syntax_:
7693     `CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
7694
7695_Arguments_:
7696     CPTR       scalar of the type `C_PTR'. It is `INTENT(IN)'.
7697     FPTR       pointer interoperable with CPTR. It is
7698                `INTENT(OUT)'.
7699     SHAPE      (Optional) Rank-one array of type `INTEGER'
7700                with `INTENT(IN)'. It shall be present if and
7701                only if FPTR is an array. The size must be
7702                equal to the rank of FPTR.
7703
7704_Example_:
7705          program main
7706            use iso_c_binding
7707            implicit none
7708            interface
7709              subroutine my_routine(p) bind(c,name='myC_func')
7710                import :: c_ptr
7711                type(c_ptr), intent(out) :: p
7712              end subroutine
7713            end interface
7714            type(c_ptr) :: cptr
7715            real,pointer :: a(:)
7716            call my_routine(cptr)
7717            call c_f_pointer(cptr, a, [12])
7718          end program main
7719
7720_See also_:
7721     *note C_LOC::, *note C_F_PROCPOINTER::
7722
7723
7724File: gfortran.info,  Node: C_F_PROCPOINTER,  Next: C_FUNLOC,  Prev: C_F_POINTER,  Up: Intrinsic Procedures
7725
77269.50 `C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
7727==================================================================
7728
7729_Description_:
7730     `C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
7731     pointer CPTR to the Fortran procedure pointer FPTR.
7732
7733_Standard_:
7734     Fortran 2003 and later
7735
7736_Class_:
7737     Subroutine
7738
7739_Syntax_:
7740     `CALL C_F_PROCPOINTER(cptr, fptr)'
7741
7742_Arguments_:
7743     CPTR       scalar of the type `C_FUNPTR'. It is
7744                `INTENT(IN)'.
7745     FPTR       procedure pointer interoperable with CPTR. It
7746                is `INTENT(OUT)'.
7747
7748_Example_:
7749          program main
7750            use iso_c_binding
7751            implicit none
7752            abstract interface
7753              function func(a)
7754                import :: c_float
7755                real(c_float), intent(in) :: a
7756                real(c_float) :: func
7757              end function
7758            end interface
7759            interface
7760               function getIterFunc() bind(c,name="getIterFunc")
7761                 import :: c_funptr
7762                 type(c_funptr) :: getIterFunc
7763               end function
7764            end interface
7765            type(c_funptr) :: cfunptr
7766            procedure(func), pointer :: myFunc
7767            cfunptr = getIterFunc()
7768            call c_f_procpointer(cfunptr, myFunc)
7769          end program main
7770
7771_See also_:
7772     *note C_LOC::, *note C_F_POINTER::
7773
7774
7775File: gfortran.info,  Node: C_FUNLOC,  Next: C_LOC,  Prev: C_F_PROCPOINTER,  Up: Intrinsic Procedures
7776
77779.51 `C_FUNLOC' -- Obtain the C address of a procedure
7778======================================================
7779
7780_Description_:
7781     `C_FUNLOC(x)' determines the C address of the argument.
7782
7783_Standard_:
7784     Fortran 2003 and later
7785
7786_Class_:
7787     Inquiry function
7788
7789_Syntax_:
7790     `RESULT = C_FUNLOC(x)'
7791
7792_Arguments_:
7793     X          Interoperable function or pointer to such
7794                function.
7795
7796_Return value_:
7797     The return value is of type `C_FUNPTR' and contains the C address
7798     of the argument.
7799
7800_Example_:
7801          module x
7802            use iso_c_binding
7803            implicit none
7804          contains
7805            subroutine sub(a) bind(c)
7806              real(c_float) :: a
7807              a = sqrt(a)+5.0
7808            end subroutine sub
7809          end module x
7810          program main
7811            use iso_c_binding
7812            use x
7813            implicit none
7814            interface
7815              subroutine my_routine(p) bind(c,name='myC_func')
7816                import :: c_funptr
7817                type(c_funptr), intent(in) :: p
7818              end subroutine
7819            end interface
7820            call my_routine(c_funloc(sub))
7821          end program main
7822
7823_See also_:
7824     *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
7825     C_F_PROCPOINTER::
7826
7827
7828File: gfortran.info,  Node: C_LOC,  Next: C_SIZEOF,  Prev: C_FUNLOC,  Up: Intrinsic Procedures
7829
78309.52 `C_LOC' -- Obtain the C address of an object
7831=================================================
7832
7833_Description_:
7834     `C_LOC(X)' determines the C address of the argument.
7835
7836_Standard_:
7837     Fortran 2003 and later
7838
7839_Class_:
7840     Inquiry function
7841
7842_Syntax_:
7843     `RESULT = C_LOC(X)'
7844
7845_Arguments_:
7846     X       Shall have either the POINTER or TARGET
7847             attribute. It shall not be a coindexed object. It
7848             shall either be a variable with interoperable
7849             type and kind type parameters, or be a scalar,
7850             nonpolymorphic variable with no length type
7851             parameters.
7852
7853_Return value_:
7854     The return value is of type `C_PTR' and contains the C address of
7855     the argument.
7856
7857_Example_:
7858          subroutine association_test(a,b)
7859            use iso_c_binding, only: c_associated, c_loc, c_ptr
7860            implicit none
7861            real, pointer :: a
7862            type(c_ptr) :: b
7863            if(c_associated(b, c_loc(a))) &
7864               stop 'b and a do not point to same target'
7865          end subroutine association_test
7866
7867_See also_:
7868     *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
7869     C_F_PROCPOINTER::
7870
7871
7872File: gfortran.info,  Node: C_SIZEOF,  Next: CEILING,  Prev: C_LOC,  Up: Intrinsic Procedures
7873
78749.53 `C_SIZEOF' -- Size in bytes of an expression
7875=================================================
7876
7877_Description_:
7878     `C_SIZEOF(X)' calculates the number of bytes of storage the
7879     expression `X' occupies.
7880
7881_Standard_:
7882     Fortran 2008
7883
7884_Class_:
7885     Inquiry function of the module `ISO_C_BINDING'
7886
7887_Syntax_:
7888     `N = C_SIZEOF(X)'
7889
7890_Arguments_:
7891     X          The argument shall be an interoperable data
7892                entity.
7893
7894_Return value_:
7895     The return value is of type integer and of the system-dependent
7896     kind `C_SIZE_T' (from the `ISO_C_BINDING' module). Its value is the
7897     number of bytes occupied by the argument.  If the argument has the
7898     `POINTER' attribute, the number of bytes of the storage area
7899     pointed to is returned.  If the argument is of a derived type with
7900     `POINTER' or `ALLOCATABLE' components, the return value does not
7901     account for the sizes of the data pointed to by these components.
7902
7903_Example_:
7904             use iso_c_binding
7905             integer(c_int) :: i
7906             real(c_float) :: r, s(5)
7907             print *, (c_sizeof(s)/c_sizeof(r) == 5)
7908             end
7909     The example will print `.TRUE.' unless you are using a platform
7910     where default `REAL' variables are unusually padded.
7911
7912_See also_:
7913     *note SIZEOF::, *note STORAGE_SIZE::
7914
7915
7916File: gfortran.info,  Node: CEILING,  Next: CHAR,  Prev: C_SIZEOF,  Up: Intrinsic Procedures
7917
79189.54 `CEILING' -- Integer ceiling function
7919==========================================
7920
7921_Description_:
7922     `CEILING(A)' returns the least integer greater than or equal to A.
7923
7924_Standard_:
7925     Fortran 95 and later
7926
7927_Class_:
7928     Elemental function
7929
7930_Syntax_:
7931     `RESULT = CEILING(A [, KIND])'
7932
7933_Arguments_:
7934     A          The type shall be `REAL'.
7935     KIND       (Optional) An `INTEGER' initialization
7936                expression indicating the kind parameter of
7937                the result.
7938
7939_Return value_:
7940     The return value is of type `INTEGER(KIND)' if KIND is present and
7941     a default-kind `INTEGER' otherwise.
7942
7943_Example_:
7944          program test_ceiling
7945              real :: x = 63.29
7946              real :: y = -63.59
7947              print *, ceiling(x) ! returns 64
7948              print *, ceiling(y) ! returns -63
7949          end program test_ceiling
7950
7951_See also_:
7952     *note FLOOR::, *note NINT::
7953
7954
7955
7956File: gfortran.info,  Node: CHAR,  Next: CHDIR,  Prev: CEILING,  Up: Intrinsic Procedures
7957
79589.55 `CHAR' -- Character conversion function
7959============================================
7960
7961_Description_:
7962     `CHAR(I [, KIND])' returns the character represented by the
7963     integer I.
7964
7965_Standard_:
7966     Fortran 77 and later
7967
7968_Class_:
7969     Elemental function
7970
7971_Syntax_:
7972     `RESULT = CHAR(I [, KIND])'
7973
7974_Arguments_:
7975     I          The type shall be `INTEGER'.
7976     KIND       (Optional) An `INTEGER' initialization
7977                expression indicating the kind parameter of
7978                the result.
7979
7980_Return value_:
7981     The return value is of type `CHARACTER(1)'
7982
7983_Example_:
7984          program test_char
7985              integer :: i = 74
7986              character(1) :: c
7987              c = char(i)
7988              print *, i, c ! returns 'J'
7989          end program test_char
7990
7991_Specific names_:
7992     Name          Argument      Return type   Standard
7993     `CHAR(I)'     `INTEGER I'   `CHARACTER(LEN=1)'F77 and later
7994
7995_Note_:
7996     See *note ICHAR:: for a discussion of converting between numerical
7997     values and formatted string representations.
7998
7999_See also_:
8000     *note ACHAR::, *note IACHAR::, *note ICHAR::
8001
8002
8003
8004File: gfortran.info,  Node: CHDIR,  Next: CHMOD,  Prev: CHAR,  Up: Intrinsic Procedures
8005
80069.56 `CHDIR' -- Change working directory
8007========================================
8008
8009_Description_:
8010     Change current working directory to a specified path.
8011
8012     This intrinsic is provided in both subroutine and function forms;
8013     however, only one form can be used in any given program unit.
8014
8015_Standard_:
8016     GNU extension
8017
8018_Class_:
8019     Subroutine, function
8020
8021_Syntax_:
8022     `CALL CHDIR(NAME [, STATUS])'
8023     `STATUS = CHDIR(NAME)'
8024
8025_Arguments_:
8026     NAME       The type shall be `CHARACTER' of default kind
8027                and shall specify a valid path within the file
8028                system.
8029     STATUS     (Optional) `INTEGER' status flag of the default
8030                kind.  Returns 0 on success, and a system
8031                specific and nonzero error code otherwise.
8032
8033_Example_:
8034          PROGRAM test_chdir
8035            CHARACTER(len=255) :: path
8036            CALL getcwd(path)
8037            WRITE(*,*) TRIM(path)
8038            CALL chdir("/tmp")
8039            CALL getcwd(path)
8040            WRITE(*,*) TRIM(path)
8041          END PROGRAM
8042
8043_See also_:
8044     *note GETCWD::
8045
8046
8047File: gfortran.info,  Node: CHMOD,  Next: CMPLX,  Prev: CHDIR,  Up: Intrinsic Procedures
8048
80499.57 `CHMOD' -- Change access permissions of files
8050==================================================
8051
8052_Description_:
8053     `CHMOD' changes the permissions of a file.
8054
8055     This intrinsic is provided in both subroutine and function forms;
8056     however, only one form can be used in any given program unit.
8057
8058_Standard_:
8059     GNU extension
8060
8061_Class_:
8062     Subroutine, function
8063
8064_Syntax_:
8065     `CALL CHMOD(NAME, MODE[, STATUS])'
8066     `STATUS = CHMOD(NAME, MODE)'
8067
8068_Arguments_:
8069     NAME       Scalar `CHARACTER' of default kind with the
8070                file name. Trailing blanks are ignored unless
8071                the character `achar(0)' is present, then all
8072                characters up to and excluding `achar(0)' are
8073                used as the file name.
8074     MODE       Scalar `CHARACTER' of default kind giving the
8075                file permission. MODE uses the same syntax as
8076                the `chmod' utility as defined by the POSIX
8077                standard. The argument shall either be a
8078                string of a nonnegative octal number or a
8079                symbolic mode.
8080     STATUS     (optional) scalar `INTEGER', which is `0' on
8081                success and nonzero otherwise.
8082
8083_Return value_:
8084     In either syntax, STATUS is set to `0' on success and nonzero
8085     otherwise.
8086
8087_Example_:
8088     `CHMOD' as subroutine
8089          program chmod_test
8090            implicit none
8091            integer :: status
8092            call chmod('test.dat','u+x',status)
8093            print *, 'Status: ', status
8094          end program chmod_test
8095     `CHMOD' as function:
8096          program chmod_test
8097            implicit none
8098            integer :: status
8099            status = chmod('test.dat','u+x')
8100            print *, 'Status: ', status
8101          end program chmod_test
8102
8103
8104
8105File: gfortran.info,  Node: CMPLX,  Next: CO_BROADCAST,  Prev: CHMOD,  Up: Intrinsic Procedures
8106
81079.58 `CMPLX' -- Complex conversion function
8108===========================================
8109
8110_Description_:
8111     `CMPLX(X [, Y [, KIND]])' returns a complex number where X is
8112     converted to the real component.  If Y is present it is converted
8113     to the imaginary component.  If Y is not present then the
8114     imaginary component is set to 0.0.  If X is complex then Y must
8115     not be present.
8116
8117_Standard_:
8118     Fortran 77 and later
8119
8120_Class_:
8121     Elemental function
8122
8123_Syntax_:
8124     `RESULT = CMPLX(X [, Y [, KIND]])'
8125
8126_Arguments_:
8127     X          The type may be `INTEGER', `REAL', or
8128                `COMPLEX'.
8129     Y          (Optional; only allowed if X is not
8130                `COMPLEX'.)  May be `INTEGER' or `REAL'.
8131     KIND       (Optional) An `INTEGER' initialization
8132                expression indicating the kind parameter of
8133                the result.
8134
8135_Return value_:
8136     The return value is of `COMPLEX' type, with a kind equal to KIND
8137     if it is specified.  If KIND is not specified, the result is of
8138     the default `COMPLEX' kind, regardless of the kinds of X and Y.
8139
8140_Example_:
8141          program test_cmplx
8142              integer :: i = 42
8143              real :: x = 3.14
8144              complex :: z
8145              z = cmplx(i, x)
8146              print *, z, cmplx(x)
8147          end program test_cmplx
8148
8149_See also_:
8150     *note COMPLEX::
8151
8152
8153File: gfortran.info,  Node: CO_BROADCAST,  Next: CO_MAX,  Prev: CMPLX,  Up: Intrinsic Procedures
8154
81559.59 `CO_BROADCAST' -- Copy a value to all images the current set of images
8156===========================================================================
8157
8158_Description_:
8159     `CO_BROADCAST' copies the value of argument A on the image with
8160     image index `SOURCE_IMAGE' to all images in the current team.  A
8161     becomes defined as if by intrinsic assignment.  If the execution
8162     was successful and STAT is present, it is assigned the value zero.
8163     If the execution failed, STAT gets assigned a nonzero value and,
8164     if present, ERRMSG gets assigned a value describing the occurred
8165     error.
8166
8167_Standard_:
8168     Technical Specification (TS) 18508 or later
8169
8170_Class_:
8171     Collective subroutine
8172
8173_Syntax_:
8174     `CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
8175
8176_Arguments_:
8177     A          INTENT(INOUT) argument; shall have the same
8178                dynamic type and type paramters on all images
8179                of the current team. If it is an array, it
8180                shall have the same shape on all images.
8181     SOURCE_IMAGEa scalar integer expression.  It shall have
8182                the same the same value on all images and
8183                refer to an image of the current team.
8184     STAT       (optional) a scalar integer variable
8185     ERRMSG     (optional) a scalar character variable
8186
8187_Example_:
8188          program test
8189            integer :: val(3)
8190            if (this_image() == 1) then
8191              val = [1, 5, 3]
8192            end if
8193            call co_broadcast (val, source_image=1)
8194            print *, this_image, ":", val
8195          end program test
8196
8197_See also_:
8198     *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
8199
8200
8201File: gfortran.info,  Node: CO_MAX,  Next: CO_MIN,  Prev: CO_BROADCAST,  Up: Intrinsic Procedures
8202
82039.60 `CO_MAX' -- Maximal value on the current set of images
8204===========================================================
8205
8206_Description_:
8207     `CO_MAX' determines element-wise the maximal value of A on all
8208     images of the current team.  If RESULT_IMAGE is present, the
8209     maximum values are returned in A on the specified image only and
8210     the value of A on the other images become undefined.  If
8211     RESULT_IMAGE is not present, the value is returned on all images.
8212     If the execution was successful and STAT is present, it is
8213     assigned the value zero.  If the execution failed, STAT gets
8214     assigned a nonzero value and, if present, ERRMSG gets assigned a
8215     value describing the occurred error.
8216
8217_Standard_:
8218     Technical Specification (TS) 18508 or later
8219
8220_Class_:
8221     Collective subroutine
8222
8223_Syntax_:
8224     `CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
8225
8226_Arguments_:
8227     A          shall be an integer, real or character
8228                variable, which has the same type and type
8229                parameters on all images of the team.
8230     RESULT_IMAGE(optional) a scalar integer expression; if
8231                present, it shall have the same the same value
8232                on all images and refer to an image of the
8233                current team.
8234     STAT       (optional) a scalar integer variable
8235     ERRMSG     (optional) a scalar character variable
8236
8237_Example_:
8238          program test
8239            integer :: val
8240            val = this_image ()
8241            call co_max (val, result_image=1)
8242            if (this_image() == 1) then
8243              write(*,*) "Maximal value", val  ! prints num_images()
8244            end if
8245          end program test
8246
8247_See also_:
8248     *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
8249     CO_BROADCAST::
8250
8251
8252File: gfortran.info,  Node: CO_MIN,  Next: CO_REDUCE,  Prev: CO_MAX,  Up: Intrinsic Procedures
8253
82549.61 `CO_MIN' -- Minimal value on the current set of images
8255===========================================================
8256
8257_Description_:
8258     `CO_MIN' determines element-wise the minimal value of A on all
8259     images of the current team.  If RESULT_IMAGE is present, the
8260     minimal values are returned in A on the specified image only and
8261     the value of A on the other images become undefined.  If
8262     RESULT_IMAGE is not present, the value is returned on all images.
8263     If the execution was successful and STAT is present, it is
8264     assigned the value zero.  If the execution failed, STAT gets
8265     assigned a nonzero value and, if present, ERRMSG gets assigned a
8266     value describing the occurred error.
8267
8268_Standard_:
8269     Technical Specification (TS) 18508 or later
8270
8271_Class_:
8272     Collective subroutine
8273
8274_Syntax_:
8275     `CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
8276
8277_Arguments_:
8278     A          shall be an integer, real or character
8279                variable, which has the same type and type
8280                parameters on all images of the team.
8281     RESULT_IMAGE(optional) a scalar integer expression; if
8282                present, it shall have the same the same value
8283                on all images and refer to an image of the
8284                current team.
8285     STAT       (optional) a scalar integer variable
8286     ERRMSG     (optional) a scalar character variable
8287
8288_Example_:
8289          program test
8290            integer :: val
8291            val = this_image ()
8292            call co_min (val, result_image=1)
8293            if (this_image() == 1) then
8294              write(*,*) "Minimal value", val  ! prints 1
8295            end if
8296          end program test
8297
8298_See also_:
8299     *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
8300     CO_BROADCAST::
8301
8302
8303File: gfortran.info,  Node: CO_REDUCE,  Next: CO_SUM,  Prev: CO_MIN,  Up: Intrinsic Procedures
8304
83059.62 `CO_REDUCE' -- Reduction of values on the current set of images
8306====================================================================
8307
8308_Description_:
8309     `CO_REDUCE' determines element-wise the reduction of the value of A
8310     on all images of the current team.  The pure function passed as
8311     OPERATOR is used to pairwise reduce the values of A by passing
8312     either the value of A of different images or the result values of
8313     such a reduction as argument.  If A is an array, the deduction is
8314     done element wise. If RESULT_IMAGE is present, the result values
8315     are returned in A on the specified image only and the value of A
8316     on the other images become undefined.  If RESULT_IMAGE is not
8317     present, the value is returned on all images.  If the execution
8318     was successful and STAT is present, it is assigned the value zero.
8319     If the execution failed, STAT gets assigned a nonzero value and,
8320     if present, ERRMSG gets assigned a value describing the occurred
8321     error.
8322
8323_Standard_:
8324     Technical Specification (TS) 18508 or later
8325
8326_Class_:
8327     Collective subroutine
8328
8329_Syntax_:
8330     `CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
8331
8332_Arguments_:
8333     A          is an `INTENT(INOUT)' argument and shall be
8334                nonpolymorphic. If it is allocatable, it shall
8335                be allocated; if it is a pointer, it shall be
8336                associated.  A shall have the same type and
8337                type parameters on all images of the team; if
8338                it is an array, it shall have the same shape
8339                on all images.
8340     OPERATOR   pure function with two scalar nonallocatable
8341                arguments, which shall be nonpolymorphic and
8342                have the same type and type parameters as A.
8343                The function shall return a nonallocatable
8344                scalar of the same type and type parameters as
8345                A.  The function shall be the same on all
8346                images and with regards to the arguments
8347                mathematically commutative and associative.
8348                Note that OPERATOR may not be an elemental
8349                function, unless it is an intrisic function.
8350     RESULT_IMAGE(optional) a scalar integer expression; if
8351                present, it shall have the same the same value
8352                on all images and refer to an image of the
8353                current team.
8354     STAT       (optional) a scalar integer variable
8355     ERRMSG     (optional) a scalar character variable
8356
8357_Example_:
8358          program test
8359            integer :: val
8360            val = this_image ()
8361            call co_reduce (val, result_image=1, operator=myprod)
8362            if (this_image() == 1) then
8363              write(*,*) "Product value", val  ! prints num_images() factorial
8364            end if
8365          contains
8366            pure function myprod(a, b)
8367              integer, value :: a, b
8368              integer :: myprod
8369              myprod = a * b
8370            end function myprod
8371          end program test
8372
8373_Note_:
8374     While the rules permit in principle an intrinsic function, none of
8375     the intrinsics in the standard fulfill the criteria of having a
8376     specific function, which takes two arguments of the same type and
8377     returning that type as result.
8378
8379_See also_:
8380     *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
8381     CO_BROADCAST::
8382
8383
8384File: gfortran.info,  Node: CO_SUM,  Next: COMMAND_ARGUMENT_COUNT,  Prev: CO_REDUCE,  Up: Intrinsic Procedures
8385
83869.63 `CO_SUM' -- Sum of values on the current set of images
8387===========================================================
8388
8389_Description_:
8390     `CO_SUM' sums up the values of each element of A on all images of
8391     the current team.  If RESULT_IMAGE is present, the summed-up
8392     values are returned in A on the specified image only and the value
8393     of A on the other images become undefined.  If RESULT_IMAGE is not
8394     present, the value is returned on all images.  If the execution was
8395     successful and STAT is present, it is assigned the value zero.  If
8396     the execution failed, STAT gets assigned a nonzero value and, if
8397     present, ERRMSG gets assigned a value describing the occurred
8398     error.
8399
8400_Standard_:
8401     Technical Specification (TS) 18508 or later
8402
8403_Class_:
8404     Collective subroutine
8405
8406_Syntax_:
8407     `CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
8408
8409_Arguments_:
8410     A          shall be an integer, real or complex variable,
8411                which has the same type and type parameters on
8412                all images of the team.
8413     RESULT_IMAGE(optional) a scalar integer expression; if
8414                present, it shall have the same the same value
8415                on all images and refer to an image of the
8416                current team.
8417     STAT       (optional) a scalar integer variable
8418     ERRMSG     (optional) a scalar character variable
8419
8420_Example_:
8421          program test
8422            integer :: val
8423            val = this_image ()
8424            call co_sum (val, result_image=1)
8425            if (this_image() == 1) then
8426              write(*,*) "The sum is ", val ! prints (n**2 + n)/2, with n = num_images()
8427            end if
8428          end program test
8429
8430_See also_:
8431     *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
8432     CO_BROADCAST::
8433
8434
8435File: gfortran.info,  Node: COMMAND_ARGUMENT_COUNT,  Next: COMPILER_OPTIONS,  Prev: CO_SUM,  Up: Intrinsic Procedures
8436
84379.64 `COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
8438=====================================================================
8439
8440_Description_:
8441     `COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
8442     the command line when the containing program was invoked.
8443
8444_Standard_:
8445     Fortran 2003 and later
8446
8447_Class_:
8448     Inquiry function
8449
8450_Syntax_:
8451     `RESULT = COMMAND_ARGUMENT_COUNT()'
8452
8453_Arguments_:
8454     None       
8455
8456_Return value_:
8457     The return value is an `INTEGER' of default kind.
8458
8459_Example_:
8460          program test_command_argument_count
8461              integer :: count
8462              count = command_argument_count()
8463              print *, count
8464          end program test_command_argument_count
8465
8466_See also_:
8467     *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
8468
8469
8470File: gfortran.info,  Node: COMPILER_OPTIONS,  Next: COMPILER_VERSION,  Prev: COMMAND_ARGUMENT_COUNT,  Up: Intrinsic Procedures
8471
84729.65 `COMPILER_OPTIONS' -- Options passed to the compiler
8473=========================================================
8474
8475_Description_:
8476     `COMPILER_OPTIONS' returns a string with the options used for
8477     compiling.
8478
8479_Standard_:
8480     Fortran 2008
8481
8482_Class_:
8483     Inquiry function of the module `ISO_FORTRAN_ENV'
8484
8485_Syntax_:
8486     `STR = COMPILER_OPTIONS()'
8487
8488_Arguments_:
8489     None.
8490
8491_Return value_:
8492     The return value is a default-kind string with system-dependent
8493     length.  It contains the compiler flags used to compile the file,
8494     which called the `COMPILER_OPTIONS' intrinsic.
8495
8496_Example_:
8497             use iso_fortran_env
8498             print '(4a)', 'This file was compiled by ', &
8499                           compiler_version(), ' using the options ', &
8500                           compiler_options()
8501             end
8502
8503_See also_:
8504     *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
8505
8506
8507File: gfortran.info,  Node: COMPILER_VERSION,  Next: COMPLEX,  Prev: COMPILER_OPTIONS,  Up: Intrinsic Procedures
8508
85099.66 `COMPILER_VERSION' -- Compiler version string
8510==================================================
8511
8512_Description_:
8513     `COMPILER_VERSION' returns a string with the name and the version
8514     of the compiler.
8515
8516_Standard_:
8517     Fortran 2008
8518
8519_Class_:
8520     Inquiry function of the module `ISO_FORTRAN_ENV'
8521
8522_Syntax_:
8523     `STR = COMPILER_VERSION()'
8524
8525_Arguments_:
8526     None.
8527
8528_Return value_:
8529     The return value is a default-kind string with system-dependent
8530     length.  It contains the name of the compiler and its version
8531     number.
8532
8533_Example_:
8534             use iso_fortran_env
8535             print '(4a)', 'This file was compiled by ', &
8536                           compiler_version(), ' using the options ', &
8537                           compiler_options()
8538             end
8539
8540_See also_:
8541     *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
8542
8543
8544File: gfortran.info,  Node: COMPLEX,  Next: CONJG,  Prev: COMPILER_VERSION,  Up: Intrinsic Procedures
8545
85469.67 `COMPLEX' -- Complex conversion function
8547=============================================
8548
8549_Description_:
8550     `COMPLEX(X, Y)' returns a complex number where X is converted to
8551     the real component and Y is converted to the imaginary component.
8552
8553_Standard_:
8554     GNU extension
8555
8556_Class_:
8557     Elemental function
8558
8559_Syntax_:
8560     `RESULT = COMPLEX(X, Y)'
8561
8562_Arguments_:
8563     X          The type may be `INTEGER' or `REAL'.
8564     Y          The type may be `INTEGER' or `REAL'.
8565
8566_Return value_:
8567     If X and Y are both of `INTEGER' type, then the return value is of
8568     default `COMPLEX' type.
8569
8570     If X and Y are of `REAL' type, or one is of `REAL' type and one is
8571     of `INTEGER' type, then the return value is of `COMPLEX' type with
8572     a kind equal to that of the `REAL' argument with the highest
8573     precision.
8574
8575_Example_:
8576          program test_complex
8577              integer :: i = 42
8578              real :: x = 3.14
8579              print *, complex(i, x)
8580          end program test_complex
8581
8582_See also_:
8583     *note CMPLX::
8584
8585
8586File: gfortran.info,  Node: CONJG,  Next: COS,  Prev: COMPLEX,  Up: Intrinsic Procedures
8587
85889.68 `CONJG' -- Complex conjugate function
8589==========================================
8590
8591_Description_:
8592     `CONJG(Z)' returns the conjugate of Z.  If Z is `(x, y)' then the
8593     result is `(x, -y)'
8594
8595_Standard_:
8596     Fortran 77 and later, has overloads that are GNU extensions
8597
8598_Class_:
8599     Elemental function
8600
8601_Syntax_:
8602     `Z = CONJG(Z)'
8603
8604_Arguments_:
8605     Z          The type shall be `COMPLEX'.
8606
8607_Return value_:
8608     The return value is of type `COMPLEX'.
8609
8610_Example_:
8611          program test_conjg
8612              complex :: z = (2.0, 3.0)
8613              complex(8) :: dz = (2.71_8, -3.14_8)
8614              z= conjg(z)
8615              print *, z
8616              dz = dconjg(dz)
8617              print *, dz
8618          end program test_conjg
8619
8620_Specific names_:
8621     Name          Argument      Return type   Standard
8622     `CONJG(Z)'    `COMPLEX Z'   `COMPLEX'     GNU extension
8623     `DCONJG(Z)'   `COMPLEX(8)   `COMPLEX(8)'  GNU extension
8624                   Z'                          
8625
8626
8627File: gfortran.info,  Node: COS,  Next: COSH,  Prev: CONJG,  Up: Intrinsic Procedures
8628
86299.69 `COS' -- Cosine function
8630=============================
8631
8632_Description_:
8633     `COS(X)' computes the cosine of X.
8634
8635_Standard_:
8636     Fortran 77 and later, has overloads that are GNU extensions
8637
8638_Class_:
8639     Elemental function
8640
8641_Syntax_:
8642     `RESULT = COS(X)'
8643
8644_Arguments_:
8645     X          The type shall be `REAL' or `COMPLEX'.
8646
8647_Return value_:
8648     The return value is of the same type and kind as X. The real part
8649     of the result is in radians. If X is of the type `REAL', the
8650     return value lies in the range  -1 \leq \cos (x) \leq 1.
8651
8652_Example_:
8653          program test_cos
8654            real :: x = 0.0
8655            x = cos(x)
8656          end program test_cos
8657
8658_Specific names_:
8659     Name          Argument      Return type   Standard
8660     `COS(X)'      `REAL(4) X'   `REAL(4)'     Fortran 77 and
8661                                               later
8662     `DCOS(X)'     `REAL(8) X'   `REAL(8)'     Fortran 77 and
8663                                               later
8664     `CCOS(X)'     `COMPLEX(4)   `COMPLEX(4)'  Fortran 77 and
8665                   X'                          later
8666     `ZCOS(X)'     `COMPLEX(8)   `COMPLEX(8)'  GNU extension
8667                   X'                          
8668     `CDCOS(X)'    `COMPLEX(8)   `COMPLEX(8)'  GNU extension
8669                   X'                          
8670
8671_See also_:
8672     Inverse function: *note ACOS::
8673
8674
8675
8676File: gfortran.info,  Node: COSH,  Next: COUNT,  Prev: COS,  Up: Intrinsic Procedures
8677
86789.70 `COSH' -- Hyperbolic cosine function
8679=========================================
8680
8681_Description_:
8682     `COSH(X)' computes the hyperbolic cosine of X.
8683
8684_Standard_:
8685     Fortran 77 and later, for a complex argument Fortran 2008 or later
8686
8687_Class_:
8688     Elemental function
8689
8690_Syntax_:
8691     `X = COSH(X)'
8692
8693_Arguments_:
8694     X          The type shall be `REAL' or `COMPLEX'.
8695
8696_Return value_:
8697     The return value has same type and kind as X. If X is complex, the
8698     imaginary part of the result is in radians. If X is `REAL', the
8699     return value has a lower bound of one, \cosh (x) \geq 1.
8700
8701_Example_:
8702          program test_cosh
8703            real(8) :: x = 1.0_8
8704            x = cosh(x)
8705          end program test_cosh
8706
8707_Specific names_:
8708     Name          Argument      Return type   Standard
8709     `COSH(X)'     `REAL(4) X'   `REAL(4)'     Fortran 77 and
8710                                               later
8711     `DCOSH(X)'    `REAL(8) X'   `REAL(8)'     Fortran 77 and
8712                                               later
8713
8714_See also_:
8715     Inverse function: *note ACOSH::
8716
8717
8718
8719File: gfortran.info,  Node: COUNT,  Next: CPU_TIME,  Prev: COSH,  Up: Intrinsic Procedures
8720
87219.71 `COUNT' -- Count function
8722==============================
8723
8724_Description_:
8725     Counts the number of `.TRUE.' elements in a logical MASK, or, if
8726     the DIM argument is supplied, counts the number of elements along
8727     each row of the array in the DIM direction.  If the array has zero
8728     size, or all of the elements of MASK are `.FALSE.', then the
8729     result is `0'.
8730
8731_Standard_:
8732     Fortran 95 and later, with KIND argument Fortran 2003 and later
8733
8734_Class_:
8735     Transformational function
8736
8737_Syntax_:
8738     `RESULT = COUNT(MASK [, DIM, KIND])'
8739
8740_Arguments_:
8741     MASK       The type shall be `LOGICAL'.
8742     DIM        (Optional) The type shall be `INTEGER'.
8743     KIND       (Optional) An `INTEGER' initialization
8744                expression indicating the kind parameter of
8745                the result.
8746
8747_Return value_:
8748     The return value is of type `INTEGER' and of kind KIND. If KIND is
8749     absent, the return value is of default integer kind.  If DIM is
8750     present, the result is an array with a rank one less than the rank
8751     of ARRAY, and a size corresponding to the shape of ARRAY with the
8752     DIM dimension removed.
8753
8754_Example_:
8755          program test_count
8756              integer, dimension(2,3) :: a, b
8757              logical, dimension(2,3) :: mask
8758              a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
8759              b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
8760              print '(3i3)', a(1,:)
8761              print '(3i3)', a(2,:)
8762              print *
8763              print '(3i3)', b(1,:)
8764              print '(3i3)', b(2,:)
8765              print *
8766              mask = a.ne.b
8767              print '(3l3)', mask(1,:)
8768              print '(3l3)', mask(2,:)
8769              print *
8770              print '(3i3)', count(mask)
8771              print *
8772              print '(3i3)', count(mask, 1)
8773              print *
8774              print '(3i3)', count(mask, 2)
8775          end program test_count
8776
8777
8778File: gfortran.info,  Node: CPU_TIME,  Next: CSHIFT,  Prev: COUNT,  Up: Intrinsic Procedures
8779
87809.72 `CPU_TIME' -- CPU elapsed time in seconds
8781==============================================
8782
8783_Description_:
8784     Returns a `REAL' value representing the elapsed CPU time in
8785     seconds.  This is useful for testing segments of code to determine
8786     execution time.
8787
8788     If a time source is available, time will be reported with
8789     microsecond resolution. If no time source is available, TIME is
8790     set to `-1.0'.
8791
8792     Note that TIME may contain a, system dependent, arbitrary offset
8793     and may not start with `0.0'. For `CPU_TIME', the absolute value
8794     is meaningless, only differences between subsequent calls to this
8795     subroutine, as shown in the example below, should be used.
8796
8797_Standard_:
8798     Fortran 95 and later
8799
8800_Class_:
8801     Subroutine
8802
8803_Syntax_:
8804     `CALL CPU_TIME(TIME)'
8805
8806_Arguments_:
8807     TIME       The type shall be `REAL' with `INTENT(OUT)'.
8808
8809_Return value_:
8810     None
8811
8812_Example_:
8813          program test_cpu_time
8814              real :: start, finish
8815              call cpu_time(start)
8816                  ! put code to test here
8817              call cpu_time(finish)
8818              print '("Time = ",f6.3," seconds.")',finish-start
8819          end program test_cpu_time
8820
8821_See also_:
8822     *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
8823
8824
8825File: gfortran.info,  Node: CSHIFT,  Next: CTIME,  Prev: CPU_TIME,  Up: Intrinsic Procedures
8826
88279.73 `CSHIFT' -- Circular shift elements of an array
8828====================================================
8829
8830_Description_:
8831     `CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
8832     elements of ARRAY along the dimension of DIM.  If DIM is omitted
8833     it is taken to be `1'.  DIM is a scalar of type `INTEGER' in the
8834     range of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the
8835     rank of ARRAY is one, then all elements of ARRAY are shifted by
8836     SHIFT places.  If rank is greater than one, then all complete rank
8837     one sections of ARRAY along the given dimension are shifted.
8838     Elements shifted out one end of each rank one section are shifted
8839     back in the other end.
8840
8841_Standard_:
8842     Fortran 95 and later
8843
8844_Class_:
8845     Transformational function
8846
8847_Syntax_:
8848     `RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
8849
8850_Arguments_:
8851     ARRAY      Shall be an array of any type.
8852     SHIFT      The type shall be `INTEGER'.
8853     DIM        The type shall be `INTEGER'.
8854
8855_Return value_:
8856     Returns an array of same type and rank as the ARRAY argument.
8857
8858_Example_:
8859          program test_cshift
8860              integer, dimension(3,3) :: a
8861              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
8862              print '(3i3)', a(1,:)
8863              print '(3i3)', a(2,:)
8864              print '(3i3)', a(3,:)
8865              a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
8866              print *
8867              print '(3i3)', a(1,:)
8868              print '(3i3)', a(2,:)
8869              print '(3i3)', a(3,:)
8870          end program test_cshift
8871
8872
8873File: gfortran.info,  Node: CTIME,  Next: DATE_AND_TIME,  Prev: CSHIFT,  Up: Intrinsic Procedures
8874
88759.74 `CTIME' -- Convert a time into a string
8876============================================
8877
8878_Description_:
8879     `CTIME' converts a system time value, such as returned by `TIME8',
8880     to a string. The output will be of the form `Sat Aug 19 18:13:14
8881     1995'.
8882
8883     This intrinsic is provided in both subroutine and function forms;
8884     however, only one form can be used in any given program unit.
8885
8886_Standard_:
8887     GNU extension
8888
8889_Class_:
8890     Subroutine, function
8891
8892_Syntax_:
8893     `CALL CTIME(TIME, RESULT)'.
8894     `RESULT = CTIME(TIME)'.
8895
8896_Arguments_:
8897     TIME       The type shall be of type `INTEGER'.
8898     RESULT     The type shall be of type `CHARACTER' and of
8899                default kind. It is an `INTENT(OUT)' argument.
8900                If the length of this variable is too short
8901                for the time and date string to fit
8902                completely, it will be blank on procedure
8903                return.
8904
8905_Return value_:
8906     The converted date and time as a string.
8907
8908_Example_:
8909          program test_ctime
8910              integer(8) :: i
8911              character(len=30) :: date
8912              i = time8()
8913
8914              ! Do something, main part of the program
8915
8916              call ctime(i,date)
8917              print *, 'Program was started on ', date
8918          end program test_ctime
8919
8920_See Also_:
8921     *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note
8922     TIME::, *note TIME8::
8923
8924
8925File: gfortran.info,  Node: DATE_AND_TIME,  Next: DBLE,  Prev: CTIME,  Up: Intrinsic Procedures
8926
89279.75 `DATE_AND_TIME' -- Date and time subroutine
8928================================================
8929
8930_Description_:
8931     `DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
8932     date and time information from the real-time system clock.  DATE is
8933     `INTENT(OUT)' and has form ccyymmdd.  TIME is `INTENT(OUT)' and
8934     has form hhmmss.sss.  ZONE is `INTENT(OUT)' and has form (+-)hhmm,
8935     representing the difference with respect to Coordinated Universal
8936     Time (UTC).  Unavailable time and date parameters return blanks.
8937
8938     VALUES is `INTENT(OUT)' and provides the following:
8939
8940                `VALUE(1)':          The year
8941                `VALUE(2)':          The month
8942                `VALUE(3)':          The day of the month
8943                `VALUE(4)':          Time difference with UTC
8944                                     in minutes
8945                `VALUE(5)':          The hour of the day
8946                `VALUE(6)':          The minutes of the hour
8947                `VALUE(7)':          The seconds of the minute
8948                `VALUE(8)':          The milliseconds of the
8949                                     second
8950
8951_Standard_:
8952     Fortran 95 and later
8953
8954_Class_:
8955     Subroutine
8956
8957_Syntax_:
8958     `CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
8959
8960_Arguments_:
8961     DATE       (Optional) The type shall be `CHARACTER(LEN=8)'
8962                or larger, and of default kind.
8963     TIME       (Optional) The type shall be
8964                `CHARACTER(LEN=10)' or larger, and of default
8965                kind.
8966     ZONE       (Optional) The type shall be `CHARACTER(LEN=5)'
8967                or larger, and of default kind.
8968     VALUES     (Optional) The type shall be `INTEGER(8)'.
8969
8970_Return value_:
8971     None
8972
8973_Example_:
8974          program test_time_and_date
8975              character(8)  :: date
8976              character(10) :: time
8977              character(5)  :: zone
8978              integer,dimension(8) :: values
8979              ! using keyword arguments
8980              call date_and_time(date,time,zone,values)
8981              call date_and_time(DATE=date,ZONE=zone)
8982              call date_and_time(TIME=time)
8983              call date_and_time(VALUES=values)
8984              print '(a,2x,a,2x,a)', date, time, zone
8985              print '(8i5)', values
8986          end program test_time_and_date
8987
8988_See also_:
8989     *note CPU_TIME::, *note SYSTEM_CLOCK::
8990
8991
8992File: gfortran.info,  Node: DBLE,  Next: DCMPLX,  Prev: DATE_AND_TIME,  Up: Intrinsic Procedures
8993
89949.76 `DBLE' -- Double conversion function
8995=========================================
8996
8997_Description_:
8998     `DBLE(A)' Converts A to double precision real type.
8999
9000_Standard_:
9001     Fortran 77 and later
9002
9003_Class_:
9004     Elemental function
9005
9006_Syntax_:
9007     `RESULT = DBLE(A)'
9008
9009_Arguments_:
9010     A          The type shall be `INTEGER', `REAL', or
9011                `COMPLEX'.
9012
9013_Return value_:
9014     The return value is of type double precision real.
9015
9016_Example_:
9017          program test_dble
9018              real    :: x = 2.18
9019              integer :: i = 5
9020              complex :: z = (2.3,1.14)
9021              print *, dble(x), dble(i), dble(z)
9022          end program test_dble
9023
9024_See also_:
9025     *note REAL::
9026
9027
9028File: gfortran.info,  Node: DCMPLX,  Next: DIGITS,  Prev: DBLE,  Up: Intrinsic Procedures
9029
90309.77 `DCMPLX' -- Double complex conversion function
9031===================================================
9032
9033_Description_:
9034     `DCMPLX(X [,Y])' returns a double complex number where X is
9035     converted to the real component.  If Y is present it is converted
9036     to the imaginary component.  If Y is not present then the
9037     imaginary component is set to 0.0.  If X is complex then Y must
9038     not be present.
9039
9040_Standard_:
9041     GNU extension
9042
9043_Class_:
9044     Elemental function
9045
9046_Syntax_:
9047     `RESULT = DCMPLX(X [, Y])'
9048
9049_Arguments_:
9050     X          The type may be `INTEGER', `REAL', or
9051                `COMPLEX'.
9052     Y          (Optional if X is not `COMPLEX'.) May be
9053                `INTEGER' or `REAL'.
9054
9055_Return value_:
9056     The return value is of type `COMPLEX(8)'
9057
9058_Example_:
9059          program test_dcmplx
9060              integer :: i = 42
9061              real :: x = 3.14
9062              complex :: z
9063              z = cmplx(i, x)
9064              print *, dcmplx(i)
9065              print *, dcmplx(x)
9066              print *, dcmplx(z)
9067              print *, dcmplx(x,i)
9068          end program test_dcmplx
9069
9070
9071File: gfortran.info,  Node: DIGITS,  Next: DIM,  Prev: DCMPLX,  Up: Intrinsic Procedures
9072
90739.78 `DIGITS' -- Significant binary digits function
9074===================================================
9075
9076_Description_:
9077     `DIGITS(X)' returns the number of significant binary digits of the
9078     internal model representation of X.  For example, on a system
9079     using a 32-bit floating point representation, a default real
9080     number would likely return 24.
9081
9082_Standard_:
9083     Fortran 95 and later
9084
9085_Class_:
9086     Inquiry function
9087
9088_Syntax_:
9089     `RESULT = DIGITS(X)'
9090
9091_Arguments_:
9092     X          The type may be `INTEGER' or `REAL'.
9093
9094_Return value_:
9095     The return value is of type `INTEGER'.
9096
9097_Example_:
9098          program test_digits
9099              integer :: i = 12345
9100              real :: x = 3.143
9101              real(8) :: y = 2.33
9102              print *, digits(i)
9103              print *, digits(x)
9104              print *, digits(y)
9105          end program test_digits
9106
9107
9108File: gfortran.info,  Node: DIM,  Next: DOT_PRODUCT,  Prev: DIGITS,  Up: Intrinsic Procedures
9109
91109.79 `DIM' -- Positive difference
9111=================================
9112
9113_Description_:
9114     `DIM(X,Y)' returns the difference `X-Y' if the result is positive;
9115     otherwise returns zero.
9116
9117_Standard_:
9118     Fortran 77 and later
9119
9120_Class_:
9121     Elemental function
9122
9123_Syntax_:
9124     `RESULT = DIM(X, Y)'
9125
9126_Arguments_:
9127     X          The type shall be `INTEGER' or `REAL'
9128     Y          The type shall be the same type and kind as X.
9129
9130_Return value_:
9131     The return value is of type `INTEGER' or `REAL'.
9132
9133_Example_:
9134          program test_dim
9135              integer :: i
9136              real(8) :: x
9137              i = dim(4, 15)
9138              x = dim(4.345_8, 2.111_8)
9139              print *, i
9140              print *, x
9141          end program test_dim
9142
9143_Specific names_:
9144     Name          Argument      Return type   Standard
9145     `DIM(X,Y)'    `REAL(4) X,   `REAL(4)'     Fortran 77 and
9146                   Y'                          later
9147     `IDIM(X,Y)'   `INTEGER(4)   `INTEGER(4)'  Fortran 77 and
9148                   X, Y'                       later
9149     `DDIM(X,Y)'   `REAL(8) X,   `REAL(8)'     Fortran 77 and
9150                   Y'                          later
9151
9152
9153File: gfortran.info,  Node: DOT_PRODUCT,  Next: DPROD,  Prev: DIM,  Up: Intrinsic Procedures
9154
91559.80 `DOT_PRODUCT' -- Dot product function
9156==========================================
9157
9158_Description_:
9159     `DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
9160     multiplication of two vectors VECTOR_A and VECTOR_B.  The two
9161     vectors may be either numeric or logical and must be arrays of
9162     rank one and of equal size. If the vectors are `INTEGER' or
9163     `REAL', the result is `SUM(VECTOR_A*VECTOR_B)'. If the vectors are
9164     `COMPLEX', the result is `SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the
9165     vectors are `LOGICAL', the result is `ANY(VECTOR_A .AND.
9166     VECTOR_B)'.
9167
9168_Standard_:
9169     Fortran 95 and later
9170
9171_Class_:
9172     Transformational function
9173
9174_Syntax_:
9175     `RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
9176
9177_Arguments_:
9178     VECTOR_A   The type shall be numeric or `LOGICAL', rank 1.
9179     VECTOR_B   The type shall be numeric if VECTOR_A is of
9180                numeric type or `LOGICAL' if VECTOR_A is of
9181                type `LOGICAL'. VECTOR_B shall be a rank-one
9182                array.
9183
9184_Return value_:
9185     If the arguments are numeric, the return value is a scalar of
9186     numeric type, `INTEGER', `REAL', or `COMPLEX'.  If the arguments
9187     are `LOGICAL', the return value is `.TRUE.' or `.FALSE.'.
9188
9189_Example_:
9190          program test_dot_prod
9191              integer, dimension(3) :: a, b
9192              a = (/ 1, 2, 3 /)
9193              b = (/ 4, 5, 6 /)
9194              print '(3i3)', a
9195              print *
9196              print '(3i3)', b
9197              print *
9198              print *, dot_product(a,b)
9199          end program test_dot_prod
9200
9201
9202File: gfortran.info,  Node: DPROD,  Next: DREAL,  Prev: DOT_PRODUCT,  Up: Intrinsic Procedures
9203
92049.81 `DPROD' -- Double product function
9205=======================================
9206
9207_Description_:
9208     `DPROD(X,Y)' returns the product `X*Y'.
9209
9210_Standard_:
9211     Fortran 77 and later
9212
9213_Class_:
9214     Elemental function
9215
9216_Syntax_:
9217     `RESULT = DPROD(X, Y)'
9218
9219_Arguments_:
9220     X          The type shall be `REAL'.
9221     Y          The type shall be `REAL'.
9222
9223_Return value_:
9224     The return value is of type `REAL(8)'.
9225
9226_Example_:
9227          program test_dprod
9228              real :: x = 5.2
9229              real :: y = 2.3
9230              real(8) :: d
9231              d = dprod(x,y)
9232              print *, d
9233          end program test_dprod
9234
9235_Specific names_:
9236     Name          Argument      Return type   Standard
9237     `DPROD(X,Y)'  `REAL(4) X,   `REAL(8)'     Fortran 77 and
9238                   Y'                          later
9239
9240
9241
9242File: gfortran.info,  Node: DREAL,  Next: DSHIFTL,  Prev: DPROD,  Up: Intrinsic Procedures
9243
92449.82 `DREAL' -- Double real part function
9245=========================================
9246
9247_Description_:
9248     `DREAL(Z)' returns the real part of complex variable Z.
9249
9250_Standard_:
9251     GNU extension
9252
9253_Class_:
9254     Elemental function
9255
9256_Syntax_:
9257     `RESULT = DREAL(A)'
9258
9259_Arguments_:
9260     A          The type shall be `COMPLEX(8)'.
9261
9262_Return value_:
9263     The return value is of type `REAL(8)'.
9264
9265_Example_:
9266          program test_dreal
9267              complex(8) :: z = (1.3_8,7.2_8)
9268              print *, dreal(z)
9269          end program test_dreal
9270
9271_See also_:
9272     *note AIMAG::
9273
9274
9275
9276File: gfortran.info,  Node: DSHIFTL,  Next: DSHIFTR,  Prev: DREAL,  Up: Intrinsic Procedures
9277
92789.83 `DSHIFTL' -- Combined left shift
9279=====================================
9280
9281_Description_:
9282     `DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost
9283     SHIFT bits of the result are the leftmost SHIFT bits of J, and the
9284     remaining bits are the rightmost bits of I.
9285
9286_Standard_:
9287     Fortran 2008 and later
9288
9289_Class_:
9290     Elemental function
9291
9292_Syntax_:
9293     `RESULT = DSHIFTL(I, J, SHIFT)'
9294
9295_Arguments_:
9296     I          Shall be of type `INTEGER' or a BOZ constant.
9297     J          Shall be of type `INTEGER' or a BOZ constant.
9298                If both I and J have integer type, then they
9299                shall have the same kind type parameter. I and
9300                J shall not both be BOZ constants.
9301     SHIFT      Shall be of type `INTEGER'. It shall be
9302                nonnegative.  If I is not a BOZ constant, then
9303                SHIFT shall be less than or equal to
9304                `BIT_SIZE(I)'; otherwise, SHIFT shall be less
9305                than or equal to `BIT_SIZE(J)'.
9306
9307_Return value_:
9308     If either I or J is a BOZ constant, it is first converted as if by
9309     the intrinsic function `INT' to an integer type with the kind type
9310     parameter of the other.
9311
9312_See also_:
9313     *note DSHIFTR::
9314
9315
9316File: gfortran.info,  Node: DSHIFTR,  Next: DTIME,  Prev: DSHIFTL,  Up: Intrinsic Procedures
9317
93189.84 `DSHIFTR' -- Combined right shift
9319======================================
9320
9321_Description_:
9322     `DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost
9323     SHIFT bits of the result are the rightmost SHIFT bits of I, and
9324     the remaining bits are the leftmost bits of J.
9325
9326_Standard_:
9327     Fortran 2008 and later
9328
9329_Class_:
9330     Elemental function
9331
9332_Syntax_:
9333     `RESULT = DSHIFTR(I, J, SHIFT)'
9334
9335_Arguments_:
9336     I          Shall be of type `INTEGER' or a BOZ constant.
9337     J          Shall be of type `INTEGER' or a BOZ constant.
9338                If both I and J have integer type, then they
9339                shall have the same kind type parameter. I and
9340                J shall not both be BOZ constants.
9341     SHIFT      Shall be of type `INTEGER'. It shall be
9342                nonnegative.  If I is not a BOZ constant, then
9343                SHIFT shall be less than or equal to
9344                `BIT_SIZE(I)'; otherwise, SHIFT shall be less
9345                than or equal to `BIT_SIZE(J)'.
9346
9347_Return value_:
9348     If either I or J is a BOZ constant, it is first converted as if by
9349     the intrinsic function `INT' to an integer type with the kind type
9350     parameter of the other.
9351
9352_See also_:
9353     *note DSHIFTL::
9354
9355
9356File: gfortran.info,  Node: DTIME,  Next: EOSHIFT,  Prev: DSHIFTR,  Up: Intrinsic Procedures
9357
93589.85 `DTIME' -- Execution time subroutine (or function)
9359=======================================================
9360
9361_Description_:
9362     `DTIME(VALUES, TIME)' initially returns the number of seconds of
9363     runtime since the start of the process's execution in TIME.  VALUES
9364     returns the user and system components of this time in `VALUES(1)'
9365     and `VALUES(2)' respectively. TIME is equal to `VALUES(1) +
9366     VALUES(2)'.
9367
9368     Subsequent invocations of `DTIME' return values accumulated since
9369     the previous invocation.
9370
9371     On some systems, the underlying timings are represented using
9372     types with sufficiently small limits that overflows (wrap around)
9373     are possible, such as 32-bit types. Therefore, the values returned
9374     by this intrinsic might be, or become, negative, or numerically
9375     less than previous values, during a single run of the compiled
9376     program.
9377
9378     Please note, that this implementation is thread safe if used
9379     within OpenMP directives, i.e., its state will be consistent while
9380     called from multiple threads. However, if `DTIME' is called from
9381     multiple threads, the result is still the time since the last
9382     invocation. This may not give the intended results. If possible,
9383     use `CPU_TIME' instead.
9384
9385     This intrinsic is provided in both subroutine and function forms;
9386     however, only one form can be used in any given program unit.
9387
9388     VALUES and TIME are `INTENT(OUT)' and provide the following:
9389
9390                `VALUES(1)':         User time in seconds.
9391                `VALUES(2)':         System time in seconds.
9392                `TIME':              Run time since start in
9393                                     seconds.
9394
9395_Standard_:
9396     GNU extension
9397
9398_Class_:
9399     Subroutine, function
9400
9401_Syntax_:
9402     `CALL DTIME(VALUES, TIME)'.
9403     `TIME = DTIME(VALUES)', (not recommended).
9404
9405_Arguments_:
9406     VALUES     The type shall be `REAL(4), DIMENSION(2)'.
9407     TIME       The type shall be `REAL(4)'.
9408
9409_Return value_:
9410     Elapsed time in seconds since the last invocation or since the
9411     start of program execution if not called before.
9412
9413_Example_:
9414          program test_dtime
9415              integer(8) :: i, j
9416              real, dimension(2) :: tarray
9417              real :: result
9418              call dtime(tarray, result)
9419              print *, result
9420              print *, tarray(1)
9421              print *, tarray(2)
9422              do i=1,100000000    ! Just a delay
9423                  j = i * i - i
9424              end do
9425              call dtime(tarray, result)
9426              print *, result
9427              print *, tarray(1)
9428              print *, tarray(2)
9429          end program test_dtime
9430
9431_See also_:
9432     *note CPU_TIME::
9433
9434
9435
9436File: gfortran.info,  Node: EOSHIFT,  Next: EPSILON,  Prev: DTIME,  Up: Intrinsic Procedures
9437
94389.86 `EOSHIFT' -- End-off shift elements of an array
9439====================================================
9440
9441_Description_:
9442     `EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
9443     on elements of ARRAY along the dimension of DIM.  If DIM is
9444     omitted it is taken to be `1'.  DIM is a scalar of type `INTEGER'
9445     in the range of 1 \leq DIM \leq n) where n is the rank of ARRAY.
9446     If the rank of ARRAY is one, then all elements of ARRAY are
9447     shifted by SHIFT places.  If rank is greater than one, then all
9448     complete rank one sections of ARRAY along the given dimension are
9449     shifted.  Elements shifted out one end of each rank one section
9450     are dropped.  If BOUNDARY is present then the corresponding value
9451     of from BOUNDARY is copied back in the other end.  If BOUNDARY is
9452     not present then the following are copied in depending on the type
9453     of ARRAY.
9454
9455     _Array     _Boundary Value_
9456     Type_      
9457     Numeric    0 of the type and kind of ARRAY.
9458     Logical    `.FALSE.'.
9459     Character(LEN)LEN blanks.
9460
9461_Standard_:
9462     Fortran 95 and later
9463
9464_Class_:
9465     Transformational function
9466
9467_Syntax_:
9468     `RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
9469
9470_Arguments_:
9471     ARRAY      May be any type, not scalar.
9472     SHIFT      The type shall be `INTEGER'.
9473     BOUNDARY   Same type as ARRAY.
9474     DIM        The type shall be `INTEGER'.
9475
9476_Return value_:
9477     Returns an array of same type and rank as the ARRAY argument.
9478
9479_Example_:
9480          program test_eoshift
9481              integer, dimension(3,3) :: a
9482              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
9483              print '(3i3)', a(1,:)
9484              print '(3i3)', a(2,:)
9485              print '(3i3)', a(3,:)
9486              a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
9487              print *
9488              print '(3i3)', a(1,:)
9489              print '(3i3)', a(2,:)
9490              print '(3i3)', a(3,:)
9491          end program test_eoshift
9492
9493
9494File: gfortran.info,  Node: EPSILON,  Next: ERF,  Prev: EOSHIFT,  Up: Intrinsic Procedures
9495
94969.87 `EPSILON' -- Epsilon function
9497==================================
9498
9499_Description_:
9500     `EPSILON(X)' returns the smallest number E of the same kind as X
9501     such that 1 + E > 1.
9502
9503_Standard_:
9504     Fortran 95 and later
9505
9506_Class_:
9507     Inquiry function
9508
9509_Syntax_:
9510     `RESULT = EPSILON(X)'
9511
9512_Arguments_:
9513     X          The type shall be `REAL'.
9514
9515_Return value_:
9516     The return value is of same type as the argument.
9517
9518_Example_:
9519          program test_epsilon
9520              real :: x = 3.143
9521              real(8) :: y = 2.33
9522              print *, EPSILON(x)
9523              print *, EPSILON(y)
9524          end program test_epsilon
9525
9526
9527File: gfortran.info,  Node: ERF,  Next: ERFC,  Prev: EPSILON,  Up: Intrinsic Procedures
9528
95299.88 `ERF' -- Error function
9530============================
9531
9532_Description_:
9533     `ERF(X)' computes the error function of X.
9534
9535_Standard_:
9536     Fortran 2008 and later
9537
9538_Class_:
9539     Elemental function
9540
9541_Syntax_:
9542     `RESULT = ERF(X)'
9543
9544_Arguments_:
9545     X          The type shall be `REAL'.
9546
9547_Return value_:
9548     The return value is of type `REAL', of the same kind as X and lies
9549     in the range -1 \leq erf (x) \leq 1 .
9550
9551_Example_:
9552          program test_erf
9553            real(8) :: x = 0.17_8
9554            x = erf(x)
9555          end program test_erf
9556
9557_Specific names_:
9558     Name          Argument      Return type   Standard
9559     `DERF(X)'     `REAL(8) X'   `REAL(8)'     GNU extension
9560
9561
9562File: gfortran.info,  Node: ERFC,  Next: ERFC_SCALED,  Prev: ERF,  Up: Intrinsic Procedures
9563
95649.89 `ERFC' -- Error function
9565=============================
9566
9567_Description_:
9568     `ERFC(X)' computes the complementary error function of X.
9569
9570_Standard_:
9571     Fortran 2008 and later
9572
9573_Class_:
9574     Elemental function
9575
9576_Syntax_:
9577     `RESULT = ERFC(X)'
9578
9579_Arguments_:
9580     X          The type shall be `REAL'.
9581
9582_Return value_:
9583     The return value is of type `REAL' and of the same kind as X.  It
9584     lies in the range  0 \leq erfc (x) \leq 2 .
9585
9586_Example_:
9587          program test_erfc
9588            real(8) :: x = 0.17_8
9589            x = erfc(x)
9590          end program test_erfc
9591
9592_Specific names_:
9593     Name          Argument      Return type   Standard
9594     `DERFC(X)'    `REAL(8) X'   `REAL(8)'     GNU extension
9595
9596
9597File: gfortran.info,  Node: ERFC_SCALED,  Next: ETIME,  Prev: ERFC,  Up: Intrinsic Procedures
9598
95999.90 `ERFC_SCALED' -- Error function
9600====================================
9601
9602_Description_:
9603     `ERFC_SCALED(X)' computes the exponentially-scaled complementary
9604     error function of X.
9605
9606_Standard_:
9607     Fortran 2008 and later
9608
9609_Class_:
9610     Elemental function
9611
9612_Syntax_:
9613     `RESULT = ERFC_SCALED(X)'
9614
9615_Arguments_:
9616     X          The type shall be `REAL'.
9617
9618_Return value_:
9619     The return value is of type `REAL' and of the same kind as X.
9620
9621_Example_:
9622          program test_erfc_scaled
9623            real(8) :: x = 0.17_8
9624            x = erfc_scaled(x)
9625          end program test_erfc_scaled
9626
9627
9628File: gfortran.info,  Node: ETIME,  Next: EXECUTE_COMMAND_LINE,  Prev: ERFC_SCALED,  Up: Intrinsic Procedures
9629
96309.91 `ETIME' -- Execution time subroutine (or function)
9631=======================================================
9632
9633_Description_:
9634     `ETIME(VALUES, TIME)' returns the number of seconds of runtime
9635     since the start of the process's execution in TIME.  VALUES
9636     returns the user and system components of this time in `VALUES(1)'
9637     and `VALUES(2)' respectively. TIME is equal to `VALUES(1) +
9638     VALUES(2)'.
9639
9640     On some systems, the underlying timings are represented using
9641     types with sufficiently small limits that overflows (wrap around)
9642     are possible, such as 32-bit types. Therefore, the values returned
9643     by this intrinsic might be, or become, negative, or numerically
9644     less than previous values, during a single run of the compiled
9645     program.
9646
9647     This intrinsic is provided in both subroutine and function forms;
9648     however, only one form can be used in any given program unit.
9649
9650     VALUES and TIME are `INTENT(OUT)' and provide the following:
9651
9652                `VALUES(1)':         User time in seconds.
9653                `VALUES(2)':         System time in seconds.
9654                `TIME':              Run time since start in seconds.
9655
9656_Standard_:
9657     GNU extension
9658
9659_Class_:
9660     Subroutine, function
9661
9662_Syntax_:
9663     `CALL ETIME(VALUES, TIME)'.
9664     `TIME = ETIME(VALUES)', (not recommended).
9665
9666_Arguments_:
9667     VALUES     The type shall be `REAL(4), DIMENSION(2)'.
9668     TIME       The type shall be `REAL(4)'.
9669
9670_Return value_:
9671     Elapsed time in seconds since the start of program execution.
9672
9673_Example_:
9674          program test_etime
9675              integer(8) :: i, j
9676              real, dimension(2) :: tarray
9677              real :: result
9678              call ETIME(tarray, result)
9679              print *, result
9680              print *, tarray(1)
9681              print *, tarray(2)
9682              do i=1,100000000    ! Just a delay
9683                  j = i * i - i
9684              end do
9685              call ETIME(tarray, result)
9686              print *, result
9687              print *, tarray(1)
9688              print *, tarray(2)
9689          end program test_etime
9690
9691_See also_:
9692     *note CPU_TIME::
9693
9694
9695
9696File: gfortran.info,  Node: EXECUTE_COMMAND_LINE,  Next: EXIT,  Prev: ETIME,  Up: Intrinsic Procedures
9697
96989.92 `EXECUTE_COMMAND_LINE' -- Execute a shell command
9699======================================================
9700
9701_Description_:
9702     `EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
9703     asynchronously.
9704
9705     The `COMMAND' argument is passed to the shell and executed, using
9706     the C library's `system' call.  (The shell is `sh' on Unix
9707     systems, and `cmd.exe' on Windows.)  If `WAIT' is present and has
9708     the value false, the execution of the command is asynchronous if
9709     the system supports it; otherwise, the command is executed
9710     synchronously.
9711
9712     The three last arguments allow the user to get status information.
9713     After synchronous execution, `EXITSTAT' contains the integer exit
9714     code of the command, as returned by `system'.  `CMDSTAT' is set to
9715     zero if the command line was executed (whatever its exit status
9716     was).  `CMDMSG' is assigned an error message if an error has
9717     occurred.
9718
9719     Note that the `system' function need not be thread-safe. It is the
9720     responsibility of the user to ensure that `system' is not called
9721     concurrently.
9722
9723_Standard_:
9724     Fortran 2008 and later
9725
9726_Class_:
9727     Subroutine
9728
9729_Syntax_:
9730     `CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
9731     CMDMSG ])'
9732
9733_Arguments_:
9734     COMMAND    Shall be a default `CHARACTER' scalar.
9735     WAIT       (Optional) Shall be a default `LOGICAL' scalar.
9736     EXITSTAT   (Optional) Shall be an `INTEGER' of the
9737                default kind.
9738     CMDSTAT    (Optional) Shall be an `INTEGER' of the
9739                default kind.
9740     CMDMSG     (Optional) Shall be an `CHARACTER' scalar of
9741                the default kind.
9742
9743_Example_:
9744          program test_exec
9745            integer :: i
9746
9747            call execute_command_line ("external_prog.exe", exitstat=i)
9748            print *, "Exit status of external_prog.exe was ", i
9749
9750            call execute_command_line ("reindex_files.exe", wait=.false.)
9751            print *, "Now reindexing files in the background"
9752
9753          end program test_exec
9754
9755_Note_:
9756     Because this intrinsic is implemented in terms of the `system'
9757     function call, its behavior with respect to signaling is processor
9758     dependent. In particular, on POSIX-compliant systems, the SIGINT
9759     and SIGQUIT signals will be ignored, and the SIGCHLD will be
9760     blocked. As such, if the parent process is terminated, the child
9761     process might not be terminated alongside.
9762
9763_See also_:
9764     *note SYSTEM::
9765
9766
9767File: gfortran.info,  Node: EXIT,  Next: EXP,  Prev: EXECUTE_COMMAND_LINE,  Up: Intrinsic Procedures
9768
97699.93 `EXIT' -- Exit the program with status.
9770============================================
9771
9772_Description_:
9773     `EXIT' causes immediate termination of the program with status.
9774     If status is omitted it returns the canonical _success_ for the
9775     system.  All Fortran I/O units are closed.
9776
9777_Standard_:
9778     GNU extension
9779
9780_Class_:
9781     Subroutine
9782
9783_Syntax_:
9784     `CALL EXIT([STATUS])'
9785
9786_Arguments_:
9787     STATUS     Shall be an `INTEGER' of the default kind.
9788
9789_Return value_:
9790     `STATUS' is passed to the parent process on exit.
9791
9792_Example_:
9793          program test_exit
9794            integer :: STATUS = 0
9795            print *, 'This program is going to exit.'
9796            call EXIT(STATUS)
9797          end program test_exit
9798
9799_See also_:
9800     *note ABORT::, *note KILL::
9801
9802
9803File: gfortran.info,  Node: EXP,  Next: EXPONENT,  Prev: EXIT,  Up: Intrinsic Procedures
9804
98059.94 `EXP' -- Exponential function
9806==================================
9807
9808_Description_:
9809     `EXP(X)' computes the base e exponential of X.
9810
9811_Standard_:
9812     Fortran 77 and later, has overloads that are GNU extensions
9813
9814_Class_:
9815     Elemental function
9816
9817_Syntax_:
9818     `RESULT = EXP(X)'
9819
9820_Arguments_:
9821     X          The type shall be `REAL' or `COMPLEX'.
9822
9823_Return value_:
9824     The return value has same type and kind as X.
9825
9826_Example_:
9827          program test_exp
9828            real :: x = 1.0
9829            x = exp(x)
9830          end program test_exp
9831
9832_Specific names_:
9833     Name          Argument      Return type   Standard
9834     `EXP(X)'      `REAL(4) X'   `REAL(4)'     Fortran 77 and
9835                                               later
9836     `DEXP(X)'     `REAL(8) X'   `REAL(8)'     Fortran 77 and
9837                                               later
9838     `CEXP(X)'     `COMPLEX(4)   `COMPLEX(4)'  Fortran 77 and
9839                   X'                          later
9840     `ZEXP(X)'     `COMPLEX(8)   `COMPLEX(8)'  GNU extension
9841                   X'                          
9842     `CDEXP(X)'    `COMPLEX(8)   `COMPLEX(8)'  GNU extension
9843                   X'                          
9844
9845
9846File: gfortran.info,  Node: EXPONENT,  Next: EXTENDS_TYPE_OF,  Prev: EXP,  Up: Intrinsic Procedures
9847
98489.95 `EXPONENT' -- Exponent function
9849====================================
9850
9851_Description_:
9852     `EXPONENT(X)' returns the value of the exponent part of X. If X is
9853     zero the value returned is zero.
9854
9855_Standard_:
9856     Fortran 95 and later
9857
9858_Class_:
9859     Elemental function
9860
9861_Syntax_:
9862     `RESULT = EXPONENT(X)'
9863
9864_Arguments_:
9865     X          The type shall be `REAL'.
9866
9867_Return value_:
9868     The return value is of type default `INTEGER'.
9869
9870_Example_:
9871          program test_exponent
9872            real :: x = 1.0
9873            integer :: i
9874            i = exponent(x)
9875            print *, i
9876            print *, exponent(0.0)
9877          end program test_exponent
9878
9879
9880File: gfortran.info,  Node: EXTENDS_TYPE_OF,  Next: FDATE,  Prev: EXPONENT,  Up: Intrinsic Procedures
9881
98829.96 `EXTENDS_TYPE_OF' --  Query dynamic type for extension
9883===========================================================
9884
9885_Description_:
9886     Query dynamic type for extension.
9887
9888_Standard_:
9889     Fortran 2003 and later
9890
9891_Class_:
9892     Inquiry function
9893
9894_Syntax_:
9895     `RESULT = EXTENDS_TYPE_OF(A, MOLD)'
9896
9897_Arguments_:
9898     A          Shall be an object of extensible declared type
9899                or unlimited polymorphic.
9900     MOLD       Shall be an object of extensible declared type
9901                or unlimited polymorphic.
9902
9903_Return value_:
9904     The return value is a scalar of type default logical. It is true
9905     if and only if the dynamic type of A is an extension type of the
9906     dynamic type of MOLD.
9907
9908_See also_:
9909     *note SAME_TYPE_AS::
9910
9911
9912File: gfortran.info,  Node: FDATE,  Next: FGET,  Prev: EXTENDS_TYPE_OF,  Up: Intrinsic Procedures
9913
99149.97 `FDATE' -- Get the current time as a string
9915================================================
9916
9917_Description_:
9918     `FDATE(DATE)' returns the current date (using the same format as
9919     `CTIME') in DATE. It is equivalent to `CALL CTIME(DATE, TIME())'.
9920
9921     This intrinsic is provided in both subroutine and function forms;
9922     however, only one form can be used in any given program unit.
9923
9924_Standard_:
9925     GNU extension
9926
9927_Class_:
9928     Subroutine, function
9929
9930_Syntax_:
9931     `CALL FDATE(DATE)'.
9932     `DATE = FDATE()'.
9933
9934_Arguments_:
9935     DATE       The type shall be of type `CHARACTER' of the
9936                default kind. It is an `INTENT(OUT)' argument.
9937                If the length of this variable is too short
9938                for the date and time string to fit
9939                completely, it will be blank on procedure
9940                return.
9941
9942_Return value_:
9943     The current date and time as a string.
9944
9945_Example_:
9946          program test_fdate
9947              integer(8) :: i, j
9948              character(len=30) :: date
9949              call fdate(date)
9950              print *, 'Program started on ', date
9951              do i = 1, 100000000 ! Just a delay
9952                  j = i * i - i
9953              end do
9954              call fdate(date)
9955              print *, 'Program ended on ', date
9956          end program test_fdate
9957
9958_See also_:
9959     *note DATE_AND_TIME::, *note CTIME::
9960
9961
9962File: gfortran.info,  Node: FGET,  Next: FGETC,  Prev: FDATE,  Up: Intrinsic Procedures
9963
99649.98 `FGET' -- Read a single character in stream mode from stdin
9965================================================================
9966
9967_Description_:
9968     Read a single character in stream mode from stdin by bypassing
9969     normal formatted output. Stream I/O should not be mixed with
9970     normal record-oriented (formatted or unformatted) I/O on the same
9971     unit; the results are unpredictable.
9972
9973     This intrinsic is provided in both subroutine and function forms;
9974     however, only one form can be used in any given program unit.
9975
9976     Note that the `FGET' intrinsic is provided for backwards
9977     compatibility with `g77'.  GNU Fortran provides the Fortran 2003
9978     Stream facility.  Programmers should consider the use of new
9979     stream IO feature in new code for future portability. See also
9980     *note Fortran 2003 status::.
9981
9982_Standard_:
9983     GNU extension
9984
9985_Class_:
9986     Subroutine, function
9987
9988_Syntax_:
9989     `CALL FGET(C [, STATUS])'
9990     `STATUS = FGET(C)'
9991
9992_Arguments_:
9993     C          The type shall be `CHARACTER' and of default
9994                kind.
9995     STATUS     (Optional) status flag of type `INTEGER'.
9996                Returns 0 on success, -1 on end-of-file, and a
9997                system specific positive error code otherwise.
9998
9999_Example_:
10000          PROGRAM test_fget
10001            INTEGER, PARAMETER :: strlen = 100
10002            INTEGER :: status, i = 1
10003            CHARACTER(len=strlen) :: str = ""
10004
10005            WRITE (*,*) 'Enter text:'
10006            DO
10007              CALL fget(str(i:i), status)
10008              if (status /= 0 .OR. i > strlen) exit
10009              i = i + 1
10010            END DO
10011            WRITE (*,*) TRIM(str)
10012          END PROGRAM
10013
10014_See also_:
10015     *note FGETC::, *note FPUT::, *note FPUTC::
10016
10017
10018File: gfortran.info,  Node: FGETC,  Next: FLOOR,  Prev: FGET,  Up: Intrinsic Procedures
10019
100209.99 `FGETC' -- Read a single character in stream mode
10021======================================================
10022
10023_Description_:
10024     Read a single character in stream mode by bypassing normal
10025     formatted output.  Stream I/O should not be mixed with normal
10026     record-oriented (formatted or unformatted) I/O on the same unit;
10027     the results are unpredictable.
10028
10029     This intrinsic is provided in both subroutine and function forms;
10030     however, only one form can be used in any given program unit.
10031
10032     Note that the `FGET' intrinsic is provided for backwards
10033     compatibility with `g77'.  GNU Fortran provides the Fortran 2003
10034     Stream facility.  Programmers should consider the use of new
10035     stream IO feature in new code for future portability. See also
10036     *note Fortran 2003 status::.
10037
10038_Standard_:
10039     GNU extension
10040
10041_Class_:
10042     Subroutine, function
10043
10044_Syntax_:
10045     `CALL FGETC(UNIT, C [, STATUS])'
10046     `STATUS = FGETC(UNIT, C)'
10047
10048_Arguments_:
10049     UNIT       The type shall be `INTEGER'.
10050     C          The type shall be `CHARACTER' and of default
10051                kind.
10052     STATUS     (Optional) status flag of type `INTEGER'.
10053                Returns 0 on success, -1 on end-of-file and a
10054                system specific positive error code otherwise.
10055
10056_Example_:
10057          PROGRAM test_fgetc
10058            INTEGER :: fd = 42, status
10059            CHARACTER :: c
10060
10061            OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
10062            DO
10063              CALL fgetc(fd, c, status)
10064              IF (status /= 0) EXIT
10065              call fput(c)
10066            END DO
10067            CLOSE(UNIT=fd)
10068          END PROGRAM
10069
10070_See also_:
10071     *note FGET::, *note FPUT::, *note FPUTC::
10072
10073
10074File: gfortran.info,  Node: FLOOR,  Next: FLUSH,  Prev: FGETC,  Up: Intrinsic Procedures
10075
100769.100 `FLOOR' -- Integer floor function
10077=======================================
10078
10079_Description_:
10080     `FLOOR(A)' returns the greatest integer less than or equal to X.
10081
10082_Standard_:
10083     Fortran 95 and later
10084
10085_Class_:
10086     Elemental function
10087
10088_Syntax_:
10089     `RESULT = FLOOR(A [, KIND])'
10090
10091_Arguments_:
10092     A          The type shall be `REAL'.
10093     KIND       (Optional) An `INTEGER' initialization
10094                expression indicating the kind parameter of
10095                the result.
10096
10097_Return value_:
10098     The return value is of type `INTEGER(KIND)' if KIND is present and
10099     of default-kind `INTEGER' otherwise.
10100
10101_Example_:
10102          program test_floor
10103              real :: x = 63.29
10104              real :: y = -63.59
10105              print *, floor(x) ! returns 63
10106              print *, floor(y) ! returns -64
10107          end program test_floor
10108
10109_See also_:
10110     *note CEILING::, *note NINT::
10111
10112
10113
10114File: gfortran.info,  Node: FLUSH,  Next: FNUM,  Prev: FLOOR,  Up: Intrinsic Procedures
10115
101169.101 `FLUSH' -- Flush I/O unit(s)
10117==================================
10118
10119_Description_:
10120     Flushes Fortran unit(s) currently open for output. Without the
10121     optional argument, all units are flushed, otherwise just the unit
10122     specified.
10123
10124_Standard_:
10125     GNU extension
10126
10127_Class_:
10128     Subroutine
10129
10130_Syntax_:
10131     `CALL FLUSH(UNIT)'
10132
10133_Arguments_:
10134     UNIT       (Optional) The type shall be `INTEGER'.
10135
10136_Note_:
10137     Beginning with the Fortran 2003 standard, there is a `FLUSH'
10138     statement that should be preferred over the `FLUSH' intrinsic.
10139
10140     The `FLUSH' intrinsic and the Fortran 2003 `FLUSH' statement have
10141     identical effect: they flush the runtime library's I/O buffer so
10142     that the data becomes visible to other processes. This does not
10143     guarantee that the data is committed to disk.
10144
10145     On POSIX systems, you can request that all data is transferred  to
10146     the storage device by calling the `fsync' function, with the POSIX
10147     file descriptor of the I/O unit as argument (retrieved with GNU
10148     intrinsic `FNUM'). The following example shows how:
10149
10150            ! Declare the interface for POSIX fsync function
10151            interface
10152              function fsync (fd) bind(c,name="fsync")
10153              use iso_c_binding, only: c_int
10154                integer(c_int), value :: fd
10155                integer(c_int) :: fsync
10156              end function fsync
10157            end interface
10158
10159            ! Variable declaration
10160            integer :: ret
10161
10162            ! Opening unit 10
10163            open (10,file="foo")
10164
10165            ! ...
10166            ! Perform I/O on unit 10
10167            ! ...
10168
10169            ! Flush and sync
10170            flush(10)
10171            ret = fsync(fnum(10))
10172
10173            ! Handle possible error
10174            if (ret /= 0) stop "Error calling FSYNC"
10175
10176
10177
10178File: gfortran.info,  Node: FNUM,  Next: FPUT,  Prev: FLUSH,  Up: Intrinsic Procedures
10179
101809.102 `FNUM' -- File number function
10181====================================
10182
10183_Description_:
10184     `FNUM(UNIT)' returns the POSIX file descriptor number
10185     corresponding to the open Fortran I/O unit `UNIT'.
10186
10187_Standard_:
10188     GNU extension
10189
10190_Class_:
10191     Function
10192
10193_Syntax_:
10194     `RESULT = FNUM(UNIT)'
10195
10196_Arguments_:
10197     UNIT       The type shall be `INTEGER'.
10198
10199_Return value_:
10200     The return value is of type `INTEGER'
10201
10202_Example_:
10203          program test_fnum
10204            integer :: i
10205            open (unit=10, status = "scratch")
10206            i = fnum(10)
10207            print *, i
10208            close (10)
10209          end program test_fnum
10210
10211
10212File: gfortran.info,  Node: FPUT,  Next: FPUTC,  Prev: FNUM,  Up: Intrinsic Procedures
10213
102149.103 `FPUT' -- Write a single character in stream mode to stdout
10215=================================================================
10216
10217_Description_:
10218     Write a single character in stream mode to stdout by bypassing
10219     normal formatted output. Stream I/O should not be mixed with
10220     normal record-oriented (formatted or unformatted) I/O on the same
10221     unit; the results are unpredictable.
10222
10223     This intrinsic is provided in both subroutine and function forms;
10224     however, only one form can be used in any given program unit.
10225
10226     Note that the `FGET' intrinsic is provided for backwards
10227     compatibility with `g77'.  GNU Fortran provides the Fortran 2003
10228     Stream facility.  Programmers should consider the use of new
10229     stream IO feature in new code for future portability. See also
10230     *note Fortran 2003 status::.
10231
10232_Standard_:
10233     GNU extension
10234
10235_Class_:
10236     Subroutine, function
10237
10238_Syntax_:
10239     `CALL FPUT(C [, STATUS])'
10240     `STATUS = FPUT(C)'
10241
10242_Arguments_:
10243     C          The type shall be `CHARACTER' and of default
10244                kind.
10245     STATUS     (Optional) status flag of type `INTEGER'.
10246                Returns 0 on success, -1 on end-of-file and a
10247                system specific positive error code otherwise.
10248
10249_Example_:
10250          PROGRAM test_fput
10251            CHARACTER(len=10) :: str = "gfortran"
10252            INTEGER :: i
10253            DO i = 1, len_trim(str)
10254              CALL fput(str(i:i))
10255            END DO
10256          END PROGRAM
10257
10258_See also_:
10259     *note FPUTC::, *note FGET::, *note FGETC::
10260
10261
10262File: gfortran.info,  Node: FPUTC,  Next: FRACTION,  Prev: FPUT,  Up: Intrinsic Procedures
10263
102649.104 `FPUTC' -- Write a single character in stream mode
10265========================================================
10266
10267_Description_:
10268     Write a single character in stream mode by bypassing normal
10269     formatted output. Stream I/O should not be mixed with normal
10270     record-oriented (formatted or unformatted) I/O on the same unit;
10271     the results are unpredictable.
10272
10273     This intrinsic is provided in both subroutine and function forms;
10274     however, only one form can be used in any given program unit.
10275
10276     Note that the `FGET' intrinsic is provided for backwards
10277     compatibility with `g77'.  GNU Fortran provides the Fortran 2003
10278     Stream facility.  Programmers should consider the use of new
10279     stream IO feature in new code for future portability. See also
10280     *note Fortran 2003 status::.
10281
10282_Standard_:
10283     GNU extension
10284
10285_Class_:
10286     Subroutine, function
10287
10288_Syntax_:
10289     `CALL FPUTC(UNIT, C [, STATUS])'
10290     `STATUS = FPUTC(UNIT, C)'
10291
10292_Arguments_:
10293     UNIT       The type shall be `INTEGER'.
10294     C          The type shall be `CHARACTER' and of default
10295                kind.
10296     STATUS     (Optional) status flag of type `INTEGER'.
10297                Returns 0 on success, -1 on end-of-file and a
10298                system specific positive error code otherwise.
10299
10300_Example_:
10301          PROGRAM test_fputc
10302            CHARACTER(len=10) :: str = "gfortran"
10303            INTEGER :: fd = 42, i
10304
10305            OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
10306            DO i = 1, len_trim(str)
10307              CALL fputc(fd, str(i:i))
10308            END DO
10309            CLOSE(fd)
10310          END PROGRAM
10311
10312_See also_:
10313     *note FPUT::, *note FGET::, *note FGETC::
10314
10315
10316File: gfortran.info,  Node: FRACTION,  Next: FREE,  Prev: FPUTC,  Up: Intrinsic Procedures
10317
103189.105 `FRACTION' -- Fractional part of the model representation
10319===============================================================
10320
10321_Description_:
10322     `FRACTION(X)' returns the fractional part of the model
10323     representation of `X'.
10324
10325_Standard_:
10326     Fortran 95 and later
10327
10328_Class_:
10329     Elemental function
10330
10331_Syntax_:
10332     `Y = FRACTION(X)'
10333
10334_Arguments_:
10335     X          The type of the argument shall be a `REAL'.
10336
10337_Return value_:
10338     The return value is of the same type and kind as the argument.
10339     The fractional part of the model representation of `X' is returned;
10340     it is `X * RADIX(X)**(-EXPONENT(X))'.
10341
10342_Example_:
10343          program test_fraction
10344            real :: x
10345            x = 178.1387e-4
10346            print *, fraction(x), x * radix(x)**(-exponent(x))
10347          end program test_fraction
10348
10349
10350
10351File: gfortran.info,  Node: FREE,  Next: FSEEK,  Prev: FRACTION,  Up: Intrinsic Procedures
10352
103539.106 `FREE' -- Frees memory
10354============================
10355
10356_Description_:
10357     Frees memory previously allocated by `MALLOC'. The `FREE'
10358     intrinsic is an extension intended to be used with Cray pointers,
10359     and is provided in GNU Fortran to allow user to compile legacy
10360     code. For new code using Fortran 95 pointers, the memory
10361     de-allocation intrinsic is `DEALLOCATE'.
10362
10363_Standard_:
10364     GNU extension
10365
10366_Class_:
10367     Subroutine
10368
10369_Syntax_:
10370     `CALL FREE(PTR)'
10371
10372_Arguments_:
10373     PTR        The type shall be `INTEGER'. It represents the
10374                location of the memory that should be
10375                de-allocated.
10376
10377_Return value_:
10378     None
10379
10380_Example_:
10381     See `MALLOC' for an example.
10382
10383_See also_:
10384     *note MALLOC::
10385
10386
10387File: gfortran.info,  Node: FSEEK,  Next: FSTAT,  Prev: FREE,  Up: Intrinsic Procedures
10388
103899.107 `FSEEK' -- Low level file positioning subroutine
10390======================================================
10391
10392_Description_:
10393     Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the
10394     OFFSET is taken as an absolute value `SEEK_SET', if set to 1,
10395     OFFSET is taken to be relative to the current position `SEEK_CUR',
10396     and if set to 2 relative to the end of the file `SEEK_END'.  On
10397     error, STATUS is set to a nonzero value. If STATUS the seek fails
10398     silently.
10399
10400     This intrinsic routine is not fully backwards compatible with
10401     `g77'.  In `g77', the `FSEEK' takes a statement label instead of a
10402     STATUS variable. If FSEEK is used in old code, change
10403            CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
10404     to
10405            INTEGER :: status
10406            CALL FSEEK(UNIT, OFFSET, WHENCE, status)
10407            IF (status /= 0) GOTO label
10408
10409     Please note that GNU Fortran provides the Fortran 2003 Stream
10410     facility.  Programmers should consider the use of new stream IO
10411     feature in new code for future portability. See also *note Fortran
10412     2003 status::.
10413
10414_Standard_:
10415     GNU extension
10416
10417_Class_:
10418     Subroutine
10419
10420_Syntax_:
10421     `CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
10422
10423_Arguments_:
10424     UNIT       Shall be a scalar of type `INTEGER'.
10425     OFFSET     Shall be a scalar of type `INTEGER'.
10426     WHENCE     Shall be a scalar of type `INTEGER'.  Its
10427                value shall be either 0, 1 or 2.
10428     STATUS     (Optional) shall be a scalar of type
10429                `INTEGER(4)'.
10430
10431_Example_:
10432          PROGRAM test_fseek
10433            INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
10434            INTEGER :: fd, offset, ierr
10435
10436            ierr   = 0
10437            offset = 5
10438            fd     = 10
10439
10440            OPEN(UNIT=fd, FILE="fseek.test")
10441            CALL FSEEK(fd, offset, SEEK_SET, ierr)  ! move to OFFSET
10442            print *, FTELL(fd), ierr
10443
10444            CALL FSEEK(fd, 0, SEEK_END, ierr)       ! move to end
10445            print *, FTELL(fd), ierr
10446
10447            CALL FSEEK(fd, 0, SEEK_SET, ierr)       ! move to beginning
10448            print *, FTELL(fd), ierr
10449
10450            CLOSE(UNIT=fd)
10451          END PROGRAM
10452
10453_See also_:
10454     *note FTELL::
10455
10456
10457File: gfortran.info,  Node: FSTAT,  Next: FTELL,  Prev: FSEEK,  Up: Intrinsic Procedures
10458
104599.108 `FSTAT' -- Get file status
10460================================
10461
10462_Description_:
10463     `FSTAT' is identical to *note STAT::, except that information
10464     about an already opened file is obtained.
10465
10466     The elements in `VALUES' are the same as described by *note STAT::.
10467
10468     This intrinsic is provided in both subroutine and function forms;
10469     however, only one form can be used in any given program unit.
10470
10471_Standard_:
10472     GNU extension
10473
10474_Class_:
10475     Subroutine, function
10476
10477_Syntax_:
10478     `CALL FSTAT(UNIT, VALUES [, STATUS])'
10479     `STATUS = FSTAT(UNIT, VALUES)'
10480
10481_Arguments_:
10482     UNIT       An open I/O unit number of type `INTEGER'.
10483     VALUES     The type shall be `INTEGER(4), DIMENSION(13)'.
10484     STATUS     (Optional) status flag of type `INTEGER(4)'.
10485                Returns 0 on success and a system specific
10486                error code otherwise.
10487
10488_Example_:
10489     See *note STAT:: for an example.
10490
10491_See also_:
10492     To stat a link: *note LSTAT::, to stat a file: *note STAT::
10493
10494
10495File: gfortran.info,  Node: FTELL,  Next: GAMMA,  Prev: FSTAT,  Up: Intrinsic Procedures
10496
104979.109 `FTELL' -- Current stream position
10498========================================
10499
10500_Description_:
10501     Retrieves the current position within an open file.
10502
10503     This intrinsic is provided in both subroutine and function forms;
10504     however, only one form can be used in any given program unit.
10505
10506_Standard_:
10507     GNU extension
10508
10509_Class_:
10510     Subroutine, function
10511
10512_Syntax_:
10513     `CALL FTELL(UNIT, OFFSET)'
10514     `OFFSET = FTELL(UNIT)'
10515
10516_Arguments_:
10517     OFFSET     Shall of type `INTEGER'.
10518     UNIT       Shall of type `INTEGER'.
10519
10520_Return value_:
10521     In either syntax, OFFSET is set to the current offset of unit
10522     number UNIT, or to -1 if the unit is not currently open.
10523
10524_Example_:
10525          PROGRAM test_ftell
10526            INTEGER :: i
10527            OPEN(10, FILE="temp.dat")
10528            CALL ftell(10,i)
10529            WRITE(*,*) i
10530          END PROGRAM
10531
10532_See also_:
10533     *note FSEEK::
10534
10535
10536File: gfortran.info,  Node: GAMMA,  Next: GERROR,  Prev: FTELL,  Up: Intrinsic Procedures
10537
105389.110 `GAMMA' -- Gamma function
10539===============================
10540
10541_Description_:
10542     `GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer
10543     values of X the Gamma function simplifies to the factorial
10544     function \Gamma(x)=(x-1)!.
10545
10546_Standard_:
10547     Fortran 2008 and later
10548
10549_Class_:
10550     Elemental function
10551
10552_Syntax_:
10553     `X = GAMMA(X)'
10554
10555_Arguments_:
10556     X          Shall be of type `REAL' and neither zero nor a
10557                negative integer.
10558
10559_Return value_:
10560     The return value is of type `REAL' of the same kind as X.
10561
10562_Example_:
10563          program test_gamma
10564            real :: x = 1.0
10565            x = gamma(x) ! returns 1.0
10566          end program test_gamma
10567
10568_Specific names_:
10569     Name          Argument      Return type   Standard
10570     `GAMMA(X)'    `REAL(4) X'   `REAL(4)'     GNU Extension
10571     `DGAMMA(X)'   `REAL(8) X'   `REAL(8)'     GNU Extension
10572
10573_See also_:
10574     Logarithm of the Gamma function: *note LOG_GAMMA::
10575
10576
10577
10578File: gfortran.info,  Node: GERROR,  Next: GETARG,  Prev: GAMMA,  Up: Intrinsic Procedures
10579
105809.111 `GERROR' -- Get last system error message
10581===============================================
10582
10583_Description_:
10584     Returns the system error message corresponding to the last system
10585     error.  This resembles the functionality of `strerror(3)' in C.
10586
10587_Standard_:
10588     GNU extension
10589
10590_Class_:
10591     Subroutine
10592
10593_Syntax_:
10594     `CALL GERROR(RESULT)'
10595
10596_Arguments_:
10597     RESULT     Shall of type `CHARACTER' and of default
10598
10599_Example_:
10600          PROGRAM test_gerror
10601            CHARACTER(len=100) :: msg
10602            CALL gerror(msg)
10603            WRITE(*,*) msg
10604          END PROGRAM
10605
10606_See also_:
10607     *note IERRNO::, *note PERROR::
10608
10609
10610File: gfortran.info,  Node: GETARG,  Next: GET_COMMAND,  Prev: GERROR,  Up: Intrinsic Procedures
10611
106129.112 `GETARG' -- Get command line arguments
10613============================================
10614
10615_Description_:
10616     Retrieve the POS-th argument that was passed on the command line
10617     when the containing program was invoked.
10618
10619     This intrinsic routine is provided for backwards compatibility with
10620     GNU Fortran 77.  In new code, programmers should consider the use
10621     of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
10622     Fortran 2003 standard.
10623
10624_Standard_:
10625     GNU extension
10626
10627_Class_:
10628     Subroutine
10629
10630_Syntax_:
10631     `CALL GETARG(POS, VALUE)'
10632
10633_Arguments_:
10634     POS        Shall be of type `INTEGER' and not wider than
10635                the default integer kind; POS \geq 0
10636     VALUE      Shall be of type `CHARACTER' and of default
10637                kind.
10638     VALUE      Shall be of type `CHARACTER'.
10639
10640_Return value_:
10641     After `GETARG' returns, the VALUE argument holds the POSth command
10642     line argument. If VALUE can not hold the argument, it is truncated
10643     to fit the length of VALUE. If there are less than POS arguments
10644     specified at the command line, VALUE will be filled with blanks.
10645     If POS = 0, VALUE is set to the name of the program (on systems
10646     that support this feature).
10647
10648_Example_:
10649          PROGRAM test_getarg
10650            INTEGER :: i
10651            CHARACTER(len=32) :: arg
10652
10653            DO i = 1, iargc()
10654              CALL getarg(i, arg)
10655              WRITE (*,*) arg
10656            END DO
10657          END PROGRAM
10658
10659_See also_:
10660     GNU Fortran 77 compatibility function: *note IARGC::
10661
10662     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
10663     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
10664
10665
10666File: gfortran.info,  Node: GET_COMMAND,  Next: GET_COMMAND_ARGUMENT,  Prev: GETARG,  Up: Intrinsic Procedures
10667
106689.113 `GET_COMMAND' -- Get the entire command line
10669==================================================
10670
10671_Description_:
10672     Retrieve the entire command line that was used to invoke the
10673     program.
10674
10675_Standard_:
10676     Fortran 2003 and later
10677
10678_Class_:
10679     Subroutine
10680
10681_Syntax_:
10682     `CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
10683
10684_Arguments_:
10685     COMMAND    (Optional) shall be of type `CHARACTER' and of
10686                default kind.
10687     LENGTH     (Optional) Shall be of type `INTEGER' and of
10688                default kind.
10689     STATUS     (Optional) Shall be of type `INTEGER' and of
10690                default kind.
10691
10692_Return value_:
10693     If COMMAND is present, stores the entire command line that was used
10694     to invoke the program in COMMAND. If LENGTH is present, it is
10695     assigned the length of the command line. If STATUS is present, it
10696     is assigned 0 upon success of the command, -1 if COMMAND is too
10697     short to store the command line, or a positive value in case of an
10698     error.
10699
10700_Example_:
10701          PROGRAM test_get_command
10702            CHARACTER(len=255) :: cmd
10703            CALL get_command(cmd)
10704            WRITE (*,*) TRIM(cmd)
10705          END PROGRAM
10706
10707_See also_:
10708     *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
10709
10710
10711File: gfortran.info,  Node: GET_COMMAND_ARGUMENT,  Next: GETCWD,  Prev: GET_COMMAND,  Up: Intrinsic Procedures
10712
107139.114 `GET_COMMAND_ARGUMENT' -- Get command line arguments
10714==========================================================
10715
10716_Description_:
10717     Retrieve the NUMBER-th argument that was passed on the command
10718     line when the containing program was invoked.
10719
10720_Standard_:
10721     Fortran 2003 and later
10722
10723_Class_:
10724     Subroutine
10725
10726_Syntax_:
10727     `CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
10728
10729_Arguments_:
10730     NUMBER     Shall be a scalar of type `INTEGER' and of
10731                default kind, NUMBER \geq 0
10732     VALUE      (Optional) Shall be a scalar of type
10733                `CHARACTER' and of default kind.
10734     LENGTH     (Optional) Shall be a scalar of type `INTEGER'
10735                and of default kind.
10736     STATUS     (Optional) Shall be a scalar of type `INTEGER'
10737                and of default kind.
10738
10739_Return value_:
10740     After `GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
10741     NUMBER-th command line argument. If VALUE can not hold the
10742     argument, it is truncated to fit the length of VALUE. If there are
10743     less than NUMBER arguments specified at the command line, VALUE
10744     will be filled with blanks.  If NUMBER = 0, VALUE is set to the
10745     name of the program (on systems that support this feature). The
10746     LENGTH argument contains the length of the NUMBER-th command line
10747     argument. If the argument retrieval fails, STATUS is a positive
10748     number; if VALUE contains a truncated command line argument,
10749     STATUS is -1; and otherwise the STATUS is zero.
10750
10751_Example_:
10752          PROGRAM test_get_command_argument
10753            INTEGER :: i
10754            CHARACTER(len=32) :: arg
10755
10756            i = 0
10757            DO
10758              CALL get_command_argument(i, arg)
10759              IF (LEN_TRIM(arg) == 0) EXIT
10760
10761              WRITE (*,*) TRIM(arg)
10762              i = i+1
10763            END DO
10764          END PROGRAM
10765
10766_See also_:
10767     *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
10768
10769
10770File: gfortran.info,  Node: GETCWD,  Next: GETENV,  Prev: GET_COMMAND_ARGUMENT,  Up: Intrinsic Procedures
10771
107729.115 `GETCWD' -- Get current working directory
10773===============================================
10774
10775_Description_:
10776     Get current working directory.
10777
10778     This intrinsic is provided in both subroutine and function forms;
10779     however, only one form can be used in any given program unit.
10780
10781_Standard_:
10782     GNU extension
10783
10784_Class_:
10785     Subroutine, function
10786
10787_Syntax_:
10788     `CALL GETCWD(C [, STATUS])'
10789     `STATUS = GETCWD(C)'
10790
10791_Arguments_:
10792     C          The type shall be `CHARACTER' and of default
10793                kind.
10794     STATUS     (Optional) status flag. Returns 0 on success,
10795                a system specific and nonzero error code
10796                otherwise.
10797
10798_Example_:
10799          PROGRAM test_getcwd
10800            CHARACTER(len=255) :: cwd
10801            CALL getcwd(cwd)
10802            WRITE(*,*) TRIM(cwd)
10803          END PROGRAM
10804
10805_See also_:
10806     *note CHDIR::
10807
10808
10809File: gfortran.info,  Node: GETENV,  Next: GET_ENVIRONMENT_VARIABLE,  Prev: GETCWD,  Up: Intrinsic Procedures
10810
108119.116 `GETENV' -- Get an environmental variable
10812===============================================
10813
10814_Description_:
10815     Get the VALUE of the environmental variable NAME.
10816
10817     This intrinsic routine is provided for backwards compatibility with
10818     GNU Fortran 77.  In new code, programmers should consider the use
10819     of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
10820     Fortran 2003 standard.
10821
10822     Note that `GETENV' need not be thread-safe. It is the
10823     responsibility of the user to ensure that the environment is not
10824     being updated concurrently with a call to the `GETENV' intrinsic.
10825
10826_Standard_:
10827     GNU extension
10828
10829_Class_:
10830     Subroutine
10831
10832_Syntax_:
10833     `CALL GETENV(NAME, VALUE)'
10834
10835_Arguments_:
10836     NAME       Shall be of type `CHARACTER' and of default
10837                kind.
10838     VALUE      Shall be of type `CHARACTER' and of default
10839                kind.
10840
10841_Return value_:
10842     Stores the value of NAME in VALUE. If VALUE is not large enough to
10843     hold the data, it is truncated. If NAME is not set, VALUE will be
10844     filled with blanks.
10845
10846_Example_:
10847          PROGRAM test_getenv
10848            CHARACTER(len=255) :: homedir
10849            CALL getenv("HOME", homedir)
10850            WRITE (*,*) TRIM(homedir)
10851          END PROGRAM
10852
10853_See also_:
10854     *note GET_ENVIRONMENT_VARIABLE::
10855
10856
10857File: gfortran.info,  Node: GET_ENVIRONMENT_VARIABLE,  Next: GETGID,  Prev: GETENV,  Up: Intrinsic Procedures
10858
108599.117 `GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
10860=================================================================
10861
10862_Description_:
10863     Get the VALUE of the environmental variable NAME.
10864
10865     Note that `GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It
10866     is the responsibility of the user to ensure that the environment is
10867     not being updated concurrently with a call to the
10868     `GET_ENVIRONMENT_VARIABLE' intrinsic.
10869
10870_Standard_:
10871     Fortran 2003 and later
10872
10873_Class_:
10874     Subroutine
10875
10876_Syntax_:
10877     `CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
10878     TRIM_NAME)'
10879
10880_Arguments_:
10881     NAME       Shall be a scalar of type `CHARACTER' and of
10882                default kind.
10883     VALUE      (Optional) Shall be a scalar of type
10884                `CHARACTER' and of default kind.
10885     LENGTH     (Optional) Shall be a scalar of type `INTEGER'
10886                and of default kind.
10887     STATUS     (Optional) Shall be a scalar of type `INTEGER'
10888                and of default kind.
10889     TRIM_NAME  (Optional) Shall be a scalar of type `LOGICAL'
10890                and of default kind.
10891
10892_Return value_:
10893     Stores the value of NAME in VALUE. If VALUE is not large enough to
10894     hold the data, it is truncated. If NAME is not set, VALUE will be
10895     filled with blanks. Argument LENGTH contains the length needed for
10896     storing the environment variable NAME or zero if it is not
10897     present. STATUS is -1 if VALUE is present but too short for the
10898     environment variable; it is 1 if the environment variable does not
10899     exist and 2 if the processor does not support environment
10900     variables; in all other cases STATUS is zero. If TRIM_NAME is
10901     present with the value `.FALSE.', the trailing blanks in NAME are
10902     significant; otherwise they are not part of the environment
10903     variable name.
10904
10905_Example_:
10906          PROGRAM test_getenv
10907            CHARACTER(len=255) :: homedir
10908            CALL get_environment_variable("HOME", homedir)
10909            WRITE (*,*) TRIM(homedir)
10910          END PROGRAM
10911
10912
10913File: gfortran.info,  Node: GETGID,  Next: GETLOG,  Prev: GET_ENVIRONMENT_VARIABLE,  Up: Intrinsic Procedures
10914
109159.118 `GETGID' -- Group ID function
10916===================================
10917
10918_Description_:
10919     Returns the numerical group ID of the current process.
10920
10921_Standard_:
10922     GNU extension
10923
10924_Class_:
10925     Function
10926
10927_Syntax_:
10928     `RESULT = GETGID()'
10929
10930_Return value_:
10931     The return value of `GETGID' is an `INTEGER' of the default kind.
10932
10933_Example_:
10934     See `GETPID' for an example.
10935
10936_See also_:
10937     *note GETPID::, *note GETUID::
10938
10939
10940File: gfortran.info,  Node: GETLOG,  Next: GETPID,  Prev: GETGID,  Up: Intrinsic Procedures
10941
109429.119 `GETLOG' -- Get login name
10943================================
10944
10945_Description_:
10946     Gets the username under which the program is running.
10947
10948_Standard_:
10949     GNU extension
10950
10951_Class_:
10952     Subroutine
10953
10954_Syntax_:
10955     `CALL GETLOG(C)'
10956
10957_Arguments_:
10958     C          Shall be of type `CHARACTER' and of default
10959                kind.
10960
10961_Return value_:
10962     Stores the current user name in LOGIN.  (On systems where POSIX
10963     functions `geteuid' and `getpwuid' are not available, and the
10964     `getlogin' function is not implemented either, this will return a
10965     blank string.)
10966
10967_Example_:
10968          PROGRAM TEST_GETLOG
10969            CHARACTER(32) :: login
10970            CALL GETLOG(login)
10971            WRITE(*,*) login
10972          END PROGRAM
10973
10974_See also_:
10975     *note GETUID::
10976
10977
10978File: gfortran.info,  Node: GETPID,  Next: GETUID,  Prev: GETLOG,  Up: Intrinsic Procedures
10979
109809.120 `GETPID' -- Process ID function
10981=====================================
10982
10983_Description_:
10984     Returns the numerical process identifier of the current process.
10985
10986_Standard_:
10987     GNU extension
10988
10989_Class_:
10990     Function
10991
10992_Syntax_:
10993     `RESULT = GETPID()'
10994
10995_Return value_:
10996     The return value of `GETPID' is an `INTEGER' of the default kind.
10997
10998_Example_:
10999          program info
11000            print *, "The current process ID is ", getpid()
11001            print *, "Your numerical user ID is ", getuid()
11002            print *, "Your numerical group ID is ", getgid()
11003          end program info
11004
11005_See also_:
11006     *note GETGID::, *note GETUID::
11007
11008
11009File: gfortran.info,  Node: GETUID,  Next: GMTIME,  Prev: GETPID,  Up: Intrinsic Procedures
11010
110119.121 `GETUID' -- User ID function
11012==================================
11013
11014_Description_:
11015     Returns the numerical user ID of the current process.
11016
11017_Standard_:
11018     GNU extension
11019
11020_Class_:
11021     Function
11022
11023_Syntax_:
11024     `RESULT = GETUID()'
11025
11026_Return value_:
11027     The return value of `GETUID' is an `INTEGER' of the default kind.
11028
11029_Example_:
11030     See `GETPID' for an example.
11031
11032_See also_:
11033     *note GETPID::, *note GETLOG::
11034
11035
11036File: gfortran.info,  Node: GMTIME,  Next: HOSTNM,  Prev: GETUID,  Up: Intrinsic Procedures
11037
110389.122 `GMTIME' -- Convert time to GMT info
11039==========================================
11040
11041_Description_:
11042     Given a system time value TIME (as provided by the `TIME8'
11043     intrinsic), fills VALUES with values extracted from it appropriate
11044     to the UTC time zone (Universal Coordinated Time, also known in
11045     some countries as GMT, Greenwich Mean Time), using `gmtime(3)'.
11046
11047_Standard_:
11048     GNU extension
11049
11050_Class_:
11051     Subroutine
11052
11053_Syntax_:
11054     `CALL GMTIME(TIME, VALUES)'
11055
11056_Arguments_:
11057     TIME       An `INTEGER' scalar expression corresponding
11058                to a system time, with `INTENT(IN)'.
11059     VALUES     A default `INTEGER' array with 9 elements,
11060                with `INTENT(OUT)'.
11061
11062_Return value_:
11063     The elements of VALUES are assigned as follows:
11064       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
11065          seconds
11066
11067       2. Minutes after the hour, range 0-59
11068
11069       3. Hours past midnight, range 0-23
11070
11071       4. Day of month, range 0-31
11072
11073       5. Number of months since January, range 0-12
11074
11075       6. Years since 1900
11076
11077       7. Number of days since Sunday, range 0-6
11078
11079       8. Days since January 1
11080
11081       9. Daylight savings indicator: positive if daylight savings is in
11082          effect, zero if not, and negative if the information is not
11083          available.
11084
11085_See also_:
11086     *note CTIME::, *note LTIME::, *note TIME::, *note TIME8::
11087
11088
11089
11090File: gfortran.info,  Node: HOSTNM,  Next: HUGE,  Prev: GMTIME,  Up: Intrinsic Procedures
11091
110929.123 `HOSTNM' -- Get system host name
11093======================================
11094
11095_Description_:
11096     Retrieves the host name of the system on which the program is
11097     running.
11098
11099     This intrinsic is provided in both subroutine and function forms;
11100     however, only one form can be used in any given program unit.
11101
11102_Standard_:
11103     GNU extension
11104
11105_Class_:
11106     Subroutine, function
11107
11108_Syntax_:
11109     `CALL HOSTNM(C [, STATUS])'
11110     `STATUS = HOSTNM(NAME)'
11111
11112_Arguments_:
11113     C          Shall of type `CHARACTER' and of default kind.
11114     STATUS     (Optional) status flag of type `INTEGER'.
11115                Returns 0 on success, or a system specific
11116                error code otherwise.
11117
11118_Return value_:
11119     In either syntax, NAME is set to the current hostname if it can be
11120     obtained, or to a blank string otherwise.
11121
11122
11123
11124File: gfortran.info,  Node: HUGE,  Next: HYPOT,  Prev: HOSTNM,  Up: Intrinsic Procedures
11125
111269.124 `HUGE' -- Largest number of a kind
11127========================================
11128
11129_Description_:
11130     `HUGE(X)' returns the largest number that is not an infinity in
11131     the model of the type of `X'.
11132
11133_Standard_:
11134     Fortran 95 and later
11135
11136_Class_:
11137     Inquiry function
11138
11139_Syntax_:
11140     `RESULT = HUGE(X)'
11141
11142_Arguments_:
11143     X          Shall be of type `REAL' or `INTEGER'.
11144
11145_Return value_:
11146     The return value is of the same type and kind as X
11147
11148_Example_:
11149          program test_huge_tiny
11150            print *, huge(0), huge(0.0), huge(0.0d0)
11151            print *, tiny(0.0), tiny(0.0d0)
11152          end program test_huge_tiny
11153
11154
11155File: gfortran.info,  Node: HYPOT,  Next: IACHAR,  Prev: HUGE,  Up: Intrinsic Procedures
11156
111579.125 `HYPOT' -- Euclidean distance function
11158============================================
11159
11160_Description_:
11161     `HYPOT(X,Y)' is the Euclidean distance function. It is equal to
11162     \sqrtX^2 + Y^2, without undue underflow or overflow.
11163
11164_Standard_:
11165     Fortran 2008 and later
11166
11167_Class_:
11168     Elemental function
11169
11170_Syntax_:
11171     `RESULT = HYPOT(X, Y)'
11172
11173_Arguments_:
11174     X          The type shall be `REAL'.
11175     Y          The type and kind type parameter shall be the
11176                same as X.
11177
11178_Return value_:
11179     The return value has the same type and kind type parameter as X.
11180
11181_Example_:
11182          program test_hypot
11183            real(4) :: x = 1.e0_4, y = 0.5e0_4
11184            x = hypot(x,y)
11185          end program test_hypot
11186
11187
11188File: gfortran.info,  Node: IACHAR,  Next: IALL,  Prev: HYPOT,  Up: Intrinsic Procedures
11189
111909.126 `IACHAR' -- Code in ASCII collating sequence
11191==================================================
11192
11193_Description_:
11194     `IACHAR(C)' returns the code for the ASCII character in the first
11195     character position of `C'.
11196
11197_Standard_:
11198     Fortran 95 and later, with KIND argument Fortran 2003 and later
11199
11200_Class_:
11201     Elemental function
11202
11203_Syntax_:
11204     `RESULT = IACHAR(C [, KIND])'
11205
11206_Arguments_:
11207     C          Shall be a scalar `CHARACTER', with
11208                `INTENT(IN)'
11209     KIND       (Optional) An `INTEGER' initialization
11210                expression indicating the kind parameter of
11211                the result.
11212
11213_Return value_:
11214     The return value is of type `INTEGER' and of kind KIND. If KIND is
11215     absent, the return value is of default integer kind.
11216
11217_Example_:
11218          program test_iachar
11219            integer i
11220            i = iachar(' ')
11221          end program test_iachar
11222
11223_Note_:
11224     See *note ICHAR:: for a discussion of converting between numerical
11225     values and formatted string representations.
11226
11227_See also_:
11228     *note ACHAR::, *note CHAR::, *note ICHAR::
11229
11230
11231
11232File: gfortran.info,  Node: IALL,  Next: IAND,  Prev: IACHAR,  Up: Intrinsic Procedures
11233
112349.127 `IALL' -- Bitwise AND of array elements
11235=============================================
11236
11237_Description_:
11238     Reduces with bitwise AND the elements of ARRAY along dimension DIM
11239     if the corresponding element in MASK is `TRUE'.
11240
11241_Standard_:
11242     Fortran 2008 and later
11243
11244_Class_:
11245     Transformational function
11246
11247_Syntax_:
11248     `RESULT = IALL(ARRAY[, MASK])'
11249     `RESULT = IALL(ARRAY, DIM[, MASK])'
11250
11251_Arguments_:
11252     ARRAY      Shall be an array of type `INTEGER'
11253     DIM        (Optional) shall be a scalar of type `INTEGER'
11254                with a value in the range from 1 to n, where n
11255                equals the rank of ARRAY.
11256     MASK       (Optional) shall be of type `LOGICAL' and
11257                either be a scalar or an array of the same
11258                shape as ARRAY.
11259
11260_Return value_:
11261     The result is of the same type as ARRAY.
11262
11263     If DIM is absent, a scalar with the bitwise ALL of all elements in
11264     ARRAY is returned. Otherwise, an array of rank n-1, where n equals
11265     the rank of ARRAY, and a shape similar to that of ARRAY with
11266     dimension DIM dropped is returned.
11267
11268_Example_:
11269          PROGRAM test_iall
11270            INTEGER(1) :: a(2)
11271
11272            a(1) = b'00100100'
11273            a(2) = b'01101010'
11274
11275            ! prints 00100000
11276            PRINT '(b8.8)', IALL(a)
11277          END PROGRAM
11278
11279_See also_:
11280     *note IANY::, *note IPARITY::, *note IAND::
11281
11282
11283File: gfortran.info,  Node: IAND,  Next: IANY,  Prev: IALL,  Up: Intrinsic Procedures
11284
112859.128 `IAND' -- Bitwise logical and
11286===================================
11287
11288_Description_:
11289     Bitwise logical `AND'.
11290
11291_Standard_:
11292     Fortran 95 and later
11293
11294_Class_:
11295     Elemental function
11296
11297_Syntax_:
11298     `RESULT = IAND(I, J)'
11299
11300_Arguments_:
11301     I          The type shall be `INTEGER'.
11302     J          The type shall be `INTEGER', of the same kind
11303                as I.  (As a GNU extension, different kinds
11304                are also permitted.)
11305
11306_Return value_:
11307     The return type is `INTEGER', of the same kind as the arguments.
11308     (If the argument kinds differ, it is of the same kind as the
11309     larger argument.)
11310
11311_Example_:
11312          PROGRAM test_iand
11313            INTEGER :: a, b
11314            DATA a / Z'F' /, b / Z'3' /
11315            WRITE (*,*) IAND(a, b)
11316          END PROGRAM
11317
11318_See also_:
11319     *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
11320     IBCLR::, *note NOT::
11321
11322
11323
11324File: gfortran.info,  Node: IANY,  Next: IARGC,  Prev: IAND,  Up: Intrinsic Procedures
11325
113269.129 `IANY' -- Bitwise OR of array elements
11327============================================
11328
11329_Description_:
11330     Reduces with bitwise OR (inclusive or) the elements of ARRAY along
11331     dimension DIM if the corresponding element in MASK is `TRUE'.
11332
11333_Standard_:
11334     Fortran 2008 and later
11335
11336_Class_:
11337     Transformational function
11338
11339_Syntax_:
11340     `RESULT = IANY(ARRAY[, MASK])'
11341     `RESULT = IANY(ARRAY, DIM[, MASK])'
11342
11343_Arguments_:
11344     ARRAY      Shall be an array of type `INTEGER'
11345     DIM        (Optional) shall be a scalar of type `INTEGER'
11346                with a value in the range from 1 to n, where n
11347                equals the rank of ARRAY.
11348     MASK       (Optional) shall be of type `LOGICAL' and
11349                either be a scalar or an array of the same
11350                shape as ARRAY.
11351
11352_Return value_:
11353     The result is of the same type as ARRAY.
11354
11355     If DIM is absent, a scalar with the bitwise OR of all elements in
11356     ARRAY is returned. Otherwise, an array of rank n-1, where n equals
11357     the rank of ARRAY, and a shape similar to that of ARRAY with
11358     dimension DIM dropped is returned.
11359
11360_Example_:
11361          PROGRAM test_iany
11362            INTEGER(1) :: a(2)
11363
11364            a(1) = b'00100100'
11365            a(2) = b'01101010'
11366
11367            ! prints 01101110
11368            PRINT '(b8.8)', IANY(a)
11369          END PROGRAM
11370
11371_See also_:
11372     *note IPARITY::, *note IALL::, *note IOR::
11373
11374
11375File: gfortran.info,  Node: IARGC,  Next: IBCLR,  Prev: IANY,  Up: Intrinsic Procedures
11376
113779.130 `IARGC' -- Get the number of command line arguments
11378=========================================================
11379
11380_Description_:
11381     `IARGC' returns the number of arguments passed on the command line
11382     when the containing program was invoked.
11383
11384     This intrinsic routine is provided for backwards compatibility with
11385     GNU Fortran 77.  In new code, programmers should consider the use
11386     of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
11387     Fortran 2003 standard.
11388
11389_Standard_:
11390     GNU extension
11391
11392_Class_:
11393     Function
11394
11395_Syntax_:
11396     `RESULT = IARGC()'
11397
11398_Arguments_:
11399     None.
11400
11401_Return value_:
11402     The number of command line arguments, type `INTEGER(4)'.
11403
11404_Example_:
11405     See *note GETARG::
11406
11407_See also_:
11408     GNU Fortran 77 compatibility subroutine: *note GETARG::
11409
11410     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
11411     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
11412
11413
11414File: gfortran.info,  Node: IBCLR,  Next: IBITS,  Prev: IARGC,  Up: Intrinsic Procedures
11415
114169.131 `IBCLR' -- Clear bit
11417==========================
11418
11419_Description_:
11420     `IBCLR' returns the value of I with the bit at position POS set to
11421     zero.
11422
11423_Standard_:
11424     Fortran 95 and later
11425
11426_Class_:
11427     Elemental function
11428
11429_Syntax_:
11430     `RESULT = IBCLR(I, POS)'
11431
11432_Arguments_:
11433     I          The type shall be `INTEGER'.
11434     POS        The type shall be `INTEGER'.
11435
11436_Return value_:
11437     The return value is of type `INTEGER' and of the same kind as I.
11438
11439_See also_:
11440     *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
11441     IEOR::, *note MVBITS::
11442
11443
11444
11445File: gfortran.info,  Node: IBITS,  Next: IBSET,  Prev: IBCLR,  Up: Intrinsic Procedures
11446
114479.132 `IBITS' -- Bit extraction
11448===============================
11449
11450_Description_:
11451     `IBITS' extracts a field of length LEN from I, starting from bit
11452     position POS and extending left for LEN bits.  The result is
11453     right-justified and the remaining bits are zeroed.  The value of
11454     `POS+LEN' must be less than or equal to the value `BIT_SIZE(I)'.
11455
11456_Standard_:
11457     Fortran 95 and later
11458
11459_Class_:
11460     Elemental function
11461
11462_Syntax_:
11463     `RESULT = IBITS(I, POS, LEN)'
11464
11465_Arguments_:
11466     I          The type shall be `INTEGER'.
11467     POS        The type shall be `INTEGER'.
11468     LEN        The type shall be `INTEGER'.
11469
11470_Return value_:
11471     The return value is of type `INTEGER' and of the same kind as I.
11472
11473_See also_:
11474     *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::,
11475     *note IOR::, *note IEOR::
11476
11477
11478File: gfortran.info,  Node: IBSET,  Next: ICHAR,  Prev: IBITS,  Up: Intrinsic Procedures
11479
114809.133 `IBSET' -- Set bit
11481========================
11482
11483_Description_:
11484     `IBSET' returns the value of I with the bit at position POS set to
11485     one.
11486
11487_Standard_:
11488     Fortran 95 and later
11489
11490_Class_:
11491     Elemental function
11492
11493_Syntax_:
11494     `RESULT = IBSET(I, POS)'
11495
11496_Arguments_:
11497     I          The type shall be `INTEGER'.
11498     POS        The type shall be `INTEGER'.
11499
11500_Return value_:
11501     The return value is of type `INTEGER' and of the same kind as I.
11502
11503_See also_:
11504     *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
11505     IEOR::, *note MVBITS::
11506
11507
11508
11509File: gfortran.info,  Node: ICHAR,  Next: IDATE,  Prev: IBSET,  Up: Intrinsic Procedures
11510
115119.134 `ICHAR' -- Character-to-integer conversion function
11512=========================================================
11513
11514_Description_:
11515     `ICHAR(C)' returns the code for the character in the first
11516     character position of `C' in the system's native character set.
11517     The correspondence between characters and their codes is not
11518     necessarily the same across different GNU Fortran implementations.
11519
11520_Standard_:
11521     Fortran 95 and later, with KIND argument Fortran 2003 and later
11522
11523_Class_:
11524     Elemental function
11525
11526_Syntax_:
11527     `RESULT = ICHAR(C [, KIND])'
11528
11529_Arguments_:
11530     C          Shall be a scalar `CHARACTER', with
11531                `INTENT(IN)'
11532     KIND       (Optional) An `INTEGER' initialization
11533                expression indicating the kind parameter of
11534                the result.
11535
11536_Return value_:
11537     The return value is of type `INTEGER' and of kind KIND. If KIND is
11538     absent, the return value is of default integer kind.
11539
11540_Example_:
11541          program test_ichar
11542            integer i
11543            i = ichar(' ')
11544          end program test_ichar
11545
11546_Specific names_:
11547     Name          Argument      Return type   Standard
11548     `ICHAR(C)'    `CHARACTER    `INTEGER(4)'  Fortran 77 and
11549                   C'                          later
11550
11551_Note_:
11552     No intrinsic exists to convert between a numeric value and a
11553     formatted character string representation - for instance, given the
11554     `CHARACTER' value `'154'', obtaining an `INTEGER' or `REAL' value
11555     with the value 154, or vice versa. Instead, this functionality is
11556     provided by internal-file I/O, as in the following example:
11557          program read_val
11558            integer value
11559            character(len=10) string, string2
11560            string = '154'
11561
11562            ! Convert a string to a numeric value
11563            read (string,'(I10)') value
11564            print *, value
11565
11566            ! Convert a value to a formatted string
11567            write (string2,'(I10)') value
11568            print *, string2
11569          end program read_val
11570
11571_See also_:
11572     *note ACHAR::, *note CHAR::, *note IACHAR::
11573
11574
11575
11576File: gfortran.info,  Node: IDATE,  Next: IEOR,  Prev: ICHAR,  Up: Intrinsic Procedures
11577
115789.135 `IDATE' -- Get current local time subroutine (day/month/year)
11579===================================================================
11580
11581_Description_:
11582     `IDATE(VALUES)' Fills VALUES with the numerical values at the
11583     current local time. The day (in the range 1-31), month (in the
11584     range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
11585     respectively.  The year has four significant digits.
11586
11587_Standard_:
11588     GNU extension
11589
11590_Class_:
11591     Subroutine
11592
11593_Syntax_:
11594     `CALL IDATE(VALUES)'
11595
11596_Arguments_:
11597     VALUES     The type shall be `INTEGER, DIMENSION(3)' and
11598                the kind shall be the default integer kind.
11599
11600_Return value_:
11601     Does not return anything.
11602
11603_Example_:
11604          program test_idate
11605            integer, dimension(3) :: tarray
11606            call idate(tarray)
11607            print *, tarray(1)
11608            print *, tarray(2)
11609            print *, tarray(3)
11610          end program test_idate
11611
11612
11613File: gfortran.info,  Node: IEOR,  Next: IERRNO,  Prev: IDATE,  Up: Intrinsic Procedures
11614
116159.136 `IEOR' -- Bitwise logical exclusive or
11616============================================
11617
11618_Description_:
11619     `IEOR' returns the bitwise Boolean exclusive-OR of I and J.
11620
11621_Standard_:
11622     Fortran 95 and later
11623
11624_Class_:
11625     Elemental function
11626
11627_Syntax_:
11628     `RESULT = IEOR(I, J)'
11629
11630_Arguments_:
11631     I          The type shall be `INTEGER'.
11632     J          The type shall be `INTEGER', of the same kind
11633                as I.  (As a GNU extension, different kinds
11634                are also permitted.)
11635
11636_Return value_:
11637     The return type is `INTEGER', of the same kind as the arguments.
11638     (If the argument kinds differ, it is of the same kind as the
11639     larger argument.)
11640
11641_See also_:
11642     *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
11643     IBCLR::, *note NOT::
11644
11645
11646File: gfortran.info,  Node: IERRNO,  Next: IMAGE_INDEX,  Prev: IEOR,  Up: Intrinsic Procedures
11647
116489.137 `IERRNO' -- Get the last system error number
11649==================================================
11650
11651_Description_:
11652     Returns the last system error number, as given by the C `errno'
11653     variable.
11654
11655_Standard_:
11656     GNU extension
11657
11658_Class_:
11659     Function
11660
11661_Syntax_:
11662     `RESULT = IERRNO()'
11663
11664_Arguments_:
11665     None.
11666
11667_Return value_:
11668     The return value is of type `INTEGER' and of the default integer
11669     kind.
11670
11671_See also_:
11672     *note PERROR::
11673
11674
11675File: gfortran.info,  Node: IMAGE_INDEX,  Next: INDEX intrinsic,  Prev: IERRNO,  Up: Intrinsic Procedures
11676
116779.138 `IMAGE_INDEX' -- Function that converts a cosubscript to an image index
11678=============================================================================
11679
11680_Description_:
11681     Returns the image index belonging to a cosubscript.
11682
11683_Standard_:
11684     Fortran 2008 and later
11685
11686_Class_:
11687     Inquiry function.
11688
11689_Syntax_:
11690     `RESULT = IMAGE_INDEX(COARRAY, SUB)'
11691
11692_Arguments_: None.
11693     COARRAY    Coarray of any type.
11694     SUB        default integer rank-1 array of a size equal to
11695                the corank of COARRAY.
11696
11697_Return value_:
11698     Scalar default integer with the value of the image index which
11699     corresponds to the cosubscripts. For invalid cosubscripts the
11700     result is zero.
11701
11702_Example_:
11703          INTEGER :: array[2,-1:4,8,*]
11704          ! Writes  28 (or 0 if there are fewer than 28 images)
11705          WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
11706
11707_See also_:
11708     *note THIS_IMAGE::, *note NUM_IMAGES::
11709
11710
11711File: gfortran.info,  Node: INDEX intrinsic,  Next: INT,  Prev: IMAGE_INDEX,  Up: Intrinsic Procedures
11712
117139.139 `INDEX' -- Position of a substring within a string
11714========================================================
11715
11716_Description_:
11717     Returns the position of the start of the first occurrence of string
11718     SUBSTRING as a substring in STRING, counting from one.  If
11719     SUBSTRING is not present in STRING, zero is returned.  If the BACK
11720     argument is present and true, the return value is the start of the
11721     last occurrence rather than the first.
11722
11723_Standard_:
11724     Fortran 77 and later, with KIND argument Fortran 2003 and later
11725
11726_Class_:
11727     Elemental function
11728
11729_Syntax_:
11730     `RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
11731
11732_Arguments_:
11733     STRING     Shall be a scalar `CHARACTER', with
11734                `INTENT(IN)'
11735     SUBSTRING  Shall be a scalar `CHARACTER', with
11736                `INTENT(IN)'
11737     BACK       (Optional) Shall be a scalar `LOGICAL', with
11738                `INTENT(IN)'
11739     KIND       (Optional) An `INTEGER' initialization
11740                expression indicating the kind parameter of
11741                the result.
11742
11743_Return value_:
11744     The return value is of type `INTEGER' and of kind KIND. If KIND is
11745     absent, the return value is of default integer kind.
11746
11747_Specific names_:
11748     Name          Argument      Return type   Standard
11749     `INDEX(STRING,`CHARACTER'   `INTEGER(4)'  Fortran 77 and
11750     SUBSTRING)'                               later
11751
11752_See also_:
11753     *note SCAN::, *note VERIFY::
11754
11755
11756File: gfortran.info,  Node: INT,  Next: INT2,  Prev: INDEX intrinsic,  Up: Intrinsic Procedures
11757
117589.140 `INT' -- Convert to integer type
11759======================================
11760
11761_Description_:
11762     Convert to integer type
11763
11764_Standard_:
11765     Fortran 77 and later
11766
11767_Class_:
11768     Elemental function
11769
11770_Syntax_:
11771     `RESULT = INT(A [, KIND))'
11772
11773_Arguments_:
11774     A          Shall be of type `INTEGER', `REAL', or
11775                `COMPLEX'.
11776     KIND       (Optional) An `INTEGER' initialization
11777                expression indicating the kind parameter of
11778                the result.
11779
11780_Return value_:
11781     These functions return a `INTEGER' variable or array under the
11782     following rules:
11783
11784    (A)
11785          If A is of type `INTEGER', `INT(A) = A'
11786
11787    (B)
11788          If A is of type `REAL' and |A| < 1, `INT(A)' equals `0'. If
11789          |A| \geq 1, then `INT(A)' is the integer whose magnitude is
11790          the largest integer that does not exceed the magnitude of A
11791          and whose sign is the same as the sign of A.
11792
11793    (C)
11794          If A is of type `COMPLEX', rule B is applied to the real part
11795          of A.
11796
11797_Example_:
11798          program test_int
11799            integer :: i = 42
11800            complex :: z = (-3.7, 1.0)
11801            print *, int(i)
11802            print *, int(z), int(z,8)
11803          end program
11804
11805_Specific names_:
11806     Name          Argument      Return type   Standard
11807     `INT(A)'      `REAL(4) A'   `INTEGER'     Fortran 77 and
11808                                               later
11809     `IFIX(A)'     `REAL(4) A'   `INTEGER'     Fortran 77 and
11810                                               later
11811     `IDINT(A)'    `REAL(8) A'   `INTEGER'     Fortran 77 and
11812                                               later
11813
11814
11815
11816File: gfortran.info,  Node: INT2,  Next: INT8,  Prev: INT,  Up: Intrinsic Procedures
11817
118189.141 `INT2' -- Convert to 16-bit integer type
11819==============================================
11820
11821_Description_:
11822     Convert to a `KIND=2' integer type. This is equivalent to the
11823     standard `INT' intrinsic with an optional argument of `KIND=2',
11824     and is only included for backwards compatibility.
11825
11826     The `SHORT' intrinsic is equivalent to `INT2'.
11827
11828_Standard_:
11829     GNU extension
11830
11831_Class_:
11832     Elemental function
11833
11834_Syntax_:
11835     `RESULT = INT2(A)'
11836
11837_Arguments_:
11838     A          Shall be of type `INTEGER', `REAL', or
11839                `COMPLEX'.
11840
11841_Return value_:
11842     The return value is a `INTEGER(2)' variable.
11843
11844_See also_:
11845     *note INT::, *note INT8::, *note LONG::
11846
11847
11848File: gfortran.info,  Node: INT8,  Next: IOR,  Prev: INT2,  Up: Intrinsic Procedures
11849
118509.142 `INT8' -- Convert to 64-bit integer type
11851==============================================
11852
11853_Description_:
11854     Convert to a `KIND=8' integer type. This is equivalent to the
11855     standard `INT' intrinsic with an optional argument of `KIND=8',
11856     and is only included for backwards compatibility.
11857
11858_Standard_:
11859     GNU extension
11860
11861_Class_:
11862     Elemental function
11863
11864_Syntax_:
11865     `RESULT = INT8(A)'
11866
11867_Arguments_:
11868     A          Shall be of type `INTEGER', `REAL', or
11869                `COMPLEX'.
11870
11871_Return value_:
11872     The return value is a `INTEGER(8)' variable.
11873
11874_See also_:
11875     *note INT::, *note INT2::, *note LONG::
11876
11877
11878File: gfortran.info,  Node: IOR,  Next: IPARITY,  Prev: INT8,  Up: Intrinsic Procedures
11879
118809.143 `IOR' -- Bitwise logical or
11881=================================
11882
11883_Description_:
11884     `IOR' returns the bitwise Boolean inclusive-OR of I and J.
11885
11886_Standard_:
11887     Fortran 95 and later
11888
11889_Class_:
11890     Elemental function
11891
11892_Syntax_:
11893     `RESULT = IOR(I, J)'
11894
11895_Arguments_:
11896     I          The type shall be `INTEGER'.
11897     J          The type shall be `INTEGER', of the same kind
11898                as I.  (As a GNU extension, different kinds
11899                are also permitted.)
11900
11901_Return value_:
11902     The return type is `INTEGER', of the same kind as the arguments.
11903     (If the argument kinds differ, it is of the same kind as the
11904     larger argument.)
11905
11906_See also_:
11907     *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
11908     IBCLR::, *note NOT::
11909
11910
11911File: gfortran.info,  Node: IPARITY,  Next: IRAND,  Prev: IOR,  Up: Intrinsic Procedures
11912
119139.144 `IPARITY' -- Bitwise XOR of array elements
11914================================================
11915
11916_Description_:
11917     Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
11918     dimension DIM if the corresponding element in MASK is `TRUE'.
11919
11920_Standard_:
11921     Fortran 2008 and later
11922
11923_Class_:
11924     Transformational function
11925
11926_Syntax_:
11927     `RESULT = IPARITY(ARRAY[, MASK])'
11928     `RESULT = IPARITY(ARRAY, DIM[, MASK])'
11929
11930_Arguments_:
11931     ARRAY      Shall be an array of type `INTEGER'
11932     DIM        (Optional) shall be a scalar of type `INTEGER'
11933                with a value in the range from 1 to n, where n
11934                equals the rank of ARRAY.
11935     MASK       (Optional) shall be of type `LOGICAL' and
11936                either be a scalar or an array of the same
11937                shape as ARRAY.
11938
11939_Return value_:
11940     The result is of the same type as ARRAY.
11941
11942     If DIM is absent, a scalar with the bitwise XOR of all elements in
11943     ARRAY is returned. Otherwise, an array of rank n-1, where n equals
11944     the rank of ARRAY, and a shape similar to that of ARRAY with
11945     dimension DIM dropped is returned.
11946
11947_Example_:
11948          PROGRAM test_iparity
11949            INTEGER(1) :: a(2)
11950
11951            a(1) = b'00100100'
11952            a(2) = b'01101010'
11953
11954            ! prints 01001110
11955            PRINT '(b8.8)', IPARITY(a)
11956          END PROGRAM
11957
11958_See also_:
11959     *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
11960
11961
11962File: gfortran.info,  Node: IRAND,  Next: IS_IOSTAT_END,  Prev: IPARITY,  Up: Intrinsic Procedures
11963
119649.145 `IRAND' -- Integer pseudo-random number
11965=============================================
11966
11967_Description_:
11968     `IRAND(FLAG)' returns a pseudo-random number from a uniform
11969     distribution between 0 and a system-dependent limit (which is in
11970     most cases 2147483647). If FLAG is 0, the next number in the
11971     current sequence is returned; if FLAG is 1, the generator is
11972     restarted by `CALL SRAND(0)'; if FLAG has any other value, it is
11973     used as a new seed with `SRAND'.
11974
11975     This intrinsic routine is provided for backwards compatibility with
11976     GNU Fortran 77. It implements a simple modulo generator as provided
11977     by `g77'. For new code, one should consider the use of *note
11978     RANDOM_NUMBER:: as it implements a superior algorithm.
11979
11980_Standard_:
11981     GNU extension
11982
11983_Class_:
11984     Function
11985
11986_Syntax_:
11987     `RESULT = IRAND(I)'
11988
11989_Arguments_:
11990     I          Shall be a scalar `INTEGER' of kind 4.
11991
11992_Return value_:
11993     The return value is of `INTEGER(kind=4)' type.
11994
11995_Example_:
11996          program test_irand
11997            integer,parameter :: seed = 86456
11998
11999            call srand(seed)
12000            print *, irand(), irand(), irand(), irand()
12001            print *, irand(seed), irand(), irand(), irand()
12002          end program test_irand
12003
12004
12005
12006File: gfortran.info,  Node: IS_IOSTAT_END,  Next: IS_IOSTAT_EOR,  Prev: IRAND,  Up: Intrinsic Procedures
12007
120089.146 `IS_IOSTAT_END' -- Test for end-of-file value
12009===================================================
12010
12011_Description_:
12012     `IS_IOSTAT_END' tests whether an variable has the value of the I/O
12013     status "end of file". The function is equivalent to comparing the
12014     variable with the `IOSTAT_END' parameter of the intrinsic module
12015     `ISO_FORTRAN_ENV'.
12016
12017_Standard_:
12018     Fortran 2003 and later
12019
12020_Class_:
12021     Elemental function
12022
12023_Syntax_:
12024     `RESULT = IS_IOSTAT_END(I)'
12025
12026_Arguments_:
12027     I          Shall be of the type `INTEGER'.
12028
12029_Return value_:
12030     Returns a `LOGICAL' of the default kind, which `.TRUE.' if I has
12031     the value which indicates an end of file condition for `IOSTAT='
12032     specifiers, and is `.FALSE.' otherwise.
12033
12034_Example_:
12035          PROGRAM iostat
12036            IMPLICIT NONE
12037            INTEGER :: stat, i
12038            OPEN(88, FILE='test.dat')
12039            READ(88, *, IOSTAT=stat) i
12040            IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
12041          END PROGRAM
12042
12043
12044File: gfortran.info,  Node: IS_IOSTAT_EOR,  Next: ISATTY,  Prev: IS_IOSTAT_END,  Up: Intrinsic Procedures
12045
120469.147 `IS_IOSTAT_EOR' -- Test for end-of-record value
12047=====================================================
12048
12049_Description_:
12050     `IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
12051     status "end of record". The function is equivalent to comparing the
12052     variable with the `IOSTAT_EOR' parameter of the intrinsic module
12053     `ISO_FORTRAN_ENV'.
12054
12055_Standard_:
12056     Fortran 2003 and later
12057
12058_Class_:
12059     Elemental function
12060
12061_Syntax_:
12062     `RESULT = IS_IOSTAT_EOR(I)'
12063
12064_Arguments_:
12065     I          Shall be of the type `INTEGER'.
12066
12067_Return value_:
12068     Returns a `LOGICAL' of the default kind, which `.TRUE.' if I has
12069     the value which indicates an end of file condition for `IOSTAT='
12070     specifiers, and is `.FALSE.' otherwise.
12071
12072_Example_:
12073          PROGRAM iostat
12074            IMPLICIT NONE
12075            INTEGER :: stat, i(50)
12076            OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
12077            READ(88, IOSTAT=stat) i
12078            IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
12079          END PROGRAM
12080
12081
12082File: gfortran.info,  Node: ISATTY,  Next: ISHFT,  Prev: IS_IOSTAT_EOR,  Up: Intrinsic Procedures
12083
120849.148 `ISATTY' -- Whether a unit is a terminal device.
12085======================================================
12086
12087_Description_:
12088     Determine whether a unit is connected to a terminal device.
12089
12090_Standard_:
12091     GNU extension
12092
12093_Class_:
12094     Function
12095
12096_Syntax_:
12097     `RESULT = ISATTY(UNIT)'
12098
12099_Arguments_:
12100     UNIT       Shall be a scalar `INTEGER'.
12101
12102_Return value_:
12103     Returns `.TRUE.' if the UNIT is connected to a terminal device,
12104     `.FALSE.' otherwise.
12105
12106_Example_:
12107          PROGRAM test_isatty
12108            INTEGER(kind=1) :: unit
12109            DO unit = 1, 10
12110              write(*,*) isatty(unit=unit)
12111            END DO
12112          END PROGRAM
12113
12114_See also_:
12115     *note TTYNAM::
12116
12117
12118File: gfortran.info,  Node: ISHFT,  Next: ISHFTC,  Prev: ISATTY,  Up: Intrinsic Procedures
12119
121209.149 `ISHFT' -- Shift bits
12121===========================
12122
12123_Description_:
12124     `ISHFT' returns a value corresponding to I with all of the bits
12125     shifted SHIFT places.  A value of SHIFT greater than zero
12126     corresponds to a left shift, a value of zero corresponds to no
12127     shift, and a value less than zero corresponds to a right shift.
12128     If the absolute value of SHIFT is greater than `BIT_SIZE(I)', the
12129     value is undefined.  Bits shifted out from the left end or right
12130     end are lost; zeros are shifted in from the opposite end.
12131
12132_Standard_:
12133     Fortran 95 and later
12134
12135_Class_:
12136     Elemental function
12137
12138_Syntax_:
12139     `RESULT = ISHFT(I, SHIFT)'
12140
12141_Arguments_:
12142     I          The type shall be `INTEGER'.
12143     SHIFT      The type shall be `INTEGER'.
12144
12145_Return value_:
12146     The return value is of type `INTEGER' and of the same kind as I.
12147
12148_See also_:
12149     *note ISHFTC::
12150
12151
12152File: gfortran.info,  Node: ISHFTC,  Next: ISNAN,  Prev: ISHFT,  Up: Intrinsic Procedures
12153
121549.150 `ISHFTC' -- Shift bits circularly
12155=======================================
12156
12157_Description_:
12158     `ISHFTC' returns a value corresponding to I with the rightmost
12159     SIZE bits shifted circularly SHIFT places; that is, bits shifted
12160     out one end are shifted into the opposite end.  A value of SHIFT
12161     greater than zero corresponds to a left shift, a value of zero
12162     corresponds to no shift, and a value less than zero corresponds to
12163     a right shift.  The absolute value of SHIFT must be less than
12164     SIZE.  If the SIZE argument is omitted, it is taken to be
12165     equivalent to `BIT_SIZE(I)'.
12166
12167_Standard_:
12168     Fortran 95 and later
12169
12170_Class_:
12171     Elemental function
12172
12173_Syntax_:
12174     `RESULT = ISHFTC(I, SHIFT [, SIZE])'
12175
12176_Arguments_:
12177     I          The type shall be `INTEGER'.
12178     SHIFT      The type shall be `INTEGER'.
12179     SIZE       (Optional) The type shall be `INTEGER'; the
12180                value must be greater than zero and less than
12181                or equal to `BIT_SIZE(I)'.
12182
12183_Return value_:
12184     The return value is of type `INTEGER' and of the same kind as I.
12185
12186_See also_:
12187     *note ISHFT::
12188
12189
12190File: gfortran.info,  Node: ISNAN,  Next: ITIME,  Prev: ISHFTC,  Up: Intrinsic Procedures
12191
121929.151 `ISNAN' -- Test for a NaN
12193===============================
12194
12195_Description_:
12196     `ISNAN' tests whether a floating-point value is an IEEE
12197     Not-a-Number (NaN).
12198
12199_Standard_:
12200     GNU extension
12201
12202_Class_:
12203     Elemental function
12204
12205_Syntax_:
12206     `ISNAN(X)'
12207
12208_Arguments_:
12209     X          Variable of the type `REAL'.
12210
12211_Return value_:
12212     Returns a default-kind `LOGICAL'. The returned value is `TRUE' if
12213     X is a NaN and `FALSE' otherwise.
12214
12215_Example_:
12216          program test_nan
12217            implicit none
12218            real :: x
12219            x = -1.0
12220            x = sqrt(x)
12221            if (isnan(x)) stop '"x" is a NaN'
12222          end program test_nan
12223
12224
12225File: gfortran.info,  Node: ITIME,  Next: KILL,  Prev: ISNAN,  Up: Intrinsic Procedures
12226
122279.152 `ITIME' -- Get current local time subroutine (hour/minutes/seconds)
12228=========================================================================
12229
12230_Description_:
12231     `IDATE(VALUES)' Fills VALUES with the numerical values at the
12232     current local time. The hour (in the range 1-24), minute (in the
12233     range 1-60), and seconds (in the range 1-60) appear in elements 1,
12234     2, and 3 of VALUES, respectively.
12235
12236_Standard_:
12237     GNU extension
12238
12239_Class_:
12240     Subroutine
12241
12242_Syntax_:
12243     `CALL ITIME(VALUES)'
12244
12245_Arguments_:
12246     VALUES     The type shall be `INTEGER, DIMENSION(3)' and
12247                the kind shall be the default integer kind.
12248
12249_Return value_:
12250     Does not return anything.
12251
12252_Example_:
12253          program test_itime
12254            integer, dimension(3) :: tarray
12255            call itime(tarray)
12256            print *, tarray(1)
12257            print *, tarray(2)
12258            print *, tarray(3)
12259          end program test_itime
12260
12261
12262File: gfortran.info,  Node: KILL,  Next: KIND,  Prev: ITIME,  Up: Intrinsic Procedures
12263
122649.153 `KILL' -- Send a signal to a process
12265==========================================
12266
12267_Description_:
12268
12269_Standard_:
12270     Sends the signal specified by SIGNAL to the process PID.  See
12271     `kill(2)'.
12272
12273     This intrinsic is provided in both subroutine and function forms;
12274     however, only one form can be used in any given program unit.
12275
12276_Class_:
12277     Subroutine, function
12278
12279_Syntax_:
12280     `CALL KILL(C, VALUE [, STATUS])'
12281     `STATUS = KILL(C, VALUE)'
12282
12283_Arguments_:
12284     C          Shall be a scalar `INTEGER', with `INTENT(IN)'
12285     VALUE      Shall be a scalar `INTEGER', with `INTENT(IN)'
12286     STATUS     (Optional) status flag of type `INTEGER(4)' or
12287                `INTEGER(8)'. Returns 0 on success, or a
12288                system-specific error code otherwise.
12289
12290_See also_:
12291     *note ABORT::, *note EXIT::
12292
12293
12294File: gfortran.info,  Node: KIND,  Next: LBOUND,  Prev: KILL,  Up: Intrinsic Procedures
12295
122969.154 `KIND' -- Kind of an entity
12297=================================
12298
12299_Description_:
12300     `KIND(X)' returns the kind value of the entity X.
12301
12302_Standard_:
12303     Fortran 95 and later
12304
12305_Class_:
12306     Inquiry function
12307
12308_Syntax_:
12309     `K = KIND(X)'
12310
12311_Arguments_:
12312     X          Shall be of type `LOGICAL', `INTEGER', `REAL',
12313                `COMPLEX' or `CHARACTER'.
12314
12315_Return value_:
12316     The return value is a scalar of type `INTEGER' and of the default
12317     integer kind.
12318
12319_Example_:
12320          program test_kind
12321            integer,parameter :: kc = kind(' ')
12322            integer,parameter :: kl = kind(.true.)
12323
12324            print *, "The default character kind is ", kc
12325            print *, "The default logical kind is ", kl
12326          end program test_kind
12327
12328
12329
12330File: gfortran.info,  Node: LBOUND,  Next: LCOBOUND,  Prev: KIND,  Up: Intrinsic Procedures
12331
123329.155 `LBOUND' -- Lower dimension bounds of an array
12333====================================================
12334
12335_Description_:
12336     Returns the lower bounds of an array, or a single lower bound
12337     along the DIM dimension.
12338
12339_Standard_:
12340     Fortran 95 and later, with KIND argument Fortran 2003 and later
12341
12342_Class_:
12343     Inquiry function
12344
12345_Syntax_:
12346     `RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
12347
12348_Arguments_:
12349     ARRAY      Shall be an array, of any type.
12350     DIM        (Optional) Shall be a scalar `INTEGER'.
12351     KIND       (Optional) An `INTEGER' initialization
12352                expression indicating the kind parameter of
12353                the result.
12354
12355_Return value_:
12356     The return value is of type `INTEGER' and of kind KIND. If KIND is
12357     absent, the return value is of default integer kind.  If DIM is
12358     absent, the result is an array of the lower bounds of ARRAY.  If
12359     DIM is present, the result is a scalar corresponding to the lower
12360     bound of the array along that dimension.  If ARRAY is an
12361     expression rather than a whole array or array structure component,
12362     or if it has a zero extent along the relevant dimension, the lower
12363     bound is taken to be 1.
12364
12365_See also_:
12366     *note UBOUND::, *note LCOBOUND::
12367
12368
12369File: gfortran.info,  Node: LCOBOUND,  Next: LEADZ,  Prev: LBOUND,  Up: Intrinsic Procedures
12370
123719.156 `LCOBOUND' -- Lower codimension bounds of an array
12372========================================================
12373
12374_Description_:
12375     Returns the lower bounds of a coarray, or a single lower cobound
12376     along the DIM codimension.
12377
12378_Standard_:
12379     Fortran 2008 and later
12380
12381_Class_:
12382     Inquiry function
12383
12384_Syntax_:
12385     `RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
12386
12387_Arguments_:
12388     ARRAY      Shall be an coarray, of any type.
12389     DIM        (Optional) Shall be a scalar `INTEGER'.
12390     KIND       (Optional) An `INTEGER' initialization
12391                expression indicating the kind parameter of
12392                the result.
12393
12394_Return value_:
12395     The return value is of type `INTEGER' and of kind KIND. If KIND is
12396     absent, the return value is of default integer kind.  If DIM is
12397     absent, the result is an array of the lower cobounds of COARRAY.
12398     If DIM is present, the result is a scalar corresponding to the
12399     lower cobound of the array along that codimension.
12400
12401_See also_:
12402     *note UCOBOUND::, *note LBOUND::
12403
12404
12405File: gfortran.info,  Node: LEADZ,  Next: LEN,  Prev: LCOBOUND,  Up: Intrinsic Procedures
12406
124079.157 `LEADZ' -- Number of leading zero bits of an integer
12408==========================================================
12409
12410_Description_:
12411     `LEADZ' returns the number of leading zero bits of an integer.
12412
12413_Standard_:
12414     Fortran 2008 and later
12415
12416_Class_:
12417     Elemental function
12418
12419_Syntax_:
12420     `RESULT = LEADZ(I)'
12421
12422_Arguments_:
12423     I          Shall be of type `INTEGER'.
12424
12425_Return value_:
12426     The type of the return value is the default `INTEGER'.  If all the
12427     bits of `I' are zero, the result value is `BIT_SIZE(I)'.
12428
12429_Example_:
12430          PROGRAM test_leadz
12431            WRITE (*,*) BIT_SIZE(1)  ! prints 32
12432            WRITE (*,*) LEADZ(1)     ! prints 31
12433          END PROGRAM
12434
12435_See also_:
12436     *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
12437
12438
12439File: gfortran.info,  Node: LEN,  Next: LEN_TRIM,  Prev: LEADZ,  Up: Intrinsic Procedures
12440
124419.158 `LEN' -- Length of a character entity
12442===========================================
12443
12444_Description_:
12445     Returns the length of a character string.  If STRING is an array,
12446     the length of an element of STRING is returned.  Note that STRING
12447     need not be defined when this intrinsic is invoked, since only the
12448     length, not the content, of STRING is needed.
12449
12450_Standard_:
12451     Fortran 77 and later, with KIND argument Fortran 2003 and later
12452
12453_Class_:
12454     Inquiry function
12455
12456_Syntax_:
12457     `L = LEN(STRING [, KIND])'
12458
12459_Arguments_:
12460     STRING     Shall be a scalar or array of type
12461                `CHARACTER', with `INTENT(IN)'
12462     KIND       (Optional) An `INTEGER' initialization
12463                expression indicating the kind parameter of
12464                the result.
12465
12466_Return value_:
12467     The return value is of type `INTEGER' and of kind KIND. If KIND is
12468     absent, the return value is of default integer kind.
12469
12470_Specific names_:
12471     Name          Argument      Return type   Standard
12472     `LEN(STRING)' `CHARACTER'   `INTEGER'     Fortran 77 and
12473                                               later
12474
12475_See also_:
12476     *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
12477
12478
12479File: gfortran.info,  Node: LEN_TRIM,  Next: LGE,  Prev: LEN,  Up: Intrinsic Procedures
12480
124819.159 `LEN_TRIM' -- Length of a character entity without trailing blank characters
12482==================================================================================
12483
12484_Description_:
12485     Returns the length of a character string, ignoring any trailing
12486     blanks.
12487
12488_Standard_:
12489     Fortran 95 and later, with KIND argument Fortran 2003 and later
12490
12491_Class_:
12492     Elemental function
12493
12494_Syntax_:
12495     `RESULT = LEN_TRIM(STRING [, KIND])'
12496
12497_Arguments_:
12498     STRING     Shall be a scalar of type `CHARACTER', with
12499                `INTENT(IN)'
12500     KIND       (Optional) An `INTEGER' initialization
12501                expression indicating the kind parameter of
12502                the result.
12503
12504_Return value_:
12505     The return value is of type `INTEGER' and of kind KIND. If KIND is
12506     absent, the return value is of default integer kind.
12507
12508_See also_:
12509     *note LEN::, *note ADJUSTL::, *note ADJUSTR::
12510
12511
12512File: gfortran.info,  Node: LGE,  Next: LGT,  Prev: LEN_TRIM,  Up: Intrinsic Procedures
12513
125149.160 `LGE' -- Lexical greater than or equal
12515============================================
12516
12517_Description_:
12518     Determines whether one string is lexically greater than or equal to
12519     another string, where the two strings are interpreted as containing
12520     ASCII character codes.  If the String A and String B are not the
12521     same length, the shorter is compared as if spaces were appended to
12522     it to form a value that has the same length as the longer.
12523
12524     In general, the lexical comparison intrinsics `LGE', `LGT', `LLE',
12525     and `LLT' differ from the corresponding intrinsic operators
12526     `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the
12527     processor's character ordering (which is not ASCII on some
12528     targets), whereas the former always use the ASCII ordering.
12529
12530_Standard_:
12531     Fortran 77 and later
12532
12533_Class_:
12534     Elemental function
12535
12536_Syntax_:
12537     `RESULT = LGE(STRING_A, STRING_B)'
12538
12539_Arguments_:
12540     STRING_A   Shall be of default `CHARACTER' type.
12541     STRING_B   Shall be of default `CHARACTER' type.
12542
12543_Return value_:
12544     Returns `.TRUE.' if `STRING_A >= STRING_B', and `.FALSE.'
12545     otherwise, based on the ASCII ordering.
12546
12547_Specific names_:
12548     Name          Argument      Return type   Standard
12549     `LGE(STRING_A,`CHARACTER'   `LOGICAL'     Fortran 77 and
12550     STRING_B)'                                later
12551
12552_See also_:
12553     *note LGT::, *note LLE::, *note LLT::
12554
12555
12556File: gfortran.info,  Node: LGT,  Next: LINK,  Prev: LGE,  Up: Intrinsic Procedures
12557
125589.161 `LGT' -- Lexical greater than
12559===================================
12560
12561_Description_:
12562     Determines whether one string is lexically greater than another
12563     string, where the two strings are interpreted as containing ASCII
12564     character codes.  If the String A and String B are not the same
12565     length, the shorter is compared as if spaces were appended to it
12566     to form a value that has the same length as the longer.
12567
12568     In general, the lexical comparison intrinsics `LGE', `LGT', `LLE',
12569     and `LLT' differ from the corresponding intrinsic operators
12570     `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the
12571     processor's character ordering (which is not ASCII on some
12572     targets), whereas the former always use the ASCII ordering.
12573
12574_Standard_:
12575     Fortran 77 and later
12576
12577_Class_:
12578     Elemental function
12579
12580_Syntax_:
12581     `RESULT = LGT(STRING_A, STRING_B)'
12582
12583_Arguments_:
12584     STRING_A   Shall be of default `CHARACTER' type.
12585     STRING_B   Shall be of default `CHARACTER' type.
12586
12587_Return value_:
12588     Returns `.TRUE.' if `STRING_A > STRING_B', and `.FALSE.'
12589     otherwise, based on the ASCII ordering.
12590
12591_Specific names_:
12592     Name          Argument      Return type   Standard
12593     `LGT(STRING_A,`CHARACTER'   `LOGICAL'     Fortran 77 and
12594     STRING_B)'                                later
12595
12596_See also_:
12597     *note LGE::, *note LLE::, *note LLT::
12598
12599
12600File: gfortran.info,  Node: LINK,  Next: LLE,  Prev: LGT,  Up: Intrinsic Procedures
12601
126029.162 `LINK' -- Create a hard link
12603==================================
12604
12605_Description_:
12606     Makes a (hard) link from file PATH1 to PATH2. A null character
12607     (`CHAR(0)') can be used to mark the end of the names in PATH1 and
12608     PATH2; otherwise, trailing blanks in the file names are ignored.
12609     If the STATUS argument is supplied, it contains 0 on success or a
12610     nonzero error code upon return; see `link(2)'.
12611
12612     This intrinsic is provided in both subroutine and function forms;
12613     however, only one form can be used in any given program unit.
12614
12615_Standard_:
12616     GNU extension
12617
12618_Class_:
12619     Subroutine, function
12620
12621_Syntax_:
12622     `CALL LINK(PATH1, PATH2 [, STATUS])'
12623     `STATUS = LINK(PATH1, PATH2)'
12624
12625_Arguments_:
12626     PATH1      Shall be of default `CHARACTER' type.
12627     PATH2      Shall be of default `CHARACTER' type.
12628     STATUS     (Optional) Shall be of default `INTEGER' type.
12629
12630_See also_:
12631     *note SYMLNK::, *note UNLINK::
12632
12633
12634File: gfortran.info,  Node: LLE,  Next: LLT,  Prev: LINK,  Up: Intrinsic Procedures
12635
126369.163 `LLE' -- Lexical less than or equal
12637=========================================
12638
12639_Description_:
12640     Determines whether one string is lexically less than or equal to
12641     another string, where the two strings are interpreted as
12642     containing ASCII character codes.  If the String A and String B
12643     are not the same length, the shorter is compared as if spaces were
12644     appended to it to form a value that has the same length as the
12645     longer.
12646
12647     In general, the lexical comparison intrinsics `LGE', `LGT', `LLE',
12648     and `LLT' differ from the corresponding intrinsic operators
12649     `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the
12650     processor's character ordering (which is not ASCII on some
12651     targets), whereas the former always use the ASCII ordering.
12652
12653_Standard_:
12654     Fortran 77 and later
12655
12656_Class_:
12657     Elemental function
12658
12659_Syntax_:
12660     `RESULT = LLE(STRING_A, STRING_B)'
12661
12662_Arguments_:
12663     STRING_A   Shall be of default `CHARACTER' type.
12664     STRING_B   Shall be of default `CHARACTER' type.
12665
12666_Return value_:
12667     Returns `.TRUE.' if `STRING_A <= STRING_B', and `.FALSE.'
12668     otherwise, based on the ASCII ordering.
12669
12670_Specific names_:
12671     Name          Argument      Return type   Standard
12672     `LLE(STRING_A,`CHARACTER'   `LOGICAL'     Fortran 77 and
12673     STRING_B)'                                later
12674
12675_See also_:
12676     *note LGE::, *note LGT::, *note LLT::
12677
12678
12679File: gfortran.info,  Node: LLT,  Next: LNBLNK,  Prev: LLE,  Up: Intrinsic Procedures
12680
126819.164 `LLT' -- Lexical less than
12682================================
12683
12684_Description_:
12685     Determines whether one string is lexically less than another
12686     string, where the two strings are interpreted as containing ASCII
12687     character codes.  If the String A and String B are not the same
12688     length, the shorter is compared as if spaces were appended to it
12689     to form a value that has the same length as the longer.
12690
12691     In general, the lexical comparison intrinsics `LGE', `LGT', `LLE',
12692     and `LLT' differ from the corresponding intrinsic operators
12693     `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the
12694     processor's character ordering (which is not ASCII on some
12695     targets), whereas the former always use the ASCII ordering.
12696
12697_Standard_:
12698     Fortran 77 and later
12699
12700_Class_:
12701     Elemental function
12702
12703_Syntax_:
12704     `RESULT = LLT(STRING_A, STRING_B)'
12705
12706_Arguments_:
12707     STRING_A   Shall be of default `CHARACTER' type.
12708     STRING_B   Shall be of default `CHARACTER' type.
12709
12710_Return value_:
12711     Returns `.TRUE.' if `STRING_A < STRING_B', and `.FALSE.'
12712     otherwise, based on the ASCII ordering.
12713
12714_Specific names_:
12715     Name          Argument      Return type   Standard
12716     `LLT(STRING_A,`CHARACTER'   `LOGICAL'     Fortran 77 and
12717     STRING_B)'                                later
12718
12719_See also_:
12720     *note LGE::, *note LGT::, *note LLE::
12721
12722
12723File: gfortran.info,  Node: LNBLNK,  Next: LOC,  Prev: LLT,  Up: Intrinsic Procedures
12724
127259.165 `LNBLNK' -- Index of the last non-blank character in a string
12726===================================================================
12727
12728_Description_:
12729     Returns the length of a character string, ignoring any trailing
12730     blanks.  This is identical to the standard `LEN_TRIM' intrinsic,
12731     and is only included for backwards compatibility.
12732
12733_Standard_:
12734     GNU extension
12735
12736_Class_:
12737     Elemental function
12738
12739_Syntax_:
12740     `RESULT = LNBLNK(STRING)'
12741
12742_Arguments_:
12743     STRING     Shall be a scalar of type `CHARACTER', with
12744                `INTENT(IN)'
12745
12746_Return value_:
12747     The return value is of `INTEGER(kind=4)' type.
12748
12749_See also_:
12750     *note INDEX intrinsic::, *note LEN_TRIM::
12751
12752
12753File: gfortran.info,  Node: LOC,  Next: LOG,  Prev: LNBLNK,  Up: Intrinsic Procedures
12754
127559.166 `LOC' -- Returns the address of a variable
12756================================================
12757
12758_Description_:
12759     `LOC(X)' returns the address of X as an integer.
12760
12761_Standard_:
12762     GNU extension
12763
12764_Class_:
12765     Inquiry function
12766
12767_Syntax_:
12768     `RESULT = LOC(X)'
12769
12770_Arguments_:
12771     X          Variable of any type.
12772
12773_Return value_:
12774     The return value is of type `INTEGER', with a `KIND' corresponding
12775     to the size (in bytes) of a memory address on the target machine.
12776
12777_Example_:
12778          program test_loc
12779            integer :: i
12780            real :: r
12781            i = loc(r)
12782            print *, i
12783          end program test_loc
12784
12785
12786File: gfortran.info,  Node: LOG,  Next: LOG10,  Prev: LOC,  Up: Intrinsic Procedures
12787
127889.167 `LOG' -- Natural logarithm function
12789=========================================
12790
12791_Description_:
12792     `LOG(X)' computes the natural logarithm of X, i.e. the logarithm
12793     to the base e.
12794
12795_Standard_:
12796     Fortran 77 and later
12797
12798_Class_:
12799     Elemental function
12800
12801_Syntax_:
12802     `RESULT = LOG(X)'
12803
12804_Arguments_:
12805     X          The type shall be `REAL' or `COMPLEX'.
12806
12807_Return value_:
12808     The return value is of type `REAL' or `COMPLEX'.  The kind type
12809     parameter is the same as X.  If X is `COMPLEX', the imaginary part
12810     \omega is in the range -\pi < \omega \leq \pi.
12811
12812_Example_:
12813          program test_log
12814            real(8) :: x = 2.7182818284590451_8
12815            complex :: z = (1.0, 2.0)
12816            x = log(x)    ! will yield (approximately) 1
12817            z = log(z)
12818          end program test_log
12819
12820_Specific names_:
12821     Name          Argument      Return type   Standard
12822     `ALOG(X)'     `REAL(4) X'   `REAL(4)'     f95, gnu
12823     `DLOG(X)'     `REAL(8) X'   `REAL(8)'     f95, gnu
12824     `CLOG(X)'     `COMPLEX(4)   `COMPLEX(4)'  f95, gnu
12825                   X'                          
12826     `ZLOG(X)'     `COMPLEX(8)   `COMPLEX(8)'  f95, gnu
12827                   X'                          
12828     `CDLOG(X)'    `COMPLEX(8)   `COMPLEX(8)'  f95, gnu
12829                   X'                          
12830
12831
12832File: gfortran.info,  Node: LOG10,  Next: LOG_GAMMA,  Prev: LOG,  Up: Intrinsic Procedures
12833
128349.168 `LOG10' -- Base 10 logarithm function
12835===========================================
12836
12837_Description_:
12838     `LOG10(X)' computes the base 10 logarithm of X.
12839
12840_Standard_:
12841     Fortran 77 and later
12842
12843_Class_:
12844     Elemental function
12845
12846_Syntax_:
12847     `RESULT = LOG10(X)'
12848
12849_Arguments_:
12850     X          The type shall be `REAL'.
12851
12852_Return value_:
12853     The return value is of type `REAL' or `COMPLEX'.  The kind type
12854     parameter is the same as X.
12855
12856_Example_:
12857          program test_log10
12858            real(8) :: x = 10.0_8
12859            x = log10(x)
12860          end program test_log10
12861
12862_Specific names_:
12863     Name          Argument      Return type   Standard
12864     `ALOG10(X)'   `REAL(4) X'   `REAL(4)'     Fortran 95 and
12865                                               later
12866     `DLOG10(X)'   `REAL(8) X'   `REAL(8)'     Fortran 95 and
12867                                               later
12868
12869
12870File: gfortran.info,  Node: LOG_GAMMA,  Next: LOGICAL,  Prev: LOG10,  Up: Intrinsic Procedures
12871
128729.169 `LOG_GAMMA' -- Logarithm of the Gamma function
12873====================================================
12874
12875_Description_:
12876     `LOG_GAMMA(X)' computes the natural logarithm of the absolute value
12877     of the Gamma (\Gamma) function.
12878
12879_Standard_:
12880     Fortran 2008 and later
12881
12882_Class_:
12883     Elemental function
12884
12885_Syntax_:
12886     `X = LOG_GAMMA(X)'
12887
12888_Arguments_:
12889     X          Shall be of type `REAL' and neither zero nor a
12890                negative integer.
12891
12892_Return value_:
12893     The return value is of type `REAL' of the same kind as X.
12894
12895_Example_:
12896          program test_log_gamma
12897            real :: x = 1.0
12898            x = lgamma(x) ! returns 0.0
12899          end program test_log_gamma
12900
12901_Specific names_:
12902     Name          Argument      Return type   Standard
12903     `LGAMMA(X)'   `REAL(4) X'   `REAL(4)'     GNU Extension
12904     `ALGAMA(X)'   `REAL(4) X'   `REAL(4)'     GNU Extension
12905     `DLGAMA(X)'   `REAL(8) X'   `REAL(8)'     GNU Extension
12906
12907_See also_:
12908     Gamma function: *note GAMMA::
12909
12910
12911
12912File: gfortran.info,  Node: LOGICAL,  Next: LONG,  Prev: LOG_GAMMA,  Up: Intrinsic Procedures
12913
129149.170 `LOGICAL' -- Convert to logical type
12915==========================================
12916
12917_Description_:
12918     Converts one kind of `LOGICAL' variable to another.
12919
12920_Standard_:
12921     Fortran 95 and later
12922
12923_Class_:
12924     Elemental function
12925
12926_Syntax_:
12927     `RESULT = LOGICAL(L [, KIND])'
12928
12929_Arguments_:
12930     L          The type shall be `LOGICAL'.
12931     KIND       (Optional) An `INTEGER' initialization
12932                expression indicating the kind parameter of
12933                the result.
12934
12935_Return value_:
12936     The return value is a `LOGICAL' value equal to L, with a kind
12937     corresponding to KIND, or of the default logical kind if KIND is
12938     not given.
12939
12940_See also_:
12941     *note INT::, *note REAL::, *note CMPLX::
12942
12943
12944File: gfortran.info,  Node: LONG,  Next: LSHIFT,  Prev: LOGICAL,  Up: Intrinsic Procedures
12945
129469.171 `LONG' -- Convert to integer type
12947=======================================
12948
12949_Description_:
12950     Convert to a `KIND=4' integer type, which is the same size as a C
12951     `long' integer.  This is equivalent to the standard `INT'
12952     intrinsic with an optional argument of `KIND=4', and is only
12953     included for backwards compatibility.
12954
12955_Standard_:
12956     GNU extension
12957
12958_Class_:
12959     Elemental function
12960
12961_Syntax_:
12962     `RESULT = LONG(A)'
12963
12964_Arguments_:
12965     A          Shall be of type `INTEGER', `REAL', or
12966                `COMPLEX'.
12967
12968_Return value_:
12969     The return value is a `INTEGER(4)' variable.
12970
12971_See also_:
12972     *note INT::, *note INT2::, *note INT8::
12973
12974
12975File: gfortran.info,  Node: LSHIFT,  Next: LSTAT,  Prev: LONG,  Up: Intrinsic Procedures
12976
129779.172 `LSHIFT' -- Left shift bits
12978=================================
12979
12980_Description_:
12981     `LSHIFT' returns a value corresponding to I with all of the bits
12982     shifted left by SHIFT places.  If the absolute value of SHIFT is
12983     greater than `BIT_SIZE(I)', the value is undefined.  Bits shifted
12984     out from the left end are lost; zeros are shifted in from the
12985     opposite end.
12986
12987     This function has been superseded by the `ISHFT' intrinsic, which
12988     is standard in Fortran 95 and later, and the `SHIFTL' intrinsic,
12989     which is standard in Fortran 2008 and later.
12990
12991_Standard_:
12992     GNU extension
12993
12994_Class_:
12995     Elemental function
12996
12997_Syntax_:
12998     `RESULT = LSHIFT(I, SHIFT)'
12999
13000_Arguments_:
13001     I          The type shall be `INTEGER'.
13002     SHIFT      The type shall be `INTEGER'.
13003
13004_Return value_:
13005     The return value is of type `INTEGER' and of the same kind as I.
13006
13007_See also_:
13008     *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
13009     *note SHIFTL::, *note SHIFTR::
13010
13011
13012
13013File: gfortran.info,  Node: LSTAT,  Next: LTIME,  Prev: LSHIFT,  Up: Intrinsic Procedures
13014
130159.173 `LSTAT' -- Get file status
13016================================
13017
13018_Description_:
13019     `LSTAT' is identical to *note STAT::, except that if path is a
13020     symbolic link, then the link itself is statted, not the file that
13021     it refers to.
13022
13023     The elements in `VALUES' are the same as described by *note STAT::.
13024
13025     This intrinsic is provided in both subroutine and function forms;
13026     however, only one form can be used in any given program unit.
13027
13028_Standard_:
13029     GNU extension
13030
13031_Class_:
13032     Subroutine, function
13033
13034_Syntax_:
13035     `CALL LSTAT(NAME, VALUES [, STATUS])'
13036     `STATUS = LSTAT(NAME, VALUES)'
13037
13038_Arguments_:
13039     NAME       The type shall be `CHARACTER' of the default
13040                kind, a valid path within the file system.
13041     VALUES     The type shall be `INTEGER(4), DIMENSION(13)'.
13042     STATUS     (Optional) status flag of type `INTEGER(4)'.
13043                Returns 0 on success and a system specific
13044                error code otherwise.
13045
13046_Example_:
13047     See *note STAT:: for an example.
13048
13049_See also_:
13050     To stat an open file: *note FSTAT::, to stat a file: *note STAT::
13051
13052
13053File: gfortran.info,  Node: LTIME,  Next: MALLOC,  Prev: LSTAT,  Up: Intrinsic Procedures
13054
130559.174 `LTIME' -- Convert time to local time info
13056================================================
13057
13058_Description_:
13059     Given a system time value TIME (as provided by the `TIME8'
13060     intrinsic), fills VALUES with values extracted from it appropriate
13061     to the local time zone using `localtime(3)'.
13062
13063_Standard_:
13064     GNU extension
13065
13066_Class_:
13067     Subroutine
13068
13069_Syntax_:
13070     `CALL LTIME(TIME, VALUES)'
13071
13072_Arguments_:
13073     TIME       An `INTEGER' scalar expression corresponding
13074                to a system time, with `INTENT(IN)'.
13075     VALUES     A default `INTEGER' array with 9 elements,
13076                with `INTENT(OUT)'.
13077
13078_Return value_:
13079     The elements of VALUES are assigned as follows:
13080       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
13081          seconds
13082
13083       2. Minutes after the hour, range 0-59
13084
13085       3. Hours past midnight, range 0-23
13086
13087       4. Day of month, range 0-31
13088
13089       5. Number of months since January, range 0-12
13090
13091       6. Years since 1900
13092
13093       7. Number of days since Sunday, range 0-6
13094
13095       8. Days since January 1
13096
13097       9. Daylight savings indicator: positive if daylight savings is in
13098          effect, zero if not, and negative if the information is not
13099          available.
13100
13101_See also_:
13102     *note CTIME::, *note GMTIME::, *note TIME::, *note TIME8::
13103
13104
13105
13106File: gfortran.info,  Node: MALLOC,  Next: MASKL,  Prev: LTIME,  Up: Intrinsic Procedures
13107
131089.175 `MALLOC' -- Allocate dynamic memory
13109=========================================
13110
13111_Description_:
13112     `MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
13113     the address of the allocated memory. The `MALLOC' intrinsic is an
13114     extension intended to be used with Cray pointers, and is provided
13115     in GNU Fortran to allow the user to compile legacy code. For new
13116     code using Fortran 95 pointers, the memory allocation intrinsic is
13117     `ALLOCATE'.
13118
13119_Standard_:
13120     GNU extension
13121
13122_Class_:
13123     Function
13124
13125_Syntax_:
13126     `PTR = MALLOC(SIZE)'
13127
13128_Arguments_:
13129     SIZE       The type shall be `INTEGER'.
13130
13131_Return value_:
13132     The return value is of type `INTEGER(K)', with K such that
13133     variables of type `INTEGER(K)' have the same size as C pointers
13134     (`sizeof(void *)').
13135
13136_Example_:
13137     The following example demonstrates the use of `MALLOC' and `FREE'
13138     with Cray pointers.
13139
13140          program test_malloc
13141            implicit none
13142            integer i
13143            real*8 x(*), z
13144            pointer(ptr_x,x)
13145
13146            ptr_x = malloc(20*8)
13147            do i = 1, 20
13148              x(i) = sqrt(1.0d0 / i)
13149            end do
13150            z = 0
13151            do i = 1, 20
13152              z = z + x(i)
13153              print *, z
13154            end do
13155            call free(ptr_x)
13156          end program test_malloc
13157
13158_See also_:
13159     *note FREE::
13160
13161
13162File: gfortran.info,  Node: MASKL,  Next: MASKR,  Prev: MALLOC,  Up: Intrinsic Procedures
13163
131649.176 `MASKL' -- Left justified mask
13165====================================
13166
13167_Description_:
13168     `MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
13169     remaining bits set to 0.
13170
13171_Standard_:
13172     Fortran 2008 and later
13173
13174_Class_:
13175     Elemental function
13176
13177_Syntax_:
13178     `RESULT = MASKL(I[, KIND])'
13179
13180_Arguments_:
13181     I          Shall be of type `INTEGER'.
13182     KIND       Shall be a scalar constant expression of type
13183                `INTEGER'.
13184
13185_Return value_:
13186     The return value is of type `INTEGER'. If KIND is present, it
13187     specifies the kind value of the return type; otherwise, it is of
13188     the default integer kind.
13189
13190_See also_:
13191     *note MASKR::
13192
13193
13194File: gfortran.info,  Node: MASKR,  Next: MATMUL,  Prev: MASKL,  Up: Intrinsic Procedures
13195
131969.177 `MASKR' -- Right justified mask
13197=====================================
13198
13199_Description_:
13200     `MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
13201     remaining bits set to 0.
13202
13203_Standard_:
13204     Fortran 2008 and later
13205
13206_Class_:
13207     Elemental function
13208
13209_Syntax_:
13210     `RESULT = MASKR(I[, KIND])'
13211
13212_Arguments_:
13213     I          Shall be of type `INTEGER'.
13214     KIND       Shall be a scalar constant expression of type
13215                `INTEGER'.
13216
13217_Return value_:
13218     The return value is of type `INTEGER'. If KIND is present, it
13219     specifies the kind value of the return type; otherwise, it is of
13220     the default integer kind.
13221
13222_See also_:
13223     *note MASKL::
13224
13225
13226File: gfortran.info,  Node: MATMUL,  Next: MAX,  Prev: MASKR,  Up: Intrinsic Procedures
13227
132289.178 `MATMUL' -- matrix multiplication
13229=======================================
13230
13231_Description_:
13232     Performs a matrix multiplication on numeric or logical arguments.
13233
13234_Standard_:
13235     Fortran 95 and later
13236
13237_Class_:
13238     Transformational function
13239
13240_Syntax_:
13241     `RESULT = MATMUL(MATRIX_A, MATRIX_B)'
13242
13243_Arguments_:
13244     MATRIX_A   An array of `INTEGER', `REAL', `COMPLEX', or
13245                `LOGICAL' type, with a rank of one or two.
13246     MATRIX_B   An array of `INTEGER', `REAL', or `COMPLEX'
13247                type if MATRIX_A is of a numeric type;
13248                otherwise, an array of `LOGICAL' type. The
13249                rank shall be one or two, and the first (or
13250                only) dimension of MATRIX_B shall be equal to
13251                the last (or only) dimension of MATRIX_A.
13252
13253_Return value_:
13254     The matrix product of MATRIX_A and MATRIX_B.  The type and kind of
13255     the result follow the usual type and kind promotion rules, as for
13256     the `*' or `.AND.' operators.
13257
13258_See also_:
13259
13260
13261File: gfortran.info,  Node: MAX,  Next: MAXEXPONENT,  Prev: MATMUL,  Up: Intrinsic Procedures
13262
132639.179 `MAX' -- Maximum value of an argument list
13264================================================
13265
13266_Description_:
13267     Returns the argument with the largest (most positive) value.
13268
13269_Standard_:
13270     Fortran 77 and later
13271
13272_Class_:
13273     Elemental function
13274
13275_Syntax_:
13276     `RESULT = MAX(A1, A2 [, A3 [, ...]])'
13277
13278_Arguments_:
13279     A1         The type shall be `INTEGER' or `REAL'.
13280     A2, A3,    An expression of the same type and kind as A1.
13281     ...        (As a GNU extension, arguments of different
13282                kinds are permitted.)
13283
13284_Return value_:
13285     The return value corresponds to the maximum value among the
13286     arguments, and has the same type and kind as the first argument.
13287
13288_Specific names_:
13289     Name          Argument      Return type   Standard
13290     `MAX0(A1)'    `INTEGER(4)   `INTEGER(4)'  Fortran 77 and
13291                   A1'                         later
13292     `AMAX0(A1)'   `INTEGER(4)   `REAL(MAX(X))'Fortran 77 and
13293                   A1'                         later
13294     `MAX1(A1)'    `REAL A1'     `INT(MAX(X))' Fortran 77 and
13295                                               later
13296     `AMAX1(A1)'   `REAL(4) A1'  `REAL(4)'     Fortran 77 and
13297                                               later
13298     `DMAX1(A1)'   `REAL(8) A1'  `REAL(8)'     Fortran 77 and
13299                                               later
13300
13301_See also_:
13302     *note MAXLOC:: *note MAXVAL::, *note MIN::
13303
13304
13305
13306File: gfortran.info,  Node: MAXEXPONENT,  Next: MAXLOC,  Prev: MAX,  Up: Intrinsic Procedures
13307
133089.180 `MAXEXPONENT' -- Maximum exponent of a real kind
13309======================================================
13310
13311_Description_:
13312     `MAXEXPONENT(X)' returns the maximum exponent in the model of the
13313     type of `X'.
13314
13315_Standard_:
13316     Fortran 95 and later
13317
13318_Class_:
13319     Inquiry function
13320
13321_Syntax_:
13322     `RESULT = MAXEXPONENT(X)'
13323
13324_Arguments_:
13325     X          Shall be of type `REAL'.
13326
13327_Return value_:
13328     The return value is of type `INTEGER' and of the default integer
13329     kind.
13330
13331_Example_:
13332          program exponents
13333            real(kind=4) :: x
13334            real(kind=8) :: y
13335
13336            print *, minexponent(x), maxexponent(x)
13337            print *, minexponent(y), maxexponent(y)
13338          end program exponents
13339
13340
13341File: gfortran.info,  Node: MAXLOC,  Next: MAXVAL,  Prev: MAXEXPONENT,  Up: Intrinsic Procedures
13342
133439.181 `MAXLOC' -- Location of the maximum value within an array
13344===============================================================
13345
13346_Description_:
13347     Determines the location of the element in the array with the
13348     maximum value, or, if the DIM argument is supplied, determines the
13349     locations of the maximum element along each row of the array in the
13350     DIM direction.  If MASK is present, only the elements for which
13351     MASK is `.TRUE.' are considered.  If more than one element in the
13352     array has the maximum value, the location returned is that of the
13353     first such element in array element order.  If the array has zero
13354     size, or all of the elements of MASK are `.FALSE.', then the
13355     result is an array of zeroes.  Similarly, if DIM is supplied and
13356     all of the elements of MASK along a given row are zero, the result
13357     value for that row is zero.
13358
13359_Standard_:
13360     Fortran 95 and later
13361
13362_Class_:
13363     Transformational function
13364
13365_Syntax_:
13366     `RESULT = MAXLOC(ARRAY, DIM [, MASK])'
13367     `RESULT = MAXLOC(ARRAY [, MASK])'
13368
13369_Arguments_:
13370     ARRAY      Shall be an array of type `INTEGER' or `REAL'.
13371     DIM        (Optional) Shall be a scalar of type
13372                `INTEGER', with a value between one and the
13373                rank of ARRAY, inclusive.  It may not be an
13374                optional dummy argument.
13375     MASK       Shall be an array of type `LOGICAL', and
13376                conformable with ARRAY.
13377
13378_Return value_:
13379     If DIM is absent, the result is a rank-one array with a length
13380     equal to the rank of ARRAY.  If DIM is present, the result is an
13381     array with a rank one less than the rank of ARRAY, and a size
13382     corresponding to the size of ARRAY with the DIM dimension removed.
13383     If DIM is present and ARRAY has a rank of one, the result is a
13384     scalar.  In all cases, the result is of default `INTEGER' type.
13385
13386_See also_:
13387     *note MAX::, *note MAXVAL::
13388
13389
13390
13391File: gfortran.info,  Node: MAXVAL,  Next: MCLOCK,  Prev: MAXLOC,  Up: Intrinsic Procedures
13392
133939.182 `MAXVAL' -- Maximum value of an array
13394===========================================
13395
13396_Description_:
13397     Determines the maximum value of the elements in an array value,
13398     or, if the DIM argument is supplied, determines the maximum value
13399     along each row of the array in the DIM direction.  If MASK is
13400     present, only the elements for which MASK is `.TRUE.' are
13401     considered.  If the array has zero size, or all of the elements of
13402     MASK are `.FALSE.', then the result is `-HUGE(ARRAY)' if ARRAY is
13403     numeric, or a string of nulls if ARRAY is of character type.
13404
13405_Standard_:
13406     Fortran 95 and later
13407
13408_Class_:
13409     Transformational function
13410
13411_Syntax_:
13412     `RESULT = MAXVAL(ARRAY, DIM [, MASK])'
13413     `RESULT = MAXVAL(ARRAY [, MASK])'
13414
13415_Arguments_:
13416     ARRAY      Shall be an array of type `INTEGER' or `REAL'.
13417     DIM        (Optional) Shall be a scalar of type
13418                `INTEGER', with a value between one and the
13419                rank of ARRAY, inclusive.  It may not be an
13420                optional dummy argument.
13421     MASK       Shall be an array of type `LOGICAL', and
13422                conformable with ARRAY.
13423
13424_Return value_:
13425     If DIM is absent, or if ARRAY has a rank of one, the result is a
13426     scalar.  If DIM is present, the result is an array with a rank one
13427     less than the rank of ARRAY, and a size corresponding to the size
13428     of ARRAY with the DIM dimension removed.  In all cases, the result
13429     is of the same type and kind as ARRAY.
13430
13431_See also_:
13432     *note MAX::, *note MAXLOC::
13433
13434
13435File: gfortran.info,  Node: MCLOCK,  Next: MCLOCK8,  Prev: MAXVAL,  Up: Intrinsic Procedures
13436
134379.183 `MCLOCK' -- Time function
13438===============================
13439
13440_Description_:
13441     Returns the number of clock ticks since the start of the process,
13442     based on the function `clock(3)' in the C standard library.
13443
13444     This intrinsic is not fully portable, such as to systems with
13445     32-bit `INTEGER' types but supporting times wider than 32 bits.
13446     Therefore, the values returned by this intrinsic might be, or
13447     become, negative, or numerically less than previous values, during
13448     a single run of the compiled program.
13449
13450_Standard_:
13451     GNU extension
13452
13453_Class_:
13454     Function
13455
13456_Syntax_:
13457     `RESULT = MCLOCK()'
13458
13459_Return value_:
13460     The return value is a scalar of type `INTEGER(4)', equal to the
13461     number of clock ticks since the start of the process, or `-1' if
13462     the system does not support `clock(3)'.
13463
13464_See also_:
13465     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::,
13466     *note TIME::
13467
13468
13469
13470File: gfortran.info,  Node: MCLOCK8,  Next: MERGE,  Prev: MCLOCK,  Up: Intrinsic Procedures
13471
134729.184 `MCLOCK8' -- Time function (64-bit)
13473=========================================
13474
13475_Description_:
13476     Returns the number of clock ticks since the start of the process,
13477     based on the function `clock(3)' in the C standard library.
13478
13479     _Warning:_ this intrinsic does not increase the range of the timing
13480     values over that returned by `clock(3)'. On a system with a 32-bit
13481     `clock(3)', `MCLOCK8' will return a 32-bit value, even though it
13482     is converted to a 64-bit `INTEGER(8)' value. That means overflows
13483     of the 32-bit value can still occur. Therefore, the values
13484     returned by this intrinsic might be or become negative or
13485     numerically less than previous values during a single run of the
13486     compiled program.
13487
13488_Standard_:
13489     GNU extension
13490
13491_Class_:
13492     Function
13493
13494_Syntax_:
13495     `RESULT = MCLOCK8()'
13496
13497_Return value_:
13498     The return value is a scalar of type `INTEGER(8)', equal to the
13499     number of clock ticks since the start of the process, or `-1' if
13500     the system does not support `clock(3)'.
13501
13502_See also_:
13503     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::,
13504     *note TIME8::
13505
13506
13507
13508File: gfortran.info,  Node: MERGE,  Next: MERGE_BITS,  Prev: MCLOCK8,  Up: Intrinsic Procedures
13509
135109.185 `MERGE' -- Merge variables
13511================================
13512
13513_Description_:
13514     Select values from two arrays according to a logical mask.  The
13515     result is equal to TSOURCE if MASK is `.TRUE.', or equal to
13516     FSOURCE if it is `.FALSE.'.
13517
13518_Standard_:
13519     Fortran 95 and later
13520
13521_Class_:
13522     Elemental function
13523
13524_Syntax_:
13525     `RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
13526
13527_Arguments_:
13528     TSOURCE    May be of any type.
13529     FSOURCE    Shall be of the same type and type parameters
13530                as TSOURCE.
13531     MASK       Shall be of type `LOGICAL'.
13532
13533_Return value_:
13534     The result is of the same type and type parameters as TSOURCE.
13535
13536
13537
13538File: gfortran.info,  Node: MERGE_BITS,  Next: MIN,  Prev: MERGE,  Up: Intrinsic Procedures
13539
135409.186 `MERGE_BITS' -- Merge of bits under mask
13541==============================================
13542
13543_Description_:
13544     `MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
13545     by the mask.  The i-th bit of the result is equal to the i-th bit
13546     of I if the i-th bit of MASK is 1; it is equal to the i-th bit of
13547     J otherwise.
13548
13549_Standard_:
13550     Fortran 2008 and later
13551
13552_Class_:
13553     Elemental function
13554
13555_Syntax_:
13556     `RESULT = MERGE_BITS(I, J, MASK)'
13557
13558_Arguments_:
13559     I          Shall be of type `INTEGER'.
13560     J          Shall be of type `INTEGER' and of the same
13561                kind as I.
13562     MASK       Shall be of type `INTEGER' and of the same
13563                kind as I.
13564
13565_Return value_:
13566     The result is of the same type and kind as I.
13567
13568
13569
13570File: gfortran.info,  Node: MIN,  Next: MINEXPONENT,  Prev: MERGE_BITS,  Up: Intrinsic Procedures
13571
135729.187 `MIN' -- Minimum value of an argument list
13573================================================
13574
13575_Description_:
13576     Returns the argument with the smallest (most negative) value.
13577
13578_Standard_:
13579     Fortran 77 and later
13580
13581_Class_:
13582     Elemental function
13583
13584_Syntax_:
13585     `RESULT = MIN(A1, A2 [, A3, ...])'
13586
13587_Arguments_:
13588     A1         The type shall be `INTEGER' or `REAL'.
13589     A2, A3,    An expression of the same type and kind as A1.
13590     ...        (As a GNU extension, arguments of different
13591                kinds are permitted.)
13592
13593_Return value_:
13594     The return value corresponds to the maximum value among the
13595     arguments, and has the same type and kind as the first argument.
13596
13597_Specific names_:
13598     Name          Argument      Return type   Standard
13599     `MIN0(A1)'    `INTEGER(4)   `INTEGER(4)'  Fortran 77 and
13600                   A1'                         later
13601     `AMIN0(A1)'   `INTEGER(4)   `REAL(4)'     Fortran 77 and
13602                   A1'                         later
13603     `MIN1(A1)'    `REAL A1'     `INTEGER(4)'  Fortran 77 and
13604                                               later
13605     `AMIN1(A1)'   `REAL(4) A1'  `REAL(4)'     Fortran 77 and
13606                                               later
13607     `DMIN1(A1)'   `REAL(8) A1'  `REAL(8)'     Fortran 77 and
13608                                               later
13609
13610_See also_:
13611     *note MAX::, *note MINLOC::, *note MINVAL::
13612
13613
13614File: gfortran.info,  Node: MINEXPONENT,  Next: MINLOC,  Prev: MIN,  Up: Intrinsic Procedures
13615
136169.188 `MINEXPONENT' -- Minimum exponent of a real kind
13617======================================================
13618
13619_Description_:
13620     `MINEXPONENT(X)' returns the minimum exponent in the model of the
13621     type of `X'.
13622
13623_Standard_:
13624     Fortran 95 and later
13625
13626_Class_:
13627     Inquiry function
13628
13629_Syntax_:
13630     `RESULT = MINEXPONENT(X)'
13631
13632_Arguments_:
13633     X          Shall be of type `REAL'.
13634
13635_Return value_:
13636     The return value is of type `INTEGER' and of the default integer
13637     kind.
13638
13639_Example_:
13640     See `MAXEXPONENT' for an example.
13641
13642
13643File: gfortran.info,  Node: MINLOC,  Next: MINVAL,  Prev: MINEXPONENT,  Up: Intrinsic Procedures
13644
136459.189 `MINLOC' -- Location of the minimum value within an array
13646===============================================================
13647
13648_Description_:
13649     Determines the location of the element in the array with the
13650     minimum value, or, if the DIM argument is supplied, determines the
13651     locations of the minimum element along each row of the array in the
13652     DIM direction.  If MASK is present, only the elements for which
13653     MASK is `.TRUE.' are considered.  If more than one element in the
13654     array has the minimum value, the location returned is that of the
13655     first such element in array element order.  If the array has zero
13656     size, or all of the elements of MASK are `.FALSE.', then the
13657     result is an array of zeroes.  Similarly, if DIM is supplied and
13658     all of the elements of MASK along a given row are zero, the result
13659     value for that row is zero.
13660
13661_Standard_:
13662     Fortran 95 and later
13663
13664_Class_:
13665     Transformational function
13666
13667_Syntax_:
13668     `RESULT = MINLOC(ARRAY, DIM [, MASK])'
13669     `RESULT = MINLOC(ARRAY [, MASK])'
13670
13671_Arguments_:
13672     ARRAY      Shall be an array of type `INTEGER' or `REAL'.
13673     DIM        (Optional) Shall be a scalar of type
13674                `INTEGER', with a value between one and the
13675                rank of ARRAY, inclusive.  It may not be an
13676                optional dummy argument.
13677     MASK       Shall be an array of type `LOGICAL', and
13678                conformable with ARRAY.
13679
13680_Return value_:
13681     If DIM is absent, the result is a rank-one array with a length
13682     equal to the rank of ARRAY.  If DIM is present, the result is an
13683     array with a rank one less than the rank of ARRAY, and a size
13684     corresponding to the size of ARRAY with the DIM dimension removed.
13685     If DIM is present and ARRAY has a rank of one, the result is a
13686     scalar.  In all cases, the result is of default `INTEGER' type.
13687
13688_See also_:
13689     *note MIN::, *note MINVAL::
13690
13691
13692
13693File: gfortran.info,  Node: MINVAL,  Next: MOD,  Prev: MINLOC,  Up: Intrinsic Procedures
13694
136959.190 `MINVAL' -- Minimum value of an array
13696===========================================
13697
13698_Description_:
13699     Determines the minimum value of the elements in an array value,
13700     or, if the DIM argument is supplied, determines the minimum value
13701     along each row of the array in the DIM direction.  If MASK is
13702     present, only the elements for which MASK is `.TRUE.' are
13703     considered.  If the array has zero size, or all of the elements of
13704     MASK are `.FALSE.', then the result is `HUGE(ARRAY)' if ARRAY is
13705     numeric, or a string of `CHAR(255)' characters if ARRAY is of
13706     character type.
13707
13708_Standard_:
13709     Fortran 95 and later
13710
13711_Class_:
13712     Transformational function
13713
13714_Syntax_:
13715     `RESULT = MINVAL(ARRAY, DIM [, MASK])'
13716     `RESULT = MINVAL(ARRAY [, MASK])'
13717
13718_Arguments_:
13719     ARRAY      Shall be an array of type `INTEGER' or `REAL'.
13720     DIM        (Optional) Shall be a scalar of type
13721                `INTEGER', with a value between one and the
13722                rank of ARRAY, inclusive.  It may not be an
13723                optional dummy argument.
13724     MASK       Shall be an array of type `LOGICAL', and
13725                conformable with ARRAY.
13726
13727_Return value_:
13728     If DIM is absent, or if ARRAY has a rank of one, the result is a
13729     scalar.  If DIM is present, the result is an array with a rank one
13730     less than the rank of ARRAY, and a size corresponding to the size
13731     of ARRAY with the DIM dimension removed.  In all cases, the result
13732     is of the same type and kind as ARRAY.
13733
13734_See also_:
13735     *note MIN::, *note MINLOC::
13736
13737
13738
13739File: gfortran.info,  Node: MOD,  Next: MODULO,  Prev: MINVAL,  Up: Intrinsic Procedures
13740
137419.191 `MOD' -- Remainder function
13742=================================
13743
13744_Description_:
13745     `MOD(A,P)' computes the remainder of the division of A by P.
13746
13747_Standard_:
13748     Fortran 77 and later
13749
13750_Class_:
13751     Elemental function
13752
13753_Syntax_:
13754     `RESULT = MOD(A, P)'
13755
13756_Arguments_:
13757     A          Shall be a scalar of type `INTEGER' or `REAL'.
13758     P          Shall be a scalar of the same type and kind as
13759                A and not equal to zero.
13760
13761_Return value_:
13762     The return value is the result of `A - (INT(A/P) * P)'. The type
13763     and kind of the return value is the same as that of the arguments.
13764     The returned value has the same sign as A and a magnitude less
13765     than the magnitude of P.
13766
13767_Example_:
13768          program test_mod
13769            print *, mod(17,3)
13770            print *, mod(17.5,5.5)
13771            print *, mod(17.5d0,5.5)
13772            print *, mod(17.5,5.5d0)
13773
13774            print *, mod(-17,3)
13775            print *, mod(-17.5,5.5)
13776            print *, mod(-17.5d0,5.5)
13777            print *, mod(-17.5,5.5d0)
13778
13779            print *, mod(17,-3)
13780            print *, mod(17.5,-5.5)
13781            print *, mod(17.5d0,-5.5)
13782            print *, mod(17.5,-5.5d0)
13783          end program test_mod
13784
13785_Specific names_:
13786     Name          Arguments     Return type   Standard
13787     `MOD(A,P)'    `INTEGER      `INTEGER'     Fortran 95 and
13788                   A,P'                        later
13789     `AMOD(A,P)'   `REAL(4)      `REAL(4)'     Fortran 95 and
13790                   A,P'                        later
13791     `DMOD(A,P)'   `REAL(8)      `REAL(8)'     Fortran 95 and
13792                   A,P'                        later
13793
13794_See also_:
13795     *note MODULO::
13796
13797
13798
13799File: gfortran.info,  Node: MODULO,  Next: MOVE_ALLOC,  Prev: MOD,  Up: Intrinsic Procedures
13800
138019.192 `MODULO' -- Modulo function
13802=================================
13803
13804_Description_:
13805     `MODULO(A,P)' computes the A modulo P.
13806
13807_Standard_:
13808     Fortran 95 and later
13809
13810_Class_:
13811     Elemental function
13812
13813_Syntax_:
13814     `RESULT = MODULO(A, P)'
13815
13816_Arguments_:
13817     A          Shall be a scalar of type `INTEGER' or `REAL'.
13818     P          Shall be a scalar of the same type and kind as
13819                A.  It shall not be zero.
13820
13821_Return value_:
13822     The type and kind of the result are those of the arguments.
13823    If A and P are of type `INTEGER':
13824          `MODULO(A,P)' has the value R such that `A=Q*P+R', where Q is
13825          an integer and R is between 0 (inclusive) and P (exclusive).
13826
13827    If A and P are of type `REAL':
13828          `MODULO(A,P)' has the value of `A - FLOOR (A / P) * P'.
13829     The returned value has the same sign as P and a magnitude less than
13830     the magnitude of P.
13831
13832_Example_:
13833          program test_modulo
13834            print *, modulo(17,3)
13835            print *, modulo(17.5,5.5)
13836
13837            print *, modulo(-17,3)
13838            print *, modulo(-17.5,5.5)
13839
13840            print *, modulo(17,-3)
13841            print *, modulo(17.5,-5.5)
13842          end program
13843
13844_See also_:
13845     *note MOD::
13846
13847
13848
13849File: gfortran.info,  Node: MOVE_ALLOC,  Next: MVBITS,  Prev: MODULO,  Up: Intrinsic Procedures
13850
138519.193 `MOVE_ALLOC' -- Move allocation from one object to another
13852================================================================
13853
13854_Description_:
13855     `MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO.  FROM
13856     will become deallocated in the process.
13857
13858_Standard_:
13859     Fortran 2003 and later
13860
13861_Class_:
13862     Pure subroutine
13863
13864_Syntax_:
13865     `CALL MOVE_ALLOC(FROM, TO)'
13866
13867_Arguments_:
13868     FROM       `ALLOCATABLE', `INTENT(INOUT)', may be of any
13869                type and kind.
13870     TO         `ALLOCATABLE', `INTENT(OUT)', shall be of the
13871                same type, kind and rank as FROM.
13872
13873_Return value_:
13874     None
13875
13876_Example_:
13877          program test_move_alloc
13878              integer, allocatable :: a(:), b(:)
13879
13880              allocate(a(3))
13881              a = [ 1, 2, 3 ]
13882              call move_alloc(a, b)
13883              print *, allocated(a), allocated(b)
13884              print *, b
13885          end program test_move_alloc
13886
13887
13888File: gfortran.info,  Node: MVBITS,  Next: NEAREST,  Prev: MOVE_ALLOC,  Up: Intrinsic Procedures
13889
138909.194 `MVBITS' -- Move bits from one integer to another
13891=======================================================
13892
13893_Description_:
13894     Moves LEN bits from positions FROMPOS through `FROMPOS+LEN-1' of
13895     FROM to positions TOPOS through `TOPOS+LEN-1' of TO. The portion
13896     of argument TO not affected by the movement of bits is unchanged.
13897     The values of `FROMPOS+LEN-1' and `TOPOS+LEN-1' must be less than
13898     `BIT_SIZE(FROM)'.
13899
13900_Standard_:
13901     Fortran 95 and later
13902
13903_Class_:
13904     Elemental subroutine
13905
13906_Syntax_:
13907     `CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
13908
13909_Arguments_:
13910     FROM       The type shall be `INTEGER'.
13911     FROMPOS    The type shall be `INTEGER'.
13912     LEN        The type shall be `INTEGER'.
13913     TO         The type shall be `INTEGER', of the same kind
13914                as FROM.
13915     TOPOS      The type shall be `INTEGER'.
13916
13917_See also_:
13918     *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
13919     IOR::, *note IEOR::
13920
13921
13922File: gfortran.info,  Node: NEAREST,  Next: NEW_LINE,  Prev: MVBITS,  Up: Intrinsic Procedures
13923
139249.195 `NEAREST' -- Nearest representable number
13925===============================================
13926
13927_Description_:
13928     `NEAREST(X, S)' returns the processor-representable number nearest
13929     to `X' in the direction indicated by the sign of `S'.
13930
13931_Standard_:
13932     Fortran 95 and later
13933
13934_Class_:
13935     Elemental function
13936
13937_Syntax_:
13938     `RESULT = NEAREST(X, S)'
13939
13940_Arguments_:
13941     X          Shall be of type `REAL'.
13942     S          Shall be of type `REAL' and not equal to zero.
13943
13944_Return value_:
13945     The return value is of the same type as `X'. If `S' is positive,
13946     `NEAREST' returns the processor-representable number greater than
13947     `X' and nearest to it. If `S' is negative, `NEAREST' returns the
13948     processor-representable number smaller than `X' and nearest to it.
13949
13950_Example_:
13951          program test_nearest
13952            real :: x, y
13953            x = nearest(42.0, 1.0)
13954            y = nearest(42.0, -1.0)
13955            write (*,"(3(G20.15))") x, y, x - y
13956          end program test_nearest
13957
13958
13959File: gfortran.info,  Node: NEW_LINE,  Next: NINT,  Prev: NEAREST,  Up: Intrinsic Procedures
13960
139619.196 `NEW_LINE' -- New line character
13962======================================
13963
13964_Description_:
13965     `NEW_LINE(C)' returns the new-line character.
13966
13967_Standard_:
13968     Fortran 2003 and later
13969
13970_Class_:
13971     Inquiry function
13972
13973_Syntax_:
13974     `RESULT = NEW_LINE(C)'
13975
13976_Arguments_:
13977     C          The argument shall be a scalar or array of the
13978                type `CHARACTER'.
13979
13980_Return value_:
13981     Returns a CHARACTER scalar of length one with the new-line
13982     character of the same kind as parameter C.
13983
13984_Example_:
13985          program newline
13986            implicit none
13987            write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
13988          end program newline
13989
13990
13991File: gfortran.info,  Node: NINT,  Next: NORM2,  Prev: NEW_LINE,  Up: Intrinsic Procedures
13992
139939.197 `NINT' -- Nearest whole number
13994====================================
13995
13996_Description_:
13997     `NINT(A)' rounds its argument to the nearest whole number.
13998
13999_Standard_:
14000     Fortran 77 and later, with KIND argument Fortran 90 and later
14001
14002_Class_:
14003     Elemental function
14004
14005_Syntax_:
14006     `RESULT = NINT(A [, KIND])'
14007
14008_Arguments_:
14009     A          The type of the argument shall be `REAL'.
14010     KIND       (Optional) An `INTEGER' initialization
14011                expression indicating the kind parameter of
14012                the result.
14013
14014_Return value_:
14015     Returns A with the fractional portion of its magnitude eliminated
14016     by rounding to the nearest whole number and with its sign
14017     preserved, converted to an `INTEGER' of the default kind.
14018
14019_Example_:
14020          program test_nint
14021            real(4) x4
14022            real(8) x8
14023            x4 = 1.234E0_4
14024            x8 = 4.321_8
14025            print *, nint(x4), idnint(x8)
14026          end program test_nint
14027
14028_Specific names_:
14029     Name          Argument      Return Type   Standard
14030     `NINT(A)'     `REAL(4) A'   `INTEGER'     Fortran 95 and
14031                                               later
14032     `IDNINT(A)'   `REAL(8) A'   `INTEGER'     Fortran 95 and
14033                                               later
14034
14035_See also_:
14036     *note CEILING::, *note FLOOR::
14037
14038
14039
14040File: gfortran.info,  Node: NORM2,  Next: NOT,  Prev: NINT,  Up: Intrinsic Procedures
14041
140429.198 `NORM2' -- Euclidean vector norms
14043=======================================
14044
14045_Description_:
14046     Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
14047     dimension DIM.
14048
14049_Standard_:
14050     Fortran 2008 and later
14051
14052_Class_:
14053     Transformational function
14054
14055_Syntax_:
14056     `RESULT = NORM2(ARRAY[, DIM])'
14057
14058_Arguments_:
14059     ARRAY      Shall be an array of type `REAL'
14060     DIM        (Optional) shall be a scalar of type `INTEGER'
14061                with a value in the range from 1 to n, where n
14062                equals the rank of ARRAY.
14063
14064_Return value_:
14065     The result is of the same type as ARRAY.
14066
14067     If DIM is absent, a scalar with the square root of the sum of all
14068     elements in ARRAY squared  is returned. Otherwise, an array of
14069     rank n-1, where n equals the rank of ARRAY, and a shape similar to
14070     that of ARRAY with dimension DIM dropped is returned.
14071
14072_Example_:
14073          PROGRAM test_sum
14074            REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
14075            print *, NORM2(x)  ! = sqrt(55.) ~ 7.416
14076          END PROGRAM
14077
14078
14079File: gfortran.info,  Node: NOT,  Next: NULL,  Prev: NORM2,  Up: Intrinsic Procedures
14080
140819.199 `NOT' -- Logical negation
14082===============================
14083
14084_Description_:
14085     `NOT' returns the bitwise Boolean inverse of I.
14086
14087_Standard_:
14088     Fortran 95 and later
14089
14090_Class_:
14091     Elemental function
14092
14093_Syntax_:
14094     `RESULT = NOT(I)'
14095
14096_Arguments_:
14097     I          The type shall be `INTEGER'.
14098
14099_Return value_:
14100     The return type is `INTEGER', of the same kind as the argument.
14101
14102_See also_:
14103     *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
14104     IBSET::, *note IBCLR::
14105
14106
14107
14108File: gfortran.info,  Node: NULL,  Next: NUM_IMAGES,  Prev: NOT,  Up: Intrinsic Procedures
14109
141109.200 `NULL' -- Function that returns an disassociated pointer
14111==============================================================
14112
14113_Description_:
14114     Returns a disassociated pointer.
14115
14116     If MOLD is present, a disassociated pointer of the same type is
14117     returned, otherwise the type is determined by context.
14118
14119     In Fortran 95, MOLD is optional. Please note that Fortran 2003
14120     includes cases where it is required.
14121
14122_Standard_:
14123     Fortran 95 and later
14124
14125_Class_:
14126     Transformational function
14127
14128_Syntax_:
14129     `PTR => NULL([MOLD])'
14130
14131_Arguments_:
14132     MOLD       (Optional) shall be a pointer of any
14133                association status and of any type.
14134
14135_Return value_:
14136     A disassociated pointer.
14137
14138_Example_:
14139          REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
14140
14141_See also_:
14142     *note ASSOCIATED::
14143
14144
14145File: gfortran.info,  Node: NUM_IMAGES,  Next: OR,  Prev: NULL,  Up: Intrinsic Procedures
14146
141479.201 `NUM_IMAGES' -- Function that returns the number of images
14148================================================================
14149
14150_Description_:
14151     Returns the number of images.
14152
14153_Standard_:
14154     Fortran 2008 and later. With DISTANCE or FAILED argument,
14155     Technical Specification (TS) 18508 or later
14156
14157_Class_:
14158     Transformational function
14159
14160_Syntax_:
14161     `RESULT = NUM_IMAGES(DISTANCE, FAILED)'
14162
14163_Arguments_:
14164     DISTANCE   (optional, intent(in)) Nonnegative scalar
14165                integer
14166     FAILED     (optional, intent(in)) Scalar logical
14167                expression
14168
14169_Return value_:
14170     Scalar default-kind integer.  If DISTANCE is not present or has
14171     value 0, the number of images in the current team is returned. For
14172     values smaller or equal distance to the initial team, it returns
14173     the number of images index on the ancestor team which has a
14174     distance of DISTANCE from the invoking team. If DISTANCE is larger
14175     than the distance to the initial team, the number of images of the
14176     initial team is returned. If FAILED is not present the total
14177     number of images is returned; if it has the value `.TRUE.', the
14178     number of failed images is returned, otherwise, the number of
14179     images which do have not the failed status.
14180
14181_Example_:
14182          INTEGER :: value[*]
14183          INTEGER :: i
14184          value = THIS_IMAGE()
14185          SYNC ALL
14186          IF (THIS_IMAGE() == 1) THEN
14187            DO i = 1, NUM_IMAGES()
14188              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
14189            END DO
14190          END IF
14191
14192_See also_:
14193     *note THIS_IMAGE::, *note IMAGE_INDEX::
14194
14195
14196File: gfortran.info,  Node: OR,  Next: PACK,  Prev: NUM_IMAGES,  Up: Intrinsic Procedures
14197
141989.202 `OR' -- Bitwise logical OR
14199================================
14200
14201_Description_:
14202     Bitwise logical `OR'.
14203
14204     This intrinsic routine is provided for backwards compatibility with
14205     GNU Fortran 77.  For integer arguments, programmers should consider
14206     the use of the *note IOR:: intrinsic defined by the Fortran
14207     standard.
14208
14209_Standard_:
14210     GNU extension
14211
14212_Class_:
14213     Function
14214
14215_Syntax_:
14216     `RESULT = OR(I, J)'
14217
14218_Arguments_:
14219     I          The type shall be either a scalar `INTEGER'
14220                type or a scalar `LOGICAL' type.
14221     J          The type shall be the same as the type of J.
14222
14223_Return value_:
14224     The return type is either a scalar `INTEGER' or a scalar
14225     `LOGICAL'.  If the kind type parameters differ, then the smaller
14226     kind type is implicitly converted to larger kind, and the return
14227     has the larger kind.
14228
14229_Example_:
14230          PROGRAM test_or
14231            LOGICAL :: T = .TRUE., F = .FALSE.
14232            INTEGER :: a, b
14233            DATA a / Z'F' /, b / Z'3' /
14234
14235            WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
14236            WRITE (*,*) OR(a, b)
14237          END PROGRAM
14238
14239_See also_:
14240     Fortran 95 elemental function: *note IOR::
14241
14242
14243File: gfortran.info,  Node: PACK,  Next: PARITY,  Prev: OR,  Up: Intrinsic Procedures
14244
142459.203 `PACK' -- Pack an array into an array of rank one
14246=======================================================
14247
14248_Description_:
14249     Stores the elements of ARRAY in an array of rank one.
14250
14251     The beginning of the resulting array is made up of elements whose
14252     MASK equals `TRUE'. Afterwards, positions are filled with elements
14253     taken from VECTOR.
14254
14255_Standard_:
14256     Fortran 95 and later
14257
14258_Class_:
14259     Transformational function
14260
14261_Syntax_:
14262     `RESULT = PACK(ARRAY, MASK[,VECTOR])'
14263
14264_Arguments_:
14265     ARRAY      Shall be an array of any type.
14266     MASK       Shall be an array of type `LOGICAL' and of the
14267                same size as ARRAY. Alternatively, it may be a
14268                `LOGICAL' scalar.
14269     VECTOR     (Optional) shall be an array of the same type
14270                as ARRAY and of rank one. If present, the
14271                number of elements in VECTOR shall be equal to
14272                or greater than the number of true elements in
14273                MASK. If MASK is scalar, the number of
14274                elements in VECTOR shall be equal to or
14275                greater than the number of elements in ARRAY.
14276
14277_Return value_:
14278     The result is an array of rank one and the same type as that of
14279     ARRAY.  If VECTOR is present, the result size is that of VECTOR,
14280     the number of `TRUE' values in MASK otherwise.
14281
14282_Example_:
14283     Gathering nonzero elements from an array:
14284          PROGRAM test_pack_1
14285            INTEGER :: m(6)
14286            m = (/ 1, 0, 0, 0, 5, 0 /)
14287            WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0)  ! "1 5"
14288          END PROGRAM
14289
14290     Gathering nonzero elements from an array and appending elements
14291     from VECTOR:
14292          PROGRAM test_pack_2
14293            INTEGER :: m(4)
14294            m = (/ 1, 0, 0, 2 /)
14295            WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /))  ! "1 2 3 4"
14296          END PROGRAM
14297
14298_See also_:
14299     *note UNPACK::
14300
14301
14302File: gfortran.info,  Node: PARITY,  Next: PERROR,  Prev: PACK,  Up: Intrinsic Procedures
14303
143049.204 `PARITY' -- Reduction with exclusive OR
14305=============================================
14306
14307_Description_:
14308     Calculates the parity, i.e. the reduction using `.XOR.', of MASK
14309     along dimension DIM.
14310
14311_Standard_:
14312     Fortran 2008 and later
14313
14314_Class_:
14315     Transformational function
14316
14317_Syntax_:
14318     `RESULT = PARITY(MASK[, DIM])'
14319
14320_Arguments_:
14321     LOGICAL    Shall be an array of type `LOGICAL'
14322     DIM        (Optional) shall be a scalar of type `INTEGER'
14323                with a value in the range from 1 to n, where n
14324                equals the rank of MASK.
14325
14326_Return value_:
14327     The result is of the same type as MASK.
14328
14329     If DIM is absent, a scalar with the parity of all elements in MASK
14330     is returned, i.e. true if an odd number of elements is `.true.'
14331     and false otherwise.  If DIM is present, an array of rank n-1,
14332     where n equals the rank of ARRAY, and a shape similar to that of
14333     MASK with dimension DIM dropped is returned.
14334
14335_Example_:
14336          PROGRAM test_sum
14337            LOGICAL :: x(2) = [ .true., .false. ]
14338            print *, PARITY(x) ! prints "T" (true).
14339          END PROGRAM
14340
14341
14342File: gfortran.info,  Node: PERROR,  Next: POPCNT,  Prev: PARITY,  Up: Intrinsic Procedures
14343
143449.205 `PERROR' -- Print system error message
14345============================================
14346
14347_Description_:
14348     Prints (on the C `stderr' stream) a newline-terminated error
14349     message corresponding to the last system error. This is prefixed by
14350     STRING, a colon and a space. See `perror(3)'.
14351
14352_Standard_:
14353     GNU extension
14354
14355_Class_:
14356     Subroutine
14357
14358_Syntax_:
14359     `CALL PERROR(STRING)'
14360
14361_Arguments_:
14362     STRING     A scalar of type `CHARACTER' and of the
14363                default kind.
14364
14365_See also_:
14366     *note IERRNO::
14367
14368
14369File: gfortran.info,  Node: POPCNT,  Next: POPPAR,  Prev: PERROR,  Up: Intrinsic Procedures
14370
143719.206 `POPCNT' -- Number of bits set
14372====================================
14373
14374_Description_:
14375     `POPCNT(I)' returns the number of bits set ('1' bits) in the binary
14376     representation of `I'.
14377
14378_Standard_:
14379     Fortran 2008 and later
14380
14381_Class_:
14382     Elemental function
14383
14384_Syntax_:
14385     `RESULT = POPCNT(I)'
14386
14387_Arguments_:
14388     I          Shall be of type `INTEGER'.
14389
14390_Return value_:
14391     The return value is of type `INTEGER' and of the default integer
14392     kind.
14393
14394_See also_:
14395     *note POPPAR::, *note LEADZ::, *note TRAILZ::
14396
14397_Example_:
14398          program test_population
14399            print *, popcnt(127),       poppar(127)
14400            print *, popcnt(huge(0_4)), poppar(huge(0_4))
14401            print *, popcnt(huge(0_8)), poppar(huge(0_8))
14402          end program test_population
14403
14404
14405File: gfortran.info,  Node: POPPAR,  Next: PRECISION,  Prev: POPCNT,  Up: Intrinsic Procedures
14406
144079.207 `POPPAR' -- Parity of the number of bits set
14408==================================================
14409
14410_Description_:
14411     `POPPAR(I)' returns parity of the integer `I', i.e. the parity of
14412     the number of bits set ('1' bits) in the binary representation of
14413     `I'. It is equal to 0 if `I' has an even number of bits set, and 1
14414     for an odd number of '1' bits.
14415
14416_Standard_:
14417     Fortran 2008 and later
14418
14419_Class_:
14420     Elemental function
14421
14422_Syntax_:
14423     `RESULT = POPPAR(I)'
14424
14425_Arguments_:
14426     I          Shall be of type `INTEGER'.
14427
14428_Return value_:
14429     The return value is of type `INTEGER' and of the default integer
14430     kind.
14431
14432_See also_:
14433     *note POPCNT::, *note LEADZ::, *note TRAILZ::
14434
14435_Example_:
14436          program test_population
14437            print *, popcnt(127),       poppar(127)
14438            print *, popcnt(huge(0_4)), poppar(huge(0_4))
14439            print *, popcnt(huge(0_8)), poppar(huge(0_8))
14440          end program test_population
14441
14442
14443File: gfortran.info,  Node: PRECISION,  Next: PRESENT,  Prev: POPPAR,  Up: Intrinsic Procedures
14444
144459.208 `PRECISION' -- Decimal precision of a real kind
14446=====================================================
14447
14448_Description_:
14449     `PRECISION(X)' returns the decimal precision in the model of the
14450     type of `X'.
14451
14452_Standard_:
14453     Fortran 95 and later
14454
14455_Class_:
14456     Inquiry function
14457
14458_Syntax_:
14459     `RESULT = PRECISION(X)'
14460
14461_Arguments_:
14462     X          Shall be of type `REAL' or `COMPLEX'.
14463
14464_Return value_:
14465     The return value is of type `INTEGER' and of the default integer
14466     kind.
14467
14468_See also_:
14469     *note SELECTED_REAL_KIND::, *note RANGE::
14470
14471_Example_:
14472          program prec_and_range
14473            real(kind=4) :: x(2)
14474            complex(kind=8) :: y
14475
14476            print *, precision(x), range(x)
14477            print *, precision(y), range(y)
14478          end program prec_and_range
14479
14480
14481File: gfortran.info,  Node: PRESENT,  Next: PRODUCT,  Prev: PRECISION,  Up: Intrinsic Procedures
14482
144839.209 `PRESENT' -- Determine whether an optional dummy argument is specified
14484============================================================================
14485
14486_Description_:
14487     Determines whether an optional dummy argument is present.
14488
14489_Standard_:
14490     Fortran 95 and later
14491
14492_Class_:
14493     Inquiry function
14494
14495_Syntax_:
14496     `RESULT = PRESENT(A)'
14497
14498_Arguments_:
14499     A          May be of any type and may be a pointer,
14500                scalar or array value, or a dummy procedure.
14501                It shall be the name of an optional dummy
14502                argument accessible within the current
14503                subroutine or function.
14504
14505_Return value_:
14506     Returns either `TRUE' if the optional argument A is present, or
14507     `FALSE' otherwise.
14508
14509_Example_:
14510          PROGRAM test_present
14511            WRITE(*,*) f(), f(42)      ! "F T"
14512          CONTAINS
14513            LOGICAL FUNCTION f(x)
14514              INTEGER, INTENT(IN), OPTIONAL :: x
14515              f = PRESENT(x)
14516            END FUNCTION
14517          END PROGRAM
14518
14519
14520File: gfortran.info,  Node: PRODUCT,  Next: RADIX,  Prev: PRESENT,  Up: Intrinsic Procedures
14521
145229.210 `PRODUCT' -- Product of array elements
14523============================================
14524
14525_Description_:
14526     Multiplies the elements of ARRAY along dimension DIM if the
14527     corresponding element in MASK is `TRUE'.
14528
14529_Standard_:
14530     Fortran 95 and later
14531
14532_Class_:
14533     Transformational function
14534
14535_Syntax_:
14536     `RESULT = PRODUCT(ARRAY[, MASK])'
14537     `RESULT = PRODUCT(ARRAY, DIM[, MASK])'
14538
14539_Arguments_:
14540     ARRAY      Shall be an array of type `INTEGER', `REAL' or
14541                `COMPLEX'.
14542     DIM        (Optional) shall be a scalar of type `INTEGER'
14543                with a value in the range from 1 to n, where n
14544                equals the rank of ARRAY.
14545     MASK       (Optional) shall be of type `LOGICAL' and
14546                either be a scalar or an array of the same
14547                shape as ARRAY.
14548
14549_Return value_:
14550     The result is of the same type as ARRAY.
14551
14552     If DIM is absent, a scalar with the product of all elements in
14553     ARRAY is returned. Otherwise, an array of rank n-1, where n equals
14554     the rank of ARRAY, and a shape similar to that of ARRAY with
14555     dimension DIM dropped is returned.
14556
14557_Example_:
14558          PROGRAM test_product
14559            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
14560            print *, PRODUCT(x)                    ! all elements, product = 120
14561            print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
14562          END PROGRAM
14563
14564_See also_:
14565     *note SUM::
14566
14567
14568File: gfortran.info,  Node: RADIX,  Next: RAN,  Prev: PRODUCT,  Up: Intrinsic Procedures
14569
145709.211 `RADIX' -- Base of a model number
14571=======================================
14572
14573_Description_:
14574     `RADIX(X)' returns the base of the model representing the entity X.
14575
14576_Standard_:
14577     Fortran 95 and later
14578
14579_Class_:
14580     Inquiry function
14581
14582_Syntax_:
14583     `RESULT = RADIX(X)'
14584
14585_Arguments_:
14586     X          Shall be of type `INTEGER' or `REAL'
14587
14588_Return value_:
14589     The return value is a scalar of type `INTEGER' and of the default
14590     integer kind.
14591
14592_See also_:
14593     *note SELECTED_REAL_KIND::
14594
14595_Example_:
14596          program test_radix
14597            print *, "The radix for the default integer kind is", radix(0)
14598            print *, "The radix for the default real kind is", radix(0.0)
14599          end program test_radix
14600
14601
14602
14603File: gfortran.info,  Node: RAN,  Next: RAND,  Prev: RADIX,  Up: Intrinsic Procedures
14604
146059.212 `RAN' -- Real pseudo-random number
14606========================================
14607
14608_Description_:
14609     For compatibility with HP FORTRAN 77/iX, the `RAN' intrinsic is
14610     provided as an alias for `RAND'.  See *note RAND:: for complete
14611     documentation.
14612
14613_Standard_:
14614     GNU extension
14615
14616_Class_:
14617     Function
14618
14619_See also_:
14620     *note RAND::, *note RANDOM_NUMBER::
14621
14622
14623File: gfortran.info,  Node: RAND,  Next: RANDOM_NUMBER,  Prev: RAN,  Up: Intrinsic Procedures
14624
146259.213 `RAND' -- Real pseudo-random number
14626=========================================
14627
14628_Description_:
14629     `RAND(FLAG)' returns a pseudo-random number from a uniform
14630     distribution between 0 and 1. If FLAG is 0, the next number in the
14631     current sequence is returned; if FLAG is 1, the generator is
14632     restarted by `CALL SRAND(0)'; if FLAG has any other value, it is
14633     used as a new seed with `SRAND'.
14634
14635     This intrinsic routine is provided for backwards compatibility with
14636     GNU Fortran 77. It implements a simple modulo generator as provided
14637     by `g77'. For new code, one should consider the use of *note
14638     RANDOM_NUMBER:: as it implements a superior algorithm.
14639
14640_Standard_:
14641     GNU extension
14642
14643_Class_:
14644     Function
14645
14646_Syntax_:
14647     `RESULT = RAND(I)'
14648
14649_Arguments_:
14650     I          Shall be a scalar `INTEGER' of kind 4.
14651
14652_Return value_:
14653     The return value is of `REAL' type and the default kind.
14654
14655_Example_:
14656          program test_rand
14657            integer,parameter :: seed = 86456
14658
14659            call srand(seed)
14660            print *, rand(), rand(), rand(), rand()
14661            print *, rand(seed), rand(), rand(), rand()
14662          end program test_rand
14663
14664_See also_:
14665     *note SRAND::, *note RANDOM_NUMBER::
14666
14667
14668
14669File: gfortran.info,  Node: RANDOM_NUMBER,  Next: RANDOM_SEED,  Prev: RAND,  Up: Intrinsic Procedures
14670
146719.214 `RANDOM_NUMBER' -- Pseudo-random number
14672=============================================
14673
14674_Description_:
14675     Returns a single pseudorandom number or an array of pseudorandom
14676     numbers from the uniform distribution over the range  0 \leq x < 1.
14677
14678     The runtime-library implements George Marsaglia's KISS (Keep It
14679     Simple Stupid) random number generator (RNG). This RNG combines:
14680       1. The congruential generator x(n) = 69069 \cdot x(n-1) +
14681          1327217885 with a period of 2^32,
14682
14683       2. A 3-shift shift-register generator with a period of 2^32 - 1,
14684
14685       3. Two 16-bit multiply-with-carry generators with a period of
14686          597273182964842497 > 2^59.
14687          The overall period exceeds 2^123.
14688
14689     Please note, this RNG is thread safe if used within OpenMP
14690     directives, i.e., its state will be consistent while called from
14691     multiple threads.  However, the KISS generator does not create
14692     random numbers in parallel from multiple sources, but in sequence
14693     from a single source. If an OpenMP-enabled application heavily
14694     relies on random numbers, one should consider employing a
14695     dedicated parallel random number generator instead.
14696
14697_Standard_:
14698     Fortran 95 and later
14699
14700_Class_:
14701     Subroutine
14702
14703_Syntax_:
14704     `RANDOM_NUMBER(HARVEST)'
14705
14706_Arguments_:
14707     HARVEST    Shall be a scalar or an array of type `REAL'.
14708
14709_Example_:
14710          program test_random_number
14711            REAL :: r(5,5)
14712            CALL init_random_seed()         ! see example of RANDOM_SEED
14713            CALL RANDOM_NUMBER(r)
14714          end program
14715
14716_See also_:
14717     *note RANDOM_SEED::
14718
14719
14720File: gfortran.info,  Node: RANDOM_SEED,  Next: RANGE,  Prev: RANDOM_NUMBER,  Up: Intrinsic Procedures
14721
147229.215 `RANDOM_SEED' -- Initialize a pseudo-random number sequence
14723=================================================================
14724
14725_Description_:
14726     Restarts or queries the state of the pseudorandom number generator
14727     used by `RANDOM_NUMBER'.
14728
14729     If `RANDOM_SEED' is called without arguments, it is initialized to
14730     a default state. The example below shows how to initialize the
14731     random seed with a varying seed in order to ensure a different
14732     random number sequence for each invocation of the program. Note
14733     that setting any of the seed values to zero should be avoided as
14734     it can result in poor quality random numbers being generated.
14735
14736_Standard_:
14737     Fortran 95 and later
14738
14739_Class_:
14740     Subroutine
14741
14742_Syntax_:
14743     `CALL RANDOM_SEED([SIZE, PUT, GET])'
14744
14745_Arguments_:
14746     SIZE       (Optional) Shall be a scalar and of type
14747                default `INTEGER', with `INTENT(OUT)'. It
14748                specifies the minimum size of the arrays used
14749                with the PUT and GET arguments.
14750     PUT        (Optional) Shall be an array of type default
14751                `INTEGER' and rank one. It is `INTENT(IN)' and
14752                the size of the array must be larger than or
14753                equal to the number returned by the SIZE
14754                argument.
14755     GET        (Optional) Shall be an array of type default
14756                `INTEGER' and rank one. It is `INTENT(OUT)'
14757                and the size of the array must be larger than
14758                or equal to the number returned by the SIZE
14759                argument.
14760
14761_Example_:
14762          subroutine init_random_seed()
14763            use iso_fortran_env, only: int64
14764            implicit none
14765            integer, allocatable :: seed(:)
14766            integer :: i, n, un, istat, dt(8), pid
14767            integer(int64) :: t
14768
14769            call random_seed(size = n)
14770            allocate(seed(n))
14771            ! First try if the OS provides a random number generator
14772            open(newunit=un, file="/dev/urandom", access="stream", &
14773                 form="unformatted", action="read", status="old", iostat=istat)
14774            if (istat == 0) then
14775               read(un) seed
14776               close(un)
14777            else
14778               ! Fallback to XOR:ing the current time and pid. The PID is
14779               ! useful in case one launches multiple instances of the same
14780               ! program in parallel.
14781               call system_clock(t)
14782               if (t == 0) then
14783                  call date_and_time(values=dt)
14784                  t = (dt(1) - 1970) * 365_int64 * 24 * 60 * 60 * 1000 &
14785                       + dt(2) * 31_int64 * 24 * 60 * 60 * 1000 &
14786                       + dt(3) * 24_int64 * 60 * 60 * 1000 &
14787                       + dt(5) * 60 * 60 * 1000 &
14788                       + dt(6) * 60 * 1000 + dt(7) * 1000 &
14789                       + dt(8)
14790               end if
14791               pid = getpid()
14792               t = ieor(t, int(pid, kind(t)))
14793               do i = 1, n
14794                  seed(i) = lcg(t)
14795               end do
14796            end if
14797            call random_seed(put=seed)
14798          contains
14799            ! This simple PRNG might not be good enough for real work, but is
14800            ! sufficient for seeding a better PRNG.
14801            function lcg(s)
14802              integer :: lcg
14803              integer(int64) :: s
14804              if (s == 0) then
14805                 s = 104729
14806              else
14807                 s = mod(s, 4294967296_int64)
14808              end if
14809              s = mod(s * 279470273_int64, 4294967291_int64)
14810              lcg = int(mod(s, int(huge(0), int64)), kind(0))
14811            end function lcg
14812          end subroutine init_random_seed
14813
14814_See also_:
14815     *note RANDOM_NUMBER::
14816
14817
14818File: gfortran.info,  Node: RANGE,  Next: RANK,  Prev: RANDOM_SEED,  Up: Intrinsic Procedures
14819
148209.216 `RANGE' -- Decimal exponent range
14821=======================================
14822
14823_Description_:
14824     `RANGE(X)' returns the decimal exponent range in the model of the
14825     type of `X'.
14826
14827_Standard_:
14828     Fortran 95 and later
14829
14830_Class_:
14831     Inquiry function
14832
14833_Syntax_:
14834     `RESULT = RANGE(X)'
14835
14836_Arguments_:
14837     X          Shall be of type `INTEGER', `REAL' or
14838                `COMPLEX'.
14839
14840_Return value_:
14841     The return value is of type `INTEGER' and of the default integer
14842     kind.
14843
14844_See also_:
14845     *note SELECTED_REAL_KIND::, *note PRECISION::
14846
14847_Example_:
14848     See `PRECISION' for an example.
14849
14850
14851File: gfortran.info,  Node: RANK,  Next: REAL,  Prev: RANGE,  Up: Intrinsic Procedures
14852
148539.217 `RANK' -- Rank of a data object
14854=====================================
14855
14856_Description_:
14857     `RANK(A)' returns the rank of a scalar or array data object.
14858
14859_Standard_:
14860     Technical Specification (TS) 29113
14861
14862_Class_:
14863     Inquiry function
14864
14865_Syntax_:
14866     `RESULT = RANK(A)'
14867
14868_Arguments_:
14869     A          can be of any type
14870
14871_Return value_:
14872     The return value is of type `INTEGER' and of the default integer
14873     kind. For arrays, their rank is returned; for scalars zero is
14874     returned.
14875
14876_Example_:
14877          program test_rank
14878            integer :: a
14879            real, allocatable :: b(:,:)
14880
14881            print *, rank(a), rank(b) ! Prints:  0  2
14882          end program test_rank
14883
14884
14885
14886File: gfortran.info,  Node: REAL,  Next: RENAME,  Prev: RANK,  Up: Intrinsic Procedures
14887
148889.218 `REAL' -- Convert to real type
14889====================================
14890
14891_Description_:
14892     `REAL(A [, KIND])' converts its argument A to a real type.  The
14893     `REALPART' function is provided for compatibility with `g77', and
14894     its use is strongly discouraged.
14895
14896_Standard_:
14897     Fortran 77 and later
14898
14899_Class_:
14900     Elemental function
14901
14902_Syntax_:
14903     `RESULT = REAL(A [, KIND])'
14904     `RESULT = REALPART(Z)'
14905
14906_Arguments_:
14907     A          Shall be `INTEGER', `REAL', or `COMPLEX'.
14908     KIND       (Optional) An `INTEGER' initialization
14909                expression indicating the kind parameter of
14910                the result.
14911
14912_Return value_:
14913     These functions return a `REAL' variable or array under the
14914     following rules:
14915
14916    (A)
14917          `REAL(A)' is converted to a default real type if A is an
14918          integer or real variable.
14919
14920    (B)
14921          `REAL(A)' is converted to a real type with the kind type
14922          parameter of A if A is a complex variable.
14923
14924    (C)
14925          `REAL(A, KIND)' is converted to a real type with kind type
14926          parameter KIND if A is a complex, integer, or real variable.
14927
14928_Example_:
14929          program test_real
14930            complex :: x = (1.0, 2.0)
14931            print *, real(x), real(x,8), realpart(x)
14932          end program test_real
14933
14934_Specific names_:
14935     Name          Argument      Return type   Standard
14936     `FLOAT(A)'    `INTEGER(4)'  `REAL(4)'     Fortran 77 and
14937                                               later
14938     `DFLOAT(A)'   `INTEGER(4)'  `REAL(8)'     GNU extension
14939     `SNGL(A)'     `INTEGER(8)'  `REAL(4)'     Fortran 77 and
14940                                               later
14941
14942_See also_:
14943     *note DBLE::
14944
14945
14946
14947File: gfortran.info,  Node: RENAME,  Next: REPEAT,  Prev: REAL,  Up: Intrinsic Procedures
14948
149499.219 `RENAME' -- Rename a file
14950===============================
14951
14952_Description_:
14953     Renames a file from file PATH1 to PATH2. A null character
14954     (`CHAR(0)') can be used to mark the end of the names in PATH1 and
14955     PATH2; otherwise, trailing blanks in the file names are ignored.
14956     If the STATUS argument is supplied, it contains 0 on success or a
14957     nonzero error code upon return; see `rename(2)'.
14958
14959     This intrinsic is provided in both subroutine and function forms;
14960     however, only one form can be used in any given program unit.
14961
14962_Standard_:
14963     GNU extension
14964
14965_Class_:
14966     Subroutine, function
14967
14968_Syntax_:
14969     `CALL RENAME(PATH1, PATH2 [, STATUS])'
14970     `STATUS = RENAME(PATH1, PATH2)'
14971
14972_Arguments_:
14973     PATH1      Shall be of default `CHARACTER' type.
14974     PATH2      Shall be of default `CHARACTER' type.
14975     STATUS     (Optional) Shall be of default `INTEGER' type.
14976
14977_See also_:
14978     *note LINK::
14979
14980
14981
14982File: gfortran.info,  Node: REPEAT,  Next: RESHAPE,  Prev: RENAME,  Up: Intrinsic Procedures
14983
149849.220 `REPEAT' -- Repeated string concatenation
14985===============================================
14986
14987_Description_:
14988     Concatenates NCOPIES copies of a string.
14989
14990_Standard_:
14991     Fortran 95 and later
14992
14993_Class_:
14994     Transformational function
14995
14996_Syntax_:
14997     `RESULT = REPEAT(STRING, NCOPIES)'
14998
14999_Arguments_:
15000     STRING     Shall be scalar and of type `CHARACTER'.
15001     NCOPIES    Shall be scalar and of type `INTEGER'.
15002
15003_Return value_:
15004     A new scalar of type `CHARACTER' built up from NCOPIES copies of
15005     STRING.
15006
15007_Example_:
15008          program test_repeat
15009            write(*,*) repeat("x", 5)   ! "xxxxx"
15010          end program
15011
15012
15013File: gfortran.info,  Node: RESHAPE,  Next: RRSPACING,  Prev: REPEAT,  Up: Intrinsic Procedures
15014
150159.221 `RESHAPE' -- Function to reshape an array
15016===============================================
15017
15018_Description_:
15019     Reshapes SOURCE to correspond to SHAPE. If necessary, the new
15020     array may be padded with elements from PAD or permuted as defined
15021     by ORDER.
15022
15023_Standard_:
15024     Fortran 95 and later
15025
15026_Class_:
15027     Transformational function
15028
15029_Syntax_:
15030     `RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
15031
15032_Arguments_:
15033     SOURCE     Shall be an array of any type.
15034     SHAPE      Shall be of type `INTEGER' and an array of
15035                rank one. Its values must be positive or zero.
15036     PAD        (Optional) shall be an array of the same type
15037                as SOURCE.
15038     ORDER      (Optional) shall be of type `INTEGER' and an
15039                array of the same shape as SHAPE. Its values
15040                shall be a permutation of the numbers from 1
15041                to n, where n is the size of SHAPE. If ORDER
15042                is absent, the natural ordering shall be
15043                assumed.
15044
15045_Return value_:
15046     The result is an array of shape SHAPE with the same type as SOURCE.
15047
15048_Example_:
15049          PROGRAM test_reshape
15050            INTEGER, DIMENSION(4) :: x
15051            WRITE(*,*) SHAPE(x)                       ! prints "4"
15052            WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/)))    ! prints "2 2"
15053          END PROGRAM
15054
15055_See also_:
15056     *note SHAPE::
15057
15058
15059File: gfortran.info,  Node: RRSPACING,  Next: RSHIFT,  Prev: RESHAPE,  Up: Intrinsic Procedures
15060
150619.222 `RRSPACING' -- Reciprocal of the relative spacing
15062=======================================================
15063
15064_Description_:
15065     `RRSPACING(X)' returns the  reciprocal of the relative spacing of
15066     model numbers near X.
15067
15068_Standard_:
15069     Fortran 95 and later
15070
15071_Class_:
15072     Elemental function
15073
15074_Syntax_:
15075     `RESULT = RRSPACING(X)'
15076
15077_Arguments_:
15078     X          Shall be of type `REAL'.
15079
15080_Return value_:
15081     The return value is of the same type and kind as X.  The value
15082     returned is equal to `ABS(FRACTION(X)) *
15083     FLOAT(RADIX(X))**DIGITS(X)'.
15084
15085_See also_:
15086     *note SPACING::
15087
15088
15089File: gfortran.info,  Node: RSHIFT,  Next: SAME_TYPE_AS,  Prev: RRSPACING,  Up: Intrinsic Procedures
15090
150919.223 `RSHIFT' -- Right shift bits
15092==================================
15093
15094_Description_:
15095     `RSHIFT' returns a value corresponding to I with all of the bits
15096     shifted right by SHIFT places.  If the absolute value of SHIFT is
15097     greater than `BIT_SIZE(I)', the value is undefined.  Bits shifted
15098     out from the right end are lost. The fill is arithmetic: the bits
15099     shifted in from the left end are equal to the leftmost bit, which
15100     in two's complement representation is the sign bit.
15101
15102     This function has been superseded by the `SHIFTA' intrinsic, which
15103     is standard in Fortran 2008 and later.
15104
15105_Standard_:
15106     GNU extension
15107
15108_Class_:
15109     Elemental function
15110
15111_Syntax_:
15112     `RESULT = RSHIFT(I, SHIFT)'
15113
15114_Arguments_:
15115     I          The type shall be `INTEGER'.
15116     SHIFT      The type shall be `INTEGER'.
15117
15118_Return value_:
15119     The return value is of type `INTEGER' and of the same kind as I.
15120
15121_See also_:
15122     *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
15123     *note SHIFTR::, *note SHIFTL::
15124
15125
15126
15127File: gfortran.info,  Node: SAME_TYPE_AS,  Next: SCALE,  Prev: RSHIFT,  Up: Intrinsic Procedures
15128
151299.224 `SAME_TYPE_AS' --  Query dynamic types for equality
15130=========================================================
15131
15132_Description_:
15133     Query dynamic types for equality.
15134
15135_Standard_:
15136     Fortran 2003 and later
15137
15138_Class_:
15139     Inquiry function
15140
15141_Syntax_:
15142     `RESULT = SAME_TYPE_AS(A, B)'
15143
15144_Arguments_:
15145     A          Shall be an object of extensible declared type
15146                or unlimited polymorphic.
15147     B          Shall be an object of extensible declared type
15148                or unlimited polymorphic.
15149
15150_Return value_:
15151     The return value is a scalar of type default logical. It is true
15152     if and only if the dynamic type of A is the same as the dynamic
15153     type of B.
15154
15155_See also_:
15156     *note EXTENDS_TYPE_OF::
15157
15158
15159
15160File: gfortran.info,  Node: SCALE,  Next: SCAN,  Prev: SAME_TYPE_AS,  Up: Intrinsic Procedures
15161
151629.225 `SCALE' -- Scale a real value
15163===================================
15164
15165_Description_:
15166     `SCALE(X,I)' returns `X * RADIX(X)**I'.
15167
15168_Standard_:
15169     Fortran 95 and later
15170
15171_Class_:
15172     Elemental function
15173
15174_Syntax_:
15175     `RESULT = SCALE(X, I)'
15176
15177_Arguments_:
15178     X          The type of the argument shall be a `REAL'.
15179     I          The type of the argument shall be a `INTEGER'.
15180
15181_Return value_:
15182     The return value is of the same type and kind as X.  Its value is
15183     `X * RADIX(X)**I'.
15184
15185_Example_:
15186          program test_scale
15187            real :: x = 178.1387e-4
15188            integer :: i = 5
15189            print *, scale(x,i), x*radix(x)**i
15190          end program test_scale
15191
15192
15193
15194File: gfortran.info,  Node: SCAN,  Next: SECNDS,  Prev: SCALE,  Up: Intrinsic Procedures
15195
151969.226 `SCAN' -- Scan a string for the presence of a set of characters
15197=====================================================================
15198
15199_Description_:
15200     Scans a STRING for any of the characters in a SET of characters.
15201
15202     If BACK is either absent or equals `FALSE', this function returns
15203     the position of the leftmost character of STRING that is in SET.
15204     If BACK equals `TRUE', the rightmost position is returned. If no
15205     character of SET is found in STRING, the result is zero.
15206
15207_Standard_:
15208     Fortran 95 and later, with KIND argument Fortran 2003 and later
15209
15210_Class_:
15211     Elemental function
15212
15213_Syntax_:
15214     `RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
15215
15216_Arguments_:
15217     STRING     Shall be of type `CHARACTER'.
15218     SET        Shall be of type `CHARACTER'.
15219     BACK       (Optional) shall be of type `LOGICAL'.
15220     KIND       (Optional) An `INTEGER' initialization
15221                expression indicating the kind parameter of
15222                the result.
15223
15224_Return value_:
15225     The return value is of type `INTEGER' and of kind KIND. If KIND is
15226     absent, the return value is of default integer kind.
15227
15228_Example_:
15229          PROGRAM test_scan
15230            WRITE(*,*) SCAN("FORTRAN", "AO")          ! 2, found 'O'
15231            WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.)  ! 6, found 'A'
15232            WRITE(*,*) SCAN("FORTRAN", "C++")         ! 0, found none
15233          END PROGRAM
15234
15235_See also_:
15236     *note INDEX intrinsic::, *note VERIFY::
15237
15238
15239File: gfortran.info,  Node: SECNDS,  Next: SECOND,  Prev: SCAN,  Up: Intrinsic Procedures
15240
152419.227 `SECNDS' -- Time function
15242===============================
15243
15244_Description_:
15245     `SECNDS(X)' gets the time in seconds from the real-time system
15246     clock.  X is a reference time, also in seconds. If this is zero,
15247     the time in seconds from midnight is returned. This function is
15248     non-standard and its use is discouraged.
15249
15250_Standard_:
15251     GNU extension
15252
15253_Class_:
15254     Function
15255
15256_Syntax_:
15257     `RESULT = SECNDS (X)'
15258
15259_Arguments_:
15260     T          Shall be of type `REAL(4)'.
15261     X          Shall be of type `REAL(4)'.
15262
15263_Return value_:
15264     None
15265
15266_Example_:
15267          program test_secnds
15268              integer :: i
15269              real(4) :: t1, t2
15270              print *, secnds (0.0)   ! seconds since midnight
15271              t1 = secnds (0.0)       ! reference time
15272              do i = 1, 10000000      ! do something
15273              end do
15274              t2 = secnds (t1)        ! elapsed time
15275              print *, "Something took ", t2, " seconds."
15276          end program test_secnds
15277
15278
15279File: gfortran.info,  Node: SECOND,  Next: SELECTED_CHAR_KIND,  Prev: SECNDS,  Up: Intrinsic Procedures
15280
152819.228 `SECOND' -- CPU time function
15282===================================
15283
15284_Description_:
15285     Returns a `REAL(4)' value representing the elapsed CPU time in
15286     seconds.  This provides the same functionality as the standard
15287     `CPU_TIME' intrinsic, and is only included for backwards
15288     compatibility.
15289
15290     This intrinsic is provided in both subroutine and function forms;
15291     however, only one form can be used in any given program unit.
15292
15293_Standard_:
15294     GNU extension
15295
15296_Class_:
15297     Subroutine, function
15298
15299_Syntax_:
15300     `CALL SECOND(TIME)'
15301     `TIME = SECOND()'
15302
15303_Arguments_:
15304     TIME       Shall be of type `REAL(4)'.
15305
15306_Return value_:
15307     In either syntax, TIME is set to the process's current runtime in
15308     seconds.
15309
15310_See also_:
15311     *note CPU_TIME::
15312
15313
15314
15315File: gfortran.info,  Node: SELECTED_CHAR_KIND,  Next: SELECTED_INT_KIND,  Prev: SECOND,  Up: Intrinsic Procedures
15316
153179.229 `SELECTED_CHAR_KIND' -- Choose character kind
15318===================================================
15319
15320_Description_:
15321     `SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
15322     set named NAME, if a character set with such a name is supported,
15323     or -1 otherwise. Currently, supported character sets include
15324     "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
15325     (Universal Character Set, UCS-4) which is commonly known as
15326     Unicode.
15327
15328_Standard_:
15329     Fortran 2003 and later
15330
15331_Class_:
15332     Transformational function
15333
15334_Syntax_:
15335     `RESULT = SELECTED_CHAR_KIND(NAME)'
15336
15337_Arguments_:
15338     NAME       Shall be a scalar and of the default character
15339                type.
15340
15341_Example_:
15342          program character_kind
15343            use iso_fortran_env
15344            implicit none
15345            integer, parameter :: ascii = selected_char_kind ("ascii")
15346            integer, parameter :: ucs4  = selected_char_kind ('ISO_10646')
15347
15348            character(kind=ascii, len=26) :: alphabet
15349            character(kind=ucs4,  len=30) :: hello_world
15350
15351            alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
15352            hello_world = ucs4_'Hello World and Ni Hao -- ' &
15353                          // char (int (z'4F60'), ucs4)     &
15354                          // char (int (z'597D'), ucs4)
15355
15356            write (*,*) alphabet
15357
15358            open (output_unit, encoding='UTF-8')
15359            write (*,*) trim (hello_world)
15360          end program character_kind
15361
15362
15363File: gfortran.info,  Node: SELECTED_INT_KIND,  Next: SELECTED_REAL_KIND,  Prev: SELECTED_CHAR_KIND,  Up: Intrinsic Procedures
15364
153659.230 `SELECTED_INT_KIND' -- Choose integer kind
15366================================================
15367
15368_Description_:
15369     `SELECTED_INT_KIND(R)' return the kind value of the smallest
15370     integer type that can represent all values ranging from -10^R
15371     (exclusive) to 10^R (exclusive). If there is no integer kind that
15372     accommodates this range, `SELECTED_INT_KIND' returns -1.
15373
15374_Standard_:
15375     Fortran 95 and later
15376
15377_Class_:
15378     Transformational function
15379
15380_Syntax_:
15381     `RESULT = SELECTED_INT_KIND(R)'
15382
15383_Arguments_:
15384     R          Shall be a scalar and of type `INTEGER'.
15385
15386_Example_:
15387          program large_integers
15388            integer,parameter :: k5 = selected_int_kind(5)
15389            integer,parameter :: k15 = selected_int_kind(15)
15390            integer(kind=k5) :: i5
15391            integer(kind=k15) :: i15
15392
15393            print *, huge(i5), huge(i15)
15394
15395            ! The following inequalities are always true
15396            print *, huge(i5) >= 10_k5**5-1
15397            print *, huge(i15) >= 10_k15**15-1
15398          end program large_integers
15399
15400
15401File: gfortran.info,  Node: SELECTED_REAL_KIND,  Next: SET_EXPONENT,  Prev: SELECTED_INT_KIND,  Up: Intrinsic Procedures
15402
154039.231 `SELECTED_REAL_KIND' -- Choose real kind
15404==============================================
15405
15406_Description_:
15407     `SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
15408     type with decimal precision of at least `P' digits, exponent range
15409     of at least `R', and with a radix of `RADIX'.
15410
15411_Standard_:
15412     Fortran 95 and later, with `RADIX' Fortran 2008 or later
15413
15414_Class_:
15415     Transformational function
15416
15417_Syntax_:
15418     `RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
15419
15420_Arguments_:
15421     P          (Optional) shall be a scalar and of type
15422                `INTEGER'.
15423     R          (Optional) shall be a scalar and of type
15424                `INTEGER'.
15425     RADIX      (Optional) shall be a scalar and of type
15426                `INTEGER'.
15427     Before Fortran 2008, at least one of the arguments R or P shall be
15428     present; since Fortran 2008, they are assumed to be zero if absent.
15429
15430_Return value_:
15431     `SELECTED_REAL_KIND' returns the value of the kind type parameter
15432     of a real data type with decimal precision of at least `P' digits,
15433     a decimal exponent range of at least `R', and with the requested
15434     `RADIX'. If the `RADIX' parameter is absent, real kinds with any
15435     radix can be returned. If more than one real data type meet the
15436     criteria, the kind of the data type with the smallest decimal
15437     precision is returned. If no real data type matches the criteria,
15438     the result is
15439    -1 if the processor does not support a real data type with a
15440          precision greater than or equal to `P', but the `R' and
15441          `RADIX' requirements can be fulfilled
15442
15443    -2 if the processor does not support a real type with an exponent
15444          range greater than or equal to `R', but `P' and `RADIX' are
15445          fulfillable
15446
15447    -3 if `RADIX' but not `P' and `R' requirements
15448          are fulfillable
15449
15450    -4 if `RADIX' and either `P' or `R' requirements
15451          are fulfillable
15452
15453    -5 if there is no real type with the given `RADIX'
15454
15455_See also_:
15456     *note PRECISION::, *note RANGE::, *note RADIX::
15457
15458_Example_:
15459          program real_kinds
15460            integer,parameter :: p6 = selected_real_kind(6)
15461            integer,parameter :: p10r100 = selected_real_kind(10,100)
15462            integer,parameter :: r400 = selected_real_kind(r=400)
15463            real(kind=p6) :: x
15464            real(kind=p10r100) :: y
15465            real(kind=r400) :: z
15466
15467            print *, precision(x), range(x)
15468            print *, precision(y), range(y)
15469            print *, precision(z), range(z)
15470          end program real_kinds
15471
15472
15473File: gfortran.info,  Node: SET_EXPONENT,  Next: SHAPE,  Prev: SELECTED_REAL_KIND,  Up: Intrinsic Procedures
15474
154759.232 `SET_EXPONENT' -- Set the exponent of the model
15476=====================================================
15477
15478_Description_:
15479     `SET_EXPONENT(X, I)' returns the real number whose fractional part
15480     is that that of X and whose exponent part is I.
15481
15482_Standard_:
15483     Fortran 95 and later
15484
15485_Class_:
15486     Elemental function
15487
15488_Syntax_:
15489     `RESULT = SET_EXPONENT(X, I)'
15490
15491_Arguments_:
15492     X          Shall be of type `REAL'.
15493     I          Shall be of type `INTEGER'.
15494
15495_Return value_:
15496     The return value is of the same type and kind as X.  The real
15497     number whose fractional part is that that of X and whose exponent
15498     part if I is returned; it is `FRACTION(X) * RADIX(X)**I'.
15499
15500_Example_:
15501          PROGRAM test_setexp
15502            REAL :: x = 178.1387e-4
15503            INTEGER :: i = 17
15504            PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
15505          END PROGRAM
15506
15507
15508
15509File: gfortran.info,  Node: SHAPE,  Next: SHIFTA,  Prev: SET_EXPONENT,  Up: Intrinsic Procedures
15510
155119.233 `SHAPE' -- Determine the shape of an array
15512================================================
15513
15514_Description_:
15515     Determines the shape of an array.
15516
15517_Standard_:
15518     Fortran 95 and later, with KIND argument Fortran 2003 and later
15519
15520_Class_:
15521     Inquiry function
15522
15523_Syntax_:
15524     `RESULT = SHAPE(SOURCE [, KIND])'
15525
15526_Arguments_:
15527     SOURCE     Shall be an array or scalar of any type.  If
15528                SOURCE is a pointer it must be associated and
15529                allocatable arrays must be allocated.
15530     KIND       (Optional) An `INTEGER' initialization
15531                expression indicating the kind parameter of
15532                the result.
15533
15534_Return value_:
15535     An `INTEGER' array of rank one with as many elements as SOURCE has
15536     dimensions. The elements of the resulting array correspond to the
15537     extend of SOURCE along the respective dimensions. If SOURCE is a
15538     scalar, the result is the rank one array of size zero. If KIND is
15539     absent, the return value has the default integer kind otherwise
15540     the specified kind.
15541
15542_Example_:
15543          PROGRAM test_shape
15544            INTEGER, DIMENSION(-1:1, -1:2) :: A
15545            WRITE(*,*) SHAPE(A)             ! (/ 3, 4 /)
15546            WRITE(*,*) SIZE(SHAPE(42))      ! (/ /)
15547          END PROGRAM
15548
15549_See also_:
15550     *note RESHAPE::, *note SIZE::
15551
15552
15553File: gfortran.info,  Node: SHIFTA,  Next: SHIFTL,  Prev: SHAPE,  Up: Intrinsic Procedures
15554
155559.234 `SHIFTA' -- Right shift with fill
15556=======================================
15557
15558_Description_:
15559     `SHIFTA' returns a value corresponding to I with all of the bits
15560     shifted right by SHIFT places.  If the absolute value of SHIFT is
15561     greater than `BIT_SIZE(I)', the value is undefined.  Bits shifted
15562     out from the right end are lost. The fill is arithmetic: the bits
15563     shifted in from the left end are equal to the leftmost bit, which
15564     in two's complement representation is the sign bit.
15565
15566_Standard_:
15567     Fortran 2008 and later
15568
15569_Class_:
15570     Elemental function
15571
15572_Syntax_:
15573     `RESULT = SHIFTA(I, SHIFT)'
15574
15575_Arguments_:
15576     I          The type shall be `INTEGER'.
15577     SHIFT      The type shall be `INTEGER'.
15578
15579_Return value_:
15580     The return value is of type `INTEGER' and of the same kind as I.
15581
15582_See also_:
15583     *note SHIFTL::, *note SHIFTR::
15584
15585
15586File: gfortran.info,  Node: SHIFTL,  Next: SHIFTR,  Prev: SHIFTA,  Up: Intrinsic Procedures
15587
155889.235 `SHIFTL' -- Left shift
15589============================
15590
15591_Description_:
15592     `SHIFTL' returns a value corresponding to I with all of the bits
15593     shifted left by SHIFT places.  If the absolute value of SHIFT is
15594     greater than `BIT_SIZE(I)', the value is undefined.  Bits shifted
15595     out from the left end are lost, and bits shifted in from the right
15596     end are set to 0.
15597
15598_Standard_:
15599     Fortran 2008 and later
15600
15601_Class_:
15602     Elemental function
15603
15604_Syntax_:
15605     `RESULT = SHIFTL(I, SHIFT)'
15606
15607_Arguments_:
15608     I          The type shall be `INTEGER'.
15609     SHIFT      The type shall be `INTEGER'.
15610
15611_Return value_:
15612     The return value is of type `INTEGER' and of the same kind as I.
15613
15614_See also_:
15615     *note SHIFTA::, *note SHIFTR::
15616
15617
15618File: gfortran.info,  Node: SHIFTR,  Next: SIGN,  Prev: SHIFTL,  Up: Intrinsic Procedures
15619
156209.236 `SHIFTR' -- Right shift
15621=============================
15622
15623_Description_:
15624     `SHIFTR' returns a value corresponding to I with all of the bits
15625     shifted right by SHIFT places.  If the absolute value of SHIFT is
15626     greater than `BIT_SIZE(I)', the value is undefined.  Bits shifted
15627     out from the right end are lost, and bits shifted in from the left
15628     end are set to 0.
15629
15630_Standard_:
15631     Fortran 2008 and later
15632
15633_Class_:
15634     Elemental function
15635
15636_Syntax_:
15637     `RESULT = SHIFTR(I, SHIFT)'
15638
15639_Arguments_:
15640     I          The type shall be `INTEGER'.
15641     SHIFT      The type shall be `INTEGER'.
15642
15643_Return value_:
15644     The return value is of type `INTEGER' and of the same kind as I.
15645
15646_See also_:
15647     *note SHIFTA::, *note SHIFTL::
15648
15649
15650File: gfortran.info,  Node: SIGN,  Next: SIGNAL,  Prev: SHIFTR,  Up: Intrinsic Procedures
15651
156529.237 `SIGN' -- Sign copying function
15653=====================================
15654
15655_Description_:
15656     `SIGN(A,B)' returns the value of A with the sign of B.
15657
15658_Standard_:
15659     Fortran 77 and later
15660
15661_Class_:
15662     Elemental function
15663
15664_Syntax_:
15665     `RESULT = SIGN(A, B)'
15666
15667_Arguments_:
15668     A          Shall be of type `INTEGER' or `REAL'
15669     B          Shall be of the same type and kind as A
15670
15671_Return value_:
15672     The kind of the return value is that of A and B.  If B\ge 0 then
15673     the result is `ABS(A)', else it is `-ABS(A)'.
15674
15675_Example_:
15676          program test_sign
15677            print *, sign(-12,1)
15678            print *, sign(-12,0)
15679            print *, sign(-12,-1)
15680
15681            print *, sign(-12.,1.)
15682            print *, sign(-12.,0.)
15683            print *, sign(-12.,-1.)
15684          end program test_sign
15685
15686_Specific names_:
15687     Name          Arguments     Return type   Standard
15688     `SIGN(A,B)'   `REAL(4) A,   `REAL(4)'     f77, gnu
15689                   B'                          
15690     `ISIGN(A,B)'  `INTEGER(4)   `INTEGER(4)'  f77, gnu
15691                   A, B'                       
15692     `DSIGN(A,B)'  `REAL(8) A,   `REAL(8)'     f77, gnu
15693                   B'                          
15694
15695
15696File: gfortran.info,  Node: SIGNAL,  Next: SIN,  Prev: SIGN,  Up: Intrinsic Procedures
15697
156989.238 `SIGNAL' -- Signal handling subroutine (or function)
15699==========================================================
15700
15701_Description_:
15702     `SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
15703     HANDLER to be executed with a single integer argument when signal
15704     NUMBER occurs.  If HANDLER is an integer, it can be used to turn
15705     off handling of signal NUMBER or revert to its default action.
15706     See `signal(2)'.
15707
15708     If `SIGNAL' is called as a subroutine and the STATUS argument is
15709     supplied, it is set to the value returned by `signal(2)'.
15710
15711_Standard_:
15712     GNU extension
15713
15714_Class_:
15715     Subroutine, function
15716
15717_Syntax_:
15718     `CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
15719     `STATUS = SIGNAL(NUMBER, HANDLER)'
15720
15721_Arguments_:
15722     NUMBER     Shall be a scalar integer, with `INTENT(IN)'
15723     HANDLER    Signal handler (`INTEGER FUNCTION' or
15724                `SUBROUTINE') or dummy/global `INTEGER' scalar.
15725                `INTEGER'. It is `INTENT(IN)'.
15726     STATUS     (Optional) STATUS shall be a scalar integer.
15727                It has `INTENT(OUT)'.
15728
15729_Return value_:
15730     The `SIGNAL' function returns the value returned by `signal(2)'.
15731
15732_Example_:
15733          program test_signal
15734            intrinsic signal
15735            external handler_print
15736
15737            call signal (12, handler_print)
15738            call signal (10, 1)
15739
15740            call sleep (30)
15741          end program test_signal
15742
15743
15744File: gfortran.info,  Node: SIN,  Next: SINH,  Prev: SIGNAL,  Up: Intrinsic Procedures
15745
157469.239 `SIN' -- Sine function
15747============================
15748
15749_Description_:
15750     `SIN(X)' computes the sine of X.
15751
15752_Standard_:
15753     Fortran 77 and later
15754
15755_Class_:
15756     Elemental function
15757
15758_Syntax_:
15759     `RESULT = SIN(X)'
15760
15761_Arguments_:
15762     X          The type shall be `REAL' or `COMPLEX'.
15763
15764_Return value_:
15765     The return value has same type and kind as X.
15766
15767_Example_:
15768          program test_sin
15769            real :: x = 0.0
15770            x = sin(x)
15771          end program test_sin
15772
15773_Specific names_:
15774     Name          Argument      Return type   Standard
15775     `SIN(X)'      `REAL(4) X'   `REAL(4)'     f77, gnu
15776     `DSIN(X)'     `REAL(8) X'   `REAL(8)'     f95, gnu
15777     `CSIN(X)'     `COMPLEX(4)   `COMPLEX(4)'  f95, gnu
15778                   X'                          
15779     `ZSIN(X)'     `COMPLEX(8)   `COMPLEX(8)'  f95, gnu
15780                   X'                          
15781     `CDSIN(X)'    `COMPLEX(8)   `COMPLEX(8)'  f95, gnu
15782                   X'                          
15783
15784_See also_:
15785     *note ASIN::
15786
15787
15788File: gfortran.info,  Node: SINH,  Next: SIZE,  Prev: SIN,  Up: Intrinsic Procedures
15789
157909.240 `SINH' -- Hyperbolic sine function
15791========================================
15792
15793_Description_:
15794     `SINH(X)' computes the hyperbolic sine of X.
15795
15796_Standard_:
15797     Fortran 95 and later, for a complex argument Fortran 2008 or later
15798
15799_Class_:
15800     Elemental function
15801
15802_Syntax_:
15803     `RESULT = SINH(X)'
15804
15805_Arguments_:
15806     X          The type shall be `REAL' or `COMPLEX'.
15807
15808_Return value_:
15809     The return value has same type and kind as X.
15810
15811_Example_:
15812          program test_sinh
15813            real(8) :: x = - 1.0_8
15814            x = sinh(x)
15815          end program test_sinh
15816
15817_Specific names_:
15818     Name          Argument      Return type   Standard
15819     `SINH(X)'     `REAL(4) X'   `REAL(4)'     Fortran 95 and
15820                                               later
15821     `DSINH(X)'    `REAL(8) X'   `REAL(8)'     Fortran 95 and
15822                                               later
15823
15824_See also_:
15825     *note ASINH::
15826
15827
15828File: gfortran.info,  Node: SIZE,  Next: SIZEOF,  Prev: SINH,  Up: Intrinsic Procedures
15829
158309.241 `SIZE' -- Determine the size of an array
15831==============================================
15832
15833_Description_:
15834     Determine the extent of ARRAY along a specified dimension DIM, or
15835     the total number of elements in ARRAY if DIM is absent.
15836
15837_Standard_:
15838     Fortran 95 and later, with KIND argument Fortran 2003 and later
15839
15840_Class_:
15841     Inquiry function
15842
15843_Syntax_:
15844     `RESULT = SIZE(ARRAY[, DIM [, KIND]])'
15845
15846_Arguments_:
15847     ARRAY      Shall be an array of any type. If ARRAY is a
15848                pointer it must be associated and allocatable
15849                arrays must be allocated.
15850     DIM        (Optional) shall be a scalar of type `INTEGER'
15851                and its value shall be in the range from 1 to
15852                n, where n equals the rank of ARRAY.
15853     KIND       (Optional) An `INTEGER' initialization
15854                expression indicating the kind parameter of
15855                the result.
15856
15857_Return value_:
15858     The return value is of type `INTEGER' and of kind KIND. If KIND is
15859     absent, the return value is of default integer kind.
15860
15861_Example_:
15862          PROGRAM test_size
15863            WRITE(*,*) SIZE((/ 1, 2 /))    ! 2
15864          END PROGRAM
15865
15866_See also_:
15867     *note SHAPE::, *note RESHAPE::
15868
15869
15870File: gfortran.info,  Node: SIZEOF,  Next: SLEEP,  Prev: SIZE,  Up: Intrinsic Procedures
15871
158729.242 `SIZEOF' -- Size in bytes of an expression
15873================================================
15874
15875_Description_:
15876     `SIZEOF(X)' calculates the number of bytes of storage the
15877     expression `X' occupies.
15878
15879_Standard_:
15880     GNU extension
15881
15882_Class_:
15883     Inquiry function
15884
15885_Syntax_:
15886     `N = SIZEOF(X)'
15887
15888_Arguments_:
15889     X          The argument shall be of any type, rank or
15890                shape.
15891
15892_Return value_:
15893     The return value is of type integer and of the system-dependent
15894     kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the
15895     number of bytes occupied by the argument.  If the argument has the
15896     `POINTER' attribute, the number of bytes of the storage area
15897     pointed to is returned.  If the argument is of a derived type with
15898     `POINTER' or `ALLOCATABLE' components, the return value does not
15899     account for the sizes of the data pointed to by these components.
15900     If the argument is polymorphic, the size according to the dynamic
15901     type is returned. The argument may not be a procedure or procedure
15902     pointer. Note that the code assumes for arrays that those are
15903     contiguous; for contiguous arrays, it returns the storage or an
15904     array element multiplied by the size of the array.
15905
15906_Example_:
15907             integer :: i
15908             real :: r, s(5)
15909             print *, (sizeof(s)/sizeof(r) == 5)
15910             end
15911     The example will print `.TRUE.' unless you are using a platform
15912     where default `REAL' variables are unusually padded.
15913
15914_See also_:
15915     *note C_SIZEOF::, *note STORAGE_SIZE::
15916
15917
15918File: gfortran.info,  Node: SLEEP,  Next: SPACING,  Prev: SIZEOF,  Up: Intrinsic Procedures
15919
159209.243 `SLEEP' -- Sleep for the specified number of seconds
15921==========================================================
15922
15923_Description_:
15924     Calling this subroutine causes the process to pause for SECONDS
15925     seconds.
15926
15927_Standard_:
15928     GNU extension
15929
15930_Class_:
15931     Subroutine
15932
15933_Syntax_:
15934     `CALL SLEEP(SECONDS)'
15935
15936_Arguments_:
15937     SECONDS    The type shall be of default `INTEGER'.
15938
15939_Example_:
15940          program test_sleep
15941            call sleep(5)
15942          end
15943
15944
15945File: gfortran.info,  Node: SPACING,  Next: SPREAD,  Prev: SLEEP,  Up: Intrinsic Procedures
15946
159479.244 `SPACING' -- Smallest distance between two numbers of a given type
15948========================================================================
15949
15950_Description_:
15951     Determines the distance between the argument X and the nearest
15952     adjacent number of the same type.
15953
15954_Standard_:
15955     Fortran 95 and later
15956
15957_Class_:
15958     Elemental function
15959
15960_Syntax_:
15961     `RESULT = SPACING(X)'
15962
15963_Arguments_:
15964     X          Shall be of type `REAL'.
15965
15966_Return value_:
15967     The result is of the same type as the input argument X.
15968
15969_Example_:
15970          PROGRAM test_spacing
15971            INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
15972            INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
15973
15974            WRITE(*,*) spacing(1.0_SGL)      ! "1.1920929E-07"          on i686
15975            WRITE(*,*) spacing(1.0_DBL)      ! "2.220446049250313E-016" on i686
15976          END PROGRAM
15977
15978_See also_:
15979     *note RRSPACING::
15980
15981
15982File: gfortran.info,  Node: SPREAD,  Next: SQRT,  Prev: SPACING,  Up: Intrinsic Procedures
15983
159849.245 `SPREAD' -- Add a dimension to an array
15985=============================================
15986
15987_Description_:
15988     Replicates a SOURCE array NCOPIES times along a specified
15989     dimension DIM.
15990
15991_Standard_:
15992     Fortran 95 and later
15993
15994_Class_:
15995     Transformational function
15996
15997_Syntax_:
15998     `RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
15999
16000_Arguments_:
16001     SOURCE     Shall be a scalar or an array of any type and
16002                a rank less than seven.
16003     DIM        Shall be a scalar of type `INTEGER' with a
16004                value in the range from 1 to n+1, where n
16005                equals the rank of SOURCE.
16006     NCOPIES    Shall be a scalar of type `INTEGER'.
16007
16008_Return value_:
16009     The result is an array of the same type as SOURCE and has rank n+1
16010     where n equals the rank of SOURCE.
16011
16012_Example_:
16013          PROGRAM test_spread
16014            INTEGER :: a = 1, b(2) = (/ 1, 2 /)
16015            WRITE(*,*) SPREAD(A, 1, 2)            ! "1 1"
16016            WRITE(*,*) SPREAD(B, 1, 2)            ! "1 1 2 2"
16017          END PROGRAM
16018
16019_See also_:
16020     *note UNPACK::
16021
16022
16023File: gfortran.info,  Node: SQRT,  Next: SRAND,  Prev: SPREAD,  Up: Intrinsic Procedures
16024
160259.246 `SQRT' -- Square-root function
16026====================================
16027
16028_Description_:
16029     `SQRT(X)' computes the square root of X.
16030
16031_Standard_:
16032     Fortran 77 and later
16033
16034_Class_:
16035     Elemental function
16036
16037_Syntax_:
16038     `RESULT = SQRT(X)'
16039
16040_Arguments_:
16041     X          The type shall be `REAL' or `COMPLEX'.
16042
16043_Return value_:
16044     The return value is of type `REAL' or `COMPLEX'.  The kind type
16045     parameter is the same as X.
16046
16047_Example_:
16048          program test_sqrt
16049            real(8) :: x = 2.0_8
16050            complex :: z = (1.0, 2.0)
16051            x = sqrt(x)
16052            z = sqrt(z)
16053          end program test_sqrt
16054
16055_Specific names_:
16056     Name          Argument      Return type   Standard
16057     `SQRT(X)'     `REAL(4) X'   `REAL(4)'     Fortran 95 and
16058                                               later
16059     `DSQRT(X)'    `REAL(8) X'   `REAL(8)'     Fortran 95 and
16060                                               later
16061     `CSQRT(X)'    `COMPLEX(4)   `COMPLEX(4)'  Fortran 95 and
16062                   X'                          later
16063     `ZSQRT(X)'    `COMPLEX(8)   `COMPLEX(8)'  GNU extension
16064                   X'                          
16065     `CDSQRT(X)'   `COMPLEX(8)   `COMPLEX(8)'  GNU extension
16066                   X'                          
16067
16068
16069File: gfortran.info,  Node: SRAND,  Next: STAT,  Prev: SQRT,  Up: Intrinsic Procedures
16070
160719.247 `SRAND' -- Reinitialize the random number generator
16072=========================================================
16073
16074_Description_:
16075     `SRAND' reinitializes the pseudo-random number generator called by
16076     `RAND' and `IRAND'. The new seed used by the generator is
16077     specified by the required argument SEED.
16078
16079_Standard_:
16080     GNU extension
16081
16082_Class_:
16083     Subroutine
16084
16085_Syntax_:
16086     `CALL SRAND(SEED)'
16087
16088_Arguments_:
16089     SEED       Shall be a scalar `INTEGER(kind=4)'.
16090
16091_Return value_:
16092     Does not return anything.
16093
16094_Example_:
16095     See `RAND' and `IRAND' for examples.
16096
16097_Notes_:
16098     The Fortran 2003 standard specifies the intrinsic `RANDOM_SEED' to
16099     initialize the pseudo-random numbers generator and `RANDOM_NUMBER'
16100     to generate pseudo-random numbers. Please note that in GNU
16101     Fortran, these two sets of intrinsics (`RAND', `IRAND' and `SRAND'
16102     on the one hand, `RANDOM_NUMBER' and `RANDOM_SEED' on the other
16103     hand) access two independent pseudo-random number generators.
16104
16105_See also_:
16106     *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
16107
16108
16109
16110File: gfortran.info,  Node: STAT,  Next: STORAGE_SIZE,  Prev: SRAND,  Up: Intrinsic Procedures
16111
161129.248 `STAT' -- Get file status
16113===============================
16114
16115_Description_:
16116     This function returns information about a file. No permissions are
16117     required on the file itself, but execute (search) permission is
16118     required on all of the directories in path that lead to the file.
16119
16120     The elements that are obtained and stored in the array `VALUES':
16121     `VALUES(1)'Device ID
16122     `VALUES(2)'Inode number
16123     `VALUES(3)'File mode
16124     `VALUES(4)'Number of links
16125     `VALUES(5)'Owner's uid
16126     `VALUES(6)'Owner's gid
16127     `VALUES(7)'ID of device containing directory entry for
16128                file (0 if not available)
16129     `VALUES(8)'File size (bytes)
16130     `VALUES(9)'Last access time
16131     `VALUES(10)'Last modification time
16132     `VALUES(11)'Last file status change time
16133     `VALUES(12)'Preferred I/O block size (-1 if not available)
16134     `VALUES(13)'Number of blocks allocated (-1 if not
16135                available)
16136
16137     Not all these elements are relevant on all systems.  If an element
16138     is not relevant, it is returned as 0.
16139
16140     This intrinsic is provided in both subroutine and function forms;
16141     however, only one form can be used in any given program unit.
16142
16143_Standard_:
16144     GNU extension
16145
16146_Class_:
16147     Subroutine, function
16148
16149_Syntax_:
16150     `CALL STAT(NAME, VALUES [, STATUS])'
16151     `STATUS = STAT(NAME, VALUES)'
16152
16153_Arguments_:
16154     NAME       The type shall be `CHARACTER', of the default
16155                kind and a valid path within the file system.
16156     VALUES     The type shall be `INTEGER(4), DIMENSION(13)'.
16157     STATUS     (Optional) status flag of type `INTEGER(4)'.
16158                Returns 0 on success and a system specific
16159                error code otherwise.
16160
16161_Example_:
16162          PROGRAM test_stat
16163            INTEGER, DIMENSION(13) :: buff
16164            INTEGER :: status
16165
16166            CALL STAT("/etc/passwd", buff, status)
16167
16168            IF (status == 0) THEN
16169              WRITE (*, FMT="('Device ID:',               T30, I19)") buff(1)
16170              WRITE (*, FMT="('Inode number:',            T30, I19)") buff(2)
16171              WRITE (*, FMT="('File mode (octal):',       T30, O19)") buff(3)
16172              WRITE (*, FMT="('Number of links:',         T30, I19)") buff(4)
16173              WRITE (*, FMT="('Owner''s uid:',            T30, I19)") buff(5)
16174              WRITE (*, FMT="('Owner''s gid:',            T30, I19)") buff(6)
16175              WRITE (*, FMT="('Device where located:',    T30, I19)") buff(7)
16176              WRITE (*, FMT="('File size:',               T30, I19)") buff(8)
16177              WRITE (*, FMT="('Last access time:',        T30, A19)") CTIME(buff(9))
16178              WRITE (*, FMT="('Last modification time',   T30, A19)") CTIME(buff(10))
16179              WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
16180              WRITE (*, FMT="('Preferred block size:',    T30, I19)") buff(12)
16181              WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
16182            END IF
16183          END PROGRAM
16184
16185_See also_:
16186     To stat an open file: *note FSTAT::, to stat a link: *note LSTAT::
16187
16188
16189File: gfortran.info,  Node: STORAGE_SIZE,  Next: SUM,  Prev: STAT,  Up: Intrinsic Procedures
16190
161919.249 `STORAGE_SIZE' -- Storage size in bits
16192============================================
16193
16194_Description_:
16195     Returns the storage size of argument A in bits.
16196
16197_Standard_:
16198     Fortran 2008 and later
16199
16200_Class_:
16201     Inquiry function
16202
16203_Syntax_:
16204     `RESULT = STORAGE_SIZE(A [, KIND])'
16205
16206_Arguments_:
16207     A          Shall be a scalar or array of any type.
16208     KIND       (Optional) shall be a scalar integer constant
16209                expression.
16210
16211_Return Value_:
16212     The result is a scalar integer with the kind type parameter
16213     specified by KIND (or default integer type if KIND is missing).
16214     The result value is the size expressed in bits for an element of
16215     an array that has the dynamic type and type parameters of A.
16216
16217_See also_:
16218     *note C_SIZEOF::, *note SIZEOF::
16219
16220
16221File: gfortran.info,  Node: SUM,  Next: SYMLNK,  Prev: STORAGE_SIZE,  Up: Intrinsic Procedures
16222
162239.250 `SUM' -- Sum of array elements
16224====================================
16225
16226_Description_:
16227     Adds the elements of ARRAY along dimension DIM if the
16228     corresponding element in MASK is `TRUE'.
16229
16230_Standard_:
16231     Fortran 95 and later
16232
16233_Class_:
16234     Transformational function
16235
16236_Syntax_:
16237     `RESULT = SUM(ARRAY[, MASK])'
16238     `RESULT = SUM(ARRAY, DIM[, MASK])'
16239
16240_Arguments_:
16241     ARRAY      Shall be an array of type `INTEGER', `REAL' or
16242                `COMPLEX'.
16243     DIM        (Optional) shall be a scalar of type `INTEGER'
16244                with a value in the range from 1 to n, where n
16245                equals the rank of ARRAY.
16246     MASK       (Optional) shall be of type `LOGICAL' and
16247                either be a scalar or an array of the same
16248                shape as ARRAY.
16249
16250_Return value_:
16251     The result is of the same type as ARRAY.
16252
16253     If DIM is absent, a scalar with the sum of all elements in ARRAY
16254     is returned. Otherwise, an array of rank n-1, where n equals the
16255     rank of ARRAY, and a shape similar to that of ARRAY with dimension
16256     DIM dropped is returned.
16257
16258_Example_:
16259          PROGRAM test_sum
16260            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
16261            print *, SUM(x)                        ! all elements, sum = 15
16262            print *, SUM(x, MASK=MOD(x, 2)==1)     ! odd elements, sum = 9
16263          END PROGRAM
16264
16265_See also_:
16266     *note PRODUCT::
16267
16268
16269File: gfortran.info,  Node: SYMLNK,  Next: SYSTEM,  Prev: SUM,  Up: Intrinsic Procedures
16270
162719.251 `SYMLNK' -- Create a symbolic link
16272========================================
16273
16274_Description_:
16275     Makes a symbolic link from file PATH1 to PATH2. A null character
16276     (`CHAR(0)') can be used to mark the end of the names in PATH1 and
16277     PATH2; otherwise, trailing blanks in the file names are ignored.
16278     If the STATUS argument is supplied, it contains 0 on success or a
16279     nonzero error code upon return; see `symlink(2)'.  If the system
16280     does not supply `symlink(2)', `ENOSYS' is returned.
16281
16282     This intrinsic is provided in both subroutine and function forms;
16283     however, only one form can be used in any given program unit.
16284
16285_Standard_:
16286     GNU extension
16287
16288_Class_:
16289     Subroutine, function
16290
16291_Syntax_:
16292     `CALL SYMLNK(PATH1, PATH2 [, STATUS])'
16293     `STATUS = SYMLNK(PATH1, PATH2)'
16294
16295_Arguments_:
16296     PATH1      Shall be of default `CHARACTER' type.
16297     PATH2      Shall be of default `CHARACTER' type.
16298     STATUS     (Optional) Shall be of default `INTEGER' type.
16299
16300_See also_:
16301     *note LINK::, *note UNLINK::
16302
16303
16304
16305File: gfortran.info,  Node: SYSTEM,  Next: SYSTEM_CLOCK,  Prev: SYMLNK,  Up: Intrinsic Procedures
16306
163079.252 `SYSTEM' -- Execute a shell command
16308=========================================
16309
16310_Description_:
16311     Passes the command COMMAND to a shell (see `system(3)'). If
16312     argument STATUS is present, it contains the value returned by
16313     `system(3)', which is presumably 0 if the shell command succeeded.
16314     Note that which shell is used to invoke the command is
16315     system-dependent and environment-dependent.
16316
16317     This intrinsic is provided in both subroutine and function forms;
16318     however, only one form can be used in any given program unit.
16319
16320     Note that the `system' function need not be thread-safe. It is the
16321     responsibility of the user to ensure that `system' is not called
16322     concurrently.
16323
16324_Standard_:
16325     GNU extension
16326
16327_Class_:
16328     Subroutine, function
16329
16330_Syntax_:
16331     `CALL SYSTEM(COMMAND [, STATUS])'
16332     `STATUS = SYSTEM(COMMAND)'
16333
16334_Arguments_:
16335     COMMAND    Shall be of default `CHARACTER' type.
16336     STATUS     (Optional) Shall be of default `INTEGER' type.
16337
16338_See also_:
16339     *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
16340     standard and should considered in new code for future portability.
16341
16342
16343File: gfortran.info,  Node: SYSTEM_CLOCK,  Next: TAN,  Prev: SYSTEM,  Up: Intrinsic Procedures
16344
163459.253 `SYSTEM_CLOCK' -- Time function
16346=====================================
16347
16348_Description_:
16349     Determines the COUNT of a processor clock since an unspecified
16350     time in the past modulo COUNT_MAX, COUNT_RATE determines the
16351     number of clock ticks per second.  If the platform supports a
16352     monotonic clock, that clock is used and can, depending on the
16353     platform clock implementation, provide up to nanosecond
16354     resolution.  If a monotonic clock is not available, the
16355     implementation falls back to a realtime clock.
16356
16357     COUNT_RATE is system dependent and can vary depending on the kind
16358     of the arguments. For KIND=4 arguments (and smaller integer kinds),
16359     COUNT represents milliseconds, while for KIND=8 arguments (and
16360     larger integer kinds), COUNT typically represents micro- or
16361     nanoseconds depending on resolution of the underlying platform
16362     clock.  COUNT_MAX usually equals `HUGE(COUNT_MAX)'. Note that the
16363     millisecond resolution of the KIND=4 version implies that the
16364     COUNT will wrap around in roughly 25 days. In order to avoid issues
16365     with the wrap around and for more precise timing, please use the
16366     KIND=8 version.
16367
16368     If there is no clock, or querying the clock fails, COUNT is set to
16369     `-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
16370
16371     When running on a platform using the GNU C library (glibc) version
16372     2.16 or older, or a derivative thereof, the high resolution
16373     monotonic clock is available only when linking with the RT
16374     library.  This can be done explicitly by adding the `-lrt' flag
16375     when linking the application, but is also done implicitly when
16376     using OpenMP.
16377
16378     On the Windows platform, the version with KIND=4 arguments uses
16379     the `GetTickCount' function, whereas the KIND=8 version uses
16380     `QueryPerformanceCounter' and `QueryPerformanceCounterFrequency'.
16381     For more information, and potential caveats, please see the
16382     platform documentation.
16383
16384_Standard_:
16385     Fortran 95 and later
16386
16387_Class_:
16388     Subroutine
16389
16390_Syntax_:
16391     `CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
16392
16393_Arguments_:
16394     COUNT      (Optional) shall be a scalar of type `INTEGER'
16395                with `INTENT(OUT)'.
16396     COUNT_RATE (Optional) shall be a scalar of type `INTEGER'
16397                or `REAL', with `INTENT(OUT)'.
16398     COUNT_MAX  (Optional) shall be a scalar of type `INTEGER'
16399                with `INTENT(OUT)'.
16400
16401_Example_:
16402          PROGRAM test_system_clock
16403            INTEGER :: count, count_rate, count_max
16404            CALL SYSTEM_CLOCK(count, count_rate, count_max)
16405            WRITE(*,*) count, count_rate, count_max
16406          END PROGRAM
16407
16408_See also_:
16409     *note DATE_AND_TIME::, *note CPU_TIME::
16410
16411
16412File: gfortran.info,  Node: TAN,  Next: TANH,  Prev: SYSTEM_CLOCK,  Up: Intrinsic Procedures
16413
164149.254 `TAN' -- Tangent function
16415===============================
16416
16417_Description_:
16418     `TAN(X)' computes the tangent of X.
16419
16420_Standard_:
16421     Fortran 77 and later, for a complex argument Fortran 2008 or later
16422
16423_Class_:
16424     Elemental function
16425
16426_Syntax_:
16427     `RESULT = TAN(X)'
16428
16429_Arguments_:
16430     X          The type shall be `REAL' or `COMPLEX'.
16431
16432_Return value_:
16433     The return value has same type and kind as X.
16434
16435_Example_:
16436          program test_tan
16437            real(8) :: x = 0.165_8
16438            x = tan(x)
16439          end program test_tan
16440
16441_Specific names_:
16442     Name          Argument      Return type   Standard
16443     `TAN(X)'      `REAL(4) X'   `REAL(4)'     Fortran 95 and
16444                                               later
16445     `DTAN(X)'     `REAL(8) X'   `REAL(8)'     Fortran 95 and
16446                                               later
16447
16448_See also_:
16449     *note ATAN::
16450
16451
16452File: gfortran.info,  Node: TANH,  Next: THIS_IMAGE,  Prev: TAN,  Up: Intrinsic Procedures
16453
164549.255 `TANH' -- Hyperbolic tangent function
16455===========================================
16456
16457_Description_:
16458     `TANH(X)' computes the hyperbolic tangent of X.
16459
16460_Standard_:
16461     Fortran 77 and later, for a complex argument Fortran 2008 or later
16462
16463_Class_:
16464     Elemental function
16465
16466_Syntax_:
16467     `X = TANH(X)'
16468
16469_Arguments_:
16470     X          The type shall be `REAL' or `COMPLEX'.
16471
16472_Return value_:
16473     The return value has same type and kind as X. If X is complex, the
16474     imaginary part of the result is in radians. If X is `REAL', the
16475     return value lies in the range  - 1 \leq tanh(x) \leq 1 .
16476
16477_Example_:
16478          program test_tanh
16479            real(8) :: x = 2.1_8
16480            x = tanh(x)
16481          end program test_tanh
16482
16483_Specific names_:
16484     Name          Argument      Return type   Standard
16485     `TANH(X)'     `REAL(4) X'   `REAL(4)'     Fortran 95 and
16486                                               later
16487     `DTANH(X)'    `REAL(8) X'   `REAL(8)'     Fortran 95 and
16488                                               later
16489
16490_See also_:
16491     *note ATANH::
16492
16493
16494File: gfortran.info,  Node: THIS_IMAGE,  Next: TIME,  Prev: TANH,  Up: Intrinsic Procedures
16495
164969.256 `THIS_IMAGE' -- Function that returns the cosubscript index of this image
16497===============================================================================
16498
16499_Description_:
16500     Returns the cosubscript for this image.
16501
16502_Standard_:
16503     Fortran 2008 and later. With DISTANCE argument, Technical
16504     Specification (TS) 18508 or later
16505
16506_Class_:
16507     Transformational function
16508
16509_Syntax_:
16510     `RESULT = THIS_IMAGE()'
16511     `RESULT = THIS_IMAGE(DISTANCE)'
16512     `RESULT = THIS_IMAGE(COARRAY [, DIM])'
16513
16514_Arguments_:
16515     DISTANCE   (optional, intent(in)) Nonnegative scalar
16516                integer (not permitted together with COARRAY).
16517     COARRAY    Coarray of any type  (optional; if DIM
16518                present, required).
16519     DIM        default integer scalar (optional). If present,
16520                DIM shall be between one and the corank of
16521                COARRAY.
16522
16523_Return value_:
16524     Default integer. If COARRAY is not present, it is scalar; if
16525     DISTANCE is not present or has value 0, its value is the image
16526     index on the invoking image for the current team, for values
16527     smaller or equal distance to the initial team, it returns the
16528     image index on the ancestor team which has a distance of DISTANCE
16529     from the invoking team. If DISTANCE is larger than the distance to
16530     the initial team, the image index of the initial team is returned.
16531     Otherwise when the COARRAY is present, if DIM is not present, a
16532     rank-1 array with corank elements is returned, containing the
16533     cosubscripts for COARRAY specifying the invoking image. If DIM is
16534     present, a scalar is returned, with the value of the DIM element
16535     of `THIS_IMAGE(COARRAY)'.
16536
16537_Example_:
16538          INTEGER :: value[*]
16539          INTEGER :: i
16540          value = THIS_IMAGE()
16541          SYNC ALL
16542          IF (THIS_IMAGE() == 1) THEN
16543            DO i = 1, NUM_IMAGES()
16544              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
16545            END DO
16546          END IF
16547
16548          ! Check whether the current image is the initial image
16549          IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
16550            error stop "something is rotten here"
16551
16552_See also_:
16553     *note NUM_IMAGES::, *note IMAGE_INDEX::
16554
16555
16556File: gfortran.info,  Node: TIME,  Next: TIME8,  Prev: THIS_IMAGE,  Up: Intrinsic Procedures
16557
165589.257 `TIME' -- Time function
16559=============================
16560
16561_Description_:
16562     Returns the current time encoded as an integer (in the manner of
16563     the function `time(3)' in the C standard library). This value is
16564     suitable for passing to `CTIME', `GMTIME', and `LTIME'.
16565
16566     This intrinsic is not fully portable, such as to systems with
16567     32-bit `INTEGER' types but supporting times wider than 32 bits.
16568     Therefore, the values returned by this intrinsic might be, or
16569     become, negative, or numerically less than previous values, during
16570     a single run of the compiled program.
16571
16572     See *note TIME8::, for information on a similar intrinsic that
16573     might be portable to more GNU Fortran implementations, though to
16574     fewer Fortran compilers.
16575
16576_Standard_:
16577     GNU extension
16578
16579_Class_:
16580     Function
16581
16582_Syntax_:
16583     `RESULT = TIME()'
16584
16585_Return value_:
16586     The return value is a scalar of type `INTEGER(4)'.
16587
16588_See also_:
16589     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::,
16590     *note TIME8::
16591
16592
16593
16594File: gfortran.info,  Node: TIME8,  Next: TINY,  Prev: TIME,  Up: Intrinsic Procedures
16595
165969.258 `TIME8' -- Time function (64-bit)
16597=======================================
16598
16599_Description_:
16600     Returns the current time encoded as an integer (in the manner of
16601     the function `time(3)' in the C standard library). This value is
16602     suitable for passing to `CTIME', `GMTIME', and `LTIME'.
16603
16604     _Warning:_ this intrinsic does not increase the range of the timing
16605     values over that returned by `time(3)'. On a system with a 32-bit
16606     `time(3)', `TIME8' will return a 32-bit value, even though it is
16607     converted to a 64-bit `INTEGER(8)' value. That means overflows of
16608     the 32-bit value can still occur. Therefore, the values returned
16609     by this intrinsic might be or become negative or numerically less
16610     than previous values during a single run of the compiled program.
16611
16612_Standard_:
16613     GNU extension
16614
16615_Class_:
16616     Function
16617
16618_Syntax_:
16619     `RESULT = TIME8()'
16620
16621_Return value_:
16622     The return value is a scalar of type `INTEGER(8)'.
16623
16624_See also_:
16625     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK8::,
16626     *note TIME::
16627
16628
16629
16630File: gfortran.info,  Node: TINY,  Next: TRAILZ,  Prev: TIME8,  Up: Intrinsic Procedures
16631
166329.259 `TINY' -- Smallest positive number of a real kind
16633=======================================================
16634
16635_Description_:
16636     `TINY(X)' returns the smallest positive (non zero) number in the
16637     model of the type of `X'.
16638
16639_Standard_:
16640     Fortran 95 and later
16641
16642_Class_:
16643     Inquiry function
16644
16645_Syntax_:
16646     `RESULT = TINY(X)'
16647
16648_Arguments_:
16649     X          Shall be of type `REAL'.
16650
16651_Return value_:
16652     The return value is of the same type and kind as X
16653
16654_Example_:
16655     See `HUGE' for an example.
16656
16657
16658File: gfortran.info,  Node: TRAILZ,  Next: TRANSFER,  Prev: TINY,  Up: Intrinsic Procedures
16659
166609.260 `TRAILZ' -- Number of trailing zero bits of an integer
16661============================================================
16662
16663_Description_:
16664     `TRAILZ' returns the number of trailing zero bits of an integer.
16665
16666_Standard_:
16667     Fortran 2008 and later
16668
16669_Class_:
16670     Elemental function
16671
16672_Syntax_:
16673     `RESULT = TRAILZ(I)'
16674
16675_Arguments_:
16676     I          Shall be of type `INTEGER'.
16677
16678_Return value_:
16679     The type of the return value is the default `INTEGER'.  If all the
16680     bits of `I' are zero, the result value is `BIT_SIZE(I)'.
16681
16682_Example_:
16683          PROGRAM test_trailz
16684            WRITE (*,*) TRAILZ(8)  ! prints 3
16685          END PROGRAM
16686
16687_See also_:
16688     *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
16689
16690
16691File: gfortran.info,  Node: TRANSFER,  Next: TRANSPOSE,  Prev: TRAILZ,  Up: Intrinsic Procedures
16692
166939.261 `TRANSFER' -- Transfer bit patterns
16694=========================================
16695
16696_Description_:
16697     Interprets the bitwise representation of SOURCE in memory as if it
16698     is the representation of a variable or array of the same type and
16699     type parameters as MOLD.
16700
16701     This is approximately equivalent to the C concept of _casting_ one
16702     type to another.
16703
16704_Standard_:
16705     Fortran 95 and later
16706
16707_Class_:
16708     Transformational function
16709
16710_Syntax_:
16711     `RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
16712
16713_Arguments_:
16714     SOURCE     Shall be a scalar or an array of any type.
16715     MOLD       Shall be a scalar or an array of any type.
16716     SIZE       (Optional) shall be a scalar of type `INTEGER'.
16717
16718_Return value_:
16719     The result has the same type as MOLD, with the bit level
16720     representation of SOURCE.  If SIZE is present, the result is a
16721     one-dimensional array of length SIZE.  If SIZE is absent but MOLD
16722     is an array (of any size or shape), the result is a one-
16723     dimensional array of the minimum length needed to contain the
16724     entirety of the bitwise representation of SOURCE.   If SIZE is
16725     absent and MOLD is a scalar, the result is a scalar.
16726
16727     If the bitwise representation of the result is longer than that of
16728     SOURCE, then the leading bits of the result correspond to those of
16729     SOURCE and any trailing bits are filled arbitrarily.
16730
16731     When the resulting bit representation does not correspond to a
16732     valid representation of a variable of the same type as MOLD, the
16733     results are undefined, and subsequent operations on the result
16734     cannot be guaranteed to produce sensible behavior.  For example,
16735     it is possible to create `LOGICAL' variables for which `VAR' and
16736     `.NOT.VAR' both appear to be true.
16737
16738_Example_:
16739          PROGRAM test_transfer
16740            integer :: x = 2143289344
16741            print *, transfer(x, 1.0)    ! prints "NaN" on i686
16742          END PROGRAM
16743
16744
16745File: gfortran.info,  Node: TRANSPOSE,  Next: TRIM,  Prev: TRANSFER,  Up: Intrinsic Procedures
16746
167479.262 `TRANSPOSE' -- Transpose an array of rank two
16748===================================================
16749
16750_Description_:
16751     Transpose an array of rank two. Element (i, j) of the result has
16752     the value `MATRIX(j, i)', for all i, j.
16753
16754_Standard_:
16755     Fortran 95 and later
16756
16757_Class_:
16758     Transformational function
16759
16760_Syntax_:
16761     `RESULT = TRANSPOSE(MATRIX)'
16762
16763_Arguments_:
16764     MATRIX     Shall be an array of any type and have a rank
16765                of two.
16766
16767_Return value_:
16768     The result has the same type as MATRIX, and has shape `(/ m, n /)'
16769     if MATRIX has shape `(/ n, m /)'.
16770
16771
16772File: gfortran.info,  Node: TRIM,  Next: TTYNAM,  Prev: TRANSPOSE,  Up: Intrinsic Procedures
16773
167749.263 `TRIM' -- Remove trailing blank characters of a string
16775============================================================
16776
16777_Description_:
16778     Removes trailing blank characters of a string.
16779
16780_Standard_:
16781     Fortran 95 and later
16782
16783_Class_:
16784     Transformational function
16785
16786_Syntax_:
16787     `RESULT = TRIM(STRING)'
16788
16789_Arguments_:
16790     STRING     Shall be a scalar of type `CHARACTER'.
16791
16792_Return value_:
16793     A scalar of type `CHARACTER' which length is that of STRING less
16794     the number of trailing blanks.
16795
16796_Example_:
16797          PROGRAM test_trim
16798            CHARACTER(len=10), PARAMETER :: s = "GFORTRAN  "
16799            WRITE(*,*) LEN(s), LEN(TRIM(s))  ! "10 8", with/without trailing blanks
16800          END PROGRAM
16801
16802_See also_:
16803     *note ADJUSTL::, *note ADJUSTR::
16804
16805
16806File: gfortran.info,  Node: TTYNAM,  Next: UBOUND,  Prev: TRIM,  Up: Intrinsic Procedures
16807
168089.264 `TTYNAM' -- Get the name of a terminal device.
16809====================================================
16810
16811_Description_:
16812     Get the name of a terminal device. For more information, see
16813     `ttyname(3)'.
16814
16815     This intrinsic is provided in both subroutine and function forms;
16816     however, only one form can be used in any given program unit.
16817
16818_Standard_:
16819     GNU extension
16820
16821_Class_:
16822     Subroutine, function
16823
16824_Syntax_:
16825     `CALL TTYNAM(UNIT, NAME)'
16826     `NAME = TTYNAM(UNIT)'
16827
16828_Arguments_:
16829     UNIT       Shall be a scalar `INTEGER'.
16830     NAME       Shall be of type `CHARACTER'.
16831
16832_Example_:
16833          PROGRAM test_ttynam
16834            INTEGER :: unit
16835            DO unit = 1, 10
16836              IF (isatty(unit=unit)) write(*,*) ttynam(unit)
16837            END DO
16838          END PROGRAM
16839
16840_See also_:
16841     *note ISATTY::
16842
16843
16844File: gfortran.info,  Node: UBOUND,  Next: UCOBOUND,  Prev: TTYNAM,  Up: Intrinsic Procedures
16845
168469.265 `UBOUND' -- Upper dimension bounds of an array
16847====================================================
16848
16849_Description_:
16850     Returns the upper bounds of an array, or a single upper bound
16851     along the DIM dimension.
16852
16853_Standard_:
16854     Fortran 95 and later, with KIND argument Fortran 2003 and later
16855
16856_Class_:
16857     Inquiry function
16858
16859_Syntax_:
16860     `RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
16861
16862_Arguments_:
16863     ARRAY      Shall be an array, of any type.
16864     DIM        (Optional) Shall be a scalar `INTEGER'.
16865     KIND       (Optional) An `INTEGER' initialization
16866                expression indicating the kind parameter of
16867                the result.
16868
16869_Return value_:
16870     The return value is of type `INTEGER' and of kind KIND. If KIND is
16871     absent, the return value is of default integer kind.  If DIM is
16872     absent, the result is an array of the upper bounds of ARRAY.  If
16873     DIM is present, the result is a scalar corresponding to the upper
16874     bound of the array along that dimension.  If ARRAY is an
16875     expression rather than a whole array or array structure component,
16876     or if it has a zero extent along the relevant dimension, the upper
16877     bound is taken to be the number of elements along the relevant
16878     dimension.
16879
16880_See also_:
16881     *note LBOUND::, *note LCOBOUND::
16882
16883
16884File: gfortran.info,  Node: UCOBOUND,  Next: UMASK,  Prev: UBOUND,  Up: Intrinsic Procedures
16885
168869.266 `UCOBOUND' -- Upper codimension bounds of an array
16887========================================================
16888
16889_Description_:
16890     Returns the upper cobounds of a coarray, or a single upper cobound
16891     along the DIM codimension.
16892
16893_Standard_:
16894     Fortran 2008 and later
16895
16896_Class_:
16897     Inquiry function
16898
16899_Syntax_:
16900     `RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
16901
16902_Arguments_:
16903     ARRAY      Shall be an coarray, of any type.
16904     DIM        (Optional) Shall be a scalar `INTEGER'.
16905     KIND       (Optional) An `INTEGER' initialization
16906                expression indicating the kind parameter of
16907                the result.
16908
16909_Return value_:
16910     The return value is of type `INTEGER' and of kind KIND. If KIND is
16911     absent, the return value is of default integer kind.  If DIM is
16912     absent, the result is an array of the lower cobounds of COARRAY.
16913     If DIM is present, the result is a scalar corresponding to the
16914     lower cobound of the array along that codimension.
16915
16916_See also_:
16917     *note LCOBOUND::, *note LBOUND::
16918
16919
16920File: gfortran.info,  Node: UMASK,  Next: UNLINK,  Prev: UCOBOUND,  Up: Intrinsic Procedures
16921
169229.267 `UMASK' -- Set the file creation mask
16923===========================================
16924
16925_Description_:
16926     Sets the file creation mask to MASK. If called as a function, it
16927     returns the old value. If called as a subroutine and argument OLD
16928     if it is supplied, it is set to the old value. See `umask(2)'.
16929
16930_Standard_:
16931     GNU extension
16932
16933_Class_:
16934     Subroutine, function
16935
16936_Syntax_:
16937     `CALL UMASK(MASK [, OLD])'
16938     `OLD = UMASK(MASK)'
16939
16940_Arguments_:
16941     MASK       Shall be a scalar of type `INTEGER'.
16942     OLD        (Optional) Shall be a scalar of type `INTEGER'.
16943
16944
16945
16946File: gfortran.info,  Node: UNLINK,  Next: UNPACK,  Prev: UMASK,  Up: Intrinsic Procedures
16947
169489.268 `UNLINK' -- Remove a file from the file system
16949====================================================
16950
16951_Description_:
16952     Unlinks the file PATH. A null character (`CHAR(0)') can be used to
16953     mark the end of the name in PATH; otherwise, trailing blanks in
16954     the file name are ignored.  If the STATUS argument is supplied, it
16955     contains 0 on success or a nonzero error code upon return; see
16956     `unlink(2)'.
16957
16958     This intrinsic is provided in both subroutine and function forms;
16959     however, only one form can be used in any given program unit.
16960
16961_Standard_:
16962     GNU extension
16963
16964_Class_:
16965     Subroutine, function
16966
16967_Syntax_:
16968     `CALL UNLINK(PATH [, STATUS])'
16969     `STATUS = UNLINK(PATH)'
16970
16971_Arguments_:
16972     PATH       Shall be of default `CHARACTER' type.
16973     STATUS     (Optional) Shall be of default `INTEGER' type.
16974
16975_See also_:
16976     *note LINK::, *note SYMLNK::
16977
16978
16979File: gfortran.info,  Node: UNPACK,  Next: VERIFY,  Prev: UNLINK,  Up: Intrinsic Procedures
16980
169819.269 `UNPACK' -- Unpack an array of rank one into an array
16982===========================================================
16983
16984_Description_:
16985     Store the elements of VECTOR in an array of higher rank.
16986
16987_Standard_:
16988     Fortran 95 and later
16989
16990_Class_:
16991     Transformational function
16992
16993_Syntax_:
16994     `RESULT = UNPACK(VECTOR, MASK, FIELD)'
16995
16996_Arguments_:
16997     VECTOR     Shall be an array of any type and rank one. It
16998                shall have at least as many elements as MASK
16999                has `TRUE' values.
17000     MASK       Shall be an array of type `LOGICAL'.
17001     FIELD      Shall be of the same type as VECTOR and have
17002                the same shape as MASK.
17003
17004_Return value_:
17005     The resulting array corresponds to FIELD with `TRUE' elements of
17006     MASK replaced by values from VECTOR in array element order.
17007
17008_Example_:
17009          PROGRAM test_unpack
17010            integer :: vector(2)  = (/1,1/)
17011            logical :: mask(4)  = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
17012            integer :: field(2,2) = 0, unity(2,2)
17013
17014            ! result: unity matrix
17015            unity = unpack(vector, reshape(mask, (/2,2/)), field)
17016          END PROGRAM
17017
17018_See also_:
17019     *note PACK::, *note SPREAD::
17020
17021
17022File: gfortran.info,  Node: VERIFY,  Next: XOR,  Prev: UNPACK,  Up: Intrinsic Procedures
17023
170249.270 `VERIFY' -- Scan a string for characters not a given set
17025==============================================================
17026
17027_Description_:
17028     Verifies that all the characters in STRING belong to the set of
17029     characters in SET.
17030
17031     If BACK is either absent or equals `FALSE', this function returns
17032     the position of the leftmost character of STRING that is not in
17033     SET. If BACK equals `TRUE', the rightmost position is returned. If
17034     all characters of STRING are found in SET, the result is zero.
17035
17036_Standard_:
17037     Fortran 95 and later, with KIND argument Fortran 2003 and later
17038
17039_Class_:
17040     Elemental function
17041
17042_Syntax_:
17043     `RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
17044
17045_Arguments_:
17046     STRING     Shall be of type `CHARACTER'.
17047     SET        Shall be of type `CHARACTER'.
17048     BACK       (Optional) shall be of type `LOGICAL'.
17049     KIND       (Optional) An `INTEGER' initialization
17050                expression indicating the kind parameter of
17051                the result.
17052
17053_Return value_:
17054     The return value is of type `INTEGER' and of kind KIND. If KIND is
17055     absent, the return value is of default integer kind.
17056
17057_Example_:
17058          PROGRAM test_verify
17059            WRITE(*,*) VERIFY("FORTRAN", "AO")           ! 1, found 'F'
17060            WRITE(*,*) VERIFY("FORTRAN", "FOO")          ! 3, found 'R'
17061            WRITE(*,*) VERIFY("FORTRAN", "C++")          ! 1, found 'F'
17062            WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.)  ! 7, found 'N'
17063            WRITE(*,*) VERIFY("FORTRAN", "FORTRAN")      ! 0' found none
17064          END PROGRAM
17065
17066_See also_:
17067     *note SCAN::, *note INDEX intrinsic::
17068
17069
17070File: gfortran.info,  Node: XOR,  Prev: VERIFY,  Up: Intrinsic Procedures
17071
170729.271 `XOR' -- Bitwise logical exclusive OR
17073===========================================
17074
17075_Description_:
17076     Bitwise logical exclusive or.
17077
17078     This intrinsic routine is provided for backwards compatibility with
17079     GNU Fortran 77.  For integer arguments, programmers should consider
17080     the use of the *note IEOR:: intrinsic and for logical arguments the
17081     `.NEQV.' operator, which are both defined by the Fortran standard.
17082
17083_Standard_:
17084     GNU extension
17085
17086_Class_:
17087     Function
17088
17089_Syntax_:
17090     `RESULT = XOR(I, J)'
17091
17092_Arguments_:
17093     I          The type shall be either  a scalar `INTEGER'
17094                type or a scalar `LOGICAL' type.
17095     J          The type shall be the same as the type of I.
17096
17097_Return value_:
17098     The return type is either a scalar `INTEGER' or a scalar
17099     `LOGICAL'.  If the kind type parameters differ, then the smaller
17100     kind type is implicitly converted to larger kind, and the return
17101     has the larger kind.
17102
17103_Example_:
17104          PROGRAM test_xor
17105            LOGICAL :: T = .TRUE., F = .FALSE.
17106            INTEGER :: a, b
17107            DATA a / Z'F' /, b / Z'3' /
17108
17109            WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
17110            WRITE (*,*) XOR(a, b)
17111          END PROGRAM
17112
17113_See also_:
17114     Fortran 95 elemental function: *note IEOR::
17115
17116
17117File: gfortran.info,  Node: Intrinsic Modules,  Next: Contributing,  Prev: Intrinsic Procedures,  Up: Top
17118
1711910 Intrinsic Modules
17120********************
17121
17122* Menu:
17123
17124* ISO_FORTRAN_ENV::
17125* ISO_C_BINDING::
17126* IEEE modules::
17127* OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
17128* OpenACC Module OPENACC::
17129
17130
17131File: gfortran.info,  Node: ISO_FORTRAN_ENV,  Next: ISO_C_BINDING,  Up: Intrinsic Modules
17132
1713310.1 `ISO_FORTRAN_ENV'
17134======================
17135
17136_Standard_:
17137     Fortran 2003 and later, except when otherwise noted
17138
17139   The `ISO_FORTRAN_ENV' module provides the following scalar
17140default-integer named constants:
17141
17142`ATOMIC_INT_KIND':
17143     Default-kind integer constant to be used as kind parameter when
17144     defining integer variables used in atomic operations. (Fortran
17145     2008 or later.)
17146
17147`ATOMIC_LOGICAL_KIND':
17148     Default-kind integer constant to be used as kind parameter when
17149     defining logical variables used in atomic operations. (Fortran
17150     2008 or later.)
17151
17152`CHARACTER_KINDS':
17153     Default-kind integer constant array of rank one containing the
17154     supported kind parameters of the `CHARACTER' type. (Fortran 2008
17155     or later.)
17156
17157`CHARACTER_STORAGE_SIZE':
17158     Size in bits of the character storage unit.
17159
17160`ERROR_UNIT':
17161     Identifies the preconnected unit used for error reporting.
17162
17163`FILE_STORAGE_SIZE':
17164     Size in bits of the file-storage unit.
17165
17166`INPUT_UNIT':
17167     Identifies the preconnected unit identified by the asterisk (`*')
17168     in `READ' statement.
17169
17170`INT8', `INT16', `INT32', `INT64':
17171     Kind type parameters to specify an INTEGER type with a storage
17172     size of 16, 32, and 64 bits. It is negative if a target platform
17173     does not support the particular kind. (Fortran 2008 or later.)
17174
17175`INTEGER_KINDS':
17176     Default-kind integer constant array of rank one containing the
17177     supported kind parameters of the `INTEGER' type. (Fortran 2008 or
17178     later.)
17179
17180`IOSTAT_END':
17181     The value assigned to the variable passed to the `IOSTAT='
17182     specifier of an input/output statement if an end-of-file condition
17183     occurred.
17184
17185`IOSTAT_EOR':
17186     The value assigned to the variable passed to the `IOSTAT='
17187     specifier of an input/output statement if an end-of-record
17188     condition occurred.
17189
17190`IOSTAT_INQUIRE_INTERNAL_UNIT':
17191     Scalar default-integer constant, used by `INQUIRE' for the
17192     `IOSTAT=' specifier to denote an that a unit number identifies an
17193     internal unit. (Fortran 2008 or later.)
17194
17195`NUMERIC_STORAGE_SIZE':
17196     The size in bits of the numeric storage unit.
17197
17198`LOGICAL_KINDS':
17199     Default-kind integer constant array of rank one containing the
17200     supported kind parameters of the `LOGICAL' type. (Fortran 2008 or
17201     later.)
17202
17203`OUTPUT_UNIT':
17204     Identifies the preconnected unit identified by the asterisk (`*')
17205     in `WRITE' statement.
17206
17207`REAL32', `REAL64', `REAL128':
17208     Kind type parameters to specify a REAL type with a storage size of
17209     32, 64, and 128 bits. It is negative if a target platform does not
17210     support the particular kind. (Fortran 2008 or later.)
17211
17212`REAL_KINDS':
17213     Default-kind integer constant array of rank one containing the
17214     supported kind parameters of the `REAL' type. (Fortran 2008 or
17215     later.)
17216
17217`STAT_LOCKED':
17218     Scalar default-integer constant used as STAT= return value by
17219     `LOCK' to denote that the lock variable is locked by the executing
17220     image. (Fortran 2008 or later.)
17221
17222`STAT_LOCKED_OTHER_IMAGE':
17223     Scalar default-integer constant used as STAT= return value by
17224     `UNLOCK' to denote that the lock variable is locked by another
17225     image. (Fortran 2008 or later.)
17226
17227`STAT_STOPPED_IMAGE':
17228     Positive, scalar default-integer constant used as STAT= return
17229     value if the argument in the statement requires synchronisation
17230     with an image, which has initiated the termination of the
17231     execution. (Fortran 2008 or later.)
17232
17233`STAT_FAILED_IMAGE':
17234     Positive, scalar default-integer constant used as STAT= return
17235     value if the argument in the statement requires communication with
17236     an image, which has is in the failed state. (TS 18508 or later.)
17237
17238`STAT_UNLOCKED':
17239     Scalar default-integer constant used as STAT= return value by
17240     `UNLOCK' to denote that the lock variable is unlocked. (Fortran
17241     2008 or later.)
17242
17243   The module provides the following derived type:
17244
17245`LOCK_TYPE':
17246     Derived type with private components to be use with the `LOCK' and
17247     `UNLOCK' statement. A variable of its type has to be always
17248     declared as coarray and may not appear in a variable-definition
17249     context.  (Fortran 2008 or later.)
17250
17251   The module also provides the following intrinsic procedures: *note
17252COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
17253
17254
17255File: gfortran.info,  Node: ISO_C_BINDING,  Next: IEEE modules,  Prev: ISO_FORTRAN_ENV,  Up: Intrinsic Modules
17256
1725710.2 `ISO_C_BINDING'
17258====================
17259
17260_Standard_:
17261     Fortran 2003 and later, GNU extensions
17262
17263   The following intrinsic procedures are provided by the module; their
17264definition can be found in the section Intrinsic Procedures of this
17265manual.
17266
17267`C_ASSOCIATED'
17268
17269`C_F_POINTER'
17270
17271`C_F_PROCPOINTER'
17272
17273`C_FUNLOC'
17274
17275`C_LOC'
17276
17277`C_SIZEOF'
17278
17279   The `ISO_C_BINDING' module provides the following named constants of
17280type default integer, which can be used as KIND type parameters.
17281
17282   In addition to the integer named constants required by the Fortran
172832003 standard and `C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
17284extension named constants for the 128-bit integer types supported by the
17285C compiler: `C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
17286Furthermore, if `__float128' is supported in C, the named constants
17287`C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
17288
17289Fortran     Named constant            C type                    Extension
17290Type                                                            
17291`INTEGER'   `C_INT'                   `int'                     
17292`INTEGER'   `C_SHORT'                 `short int'               
17293`INTEGER'   `C_LONG'                  `long int'                
17294`INTEGER'   `C_LONG_LONG'             `long long int'           
17295`INTEGER'   `C_SIGNED_CHAR'           `signed char'/`unsigned   
17296                                      char'                     
17297`INTEGER'   `C_SIZE_T'                `size_t'                  
17298`INTEGER'   `C_INT8_T'                `int8_t'                  
17299`INTEGER'   `C_INT16_T'               `int16_t'                 
17300`INTEGER'   `C_INT32_T'               `int32_t'                 
17301`INTEGER'   `C_INT64_T'               `int64_t'                 
17302`INTEGER'   `C_INT128_T'              `int128_t'                Ext.
17303`INTEGER'   `C_INT_LEAST8_T'          `int_least8_t'            
17304`INTEGER'   `C_INT_LEAST16_T'         `int_least16_t'           
17305`INTEGER'   `C_INT_LEAST32_T'         `int_least32_t'           
17306`INTEGER'   `C_INT_LEAST64_T'         `int_least64_t'           
17307`INTEGER'   `C_INT_LEAST128_T'        `int_least128_t'          Ext.
17308`INTEGER'   `C_INT_FAST8_T'           `int_fast8_t'             
17309`INTEGER'   `C_INT_FAST16_T'          `int_fast16_t'            
17310`INTEGER'   `C_INT_FAST32_T'          `int_fast32_t'            
17311`INTEGER'   `C_INT_FAST64_T'          `int_fast64_t'            
17312`INTEGER'   `C_INT_FAST128_T'         `int_fast128_t'           Ext.
17313`INTEGER'   `C_INTMAX_T'              `intmax_t'                
17314`INTEGER'   `C_INTPTR_T'              `intptr_t'                
17315`INTEGER'   `C_PTRDIFF_T'             `intptr_t'                TS 29113
17316`REAL'      `C_FLOAT'                 `float'                   
17317`REAL'      `C_DOUBLE'                `double'                  
17318`REAL'      `C_LONG_DOUBLE'           `long double'             
17319`REAL'      `C_FLOAT128'              `__float128'              Ext.
17320`COMPLEX'   `C_FLOAT_COMPLEX'         `float _Complex'          
17321`COMPLEX'   `C_DOUBLE_COMPLEX'        `double _Complex'         
17322`COMPLEX'   `C_LONG_DOUBLE_COMPLEX'   `long double _Complex'    
17323`REAL'      `C_FLOAT128_COMPLEX'      `__float128 _Complex'     Ext.
17324`LOGICAL'   `C_BOOL'                  `_Bool'                   
17325`CHARACTER' `C_CHAR'                  `char'                    
17326
17327   Additionally, the following parameters of type
17328`CHARACTER(KIND=C_CHAR)' are defined.
17329
17330Name           C definition                     Value
17331`C_NULL_CHAR'  null character                   `'\0''
17332`C_ALERT'      alert                            `'\a''
17333`C_BACKSPACE'  backspace                        `'\b''
17334`C_FORM_FEED'  form feed                        `'\f''
17335`C_NEW_LINE'   new line                         `'\n''
17336`C_CARRIAGE_RETURN'carriage return                  `'\r''
17337`C_HORIZONTAL_TAB'horizontal tab                   `'\t''
17338`C_VERTICAL_TAB'vertical tab                     `'\v''
17339
17340   Moreover, the following two named constants are defined:
17341
17342Name           Type
17343`C_NULL_PTR'   `C_PTR'
17344`C_NULL_FUNPTR'`C_FUNPTR'
17345
17346   Both are equivalent to the value `NULL' in C.
17347
17348
17349File: gfortran.info,  Node: IEEE modules,  Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Prev: ISO_C_BINDING,  Up: Intrinsic Modules
17350
1735110.3 IEEE modules: `IEEE_EXCEPTIONS', `IEEE_ARITHMETIC', and `IEEE_FEATURES'
17352============================================================================
17353
17354_Standard_:
17355     Fortran 2003 and later
17356
17357   The `IEEE_EXCEPTIONS', `IEEE_ARITHMETIC', and `IEEE_FEATURES'
17358intrinsic modules provide support for exceptions and IEEE arithmetic, as
17359defined in Fortran 2003 and later standards, and the IEC 60559:1989
17360standard (_Binary floating-point arithmetic for microprocessor
17361systems_). These modules are only provided on the following supported
17362platforms:
17363
17364   * i386 and x86_64 processors
17365
17366   * platforms which use the GNU C Library (glibc)
17367
17368   * platforms with support for SysV/386 routines for floating point
17369     interface (including Solaris and BSDs)
17370
17371   * platforms with the AIX OS
17372
17373   For full compliance with the Fortran standards, code using the
17374`IEEE_EXCEPTIONS' or `IEEE_ARITHMETIC' modules should be compiled with
17375the following options: `-fno-unsafe-math-optimizations -frounding-math
17376-fsignaling-nans'.
17377
17378
17379File: gfortran.info,  Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Next: OpenACC Module OPENACC,  Prev: IEEE modules,  Up: Intrinsic Modules
17380
1738110.4 OpenMP Modules `OMP_LIB' and `OMP_LIB_KINDS'
17382=================================================
17383
17384_Standard_:
17385     OpenMP Application Program Interface v4.0
17386
17387   The OpenMP Fortran runtime library routines are provided both in a
17388form of two Fortran 90 modules, named `OMP_LIB' and `OMP_LIB_KINDS',
17389and in a form of a Fortran `include' file named `omp_lib.h'. The
17390procedures provided by `OMP_LIB' can be found in the *note
17391Introduction: (libgomp)Top. manual, the named constants defined in the
17392modules are listed below.
17393
17394   For details refer to the actual OpenMP Application Program Interface
17395v4.0 (http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf).
17396
17397   `OMP_LIB_KINDS' provides the following scalar default-integer named
17398constants:
17399
17400`omp_lock_kind'
17401
17402`omp_nest_lock_kind'
17403
17404`omp_proc_bind_kind'
17405
17406`omp_sched_kind'
17407
17408   `OMP_LIB' provides the scalar default-integer named constant
17409`openmp_version' with a value of the form YYYYMM, where `yyyy' is the
17410year and MM the month of the OpenMP version; for OpenMP v4.0 the value
17411is `201307'.
17412
17413   The following scalar integer named constants of the kind
17414`omp_sched_kind':
17415
17416`omp_sched_static'
17417
17418`omp_sched_dynamic'
17419
17420`omp_sched_guided'
17421
17422`omp_sched_auto'
17423
17424   And the following scalar integer named constants of the kind
17425`omp_proc_bind_kind':
17426
17427`omp_proc_bind_false'
17428
17429`omp_proc_bind_true'
17430
17431`omp_proc_bind_master'
17432
17433`omp_proc_bind_close'
17434
17435`omp_proc_bind_spread'
17436
17437
17438File: gfortran.info,  Node: OpenACC Module OPENACC,  Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Up: Intrinsic Modules
17439
1744010.5 OpenACC Module `OPENACC'
17441=============================
17442
17443_Standard_:
17444     OpenACC Application Programming Interface v2.0
17445
17446   The OpenACC Fortran runtime library routines are provided both in a
17447form of a Fortran 90 module, named `OPENACC', and in form of a Fortran
17448`include' file named `openacc_lib.h'.  The procedures provided by
17449`OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
17450the named constants defined in the modules are listed below.
17451
17452   For details refer to the actual OpenACC Application Programming
17453Interface v2.0 (http://www.openacc.org/).
17454
17455   `OPENACC' provides the scalar default-integer named constant
17456`openacc_version' with a value of the form YYYYMM, where `yyyy' is the
17457year and MM the month of the OpenACC version; for OpenACC v2.0 the
17458value is `201306'.
17459
17460
17461File: gfortran.info,  Node: Contributing,  Next: Copying,  Prev: Intrinsic Modules,  Up: Top
17462
17463Contributing
17464************
17465
17466Free software is only possible if people contribute to efforts to
17467create it.  We're always in need of more people helping out with ideas
17468and comments, writing documentation and contributing code.
17469
17470   If you want to contribute to GNU Fortran, have a look at the long
17471lists of projects you can take on.  Some of these projects are small,
17472some of them are large; some are completely orthogonal to the rest of
17473what is happening on GNU Fortran, but others are "mainstream" projects
17474in need of enthusiastic hackers.  All of these projects are important!
17475We will eventually get around to the things here, but they are also
17476things doable by someone who is willing and able.
17477
17478* Menu:
17479
17480* Contributors::
17481* Projects::
17482* Proposed Extensions::
17483
17484
17485File: gfortran.info,  Node: Contributors,  Next: Projects,  Up: Contributing
17486
17487Contributors to GNU Fortran
17488===========================
17489
17490Most of the parser was hand-crafted by _Andy Vaught_, who is also the
17491initiator of the whole project.  Thanks Andy!  Most of the interface
17492with GCC was written by _Paul Brook_.
17493
17494   The following individuals have contributed code and/or ideas and
17495significant help to the GNU Fortran project (in alphabetical order):
17496
17497   - Janne Blomqvist
17498
17499   - Steven Bosscher
17500
17501   - Paul Brook
17502
17503   - Tobias Burnus
17504
17505   - Franc,ois-Xavier Coudert
17506
17507   - Bud Davis
17508
17509   - Jerry DeLisle
17510
17511   - Erik Edelmann
17512
17513   - Bernhard Fischer
17514
17515   - Daniel Franke
17516
17517   - Richard Guenther
17518
17519   - Richard Henderson
17520
17521   - Katherine Holcomb
17522
17523   - Jakub Jelinek
17524
17525   - Niels Kristian Bech Jensen
17526
17527   - Steven Johnson
17528
17529   - Steven G. Kargl
17530
17531   - Thomas Koenig
17532
17533   - Asher Langton
17534
17535   - H. J. Lu
17536
17537   - Toon Moene
17538
17539   - Brooks Moses
17540
17541   - Andrew Pinski
17542
17543   - Tim Prince
17544
17545   - Christopher D. Rickett
17546
17547   - Richard Sandiford
17548
17549   - Tobias Schlu"ter
17550
17551   - Roger Sayle
17552
17553   - Paul Thomas
17554
17555   - Andy Vaught
17556
17557   - Feng Wang
17558
17559   - Janus Weil
17560
17561   - Daniel Kraft
17562
17563   The following people have contributed bug reports, smaller or larger
17564patches, and much needed feedback and encouragement for the GNU Fortran
17565project:
17566
17567   - Bill Clodius
17568
17569   - Dominique d'Humie`res
17570
17571   - Kate Hedstrom
17572
17573   - Erik Schnetter
17574
17575   - Joost VandeVondele
17576
17577   Many other individuals have helped debug, test and improve the GNU
17578Fortran compiler over the past few years, and we welcome you to do the
17579same!  If you already have done so, and you would like to see your name
17580listed in the list above, please contact us.
17581
17582
17583File: gfortran.info,  Node: Projects,  Next: Proposed Extensions,  Prev: Contributors,  Up: Contributing
17584
17585Projects
17586========
17587
17588_Help build the test suite_
17589     Solicit more code for donation to the test suite: the more
17590     extensive the testsuite, the smaller the risk of breaking things
17591     in the future! We can keep code private on request.
17592
17593_Bug hunting/squishing_
17594     Find bugs and write more test cases! Test cases are especially very
17595     welcome, because it allows us to concentrate on fixing bugs
17596     instead of isolating them.  Going through the bugzilla database at
17597     `https://gcc.gnu.org/bugzilla/' to reduce testcases posted there
17598     and add more information (for example, for which version does the
17599     testcase work, for which versions does it fail?) is also very
17600     helpful.
17601
17602
17603
17604File: gfortran.info,  Node: Proposed Extensions,  Prev: Projects,  Up: Contributing
17605
17606Proposed Extensions
17607===================
17608
17609Here's a list of proposed extensions for the GNU Fortran compiler, in
17610no particular order.  Most of these are necessary to be fully
17611compatible with existing Fortran compilers, but they are not part of
17612the official J3 Fortran 95 standard.
17613
17614Compiler extensions:
17615--------------------
17616
17617   * User-specified alignment rules for structures.
17618
17619   * Automatically extend single precision constants to double.
17620
17621   * Compile code that conserves memory by dynamically allocating
17622     common and module storage either on stack or heap.
17623
17624   * Compile flag to generate code for array conformance checking
17625     (suggest -CC).
17626
17627   * User control of symbol names (underscores, etc).
17628
17629   * Compile setting for maximum size of stack frame size before
17630     spilling parts to static or heap.
17631
17632   * Flag to force local variables into static space.
17633
17634   * Flag to force local variables onto stack.
17635
17636Environment Options
17637-------------------
17638
17639   * Pluggable library modules for random numbers, linear algebra.  LA
17640     should use BLAS calling conventions.
17641
17642   * Environment variables controlling actions on arithmetic exceptions
17643     like overflow, underflow, precision loss--Generate NaN, abort,
17644     default.  action.
17645
17646   * Set precision for fp units that support it (i387).
17647
17648   * Variable for setting fp rounding mode.
17649
17650   * Variable to fill uninitialized variables with a user-defined bit
17651     pattern.
17652
17653   * Environment variable controlling filename that is opened for that
17654     unit number.
17655
17656   * Environment variable to clear/trash memory being freed.
17657
17658   * Environment variable to control tracing of allocations and frees.
17659
17660   * Environment variable to display allocated memory at normal program
17661     end.
17662
17663   * Environment variable for filename for * IO-unit.
17664
17665   * Environment variable for temporary file directory.
17666
17667   * Environment variable forcing standard output to be line buffered
17668     (Unix).
17669
17670
17671
17672File: gfortran.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Contributing,  Up: Top
17673
17674GNU General Public License
17675**************************
17676
17677                        Version 3, 29 June 2007
17678
17679     Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/'
17680
17681     Everyone is permitted to copy and distribute verbatim copies of this
17682     license document, but changing it is not allowed.
17683
17684Preamble
17685========
17686
17687The GNU General Public License is a free, copyleft license for software
17688and other kinds of works.
17689
17690   The licenses for most software and other practical works are designed
17691to take away your freedom to share and change the works.  By contrast,
17692the GNU General Public License is intended to guarantee your freedom to
17693share and change all versions of a program-to make sure it remains free
17694software for all its users.  We, the Free Software Foundation, use the
17695GNU General Public License for most of our software; it applies also to
17696any other work released this way by its authors.  You can apply it to
17697your programs, too.
17698
17699   When we speak of free software, we are referring to freedom, not
17700price.  Our General Public Licenses are designed to make sure that you
17701have the freedom to distribute copies of free software (and charge for
17702them if you wish), that you receive source code or can get it if you
17703want it, that you can change the software or use pieces of it in new
17704free programs, and that you know you can do these things.
17705
17706   To protect your rights, we need to prevent others from denying you
17707these rights or asking you to surrender the rights.  Therefore, you
17708have certain responsibilities if you distribute copies of the software,
17709or if you modify it: responsibilities to respect the freedom of others.
17710
17711   For example, if you distribute copies of such a program, whether
17712gratis or for a fee, you must pass on to the recipients the same
17713freedoms that you received.  You must make sure that they, too, receive
17714or can get the source code.  And you must show them these terms so they
17715know their rights.
17716
17717   Developers that use the GNU GPL protect your rights with two steps:
17718(1) assert copyright on the software, and (2) offer you this License
17719giving you legal permission to copy, distribute and/or modify it.
17720
17721   For the developers' and authors' protection, the GPL clearly explains
17722that there is no warranty for this free software.  For both users' and
17723authors' sake, the GPL requires that modified versions be marked as
17724changed, so that their problems will not be attributed erroneously to
17725authors of previous versions.
17726
17727   Some devices are designed to deny users access to install or run
17728modified versions of the software inside them, although the
17729manufacturer can do so.  This is fundamentally incompatible with the
17730aim of protecting users' freedom to change the software.  The
17731systematic pattern of such abuse occurs in the area of products for
17732individuals to use, which is precisely where it is most unacceptable.
17733Therefore, we have designed this version of the GPL to prohibit the
17734practice for those products.  If such problems arise substantially in
17735other domains, we stand ready to extend this provision to those domains
17736in future versions of the GPL, as needed to protect the freedom of
17737users.
17738
17739   Finally, every program is threatened constantly by software patents.
17740States should not allow patents to restrict development and use of
17741software on general-purpose computers, but in those that do, we wish to
17742avoid the special danger that patents applied to a free program could
17743make it effectively proprietary.  To prevent this, the GPL assures that
17744patents cannot be used to render the program non-free.
17745
17746   The precise terms and conditions for copying, distribution and
17747modification follow.
17748
17749TERMS AND CONDITIONS
17750====================
17751
17752  0. Definitions.
17753
17754     "This License" refers to version 3 of the GNU General Public
17755     License.
17756
17757     "Copyright" also means copyright-like laws that apply to other
17758     kinds of works, such as semiconductor masks.
17759
17760     "The Program" refers to any copyrightable work licensed under this
17761     License.  Each licensee is addressed as "you".  "Licensees" and
17762     "recipients" may be individuals or organizations.
17763
17764     To "modify" a work means to copy from or adapt all or part of the
17765     work in a fashion requiring copyright permission, other than the
17766     making of an exact copy.  The resulting work is called a "modified
17767     version" of the earlier work or a work "based on" the earlier work.
17768
17769     A "covered work" means either the unmodified Program or a work
17770     based on the Program.
17771
17772     To "propagate" a work means to do anything with it that, without
17773     permission, would make you directly or secondarily liable for
17774     infringement under applicable copyright law, except executing it
17775     on a computer or modifying a private copy.  Propagation includes
17776     copying, distribution (with or without modification), making
17777     available to the public, and in some countries other activities as
17778     well.
17779
17780     To "convey" a work means any kind of propagation that enables other
17781     parties to make or receive copies.  Mere interaction with a user
17782     through a computer network, with no transfer of a copy, is not
17783     conveying.
17784
17785     An interactive user interface displays "Appropriate Legal Notices"
17786     to the extent that it includes a convenient and prominently visible
17787     feature that (1) displays an appropriate copyright notice, and (2)
17788     tells the user that there is no warranty for the work (except to
17789     the extent that warranties are provided), that licensees may
17790     convey the work under this License, and how to view a copy of this
17791     License.  If the interface presents a list of user commands or
17792     options, such as a menu, a prominent item in the list meets this
17793     criterion.
17794
17795  1. Source Code.
17796
17797     The "source code" for a work means the preferred form of the work
17798     for making modifications to it.  "Object code" means any
17799     non-source form of a work.
17800
17801     A "Standard Interface" means an interface that either is an
17802     official standard defined by a recognized standards body, or, in
17803     the case of interfaces specified for a particular programming
17804     language, one that is widely used among developers working in that
17805     language.
17806
17807     The "System Libraries" of an executable work include anything,
17808     other than the work as a whole, that (a) is included in the normal
17809     form of packaging a Major Component, but which is not part of that
17810     Major Component, and (b) serves only to enable use of the work
17811     with that Major Component, or to implement a Standard Interface
17812     for which an implementation is available to the public in source
17813     code form.  A "Major Component", in this context, means a major
17814     essential component (kernel, window system, and so on) of the
17815     specific operating system (if any) on which the executable work
17816     runs, or a compiler used to produce the work, or an object code
17817     interpreter used to run it.
17818
17819     The "Corresponding Source" for a work in object code form means all
17820     the source code needed to generate, install, and (for an executable
17821     work) run the object code and to modify the work, including
17822     scripts to control those activities.  However, it does not include
17823     the work's System Libraries, or general-purpose tools or generally
17824     available free programs which are used unmodified in performing
17825     those activities but which are not part of the work.  For example,
17826     Corresponding Source includes interface definition files
17827     associated with source files for the work, and the source code for
17828     shared libraries and dynamically linked subprograms that the work
17829     is specifically designed to require, such as by intimate data
17830     communication or control flow between those subprograms and other
17831     parts of the work.
17832
17833     The Corresponding Source need not include anything that users can
17834     regenerate automatically from other parts of the Corresponding
17835     Source.
17836
17837     The Corresponding Source for a work in source code form is that
17838     same work.
17839
17840  2. Basic Permissions.
17841
17842     All rights granted under this License are granted for the term of
17843     copyright on the Program, and are irrevocable provided the stated
17844     conditions are met.  This License explicitly affirms your unlimited
17845     permission to run the unmodified Program.  The output from running
17846     a covered work is covered by this License only if the output,
17847     given its content, constitutes a covered work.  This License
17848     acknowledges your rights of fair use or other equivalent, as
17849     provided by copyright law.
17850
17851     You may make, run and propagate covered works that you do not
17852     convey, without conditions so long as your license otherwise
17853     remains in force.  You may convey covered works to others for the
17854     sole purpose of having them make modifications exclusively for
17855     you, or provide you with facilities for running those works,
17856     provided that you comply with the terms of this License in
17857     conveying all material for which you do not control copyright.
17858     Those thus making or running the covered works for you must do so
17859     exclusively on your behalf, under your direction and control, on
17860     terms that prohibit them from making any copies of your
17861     copyrighted material outside their relationship with you.
17862
17863     Conveying under any other circumstances is permitted solely under
17864     the conditions stated below.  Sublicensing is not allowed; section
17865     10 makes it unnecessary.
17866
17867  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
17868
17869     No covered work shall be deemed part of an effective technological
17870     measure under any applicable law fulfilling obligations under
17871     article 11 of the WIPO copyright treaty adopted on 20 December
17872     1996, or similar laws prohibiting or restricting circumvention of
17873     such measures.
17874
17875     When you convey a covered work, you waive any legal power to forbid
17876     circumvention of technological measures to the extent such
17877     circumvention is effected by exercising rights under this License
17878     with respect to the covered work, and you disclaim any intention
17879     to limit operation or modification of the work as a means of
17880     enforcing, against the work's users, your or third parties' legal
17881     rights to forbid circumvention of technological measures.
17882
17883  4. Conveying Verbatim Copies.
17884
17885     You may convey verbatim copies of the Program's source code as you
17886     receive it, in any medium, provided that you conspicuously and
17887     appropriately publish on each copy an appropriate copyright notice;
17888     keep intact all notices stating that this License and any
17889     non-permissive terms added in accord with section 7 apply to the
17890     code; keep intact all notices of the absence of any warranty; and
17891     give all recipients a copy of this License along with the Program.
17892
17893     You may charge any price or no price for each copy that you convey,
17894     and you may offer support or warranty protection for a fee.
17895
17896  5. Conveying Modified Source Versions.
17897
17898     You may convey a work based on the Program, or the modifications to
17899     produce it from the Program, in the form of source code under the
17900     terms of section 4, provided that you also meet all of these
17901     conditions:
17902
17903       a. The work must carry prominent notices stating that you
17904          modified it, and giving a relevant date.
17905
17906       b. The work must carry prominent notices stating that it is
17907          released under this License and any conditions added under
17908          section 7.  This requirement modifies the requirement in
17909          section 4 to "keep intact all notices".
17910
17911       c. You must license the entire work, as a whole, under this
17912          License to anyone who comes into possession of a copy.  This
17913          License will therefore apply, along with any applicable
17914          section 7 additional terms, to the whole of the work, and all
17915          its parts, regardless of how they are packaged.  This License
17916          gives no permission to license the work in any other way, but
17917          it does not invalidate such permission if you have separately
17918          received it.
17919
17920       d. If the work has interactive user interfaces, each must display
17921          Appropriate Legal Notices; however, if the Program has
17922          interactive interfaces that do not display Appropriate Legal
17923          Notices, your work need not make them do so.
17924
17925     A compilation of a covered work with other separate and independent
17926     works, which are not by their nature extensions of the covered
17927     work, and which are not combined with it such as to form a larger
17928     program, in or on a volume of a storage or distribution medium, is
17929     called an "aggregate" if the compilation and its resulting
17930     copyright are not used to limit the access or legal rights of the
17931     compilation's users beyond what the individual works permit.
17932     Inclusion of a covered work in an aggregate does not cause this
17933     License to apply to the other parts of the aggregate.
17934
17935  6. Conveying Non-Source Forms.
17936
17937     You may convey a covered work in object code form under the terms
17938     of sections 4 and 5, provided that you also convey the
17939     machine-readable Corresponding Source under the terms of this
17940     License, in one of these ways:
17941
17942       a. Convey the object code in, or embodied in, a physical product
17943          (including a physical distribution medium), accompanied by the
17944          Corresponding Source fixed on a durable physical medium
17945          customarily used for software interchange.
17946
17947       b. Convey the object code in, or embodied in, a physical product
17948          (including a physical distribution medium), accompanied by a
17949          written offer, valid for at least three years and valid for
17950          as long as you offer spare parts or customer support for that
17951          product model, to give anyone who possesses the object code
17952          either (1) a copy of the Corresponding Source for all the
17953          software in the product that is covered by this License, on a
17954          durable physical medium customarily used for software
17955          interchange, for a price no more than your reasonable cost of
17956          physically performing this conveying of source, or (2) access
17957          to copy the Corresponding Source from a network server at no
17958          charge.
17959
17960       c. Convey individual copies of the object code with a copy of
17961          the written offer to provide the Corresponding Source.  This
17962          alternative is allowed only occasionally and noncommercially,
17963          and only if you received the object code with such an offer,
17964          in accord with subsection 6b.
17965
17966       d. Convey the object code by offering access from a designated
17967          place (gratis or for a charge), and offer equivalent access
17968          to the Corresponding Source in the same way through the same
17969          place at no further charge.  You need not require recipients
17970          to copy the Corresponding Source along with the object code.
17971          If the place to copy the object code is a network server, the
17972          Corresponding Source may be on a different server (operated
17973          by you or a third party) that supports equivalent copying
17974          facilities, provided you maintain clear directions next to
17975          the object code saying where to find the Corresponding Source.
17976          Regardless of what server hosts the Corresponding Source, you
17977          remain obligated to ensure that it is available for as long
17978          as needed to satisfy these requirements.
17979
17980       e. Convey the object code using peer-to-peer transmission,
17981          provided you inform other peers where the object code and
17982          Corresponding Source of the work are being offered to the
17983          general public at no charge under subsection 6d.
17984
17985
17986     A separable portion of the object code, whose source code is
17987     excluded from the Corresponding Source as a System Library, need
17988     not be included in conveying the object code work.
17989
17990     A "User Product" is either (1) a "consumer product", which means
17991     any tangible personal property which is normally used for personal,
17992     family, or household purposes, or (2) anything designed or sold for
17993     incorporation into a dwelling.  In determining whether a product
17994     is a consumer product, doubtful cases shall be resolved in favor of
17995     coverage.  For a particular product received by a particular user,
17996     "normally used" refers to a typical or common use of that class of
17997     product, regardless of the status of the particular user or of the
17998     way in which the particular user actually uses, or expects or is
17999     expected to use, the product.  A product is a consumer product
18000     regardless of whether the product has substantial commercial,
18001     industrial or non-consumer uses, unless such uses represent the
18002     only significant mode of use of the product.
18003
18004     "Installation Information" for a User Product means any methods,
18005     procedures, authorization keys, or other information required to
18006     install and execute modified versions of a covered work in that
18007     User Product from a modified version of its Corresponding Source.
18008     The information must suffice to ensure that the continued
18009     functioning of the modified object code is in no case prevented or
18010     interfered with solely because modification has been made.
18011
18012     If you convey an object code work under this section in, or with,
18013     or specifically for use in, a User Product, and the conveying
18014     occurs as part of a transaction in which the right of possession
18015     and use of the User Product is transferred to the recipient in
18016     perpetuity or for a fixed term (regardless of how the transaction
18017     is characterized), the Corresponding Source conveyed under this
18018     section must be accompanied by the Installation Information.  But
18019     this requirement does not apply if neither you nor any third party
18020     retains the ability to install modified object code on the User
18021     Product (for example, the work has been installed in ROM).
18022
18023     The requirement to provide Installation Information does not
18024     include a requirement to continue to provide support service,
18025     warranty, or updates for a work that has been modified or
18026     installed by the recipient, or for the User Product in which it
18027     has been modified or installed.  Access to a network may be denied
18028     when the modification itself materially and adversely affects the
18029     operation of the network or violates the rules and protocols for
18030     communication across the network.
18031
18032     Corresponding Source conveyed, and Installation Information
18033     provided, in accord with this section must be in a format that is
18034     publicly documented (and with an implementation available to the
18035     public in source code form), and must require no special password
18036     or key for unpacking, reading or copying.
18037
18038  7. Additional Terms.
18039
18040     "Additional permissions" are terms that supplement the terms of
18041     this License by making exceptions from one or more of its
18042     conditions.  Additional permissions that are applicable to the
18043     entire Program shall be treated as though they were included in
18044     this License, to the extent that they are valid under applicable
18045     law.  If additional permissions apply only to part of the Program,
18046     that part may be used separately under those permissions, but the
18047     entire Program remains governed by this License without regard to
18048     the additional permissions.
18049
18050     When you convey a copy of a covered work, you may at your option
18051     remove any additional permissions from that copy, or from any part
18052     of it.  (Additional permissions may be written to require their own
18053     removal in certain cases when you modify the work.)  You may place
18054     additional permissions on material, added by you to a covered work,
18055     for which you have or can give appropriate copyright permission.
18056
18057     Notwithstanding any other provision of this License, for material
18058     you add to a covered work, you may (if authorized by the copyright
18059     holders of that material) supplement the terms of this License
18060     with terms:
18061
18062       a. Disclaiming warranty or limiting liability differently from
18063          the terms of sections 15 and 16 of this License; or
18064
18065       b. Requiring preservation of specified reasonable legal notices
18066          or author attributions in that material or in the Appropriate
18067          Legal Notices displayed by works containing it; or
18068
18069       c. Prohibiting misrepresentation of the origin of that material,
18070          or requiring that modified versions of such material be
18071          marked in reasonable ways as different from the original
18072          version; or
18073
18074       d. Limiting the use for publicity purposes of names of licensors
18075          or authors of the material; or
18076
18077       e. Declining to grant rights under trademark law for use of some
18078          trade names, trademarks, or service marks; or
18079
18080       f. Requiring indemnification of licensors and authors of that
18081          material by anyone who conveys the material (or modified
18082          versions of it) with contractual assumptions of liability to
18083          the recipient, for any liability that these contractual
18084          assumptions directly impose on those licensors and authors.
18085
18086     All other non-permissive additional terms are considered "further
18087     restrictions" within the meaning of section 10.  If the Program as
18088     you received it, or any part of it, contains a notice stating that
18089     it is governed by this License along with a term that is a further
18090     restriction, you may remove that term.  If a license document
18091     contains a further restriction but permits relicensing or
18092     conveying under this License, you may add to a covered work
18093     material governed by the terms of that license document, provided
18094     that the further restriction does not survive such relicensing or
18095     conveying.
18096
18097     If you add terms to a covered work in accord with this section, you
18098     must place, in the relevant source files, a statement of the
18099     additional terms that apply to those files, or a notice indicating
18100     where to find the applicable terms.
18101
18102     Additional terms, permissive or non-permissive, may be stated in
18103     the form of a separately written license, or stated as exceptions;
18104     the above requirements apply either way.
18105
18106  8. Termination.
18107
18108     You may not propagate or modify a covered work except as expressly
18109     provided under this License.  Any attempt otherwise to propagate or
18110     modify it is void, and will automatically terminate your rights
18111     under this License (including any patent licenses granted under
18112     the third paragraph of section 11).
18113
18114     However, if you cease all violation of this License, then your
18115     license from a particular copyright holder is reinstated (a)
18116     provisionally, unless and until the copyright holder explicitly
18117     and finally terminates your license, and (b) permanently, if the
18118     copyright holder fails to notify you of the violation by some
18119     reasonable means prior to 60 days after the cessation.
18120
18121     Moreover, your license from a particular copyright holder is
18122     reinstated permanently if the copyright holder notifies you of the
18123     violation by some reasonable means, this is the first time you have
18124     received notice of violation of this License (for any work) from
18125     that copyright holder, and you cure the violation prior to 30 days
18126     after your receipt of the notice.
18127
18128     Termination of your rights under this section does not terminate
18129     the licenses of parties who have received copies or rights from
18130     you under this License.  If your rights have been terminated and
18131     not permanently reinstated, you do not qualify to receive new
18132     licenses for the same material under section 10.
18133
18134  9. Acceptance Not Required for Having Copies.
18135
18136     You are not required to accept this License in order to receive or
18137     run a copy of the Program.  Ancillary propagation of a covered work
18138     occurring solely as a consequence of using peer-to-peer
18139     transmission to receive a copy likewise does not require
18140     acceptance.  However, nothing other than this License grants you
18141     permission to propagate or modify any covered work.  These actions
18142     infringe copyright if you do not accept this License.  Therefore,
18143     by modifying or propagating a covered work, you indicate your
18144     acceptance of this License to do so.
18145
18146 10. Automatic Licensing of Downstream Recipients.
18147
18148     Each time you convey a covered work, the recipient automatically
18149     receives a license from the original licensors, to run, modify and
18150     propagate that work, subject to this License.  You are not
18151     responsible for enforcing compliance by third parties with this
18152     License.
18153
18154     An "entity transaction" is a transaction transferring control of an
18155     organization, or substantially all assets of one, or subdividing an
18156     organization, or merging organizations.  If propagation of a
18157     covered work results from an entity transaction, each party to that
18158     transaction who receives a copy of the work also receives whatever
18159     licenses to the work the party's predecessor in interest had or
18160     could give under the previous paragraph, plus a right to
18161     possession of the Corresponding Source of the work from the
18162     predecessor in interest, if the predecessor has it or can get it
18163     with reasonable efforts.
18164
18165     You may not impose any further restrictions on the exercise of the
18166     rights granted or affirmed under this License.  For example, you
18167     may not impose a license fee, royalty, or other charge for
18168     exercise of rights granted under this License, and you may not
18169     initiate litigation (including a cross-claim or counterclaim in a
18170     lawsuit) alleging that any patent claim is infringed by making,
18171     using, selling, offering for sale, or importing the Program or any
18172     portion of it.
18173
18174 11. Patents.
18175
18176     A "contributor" is a copyright holder who authorizes use under this
18177     License of the Program or a work on which the Program is based.
18178     The work thus licensed is called the contributor's "contributor
18179     version".
18180
18181     A contributor's "essential patent claims" are all patent claims
18182     owned or controlled by the contributor, whether already acquired or
18183     hereafter acquired, that would be infringed by some manner,
18184     permitted by this License, of making, using, or selling its
18185     contributor version, but do not include claims that would be
18186     infringed only as a consequence of further modification of the
18187     contributor version.  For purposes of this definition, "control"
18188     includes the right to grant patent sublicenses in a manner
18189     consistent with the requirements of this License.
18190
18191     Each contributor grants you a non-exclusive, worldwide,
18192     royalty-free patent license under the contributor's essential
18193     patent claims, to make, use, sell, offer for sale, import and
18194     otherwise run, modify and propagate the contents of its
18195     contributor version.
18196
18197     In the following three paragraphs, a "patent license" is any
18198     express agreement or commitment, however denominated, not to
18199     enforce a patent (such as an express permission to practice a
18200     patent or covenant not to sue for patent infringement).  To
18201     "grant" such a patent license to a party means to make such an
18202     agreement or commitment not to enforce a patent against the party.
18203
18204     If you convey a covered work, knowingly relying on a patent
18205     license, and the Corresponding Source of the work is not available
18206     for anyone to copy, free of charge and under the terms of this
18207     License, through a publicly available network server or other
18208     readily accessible means, then you must either (1) cause the
18209     Corresponding Source to be so available, or (2) arrange to deprive
18210     yourself of the benefit of the patent license for this particular
18211     work, or (3) arrange, in a manner consistent with the requirements
18212     of this License, to extend the patent license to downstream
18213     recipients.  "Knowingly relying" means you have actual knowledge
18214     that, but for the patent license, your conveying the covered work
18215     in a country, or your recipient's use of the covered work in a
18216     country, would infringe one or more identifiable patents in that
18217     country that you have reason to believe are valid.
18218
18219     If, pursuant to or in connection with a single transaction or
18220     arrangement, you convey, or propagate by procuring conveyance of, a
18221     covered work, and grant a patent license to some of the parties
18222     receiving the covered work authorizing them to use, propagate,
18223     modify or convey a specific copy of the covered work, then the
18224     patent license you grant is automatically extended to all
18225     recipients of the covered work and works based on it.
18226
18227     A patent license is "discriminatory" if it does not include within
18228     the scope of its coverage, prohibits the exercise of, or is
18229     conditioned on the non-exercise of one or more of the rights that
18230     are specifically granted under this License.  You may not convey a
18231     covered work if you are a party to an arrangement with a third
18232     party that is in the business of distributing software, under
18233     which you make payment to the third party based on the extent of
18234     your activity of conveying the work, and under which the third
18235     party grants, to any of the parties who would receive the covered
18236     work from you, a discriminatory patent license (a) in connection
18237     with copies of the covered work conveyed by you (or copies made
18238     from those copies), or (b) primarily for and in connection with
18239     specific products or compilations that contain the covered work,
18240     unless you entered into that arrangement, or that patent license
18241     was granted, prior to 28 March 2007.
18242
18243     Nothing in this License shall be construed as excluding or limiting
18244     any implied license or other defenses to infringement that may
18245     otherwise be available to you under applicable patent law.
18246
18247 12. No Surrender of Others' Freedom.
18248
18249     If conditions are imposed on you (whether by court order,
18250     agreement or otherwise) that contradict the conditions of this
18251     License, they do not excuse you from the conditions of this
18252     License.  If you cannot convey a covered work so as to satisfy
18253     simultaneously your obligations under this License and any other
18254     pertinent obligations, then as a consequence you may not convey it
18255     at all.  For example, if you agree to terms that obligate you to
18256     collect a royalty for further conveying from those to whom you
18257     convey the Program, the only way you could satisfy both those
18258     terms and this License would be to refrain entirely from conveying
18259     the Program.
18260
18261 13. Use with the GNU Affero General Public License.
18262
18263     Notwithstanding any other provision of this License, you have
18264     permission to link or combine any covered work with a work licensed
18265     under version 3 of the GNU Affero General Public License into a
18266     single combined work, and to convey the resulting work.  The terms
18267     of this License will continue to apply to the part which is the
18268     covered work, but the special requirements of the GNU Affero
18269     General Public License, section 13, concerning interaction through
18270     a network will apply to the combination as such.
18271
18272 14. Revised Versions of this License.
18273
18274     The Free Software Foundation may publish revised and/or new
18275     versions of the GNU General Public License from time to time.
18276     Such new versions will be similar in spirit to the present
18277     version, but may differ in detail to address new problems or
18278     concerns.
18279
18280     Each version is given a distinguishing version number.  If the
18281     Program specifies that a certain numbered version of the GNU
18282     General Public License "or any later version" applies to it, you
18283     have the option of following the terms and conditions either of
18284     that numbered version or of any later version published by the
18285     Free Software Foundation.  If the Program does not specify a
18286     version number of the GNU General Public License, you may choose
18287     any version ever published by the Free Software Foundation.
18288
18289     If the Program specifies that a proxy can decide which future
18290     versions of the GNU General Public License can be used, that
18291     proxy's public statement of acceptance of a version permanently
18292     authorizes you to choose that version for the Program.
18293
18294     Later license versions may give you additional or different
18295     permissions.  However, no additional obligations are imposed on any
18296     author or copyright holder as a result of your choosing to follow a
18297     later version.
18298
18299 15. Disclaimer of Warranty.
18300
18301     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
18302     APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE
18303     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
18304     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
18305     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18306     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE
18307     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
18308     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
18309     NECESSARY SERVICING, REPAIR OR CORRECTION.
18310
18311 16. Limitation of Liability.
18312
18313     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
18314     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
18315     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
18316     FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
18317     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
18318     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
18319     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
18320     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
18321     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
18322     THE POSSIBILITY OF SUCH DAMAGES.
18323
18324 17. Interpretation of Sections 15 and 16.
18325
18326     If the disclaimer of warranty and limitation of liability provided
18327     above cannot be given local legal effect according to their terms,
18328     reviewing courts shall apply local law that most closely
18329     approximates an absolute waiver of all civil liability in
18330     connection with the Program, unless a warranty or assumption of
18331     liability accompanies a copy of the Program in return for a fee.
18332
18333
18334END OF TERMS AND CONDITIONS
18335===========================
18336
18337How to Apply These Terms to Your New Programs
18338=============================================
18339
18340If you develop a new program, and you want it to be of the greatest
18341possible use to the public, the best way to achieve this is to make it
18342free software which everyone can redistribute and change under these
18343terms.
18344
18345   To do so, attach the following notices to the program.  It is safest
18346to attach them to the start of each source file to most effectively
18347state the exclusion of warranty; and each file should have at least the
18348"copyright" line and a pointer to where the full notice is found.
18349
18350     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
18351     Copyright (C) YEAR NAME OF AUTHOR
18352
18353     This program is free software: you can redistribute it and/or modify
18354     it under the terms of the GNU General Public License as published by
18355     the Free Software Foundation, either version 3 of the License, or (at
18356     your option) any later version.
18357
18358     This program is distributed in the hope that it will be useful, but
18359     WITHOUT ANY WARRANTY; without even the implied warranty of
18360     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18361     General Public License for more details.
18362
18363     You should have received a copy of the GNU General Public License
18364     along with this program.  If not, see `http://www.gnu.org/licenses/'.
18365
18366   Also add information on how to contact you by electronic and paper
18367mail.
18368
18369   If the program does terminal interaction, make it output a short
18370notice like this when it starts in an interactive mode:
18371
18372     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
18373     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
18374     This is free software, and you are welcome to redistribute it
18375     under certain conditions; type `show c' for details.
18376
18377   The hypothetical commands `show w' and `show c' should show the
18378appropriate parts of the General Public License.  Of course, your
18379program's commands might be different; for a GUI interface, you would
18380use an "about box".
18381
18382   You should also get your employer (if you work as a programmer) or
18383school, if any, to sign a "copyright disclaimer" for the program, if
18384necessary.  For more information on this, and how to apply and follow
18385the GNU GPL, see `http://www.gnu.org/licenses/'.
18386
18387   The GNU General Public License does not permit incorporating your
18388program into proprietary programs.  If your program is a subroutine
18389library, you may consider it more useful to permit linking proprietary
18390applications with the library.  If this is what you want to do, use the
18391GNU Lesser General Public License instead of this License.  But first,
18392please read `http://www.gnu.org/philosophy/why-not-lgpl.html'.
18393
18394
18395File: gfortran.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
18396
18397GNU Free Documentation License
18398******************************
18399
18400                     Version 1.3, 3 November 2008
18401
18402     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
18403     `http://fsf.org/'
18404
18405     Everyone is permitted to copy and distribute verbatim copies
18406     of this license document, but changing it is not allowed.
18407
18408  0. PREAMBLE
18409
18410     The purpose of this License is to make a manual, textbook, or other
18411     functional and useful document "free" in the sense of freedom: to
18412     assure everyone the effective freedom to copy and redistribute it,
18413     with or without modifying it, either commercially or
18414     noncommercially.  Secondarily, this License preserves for the
18415     author and publisher a way to get credit for their work, while not
18416     being considered responsible for modifications made by others.
18417
18418     This License is a kind of "copyleft", which means that derivative
18419     works of the document must themselves be free in the same sense.
18420     It complements the GNU General Public License, which is a copyleft
18421     license designed for free software.
18422
18423     We have designed this License in order to use it for manuals for
18424     free software, because free software needs free documentation: a
18425     free program should come with manuals providing the same freedoms
18426     that the software does.  But this License is not limited to
18427     software manuals; it can be used for any textual work, regardless
18428     of subject matter or whether it is published as a printed book.
18429     We recommend this License principally for works whose purpose is
18430     instruction or reference.
18431
18432  1. APPLICABILITY AND DEFINITIONS
18433
18434     This License applies to any manual or other work, in any medium,
18435     that contains a notice placed by the copyright holder saying it
18436     can be distributed under the terms of this License.  Such a notice
18437     grants a world-wide, royalty-free license, unlimited in duration,
18438     to use that work under the conditions stated herein.  The
18439     "Document", below, refers to any such manual or work.  Any member
18440     of the public is a licensee, and is addressed as "you".  You
18441     accept the license if you copy, modify or distribute the work in a
18442     way requiring permission under copyright law.
18443
18444     A "Modified Version" of the Document means any work containing the
18445     Document or a portion of it, either copied verbatim, or with
18446     modifications and/or translated into another language.
18447
18448     A "Secondary Section" is a named appendix or a front-matter section
18449     of the Document that deals exclusively with the relationship of the
18450     publishers or authors of the Document to the Document's overall
18451     subject (or to related matters) and contains nothing that could
18452     fall directly within that overall subject.  (Thus, if the Document
18453     is in part a textbook of mathematics, a Secondary Section may not
18454     explain any mathematics.)  The relationship could be a matter of
18455     historical connection with the subject or with related matters, or
18456     of legal, commercial, philosophical, ethical or political position
18457     regarding them.
18458
18459     The "Invariant Sections" are certain Secondary Sections whose
18460     titles are designated, as being those of Invariant Sections, in
18461     the notice that says that the Document is released under this
18462     License.  If a section does not fit the above definition of
18463     Secondary then it is not allowed to be designated as Invariant.
18464     The Document may contain zero Invariant Sections.  If the Document
18465     does not identify any Invariant Sections then there are none.
18466
18467     The "Cover Texts" are certain short passages of text that are
18468     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
18469     that says that the Document is released under this License.  A
18470     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
18471     be at most 25 words.
18472
18473     A "Transparent" copy of the Document means a machine-readable copy,
18474     represented in a format whose specification is available to the
18475     general public, that is suitable for revising the document
18476     straightforwardly with generic text editors or (for images
18477     composed of pixels) generic paint programs or (for drawings) some
18478     widely available drawing editor, and that is suitable for input to
18479     text formatters or for automatic translation to a variety of
18480     formats suitable for input to text formatters.  A copy made in an
18481     otherwise Transparent file format whose markup, or absence of
18482     markup, has been arranged to thwart or discourage subsequent
18483     modification by readers is not Transparent.  An image format is
18484     not Transparent if used for any substantial amount of text.  A
18485     copy that is not "Transparent" is called "Opaque".
18486
18487     Examples of suitable formats for Transparent copies include plain
18488     ASCII without markup, Texinfo input format, LaTeX input format,
18489     SGML or XML using a publicly available DTD, and
18490     standard-conforming simple HTML, PostScript or PDF designed for
18491     human modification.  Examples of transparent image formats include
18492     PNG, XCF and JPG.  Opaque formats include proprietary formats that
18493     can be read and edited only by proprietary word processors, SGML or
18494     XML for which the DTD and/or processing tools are not generally
18495     available, and the machine-generated HTML, PostScript or PDF
18496     produced by some word processors for output purposes only.
18497
18498     The "Title Page" means, for a printed book, the title page itself,
18499     plus such following pages as are needed to hold, legibly, the
18500     material this License requires to appear in the title page.  For
18501     works in formats which do not have any title page as such, "Title
18502     Page" means the text near the most prominent appearance of the
18503     work's title, preceding the beginning of the body of the text.
18504
18505     The "publisher" means any person or entity that distributes copies
18506     of the Document to the public.
18507
18508     A section "Entitled XYZ" means a named subunit of the Document
18509     whose title either is precisely XYZ or contains XYZ in parentheses
18510     following text that translates XYZ in another language.  (Here XYZ
18511     stands for a specific section name mentioned below, such as
18512     "Acknowledgements", "Dedications", "Endorsements", or "History".)
18513     To "Preserve the Title" of such a section when you modify the
18514     Document means that it remains a section "Entitled XYZ" according
18515     to this definition.
18516
18517     The Document may include Warranty Disclaimers next to the notice
18518     which states that this License applies to the Document.  These
18519     Warranty Disclaimers are considered to be included by reference in
18520     this License, but only as regards disclaiming warranties: any other
18521     implication that these Warranty Disclaimers may have is void and
18522     has no effect on the meaning of this License.
18523
18524  2. VERBATIM COPYING
18525
18526     You may copy and distribute the Document in any medium, either
18527     commercially or noncommercially, provided that this License, the
18528     copyright notices, and the license notice saying this License
18529     applies to the Document are reproduced in all copies, and that you
18530     add no other conditions whatsoever to those of this License.  You
18531     may not use technical measures to obstruct or control the reading
18532     or further copying of the copies you make or distribute.  However,
18533     you may accept compensation in exchange for copies.  If you
18534     distribute a large enough number of copies you must also follow
18535     the conditions in section 3.
18536
18537     You may also lend copies, under the same conditions stated above,
18538     and you may publicly display copies.
18539
18540  3. COPYING IN QUANTITY
18541
18542     If you publish printed copies (or copies in media that commonly
18543     have printed covers) of the Document, numbering more than 100, and
18544     the Document's license notice requires Cover Texts, you must
18545     enclose the copies in covers that carry, clearly and legibly, all
18546     these Cover Texts: Front-Cover Texts on the front cover, and
18547     Back-Cover Texts on the back cover.  Both covers must also clearly
18548     and legibly identify you as the publisher of these copies.  The
18549     front cover must present the full title with all words of the
18550     title equally prominent and visible.  You may add other material
18551     on the covers in addition.  Copying with changes limited to the
18552     covers, as long as they preserve the title of the Document and
18553     satisfy these conditions, can be treated as verbatim copying in
18554     other respects.
18555
18556     If the required texts for either cover are too voluminous to fit
18557     legibly, you should put the first ones listed (as many as fit
18558     reasonably) on the actual cover, and continue the rest onto
18559     adjacent pages.
18560
18561     If you publish or distribute Opaque copies of the Document
18562     numbering more than 100, you must either include a
18563     machine-readable Transparent copy along with each Opaque copy, or
18564     state in or with each Opaque copy a computer-network location from
18565     which the general network-using public has access to download
18566     using public-standard network protocols a complete Transparent
18567     copy of the Document, free of added material.  If you use the
18568     latter option, you must take reasonably prudent steps, when you
18569     begin distribution of Opaque copies in quantity, to ensure that
18570     this Transparent copy will remain thus accessible at the stated
18571     location until at least one year after the last time you
18572     distribute an Opaque copy (directly or through your agents or
18573     retailers) of that edition to the public.
18574
18575     It is requested, but not required, that you contact the authors of
18576     the Document well before redistributing any large number of
18577     copies, to give them a chance to provide you with an updated
18578     version of the Document.
18579
18580  4. MODIFICATIONS
18581
18582     You may copy and distribute a Modified Version of the Document
18583     under the conditions of sections 2 and 3 above, provided that you
18584     release the Modified Version under precisely this License, with
18585     the Modified Version filling the role of the Document, thus
18586     licensing distribution and modification of the Modified Version to
18587     whoever possesses a copy of it.  In addition, you must do these
18588     things in the Modified Version:
18589
18590       A. Use in the Title Page (and on the covers, if any) a title
18591          distinct from that of the Document, and from those of
18592          previous versions (which should, if there were any, be listed
18593          in the History section of the Document).  You may use the
18594          same title as a previous version if the original publisher of
18595          that version gives permission.
18596
18597       B. List on the Title Page, as authors, one or more persons or
18598          entities responsible for authorship of the modifications in
18599          the Modified Version, together with at least five of the
18600          principal authors of the Document (all of its principal
18601          authors, if it has fewer than five), unless they release you
18602          from this requirement.
18603
18604       C. State on the Title page the name of the publisher of the
18605          Modified Version, as the publisher.
18606
18607       D. Preserve all the copyright notices of the Document.
18608
18609       E. Add an appropriate copyright notice for your modifications
18610          adjacent to the other copyright notices.
18611
18612       F. Include, immediately after the copyright notices, a license
18613          notice giving the public permission to use the Modified
18614          Version under the terms of this License, in the form shown in
18615          the Addendum below.
18616
18617       G. Preserve in that license notice the full lists of Invariant
18618          Sections and required Cover Texts given in the Document's
18619          license notice.
18620
18621       H. Include an unaltered copy of this License.
18622
18623       I. Preserve the section Entitled "History", Preserve its Title,
18624          and add to it an item stating at least the title, year, new
18625          authors, and publisher of the Modified Version as given on
18626          the Title Page.  If there is no section Entitled "History" in
18627          the Document, create one stating the title, year, authors,
18628          and publisher of the Document as given on its Title Page,
18629          then add an item describing the Modified Version as stated in
18630          the previous sentence.
18631
18632       J. Preserve the network location, if any, given in the Document
18633          for public access to a Transparent copy of the Document, and
18634          likewise the network locations given in the Document for
18635          previous versions it was based on.  These may be placed in
18636          the "History" section.  You may omit a network location for a
18637          work that was published at least four years before the
18638          Document itself, or if the original publisher of the version
18639          it refers to gives permission.
18640
18641       K. For any section Entitled "Acknowledgements" or "Dedications",
18642          Preserve the Title of the section, and preserve in the
18643          section all the substance and tone of each of the contributor
18644          acknowledgements and/or dedications given therein.
18645
18646       L. Preserve all the Invariant Sections of the Document,
18647          unaltered in their text and in their titles.  Section numbers
18648          or the equivalent are not considered part of the section
18649          titles.
18650
18651       M. Delete any section Entitled "Endorsements".  Such a section
18652          may not be included in the Modified Version.
18653
18654       N. Do not retitle any existing section to be Entitled
18655          "Endorsements" or to conflict in title with any Invariant
18656          Section.
18657
18658       O. Preserve any Warranty Disclaimers.
18659
18660     If the Modified Version includes new front-matter sections or
18661     appendices that qualify as Secondary Sections and contain no
18662     material copied from the Document, you may at your option
18663     designate some or all of these sections as invariant.  To do this,
18664     add their titles to the list of Invariant Sections in the Modified
18665     Version's license notice.  These titles must be distinct from any
18666     other section titles.
18667
18668     You may add a section Entitled "Endorsements", provided it contains
18669     nothing but endorsements of your Modified Version by various
18670     parties--for example, statements of peer review or that the text
18671     has been approved by an organization as the authoritative
18672     definition of a standard.
18673
18674     You may add a passage of up to five words as a Front-Cover Text,
18675     and a passage of up to 25 words as a Back-Cover Text, to the end
18676     of the list of Cover Texts in the Modified Version.  Only one
18677     passage of Front-Cover Text and one of Back-Cover Text may be
18678     added by (or through arrangements made by) any one entity.  If the
18679     Document already includes a cover text for the same cover,
18680     previously added by you or by arrangement made by the same entity
18681     you are acting on behalf of, you may not add another; but you may
18682     replace the old one, on explicit permission from the previous
18683     publisher that added the old one.
18684
18685     The author(s) and publisher(s) of the Document do not by this
18686     License give permission to use their names for publicity for or to
18687     assert or imply endorsement of any Modified Version.
18688
18689  5. COMBINING DOCUMENTS
18690
18691     You may combine the Document with other documents released under
18692     this License, under the terms defined in section 4 above for
18693     modified versions, provided that you include in the combination
18694     all of the Invariant Sections of all of the original documents,
18695     unmodified, and list them all as Invariant Sections of your
18696     combined work in its license notice, and that you preserve all
18697     their Warranty Disclaimers.
18698
18699     The combined work need only contain one copy of this License, and
18700     multiple identical Invariant Sections may be replaced with a single
18701     copy.  If there are multiple Invariant Sections with the same name
18702     but different contents, make the title of each such section unique
18703     by adding at the end of it, in parentheses, the name of the
18704     original author or publisher of that section if known, or else a
18705     unique number.  Make the same adjustment to the section titles in
18706     the list of Invariant Sections in the license notice of the
18707     combined work.
18708
18709     In the combination, you must combine any sections Entitled
18710     "History" in the various original documents, forming one section
18711     Entitled "History"; likewise combine any sections Entitled
18712     "Acknowledgements", and any sections Entitled "Dedications".  You
18713     must delete all sections Entitled "Endorsements."
18714
18715  6. COLLECTIONS OF DOCUMENTS
18716
18717     You may make a collection consisting of the Document and other
18718     documents released under this License, and replace the individual
18719     copies of this License in the various documents with a single copy
18720     that is included in the collection, provided that you follow the
18721     rules of this License for verbatim copying of each of the
18722     documents in all other respects.
18723
18724     You may extract a single document from such a collection, and
18725     distribute it individually under this License, provided you insert
18726     a copy of this License into the extracted document, and follow
18727     this License in all other respects regarding verbatim copying of
18728     that document.
18729
18730  7. AGGREGATION WITH INDEPENDENT WORKS
18731
18732     A compilation of the Document or its derivatives with other
18733     separate and independent documents or works, in or on a volume of
18734     a storage or distribution medium, is called an "aggregate" if the
18735     copyright resulting from the compilation is not used to limit the
18736     legal rights of the compilation's users beyond what the individual
18737     works permit.  When the Document is included in an aggregate, this
18738     License does not apply to the other works in the aggregate which
18739     are not themselves derivative works of the Document.
18740
18741     If the Cover Text requirement of section 3 is applicable to these
18742     copies of the Document, then if the Document is less than one half
18743     of the entire aggregate, the Document's Cover Texts may be placed
18744     on covers that bracket the Document within the aggregate, or the
18745     electronic equivalent of covers if the Document is in electronic
18746     form.  Otherwise they must appear on printed covers that bracket
18747     the whole aggregate.
18748
18749  8. TRANSLATION
18750
18751     Translation is considered a kind of modification, so you may
18752     distribute translations of the Document under the terms of section
18753     4.  Replacing Invariant Sections with translations requires special
18754     permission from their copyright holders, but you may include
18755     translations of some or all Invariant Sections in addition to the
18756     original versions of these Invariant Sections.  You may include a
18757     translation of this License, and all the license notices in the
18758     Document, and any Warranty Disclaimers, provided that you also
18759     include the original English version of this License and the
18760     original versions of those notices and disclaimers.  In case of a
18761     disagreement between the translation and the original version of
18762     this License or a notice or disclaimer, the original version will
18763     prevail.
18764
18765     If a section in the Document is Entitled "Acknowledgements",
18766     "Dedications", or "History", the requirement (section 4) to
18767     Preserve its Title (section 1) will typically require changing the
18768     actual title.
18769
18770  9. TERMINATION
18771
18772     You may not copy, modify, sublicense, or distribute the Document
18773     except as expressly provided under this License.  Any attempt
18774     otherwise to copy, modify, sublicense, or distribute it is void,
18775     and will automatically terminate your rights under this License.
18776
18777     However, if you cease all violation of this License, then your
18778     license from a particular copyright holder is reinstated (a)
18779     provisionally, unless and until the copyright holder explicitly
18780     and finally terminates your license, and (b) permanently, if the
18781     copyright holder fails to notify you of the violation by some
18782     reasonable means prior to 60 days after the cessation.
18783
18784     Moreover, your license from a particular copyright holder is
18785     reinstated permanently if the copyright holder notifies you of the
18786     violation by some reasonable means, this is the first time you have
18787     received notice of violation of this License (for any work) from
18788     that copyright holder, and you cure the violation prior to 30 days
18789     after your receipt of the notice.
18790
18791     Termination of your rights under this section does not terminate
18792     the licenses of parties who have received copies or rights from
18793     you under this License.  If your rights have been terminated and
18794     not permanently reinstated, receipt of a copy of some or all of
18795     the same material does not give you any rights to use it.
18796
18797 10. FUTURE REVISIONS OF THIS LICENSE
18798
18799     The Free Software Foundation may publish new, revised versions of
18800     the GNU Free Documentation License from time to time.  Such new
18801     versions will be similar in spirit to the present version, but may
18802     differ in detail to address new problems or concerns.  See
18803     `http://www.gnu.org/copyleft/'.
18804
18805     Each version of the License is given a distinguishing version
18806     number.  If the Document specifies that a particular numbered
18807     version of this License "or any later version" applies to it, you
18808     have the option of following the terms and conditions either of
18809     that specified version or of any later version that has been
18810     published (not as a draft) by the Free Software Foundation.  If
18811     the Document does not specify a version number of this License,
18812     you may choose any version ever published (not as a draft) by the
18813     Free Software Foundation.  If the Document specifies that a proxy
18814     can decide which future versions of this License can be used, that
18815     proxy's public statement of acceptance of a version permanently
18816     authorizes you to choose that version for the Document.
18817
18818 11. RELICENSING
18819
18820     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
18821     World Wide Web server that publishes copyrightable works and also
18822     provides prominent facilities for anybody to edit those works.  A
18823     public wiki that anybody can edit is an example of such a server.
18824     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
18825     site means any set of copyrightable works thus published on the MMC
18826     site.
18827
18828     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
18829     license published by Creative Commons Corporation, a not-for-profit
18830     corporation with a principal place of business in San Francisco,
18831     California, as well as future copyleft versions of that license
18832     published by that same organization.
18833
18834     "Incorporate" means to publish or republish a Document, in whole or
18835     in part, as part of another Document.
18836
18837     An MMC is "eligible for relicensing" if it is licensed under this
18838     License, and if all works that were first published under this
18839     License somewhere other than this MMC, and subsequently
18840     incorporated in whole or in part into the MMC, (1) had no cover
18841     texts or invariant sections, and (2) were thus incorporated prior
18842     to November 1, 2008.
18843
18844     The operator of an MMC Site may republish an MMC contained in the
18845     site under CC-BY-SA on the same site at any time before August 1,
18846     2009, provided the MMC is eligible for relicensing.
18847
18848
18849ADDENDUM: How to use this License for your documents
18850====================================================
18851
18852To use this License in a document you have written, include a copy of
18853the License in the document and put the following copyright and license
18854notices just after the title page:
18855
18856       Copyright (C)  YEAR  YOUR NAME.
18857       Permission is granted to copy, distribute and/or modify this document
18858       under the terms of the GNU Free Documentation License, Version 1.3
18859       or any later version published by the Free Software Foundation;
18860       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
18861       Texts.  A copy of the license is included in the section entitled ``GNU
18862       Free Documentation License''.
18863
18864   If you have Invariant Sections, Front-Cover Texts and Back-Cover
18865Texts, replace the "with...Texts." line with this:
18866
18867         with the Invariant Sections being LIST THEIR TITLES, with
18868         the Front-Cover Texts being LIST, and with the Back-Cover Texts
18869         being LIST.
18870
18871   If you have Invariant Sections without Cover Texts, or some other
18872combination of the three, merge those two alternatives to suit the
18873situation.
18874
18875   If your document contains nontrivial examples of program code, we
18876recommend releasing these examples in parallel under your choice of
18877free software license, such as the GNU General Public License, to
18878permit their use in free software.
18879
18880
18881File: gfortran.info,  Node: Funding,  Next: Option Index,  Prev: GNU Free Documentation License,  Up: Top
18882
18883Funding Free Software
18884*********************
18885
18886If you want to have more free software a few years from now, it makes
18887sense for you to help encourage people to contribute funds for its
18888development.  The most effective approach known is to encourage
18889commercial redistributors to donate.
18890
18891   Users of free software systems can boost the pace of development by
18892encouraging for-a-fee distributors to donate part of their selling price
18893to free software developers--the Free Software Foundation, and others.
18894
18895   The way to convince distributors to do this is to demand it and
18896expect it from them.  So when you compare distributors, judge them
18897partly by how much they give to free software development.  Show
18898distributors they must compete to be the one who gives the most.
18899
18900   To make this approach work, you must insist on numbers that you can
18901compare, such as, "We will donate ten dollars to the Frobnitz project
18902for each disk sold."  Don't be satisfied with a vague promise, such as
18903"A portion of the profits are donated," since it doesn't give a basis
18904for comparison.
18905
18906   Even a precise fraction "of the profits from this disk" is not very
18907meaningful, since creative accounting and unrelated business decisions
18908can greatly alter what fraction of the sales price counts as profit.
18909If the price you pay is $50, ten percent of the profit is probably less
18910than a dollar; it might be a few cents, or nothing at all.
18911
18912   Some redistributors do development work themselves.  This is useful
18913too; but to keep everyone honest, you need to inquire how much they do,
18914and what kind.  Some kinds of development make much more long-term
18915difference than others.  For example, maintaining a separate version of
18916a program contributes very little; maintaining the standard version of a
18917program for the whole community contributes much.  Easy new ports
18918contribute little, since someone else would surely do them; difficult
18919ports such as adding a new CPU to the GNU Compiler Collection
18920contribute more; major new features or packages contribute the most.
18921
18922   By establishing the idea that supporting further development is "the
18923proper thing to do" when distributing free software for a fee, we can
18924assure a steady flow of resources into making more free software.
18925
18926     Copyright (C) 1994 Free Software Foundation, Inc.
18927     Verbatim copying and redistribution of this section is permitted
18928     without royalty; alteration is not permitted.
18929
18930
18931File: gfortran.info,  Node: Option Index,  Next: Keyword Index,  Prev: Funding,  Up: Top
18932
18933Option Index
18934************
18935
18936`gfortran''s command line options are indexed here without any initial
18937`-' or `--'.  Where an option has both positive and negative forms
18938(such as -foption and -fno-option), relevant entries in the manual are
18939indexed under the most appropriate form; it may sometimes be useful to
18940look up both forms.
18941
18942[index]
18943* Menu:
18944
18945* A-PREDICATE=ANSWER:                    Preprocessing Options.
18946                                                              (line 120)
18947* APREDICATE=ANSWER:                     Preprocessing Options.
18948                                                              (line 114)
18949* backslash:                             Fortran Dialect Options.
18950                                                              (line  40)
18951* C:                                     Preprocessing Options.
18952                                                              (line 123)
18953* CC:                                    Preprocessing Options.
18954                                                              (line 138)
18955* cpp:                                   Preprocessing Options.
18956                                                              (line  12)
18957* dD:                                    Preprocessing Options.
18958                                                              (line  35)
18959* dI:                                    Preprocessing Options.
18960                                                              (line  51)
18961* dM:                                    Preprocessing Options.
18962                                                              (line  26)
18963* dN:                                    Preprocessing Options.
18964                                                              (line  41)
18965* DNAME:                                 Preprocessing Options.
18966                                                              (line 153)
18967* DNAME=DEFINITION:                      Preprocessing Options.
18968                                                              (line 156)
18969* dU:                                    Preprocessing Options.
18970                                                              (line  44)
18971* faggressive-function-elimination:      Code Gen Options.    (line 343)
18972* falign-commons:                        Code Gen Options.    (line 316)
18973* fall-intrinsics:                       Fortran Dialect Options.
18974                                                              (line  17)
18975* fblas-matmul-limit:                    Code Gen Options.    (line 268)
18976* fbounds-check:                         Code Gen Options.    (line 192)
18977* fcheck:                                Code Gen Options.    (line 143)
18978* fcheck-array-temporaries:              Code Gen Options.    (line 195)
18979* fcoarray:                              Code Gen Options.    (line 129)
18980* fconvert=CONVERSION:                   Runtime Options.     (line  10)
18981* fcray-pointer:                         Fortran Dialect Options.
18982                                                              (line  86)
18983* fd-lines-as-code:                      Fortran Dialect Options.
18984                                                              (line  27)
18985* fd-lines-as-comments:                  Fortran Dialect Options.
18986                                                              (line  27)
18987* fdefault-double-8:                     Fortran Dialect Options.
18988                                                              (line 136)
18989* fdefault-integer-8:                    Fortran Dialect Options.
18990                                                              (line 122)
18991* fdefault-real-8:                       Fortran Dialect Options.
18992                                                              (line 128)
18993* fdollar-ok:                            Fortran Dialect Options.
18994                                                              (line  34)
18995* fdump-fortran-optimized:               Debugging Options.   (line  15)
18996* fdump-fortran-original:                Debugging Options.   (line  10)
18997* fdump-parse-tree:                      Debugging Options.   (line  19)
18998* fexternal-blas:                        Code Gen Options.    (line 260)
18999* ff2c:                                  Code Gen Options.    (line  25)
19000* ffixed-form:                           Fortran Dialect Options.
19001                                                              (line  11)
19002* ffixed-line-length-N:                  Fortran Dialect Options.
19003                                                              (line  57)
19004* ffpe-summary=LIST:                     Debugging Options.   (line  52)
19005* ffpe-trap=LIST:                        Debugging Options.   (line  25)
19006* ffree-form:                            Fortran Dialect Options.
19007                                                              (line  11)
19008* ffree-line-length-N:                   Fortran Dialect Options.
19009                                                              (line  70)
19010* fimplicit-none:                        Fortran Dialect Options.
19011                                                              (line  81)
19012* finit-character:                       Code Gen Options.    (line 288)
19013* finit-integer:                         Code Gen Options.    (line 288)
19014* finit-local-zero:                      Code Gen Options.    (line 288)
19015* finit-logical:                         Code Gen Options.    (line 288)
19016* finit-real:                            Code Gen Options.    (line 288)
19017* finteger-4-integer-8:                  Fortran Dialect Options.
19018                                                              (line 145)
19019* fintrinsic-modules-path DIR:           Directory Options.   (line  36)
19020* fmax-array-constructor:                Code Gen Options.    (line 198)
19021* fmax-errors=N:                         Error and Warning Options.
19022                                                              (line  27)
19023* fmax-identifier-length=N:              Fortran Dialect Options.
19024                                                              (line  77)
19025* fmax-stack-var-size:                   Code Gen Options.    (line 216)
19026* fmax-subrecord-length=LENGTH:          Runtime Options.     (line  29)
19027* fmodule-private:                       Fortran Dialect Options.
19028                                                              (line  52)
19029* fno-automatic:                         Code Gen Options.    (line  15)
19030* fno-backtrace:                         Debugging Options.   (line  62)
19031* fno-protect-parens:                    Code Gen Options.    (line 328)
19032* fno-underscoring:                      Code Gen Options.    (line  54)
19033* fopenacc:                              Fortran Dialect Options.
19034                                                              (line  90)
19035* fopenmp:                               Fortran Dialect Options.
19036                                                              (line 102)
19037* fpack-derived:                         Code Gen Options.    (line 238)
19038* fpp:                                   Preprocessing Options.
19039                                                              (line  12)
19040* frange-check:                          Fortran Dialect Options.
19041                                                              (line 110)
19042* freal-4-real-10:                       Fortran Dialect Options.
19043                                                              (line 161)
19044* freal-4-real-16:                       Fortran Dialect Options.
19045                                                              (line 161)
19046* freal-4-real-8:                        Fortran Dialect Options.
19047                                                              (line 161)
19048* freal-8-real-10:                       Fortran Dialect Options.
19049                                                              (line 161)
19050* freal-8-real-16:                       Fortran Dialect Options.
19051                                                              (line 161)
19052* freal-8-real-4:                        Fortran Dialect Options.
19053                                                              (line 161)
19054* frealloc-lhs:                          Code Gen Options.    (line 337)
19055* frecord-marker=LENGTH:                 Runtime Options.     (line  21)
19056* frecursive:                            Code Gen Options.    (line 279)
19057* frepack-arrays:                        Code Gen Options.    (line 244)
19058* frontend-optimize:                     Code Gen Options.    (line 351)
19059* fsecond-underscore:                    Code Gen Options.    (line 112)
19060* fshort-enums <1>:                      Fortran 2003 status. (line  93)
19061* fshort-enums:                          Code Gen Options.    (line 254)
19062* fsign-zero:                            Runtime Options.     (line  34)
19063* fstack-arrays:                         Code Gen Options.    (line 230)
19064* fsyntax-only:                          Error and Warning Options.
19065                                                              (line  33)
19066* fworking-directory:                    Preprocessing Options.
19067                                                              (line  55)
19068* H:                                     Preprocessing Options.
19069                                                              (line 176)
19070* IDIR:                                  Directory Options.   (line  14)
19071* idirafter DIR:                         Preprocessing Options.
19072                                                              (line  70)
19073* imultilib DIR:                         Preprocessing Options.
19074                                                              (line  77)
19075* iprefix PREFIX:                        Preprocessing Options.
19076                                                              (line  81)
19077* iquote DIR:                            Preprocessing Options.
19078                                                              (line  90)
19079* isysroot DIR:                          Preprocessing Options.
19080                                                              (line  86)
19081* isystem DIR:                           Preprocessing Options.
19082                                                              (line  97)
19083* JDIR:                                  Directory Options.   (line  29)
19084* MDIR:                                  Directory Options.   (line  29)
19085* nostdinc:                              Preprocessing Options.
19086                                                              (line 105)
19087* P:                                     Preprocessing Options.
19088                                                              (line 181)
19089* pedantic:                              Error and Warning Options.
19090                                                              (line  38)
19091* pedantic-errors:                       Error and Warning Options.
19092                                                              (line  57)
19093* static-libgfortran:                    Link Options.        (line  11)
19094* std=STD option:                        Fortran Dialect Options.
19095                                                              (line 172)
19096* UNAME:                                 Preprocessing Options.
19097                                                              (line 187)
19098* undef:                                 Preprocessing Options.
19099                                                              (line 110)
19100* Waliasing:                             Error and Warning Options.
19101                                                              (line  69)
19102* Walign-commons:                        Error and Warning Options.
19103                                                              (line 206)
19104* Wall:                                  Error and Warning Options.
19105                                                              (line  61)
19106* Wampersand:                            Error and Warning Options.
19107                                                              (line  86)
19108* Warray-temporaries:                    Error and Warning Options.
19109                                                              (line  94)
19110* Wc-binding-type:                       Error and Warning Options.
19111                                                              (line  99)
19112* Wcharacter-truncation:                 Error and Warning Options.
19113                                                              (line 106)
19114* Wcompare-reals:                        Error and Warning Options.
19115                                                              (line 234)
19116* Wconversion:                           Error and Warning Options.
19117                                                              (line 115)
19118* Wconversion-extra:                     Error and Warning Options.
19119                                                              (line 119)
19120* Werror:                                Error and Warning Options.
19121                                                              (line 246)
19122* Wextra:                                Error and Warning Options.
19123                                                              (line 123)
19124* Wfunction-elimination:                 Error and Warning Options.
19125                                                              (line 212)
19126* Wimplicit-interface:                   Error and Warning Options.
19127                                                              (line 128)
19128* Wimplicit-procedure:                   Error and Warning Options.
19129                                                              (line 134)
19130* Wintrinsic-shadow:                     Error and Warning Options.
19131                                                              (line 184)
19132* Wintrinsics-std:                       Error and Warning Options.
19133                                                              (line 138)
19134* Wline-truncation:                      Error and Warning Options.
19135                                                              (line 109)
19136* Wreal-q-constant:                      Error and Warning Options.
19137                                                              (line 145)
19138* Wrealloc-lhs:                          Error and Warning Options.
19139                                                              (line 216)
19140* Wrealloc-lhs-all:                      Error and Warning Options.
19141                                                              (line 229)
19142* Wsurprising:                           Error and Warning Options.
19143                                                              (line 149)
19144* Wtabs:                                 Error and Warning Options.
19145                                                              (line 171)
19146* Wtargt-lifetime:                       Error and Warning Options.
19147                                                              (line 238)
19148* Wunderflow:                            Error and Warning Options.
19149                                                              (line 179)
19150* Wunused-dummy-argument:                Error and Warning Options.
19151                                                              (line 195)
19152* Wunused-parameter:                     Error and Warning Options.
19153                                                              (line 199)
19154* Wuse-without-only:                     Error and Warning Options.
19155                                                              (line 191)
19156* Wzerotrip:                             Error and Warning Options.
19157                                                              (line 242)
19158
19159
19160File: gfortran.info,  Node: Keyword Index,  Prev: Option Index,  Up: Top
19161
19162Keyword Index
19163*************
19164
19165[index]
19166* Menu:
19167
19168* $:                                     Fortran Dialect Options.
19169                                                              (line  34)
19170* %LOC:                                  Argument list functions.
19171                                                              (line   6)
19172* %REF:                                  Argument list functions.
19173                                                              (line   6)
19174* %VAL:                                  Argument list functions.
19175                                                              (line   6)
19176* &:                                     Error and Warning Options.
19177                                                              (line  86)
19178* [...]:                                 Fortran 2003 status. (line  78)
19179* _gfortran_set_args:                    _gfortran_set_args.  (line   6)
19180* _gfortran_set_convert:                 _gfortran_set_convert.
19181                                                              (line   6)
19182* _gfortran_set_fpe:                     _gfortran_set_fpe.   (line   6)
19183* _gfortran_set_max_subrecord_length:    _gfortran_set_max_subrecord_length.
19184                                                              (line   6)
19185* _gfortran_set_options:                 _gfortran_set_options.
19186                                                              (line   6)
19187* _gfortran_set_record_marker:           _gfortran_set_record_marker.
19188                                                              (line   6)
19189* ABORT:                                 ABORT.               (line   6)
19190* ABS:                                   ABS.                 (line   6)
19191* absolute value:                        ABS.                 (line   6)
19192* ACCESS:                                ACCESS.              (line   6)
19193* ACCESS='STREAM' I/O:                   Fortran 2003 status. (line 105)
19194* ACHAR:                                 ACHAR.               (line   6)
19195* ACOS:                                  ACOS.                (line   6)
19196* ACOSH:                                 ACOSH.               (line   6)
19197* adjust string <1>:                     ADJUSTR.             (line   6)
19198* adjust string:                         ADJUSTL.             (line   6)
19199* ADJUSTL:                               ADJUSTL.             (line   6)
19200* ADJUSTR:                               ADJUSTR.             (line   6)
19201* AIMAG:                                 AIMAG.               (line   6)
19202* AINT:                                  AINT.                (line   6)
19203* ALARM:                                 ALARM.               (line   6)
19204* ALGAMA:                                LOG_GAMMA.           (line   6)
19205* aliasing:                              Error and Warning Options.
19206                                                              (line  69)
19207* alignment of COMMON blocks <1>:        Code Gen Options.    (line 316)
19208* alignment of COMMON blocks:            Error and Warning Options.
19209                                                              (line 206)
19210* ALL:                                   ALL.                 (line   6)
19211* all warnings:                          Error and Warning Options.
19212                                                              (line  61)
19213* ALLOCATABLE components of derived types: Fortran 2003 status.
19214                                                              (line 103)
19215* ALLOCATABLE dummy arguments:           Fortran 2003 status. (line  99)
19216* ALLOCATABLE function results:          Fortran 2003 status. (line 101)
19217* ALLOCATED:                             ALLOCATED.           (line   6)
19218* allocation, moving:                    MOVE_ALLOC.          (line   6)
19219* allocation, status:                    ALLOCATED.           (line   6)
19220* ALOG:                                  LOG.                 (line   6)
19221* ALOG10:                                LOG10.               (line   6)
19222* AMAX0:                                 MAX.                 (line   6)
19223* AMAX1:                                 MAX.                 (line   6)
19224* AMIN0:                                 MIN.                 (line   6)
19225* AMIN1:                                 MIN.                 (line   6)
19226* AMOD:                                  MOD.                 (line   6)
19227* AND:                                   AND.                 (line   6)
19228* ANINT:                                 ANINT.               (line   6)
19229* ANY:                                   ANY.                 (line   6)
19230* area hyperbolic cosine:                ACOSH.               (line   6)
19231* area hyperbolic sine:                  ASINH.               (line   6)
19232* area hyperbolic tangent:               ATANH.               (line   6)
19233* argument list functions:               Argument list functions.
19234                                                              (line   6)
19235* arguments, to program <1>:             IARGC.               (line   6)
19236* arguments, to program <2>:             GET_COMMAND_ARGUMENT.
19237                                                              (line   6)
19238* arguments, to program <3>:             GET_COMMAND.         (line   6)
19239* arguments, to program <4>:             GETARG.              (line   6)
19240* arguments, to program:                 COMMAND_ARGUMENT_COUNT.
19241                                                              (line   6)
19242* array, add elements:                   SUM.                 (line   6)
19243* array, AND:                            IALL.                (line   6)
19244* array, apply condition <1>:            ANY.                 (line   6)
19245* array, apply condition:                ALL.                 (line   6)
19246* array, bounds checking:                Code Gen Options.    (line 143)
19247* array, change dimensions:              RESHAPE.             (line   6)
19248* array, combine arrays:                 MERGE.               (line   6)
19249* array, condition testing <1>:          ANY.                 (line   6)
19250* array, condition testing:              ALL.                 (line   6)
19251* array, conditionally add elements:     SUM.                 (line   6)
19252* array, conditionally count elements:   COUNT.               (line   6)
19253* array, conditionally multiply elements: PRODUCT.            (line   6)
19254* array, constructors:                   Fortran 2003 status. (line  78)
19255* array, count elements:                 SIZE.                (line   6)
19256* array, duplicate dimensions:           SPREAD.              (line   6)
19257* array, duplicate elements:             SPREAD.              (line   6)
19258* array, element counting:               COUNT.               (line   6)
19259* array, gather elements:                PACK.                (line   6)
19260* array, increase dimension <1>:         UNPACK.              (line   6)
19261* array, increase dimension:             SPREAD.              (line   6)
19262* array, indices of type real:           Real array indices.  (line   6)
19263* array, location of maximum element:    MAXLOC.              (line   6)
19264* array, location of minimum element:    MINLOC.              (line   6)
19265* array, lower bound:                    LBOUND.              (line   6)
19266* array, maximum value:                  MAXVAL.              (line   6)
19267* array, merge arrays:                   MERGE.               (line   6)
19268* array, minimum value:                  MINVAL.              (line   6)
19269* array, multiply elements:              PRODUCT.             (line   6)
19270* array, number of elements <1>:         SIZE.                (line   6)
19271* array, number of elements:             COUNT.               (line   6)
19272* array, OR:                             IANY.                (line   6)
19273* array, packing:                        PACK.                (line   6)
19274* array, parity:                         IPARITY.             (line   6)
19275* array, permutation:                    CSHIFT.              (line   6)
19276* array, product:                        PRODUCT.             (line   6)
19277* array, reduce dimension:               PACK.                (line   6)
19278* array, rotate:                         CSHIFT.              (line   6)
19279* array, scatter elements:               UNPACK.              (line   6)
19280* array, shape:                          SHAPE.               (line   6)
19281* array, shift:                          EOSHIFT.             (line   6)
19282* array, shift circularly:               CSHIFT.              (line   6)
19283* array, size:                           SIZE.                (line   6)
19284* array, sum:                            SUM.                 (line   6)
19285* array, transmogrify:                   RESHAPE.             (line   6)
19286* array, transpose:                      TRANSPOSE.           (line   6)
19287* array, unpacking:                      UNPACK.              (line   6)
19288* array, upper bound:                    UBOUND.              (line   6)
19289* array, XOR:                            IPARITY.             (line   6)
19290* ASCII collating sequence <1>:          IACHAR.              (line   6)
19291* ASCII collating sequence:              ACHAR.               (line   6)
19292* ASIN:                                  ASIN.                (line   6)
19293* ASINH:                                 ASINH.               (line   6)
19294* ASSOCIATED:                            ASSOCIATED.          (line   6)
19295* association status:                    ASSOCIATED.          (line   6)
19296* association status, C pointer:         C_ASSOCIATED.        (line   6)
19297* ATAN:                                  ATAN.                (line   6)
19298* ATAN2:                                 ATAN2.               (line   6)
19299* ATANH:                                 ATANH.               (line   6)
19300* Atomic subroutine, add:                ATOMIC_ADD.          (line   6)
19301* Atomic subroutine, ADD with fetch:     ATOMIC_FETCH_ADD.    (line   6)
19302* Atomic subroutine, AND:                ATOMIC_AND.          (line   6)
19303* Atomic subroutine, AND with fetch:     ATOMIC_FETCH_AND.    (line   6)
19304* Atomic subroutine, compare and swap:   ATOMIC_CAS.          (line   6)
19305* Atomic subroutine, define:             ATOMIC_DEFINE.       (line   6)
19306* Atomic subroutine, OR:                 ATOMIC_OR.           (line   6)
19307* Atomic subroutine, OR with fetch:      ATOMIC_FETCH_OR.     (line   6)
19308* Atomic subroutine, reference:          ATOMIC_REF.          (line   6)
19309* Atomic subroutine, XOR:                ATOMIC_XOR.          (line   6)
19310* Atomic subroutine, XOR with fetch:     ATOMIC_FETCH_XOR.    (line   6)
19311* ATOMIC_ADD:                            ATOMIC_ADD.          (line   6)
19312* ATOMIC_AND:                            ATOMIC_AND.          (line   6)
19313* ATOMIC_DEFINE <1>:                     ATOMIC_DEFINE.       (line   6)
19314* ATOMIC_DEFINE:                         ATOMIC_CAS.          (line   6)
19315* ATOMIC_FETCH_ADD:                      ATOMIC_FETCH_ADD.    (line   6)
19316* ATOMIC_FETCH_AND:                      ATOMIC_FETCH_AND.    (line   6)
19317* ATOMIC_FETCH_OR:                       ATOMIC_FETCH_OR.     (line   6)
19318* ATOMIC_FETCH_XOR:                      ATOMIC_FETCH_XOR.    (line   6)
19319* ATOMIC_OR:                             ATOMIC_OR.           (line   6)
19320* ATOMIC_REF:                            ATOMIC_REF.          (line   6)
19321* ATOMIC_XOR:                            ATOMIC_XOR.          (line   6)
19322* Authors:                               Contributors.        (line   6)
19323* backslash:                             Fortran Dialect Options.
19324                                                              (line  40)
19325* BACKSPACE:                             Read/Write after EOF marker.
19326                                                              (line   6)
19327* backtrace:                             BACKTRACE.           (line   6)
19328* BACKTRACE:                             BACKTRACE.           (line   6)
19329* backtrace:                             Debugging Options.   (line  62)
19330* base 10 logarithm function:            LOG10.               (line   6)
19331* BESJ0:                                 BESSEL_J0.           (line   6)
19332* BESJ1:                                 BESSEL_J1.           (line   6)
19333* BESJN:                                 BESSEL_JN.           (line   6)
19334* Bessel function, first kind <1>:       BESSEL_JN.           (line   6)
19335* Bessel function, first kind <2>:       BESSEL_J1.           (line   6)
19336* Bessel function, first kind:           BESSEL_J0.           (line   6)
19337* Bessel function, second kind <1>:      BESSEL_YN.           (line   6)
19338* Bessel function, second kind <2>:      BESSEL_Y1.           (line   6)
19339* Bessel function, second kind:          BESSEL_Y0.           (line   6)
19340* BESSEL_J0:                             BESSEL_J0.           (line   6)
19341* BESSEL_J1:                             BESSEL_J1.           (line   6)
19342* BESSEL_JN:                             BESSEL_JN.           (line   6)
19343* BESSEL_Y0:                             BESSEL_Y0.           (line   6)
19344* BESSEL_Y1:                             BESSEL_Y1.           (line   6)
19345* BESSEL_YN:                             BESSEL_YN.           (line   6)
19346* BESY0:                                 BESSEL_Y0.           (line   6)
19347* BESY1:                                 BESSEL_Y1.           (line   6)
19348* BESYN:                                 BESSEL_YN.           (line   6)
19349* BGE:                                   BGE.                 (line   6)
19350* BGT:                                   BGT.                 (line   6)
19351* binary representation <1>:             POPPAR.              (line   6)
19352* binary representation:                 POPCNT.              (line   6)
19353* BIT_SIZE:                              BIT_SIZE.            (line   6)
19354* bits set:                              POPCNT.              (line   6)
19355* bits, AND of array elements:           IALL.                (line   6)
19356* bits, clear:                           IBCLR.               (line   6)
19357* bits, extract:                         IBITS.               (line   6)
19358* bits, get:                             IBITS.               (line   6)
19359* bits, merge:                           MERGE_BITS.          (line   6)
19360* bits, move <1>:                        TRANSFER.            (line   6)
19361* bits, move:                            MVBITS.              (line   6)
19362* bits, negate:                          NOT.                 (line   6)
19363* bits, number of:                       BIT_SIZE.            (line   6)
19364* bits, OR of array elements:            IANY.                (line   6)
19365* bits, set:                             IBSET.               (line   6)
19366* bits, shift:                           ISHFT.               (line   6)
19367* bits, shift circular:                  ISHFTC.              (line   6)
19368* bits, shift left <1>:                  SHIFTL.              (line   6)
19369* bits, shift left:                      LSHIFT.              (line   6)
19370* bits, shift right <1>:                 SHIFTR.              (line   6)
19371* bits, shift right <2>:                 SHIFTA.              (line   6)
19372* bits, shift right:                     RSHIFT.              (line   6)
19373* bits, testing:                         BTEST.               (line   6)
19374* bits, unset:                           IBCLR.               (line   6)
19375* bits, XOR of array elements:           IPARITY.             (line   6)
19376* bitwise comparison <1>:                BLT.                 (line   6)
19377* bitwise comparison <2>:                BLE.                 (line   6)
19378* bitwise comparison <3>:                BGT.                 (line   6)
19379* bitwise comparison:                    BGE.                 (line   6)
19380* bitwise logical and <1>:               IAND.                (line   6)
19381* bitwise logical and:                   AND.                 (line   6)
19382* bitwise logical exclusive or <1>:      XOR.                 (line   6)
19383* bitwise logical exclusive or:          IEOR.                (line   6)
19384* bitwise logical not:                   NOT.                 (line   6)
19385* bitwise logical or <1>:                OR.                  (line   6)
19386* bitwise logical or:                    IOR.                 (line   6)
19387* BLE:                                   BLE.                 (line   6)
19388* BLT:                                   BLT.                 (line   6)
19389* bounds checking:                       Code Gen Options.    (line 143)
19390* BOZ literal constants:                 BOZ literal constants.
19391                                                              (line   6)
19392* BTEST:                                 BTEST.               (line   6)
19393* C_ASSOCIATED:                          C_ASSOCIATED.        (line   6)
19394* C_F_POINTER:                           C_F_POINTER.         (line   6)
19395* C_F_PROCPOINTER:                       C_F_PROCPOINTER.     (line   6)
19396* C_FUNLOC:                              C_FUNLOC.            (line   6)
19397* C_LOC:                                 C_LOC.               (line   6)
19398* C_SIZEOF:                              C_SIZEOF.            (line   6)
19399* CABS:                                  ABS.                 (line   6)
19400* calling convention:                    Code Gen Options.    (line  25)
19401* CCOS:                                  COS.                 (line   6)
19402* CDABS:                                 ABS.                 (line   6)
19403* CDCOS:                                 COS.                 (line   6)
19404* CDEXP:                                 EXP.                 (line   6)
19405* CDLOG:                                 LOG.                 (line   6)
19406* CDSIN:                                 SIN.                 (line   6)
19407* CDSQRT:                                SQRT.                (line   6)
19408* ceiling:                               CEILING.             (line   6)
19409* CEILING:                               CEILING.             (line   6)
19410* ceiling:                               ANINT.               (line   6)
19411* CEXP:                                  EXP.                 (line   6)
19412* CHAR:                                  CHAR.                (line   6)
19413* character kind:                        SELECTED_CHAR_KIND.  (line   6)
19414* character set:                         Fortran Dialect Options.
19415                                                              (line  34)
19416* CHDIR:                                 CHDIR.               (line   6)
19417* checking array temporaries:            Code Gen Options.    (line 143)
19418* checking subscripts:                   Code Gen Options.    (line 143)
19419* CHMOD:                                 CHMOD.               (line   6)
19420* clock ticks <1>:                       SYSTEM_CLOCK.        (line   6)
19421* clock ticks <2>:                       MCLOCK8.             (line   6)
19422* clock ticks:                           MCLOCK.              (line   6)
19423* CLOG:                                  LOG.                 (line   6)
19424* CMPLX:                                 CMPLX.               (line   6)
19425* CO_BROADCAST:                          CO_BROADCAST.        (line   6)
19426* CO_MAX:                                CO_MAX.              (line   6)
19427* CO_MIN:                                CO_MIN.              (line   6)
19428* CO_REDUCE:                             CO_REDUCE.           (line   6)
19429* CO_SUM:                                CO_SUM.              (line   6)
19430* Coarray, _gfortran_caf_atomic_cas:     _gfortran_caf_atomic_cas.
19431                                                              (line   6)
19432* Coarray, _gfortran_caf_atomic_define:  _gfortran_caf_atomic_define.
19433                                                              (line   6)
19434* Coarray, _gfortran_caf_atomic_op:      _gfortran_caf_atomic_op.
19435                                                              (line   6)
19436* Coarray, _gfortran_caf_atomic_ref:     _gfortran_caf_atomic_ref.
19437                                                              (line   6)
19438* Coarray, _gfortran_caf_co_broadcast:   _gfortran_caf_co_broadcast.
19439                                                              (line   6)
19440* Coarray, _gfortran_caf_co_max:         _gfortran_caf_co_max.
19441                                                              (line   6)
19442* Coarray, _gfortran_caf_co_min:         _gfortran_caf_co_min.
19443                                                              (line   6)
19444* Coarray, _gfortran_caf_co_reduce:      _gfortran_caf_co_reduce.
19445                                                              (line   6)
19446* Coarray, _gfortran_caf_co_sum:         _gfortran_caf_co_sum.
19447                                                              (line   6)
19448* Coarray, _gfortran_caf_deregister <1>: _gfortran_caf_deregister.
19449                                                              (line   6)
19450* Coarray, _gfortran_caf_deregister:     _gfortran_caf_register.
19451                                                              (line   6)
19452* Coarray, _gfortran_caf_error_stop:     _gfortran_caf_error_stop.
19453                                                              (line   6)
19454* Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
19455                                                              (line   6)
19456* Coarray, _gfortran_caf_event_post:     _gfortran_caf_event_post.
19457                                                              (line   6)
19458* Coarray, _gfortran_caf_event_query:    _gfortran_caf_event_query.
19459                                                              (line   6)
19460* Coarray, _gfortran_caf_event_wait:     _gfortran_caf_event_wait.
19461                                                              (line   6)
19462* Coarray, _gfortran_caf_finish:         _gfortran_caf_finish.
19463                                                              (line   6)
19464* Coarray, _gfortran_caf_get:            _gfortran_caf_get.   (line   6)
19465* Coarray, _gfortran_caf_init:           _gfortran_caf_init.  (line   6)
19466* Coarray, _gfortran_caf_lock:           _gfortran_caf_lock.  (line   6)
19467* Coarray, _gfortran_caf_num_images:     _gfortran_caf_num_images.
19468                                                              (line   6)
19469* Coarray, _gfortran_caf_send:           _gfortran_caf_send.  (line   6)
19470* Coarray, _gfortran_caf_sendget:        _gfortran_caf_sendget.
19471                                                              (line   6)
19472* Coarray, _gfortran_caf_sync_all:       _gfortran_caf_sync_all.
19473                                                              (line   6)
19474* Coarray, _gfortran_caf_sync_images:    _gfortran_caf_sync_images.
19475                                                              (line   6)
19476* Coarray, _gfortran_caf_sync_memory:    _gfortran_caf_sync_memory.
19477                                                              (line   6)
19478* Coarray, _gfortran_caf_this_image:     _gfortran_caf_this_image.
19479                                                              (line   6)
19480* Coarray, _gfortran_caf_unlock:         _gfortran_caf_unlock.
19481                                                              (line   6)
19482* coarray, IMAGE_INDEX:                  IMAGE_INDEX.         (line   6)
19483* coarray, lower bound:                  LCOBOUND.            (line   6)
19484* coarray, NUM_IMAGES:                   NUM_IMAGES.          (line   6)
19485* coarray, THIS_IMAGE:                   THIS_IMAGE.          (line   6)
19486* coarray, upper bound:                  UCOBOUND.            (line   6)
19487* Coarrays:                              Coarray Programming. (line   6)
19488* coarrays:                              Code Gen Options.    (line 129)
19489* code generation, conventions:          Code Gen Options.    (line   6)
19490* collating sequence, ASCII <1>:         IACHAR.              (line   6)
19491* collating sequence, ASCII:             ACHAR.               (line   6)
19492* Collectives, generic reduction:        CO_REDUCE.           (line   6)
19493* Collectives, maximal value:            CO_MAX.              (line   6)
19494* Collectives, minimal value:            CO_MIN.              (line   6)
19495* Collectives, sum of values:            CO_SUM.              (line   6)
19496* Collectives, value broadcasting:       CO_BROADCAST.        (line   6)
19497* command line:                          EXECUTE_COMMAND_LINE.
19498                                                              (line   6)
19499* command options:                       Invoking GNU Fortran.
19500                                                              (line   6)
19501* command-line arguments <1>:            IARGC.               (line   6)
19502* command-line arguments <2>:            GET_COMMAND_ARGUMENT.
19503                                                              (line   6)
19504* command-line arguments <3>:            GET_COMMAND.         (line   6)
19505* command-line arguments <4>:            GETARG.              (line   6)
19506* command-line arguments:                COMMAND_ARGUMENT_COUNT.
19507                                                              (line   6)
19508* command-line arguments, number of <1>: IARGC.               (line   6)
19509* command-line arguments, number of:     COMMAND_ARGUMENT_COUNT.
19510                                                              (line   6)
19511* COMMAND_ARGUMENT_COUNT:                COMMAND_ARGUMENT_COUNT.
19512                                                              (line   6)
19513* COMMON:                                Volatile COMMON blocks.
19514                                                              (line   6)
19515* compiler flags inquiry function:       COMPILER_OPTIONS.    (line   6)
19516* compiler, name and version:            COMPILER_VERSION.    (line   6)
19517* COMPILER_OPTIONS:                      COMPILER_OPTIONS.    (line   6)
19518* COMPILER_VERSION:                      COMPILER_VERSION.    (line   6)
19519* COMPLEX:                               COMPLEX.             (line   6)
19520* complex conjugate:                     CONJG.               (line   6)
19521* Complex function:                      Alternate complex function syntax.
19522                                                              (line   6)
19523* complex numbers, conversion to <1>:    DCMPLX.              (line   6)
19524* complex numbers, conversion to <2>:    COMPLEX.             (line   6)
19525* complex numbers, conversion to:        CMPLX.               (line   6)
19526* complex numbers, imaginary part:       AIMAG.               (line   6)
19527* complex numbers, real part <1>:        REAL.                (line   6)
19528* complex numbers, real part:            DREAL.               (line   6)
19529* Conditional compilation:               Preprocessing and conditional compilation.
19530                                                              (line   6)
19531* CONJG:                                 CONJG.               (line   6)
19532* consistency, durability:               Data consistency and durability.
19533                                                              (line   6)
19534* Contributing:                          Contributing.        (line   6)
19535* Contributors:                          Contributors.        (line   6)
19536* conversion:                            Error and Warning Options.
19537                                                              (line 115)
19538* conversion, to character:              CHAR.                (line   6)
19539* conversion, to complex <1>:            DCMPLX.              (line   6)
19540* conversion, to complex <2>:            COMPLEX.             (line   6)
19541* conversion, to complex:                CMPLX.               (line   6)
19542* conversion, to integer <1>:            LONG.                (line   6)
19543* conversion, to integer <2>:            INT8.                (line   6)
19544* conversion, to integer <3>:            INT2.                (line   6)
19545* conversion, to integer <4>:            INT.                 (line   6)
19546* conversion, to integer <5>:            ICHAR.               (line   6)
19547* conversion, to integer <6>:            IACHAR.              (line   6)
19548* conversion, to integer:                Implicitly convert LOGICAL and INTEGER values.
19549                                                              (line   6)
19550* conversion, to logical <1>:            LOGICAL.             (line   6)
19551* conversion, to logical:                Implicitly convert LOGICAL and INTEGER values.
19552                                                              (line   6)
19553* conversion, to real <1>:               REAL.                (line   6)
19554* conversion, to real:                   DBLE.                (line   6)
19555* conversion, to string:                 CTIME.               (line   6)
19556* CONVERT specifier:                     CONVERT specifier.   (line   6)
19557* core, dump:                            ABORT.               (line   6)
19558* COS:                                   COS.                 (line   6)
19559* COSH:                                  COSH.                (line   6)
19560* cosine:                                COS.                 (line   6)
19561* cosine, hyperbolic:                    COSH.                (line   6)
19562* cosine, hyperbolic, inverse:           ACOSH.               (line   6)
19563* cosine, inverse:                       ACOS.                (line   6)
19564* COUNT:                                 COUNT.               (line   6)
19565* CPP <1>:                               Preprocessing Options.
19566                                                              (line   6)
19567* CPP:                                   Preprocessing and conditional compilation.
19568                                                              (line   6)
19569* CPU_TIME:                              CPU_TIME.            (line   6)
19570* Credits:                               Contributors.        (line   6)
19571* CSHIFT:                                CSHIFT.              (line   6)
19572* CSIN:                                  SIN.                 (line   6)
19573* CSQRT:                                 SQRT.                (line   6)
19574* CTIME:                                 CTIME.               (line   6)
19575* current date <1>:                      IDATE.               (line   6)
19576* current date <2>:                      FDATE.               (line   6)
19577* current date:                          DATE_AND_TIME.       (line   6)
19578* current time <1>:                      TIME8.               (line   6)
19579* current time <2>:                      TIME.                (line   6)
19580* current time <3>:                      ITIME.               (line   6)
19581* current time <4>:                      FDATE.               (line   6)
19582* current time:                          DATE_AND_TIME.       (line   6)
19583* DABS:                                  ABS.                 (line   6)
19584* DACOS:                                 ACOS.                (line   6)
19585* DACOSH:                                ACOSH.               (line   6)
19586* DASIN:                                 ASIN.                (line   6)
19587* DASINH:                                ASINH.               (line   6)
19588* DATAN:                                 ATAN.                (line   6)
19589* DATAN2:                                ATAN2.               (line   6)
19590* DATANH:                                ATANH.               (line   6)
19591* date, current <1>:                     IDATE.               (line   6)
19592* date, current <2>:                     FDATE.               (line   6)
19593* date, current:                         DATE_AND_TIME.       (line   6)
19594* DATE_AND_TIME:                         DATE_AND_TIME.       (line   6)
19595* DBESJ0:                                BESSEL_J0.           (line   6)
19596* DBESJ1:                                BESSEL_J1.           (line   6)
19597* DBESJN:                                BESSEL_JN.           (line   6)
19598* DBESY0:                                BESSEL_Y0.           (line   6)
19599* DBESY1:                                BESSEL_Y1.           (line   6)
19600* DBESYN:                                BESSEL_YN.           (line   6)
19601* DBLE:                                  DBLE.                (line   6)
19602* DCMPLX:                                DCMPLX.              (line   6)
19603* DCONJG:                                CONJG.               (line   6)
19604* DCOS:                                  COS.                 (line   6)
19605* DCOSH:                                 COSH.                (line   6)
19606* DDIM:                                  DIM.                 (line   6)
19607* debugging information options:         Debugging Options.   (line   6)
19608* debugging, preprocessor:               Preprocessing Options.
19609                                                              (line  26)
19610* DECODE:                                ENCODE and DECODE statements.
19611                                                              (line   6)
19612* delayed execution <1>:                 SLEEP.               (line   6)
19613* delayed execution:                     ALARM.               (line   6)
19614* DEXP:                                  EXP.                 (line   6)
19615* DFLOAT:                                REAL.                (line   6)
19616* DGAMMA:                                GAMMA.               (line   6)
19617* dialect options:                       Fortran Dialect Options.
19618                                                              (line   6)
19619* DIGITS:                                DIGITS.              (line   6)
19620* DIM:                                   DIM.                 (line   6)
19621* DIMAG:                                 AIMAG.               (line   6)
19622* DINT:                                  AINT.                (line   6)
19623* directive, INCLUDE:                    Directory Options.   (line   6)
19624* directory, options:                    Directory Options.   (line   6)
19625* directory, search paths for inclusion: Directory Options.   (line  14)
19626* division, modulo:                      MODULO.              (line   6)
19627* division, remainder:                   MOD.                 (line   6)
19628* DLGAMA:                                LOG_GAMMA.           (line   6)
19629* DLOG:                                  LOG.                 (line   6)
19630* DLOG10:                                LOG10.               (line   6)
19631* DMAX1:                                 MAX.                 (line   6)
19632* DMIN1:                                 MIN.                 (line   6)
19633* DMOD:                                  MOD.                 (line   6)
19634* DNINT:                                 ANINT.               (line   6)
19635* dot product:                           DOT_PRODUCT.         (line   6)
19636* DOT_PRODUCT:                           DOT_PRODUCT.         (line   6)
19637* DPROD:                                 DPROD.               (line   6)
19638* DREAL:                                 DREAL.               (line   6)
19639* DSHIFTL:                               DSHIFTL.             (line   6)
19640* DSHIFTR:                               DSHIFTR.             (line   6)
19641* DSIGN:                                 SIGN.                (line   6)
19642* DSIN:                                  SIN.                 (line   6)
19643* DSINH:                                 SINH.                (line   6)
19644* DSQRT:                                 SQRT.                (line   6)
19645* DTAN:                                  TAN.                 (line   6)
19646* DTANH:                                 TANH.                (line   6)
19647* DTIME:                                 DTIME.               (line   6)
19648* dummy argument, unused:                Error and Warning Options.
19649                                                              (line 195)
19650* elapsed time <1>:                      SECOND.              (line   6)
19651* elapsed time <2>:                      SECNDS.              (line   6)
19652* elapsed time:                          DTIME.               (line   6)
19653* Elimination of functions with identical argument lists: Code Gen Options.
19654                                                              (line 343)
19655* ENCODE:                                ENCODE and DECODE statements.
19656                                                              (line   6)
19657* ENUM statement:                        Fortran 2003 status. (line  93)
19658* ENUMERATOR statement:                  Fortran 2003 status. (line  93)
19659* environment variable <1>:              GET_ENVIRONMENT_VARIABLE.
19660                                                              (line   6)
19661* environment variable <2>:              GETENV.              (line   6)
19662* environment variable <3>:              Runtime.             (line   6)
19663* environment variable:                  Environment Variables.
19664                                                              (line   6)
19665* EOF:                                   Read/Write after EOF marker.
19666                                                              (line   6)
19667* EOSHIFT:                               EOSHIFT.             (line   6)
19668* EPSILON:                               EPSILON.             (line   6)
19669* ERF:                                   ERF.                 (line   6)
19670* ERFC:                                  ERFC.                (line   6)
19671* ERFC_SCALED:                           ERFC_SCALED.         (line   6)
19672* error function:                        ERF.                 (line   6)
19673* error function, complementary:         ERFC.                (line   6)
19674* error function, complementary, exponentially-scaled: ERFC_SCALED.
19675                                                              (line   6)
19676* errors, limiting:                      Error and Warning Options.
19677                                                              (line  27)
19678* escape characters:                     Fortran Dialect Options.
19679                                                              (line  40)
19680* ETIME:                                 ETIME.               (line   6)
19681* Euclidean distance:                    HYPOT.               (line   6)
19682* Euclidean vector norm:                 NORM2.               (line   6)
19683* EXECUTE_COMMAND_LINE:                  EXECUTE_COMMAND_LINE.
19684                                                              (line   6)
19685* EXIT:                                  EXIT.                (line   6)
19686* EXP:                                   EXP.                 (line   6)
19687* EXPONENT:                              EXPONENT.            (line   6)
19688* exponential function:                  EXP.                 (line   6)
19689* exponential function, inverse <1>:     LOG10.               (line   6)
19690* exponential function, inverse:         LOG.                 (line   6)
19691* expression size <1>:                   SIZEOF.              (line   6)
19692* expression size:                       C_SIZEOF.            (line   6)
19693* EXTENDS_TYPE_OF:                       EXTENDS_TYPE_OF.     (line   6)
19694* extensions:                            Extensions.          (line   6)
19695* extensions, implemented:               Extensions implemented in GNU Fortran.
19696                                                              (line   6)
19697* extensions, not implemented:           Extensions not implemented in GNU Fortran.
19698                                                              (line   6)
19699* extra warnings:                        Error and Warning Options.
19700                                                              (line 123)
19701* f2c calling convention:                Code Gen Options.    (line  25)
19702* Factorial function:                    GAMMA.               (line   6)
19703* FDATE:                                 FDATE.               (line   6)
19704* FDL, GNU Free Documentation License:   GNU Free Documentation License.
19705                                                              (line   6)
19706* FGET:                                  FGET.                (line   6)
19707* FGETC:                                 FGETC.               (line   6)
19708* file format, fixed:                    Fortran Dialect Options.
19709                                                              (line  11)
19710* file format, free:                     Fortran Dialect Options.
19711                                                              (line  11)
19712* file operation, file number:           FNUM.                (line   6)
19713* file operation, flush:                 FLUSH.               (line   6)
19714* file operation, position <1>:          FTELL.               (line   6)
19715* file operation, position:              FSEEK.               (line   6)
19716* file operation, read character <1>:    FGETC.               (line   6)
19717* file operation, read character:        FGET.                (line   6)
19718* file operation, seek:                  FSEEK.               (line   6)
19719* file operation, write character <1>:   FPUTC.               (line   6)
19720* file operation, write character:       FPUT.                (line   6)
19721* file system, access mode:              ACCESS.              (line   6)
19722* file system, change access mode:       CHMOD.               (line   6)
19723* file system, create link <1>:          SYMLNK.              (line   6)
19724* file system, create link:              LINK.                (line   6)
19725* file system, file creation mask:       UMASK.               (line   6)
19726* file system, file status <1>:          STAT.                (line   6)
19727* file system, file status <2>:          LSTAT.               (line   6)
19728* file system, file status:              FSTAT.               (line   6)
19729* file system, hard link:                LINK.                (line   6)
19730* file system, remove file:              UNLINK.              (line   6)
19731* file system, rename file:              RENAME.              (line   6)
19732* file system, soft link:                SYMLNK.              (line   6)
19733* flags inquiry function:                COMPILER_OPTIONS.    (line   6)
19734* FLOAT:                                 REAL.                (line   6)
19735* floating point, exponent:              EXPONENT.            (line   6)
19736* floating point, fraction:              FRACTION.            (line   6)
19737* floating point, nearest different:     NEAREST.             (line   6)
19738* floating point, relative spacing <1>:  SPACING.             (line   6)
19739* floating point, relative spacing:      RRSPACING.           (line   6)
19740* floating point, scale:                 SCALE.               (line   6)
19741* floating point, set exponent:          SET_EXPONENT.        (line   6)
19742* floor:                                 FLOOR.               (line   6)
19743* FLOOR:                                 FLOOR.               (line   6)
19744* floor:                                 AINT.                (line   6)
19745* FLUSH:                                 FLUSH.               (line   6)
19746* FLUSH statement:                       Fortran 2003 status. (line  89)
19747* FNUM:                                  FNUM.                (line   6)
19748* FORMAT:                                Variable FORMAT expressions.
19749                                                              (line   6)
19750* Fortran 77:                            GNU Fortran and G77. (line   6)
19751* FPP:                                   Preprocessing and conditional compilation.
19752                                                              (line   6)
19753* FPUT:                                  FPUT.                (line   6)
19754* FPUTC:                                 FPUTC.               (line   6)
19755* FRACTION:                              FRACTION.            (line   6)
19756* FREE:                                  FREE.                (line   6)
19757* Front-end optimization:                Code Gen Options.    (line 351)
19758* FSEEK:                                 FSEEK.               (line   6)
19759* FSTAT:                                 FSTAT.               (line   6)
19760* FTELL:                                 FTELL.               (line   6)
19761* function elimination:                  Error and Warning Options.
19762                                                              (line 212)
19763* g77:                                   GNU Fortran and G77. (line   6)
19764* g77 calling convention:                Code Gen Options.    (line  25)
19765* GAMMA:                                 GAMMA.               (line   6)
19766* Gamma function:                        GAMMA.               (line   6)
19767* Gamma function, logarithm of:          LOG_GAMMA.           (line   6)
19768* GCC:                                   GNU Fortran and GCC. (line   6)
19769* GERROR:                                GERROR.              (line   6)
19770* GET_COMMAND:                           GET_COMMAND.         (line   6)
19771* GET_COMMAND_ARGUMENT:                  GET_COMMAND_ARGUMENT.
19772                                                              (line   6)
19773* GET_ENVIRONMENT_VARIABLE:              GET_ENVIRONMENT_VARIABLE.
19774                                                              (line   6)
19775* GETARG:                                GETARG.              (line   6)
19776* GETCWD:                                GETCWD.              (line   6)
19777* GETENV:                                GETENV.              (line   6)
19778* GETGID:                                GETGID.              (line   6)
19779* GETLOG:                                GETLOG.              (line   6)
19780* GETPID:                                GETPID.              (line   6)
19781* GETUID:                                GETUID.              (line   6)
19782* GMTIME:                                GMTIME.              (line   6)
19783* GNU Compiler Collection:               GNU Fortran and GCC. (line   6)
19784* GNU Fortran command options:           Invoking GNU Fortran.
19785                                                              (line   6)
19786* Hollerith constants:                   Hollerith constants support.
19787                                                              (line   6)
19788* HOSTNM:                                HOSTNM.              (line   6)
19789* HUGE:                                  HUGE.                (line   6)
19790* hyperbolic cosine:                     COSH.                (line   6)
19791* hyperbolic function, cosine:           COSH.                (line   6)
19792* hyperbolic function, cosine, inverse:  ACOSH.               (line   6)
19793* hyperbolic function, sine:             SINH.                (line   6)
19794* hyperbolic function, sine, inverse:    ASINH.               (line   6)
19795* hyperbolic function, tangent:          TANH.                (line   6)
19796* hyperbolic function, tangent, inverse: ATANH.               (line   6)
19797* hyperbolic sine:                       SINH.                (line   6)
19798* hyperbolic tangent:                    TANH.                (line   6)
19799* HYPOT:                                 HYPOT.               (line   6)
19800* I/O item lists:                        I/O item lists.      (line   6)
19801* IABS:                                  ABS.                 (line   6)
19802* IACHAR:                                IACHAR.              (line   6)
19803* IALL:                                  IALL.                (line   6)
19804* IAND:                                  IAND.                (line   6)
19805* IANY:                                  IANY.                (line   6)
19806* IARGC:                                 IARGC.               (line   6)
19807* IBCLR:                                 IBCLR.               (line   6)
19808* IBITS:                                 IBITS.               (line   6)
19809* IBSET:                                 IBSET.               (line   6)
19810* ICHAR:                                 ICHAR.               (line   6)
19811* IDATE:                                 IDATE.               (line   6)
19812* IDIM:                                  DIM.                 (line   6)
19813* IDINT:                                 INT.                 (line   6)
19814* IDNINT:                                NINT.                (line   6)
19815* IEEE, ISNAN:                           ISNAN.               (line   6)
19816* IEOR:                                  IEOR.                (line   6)
19817* IERRNO:                                IERRNO.              (line   6)
19818* IFIX:                                  INT.                 (line   6)
19819* IMAG:                                  AIMAG.               (line   6)
19820* IMAGE_INDEX:                           IMAGE_INDEX.         (line   6)
19821* images, cosubscript to image index conversion: IMAGE_INDEX. (line   6)
19822* images, index of this image:           THIS_IMAGE.          (line   6)
19823* images, number of:                     NUM_IMAGES.          (line   6)
19824* IMAGPART:                              AIMAG.               (line   6)
19825* IMPORT statement:                      Fortran 2003 status. (line 122)
19826* INCLUDE directive:                     Directory Options.   (line   6)
19827* inclusion, directory search paths for: Directory Options.   (line  14)
19828* INDEX:                                 INDEX intrinsic.     (line   6)
19829* INT:                                   INT.                 (line   6)
19830* INT2:                                  INT2.                (line   6)
19831* INT8:                                  INT8.                (line   6)
19832* integer kind:                          SELECTED_INT_KIND.   (line   6)
19833* Interoperability:                      Mixed-Language Programming.
19834                                                              (line   6)
19835* intrinsic:                             Error and Warning Options.
19836                                                              (line 184)
19837* intrinsic Modules:                     Intrinsic Modules.   (line   6)
19838* intrinsic procedures:                  Intrinsic Procedures.
19839                                                              (line   6)
19840* Introduction:                          Top.                 (line   6)
19841* inverse hyperbolic cosine:             ACOSH.               (line   6)
19842* inverse hyperbolic sine:               ASINH.               (line   6)
19843* inverse hyperbolic tangent:            ATANH.               (line   6)
19844* IOMSG= specifier:                      Fortran 2003 status. (line  91)
19845* IOR:                                   IOR.                 (line   6)
19846* IOSTAT, end of file:                   IS_IOSTAT_END.       (line   6)
19847* IOSTAT, end of record:                 IS_IOSTAT_EOR.       (line   6)
19848* IPARITY:                               IPARITY.             (line   6)
19849* IRAND:                                 IRAND.               (line   6)
19850* IS_IOSTAT_END:                         IS_IOSTAT_END.       (line   6)
19851* IS_IOSTAT_EOR:                         IS_IOSTAT_EOR.       (line   6)
19852* ISATTY:                                ISATTY.              (line   6)
19853* ISHFT:                                 ISHFT.               (line   6)
19854* ISHFTC:                                ISHFTC.              (line   6)
19855* ISIGN:                                 SIGN.                (line   6)
19856* ISNAN:                                 ISNAN.               (line   6)
19857* ISO_FORTRAN_ENV statement:             Fortran 2003 status. (line 130)
19858* ITIME:                                 ITIME.               (line   6)
19859* KILL:                                  KILL.                (line   6)
19860* kind:                                  KIND.                (line   6)
19861* KIND:                                  KIND.                (line   6)
19862* kind:                                  KIND Type Parameters.
19863                                                              (line   6)
19864* kind, character:                       SELECTED_CHAR_KIND.  (line   6)
19865* kind, integer:                         SELECTED_INT_KIND.   (line   6)
19866* kind, old-style:                       Old-style kind specifications.
19867                                                              (line   6)
19868* kind, real:                            SELECTED_REAL_KIND.  (line   6)
19869* L2 vector norm:                        NORM2.               (line   6)
19870* language, dialect options:             Fortran Dialect Options.
19871                                                              (line   6)
19872* LBOUND:                                LBOUND.              (line   6)
19873* LCOBOUND:                              LCOBOUND.            (line   6)
19874* LEADZ:                                 LEADZ.               (line   6)
19875* left shift, combined:                  DSHIFTL.             (line   6)
19876* LEN:                                   LEN.                 (line   6)
19877* LEN_TRIM:                              LEN_TRIM.            (line   6)
19878* lexical comparison of strings <1>:     LLT.                 (line   6)
19879* lexical comparison of strings <2>:     LLE.                 (line   6)
19880* lexical comparison of strings <3>:     LGT.                 (line   6)
19881* lexical comparison of strings:         LGE.                 (line   6)
19882* LGAMMA:                                LOG_GAMMA.           (line   6)
19883* LGE:                                   LGE.                 (line   6)
19884* LGT:                                   LGT.                 (line   6)
19885* libf2c calling convention:             Code Gen Options.    (line  25)
19886* libgfortran initialization, set_args:  _gfortran_set_args.  (line   6)
19887* libgfortran initialization, set_convert: _gfortran_set_convert.
19888                                                              (line   6)
19889* libgfortran initialization, set_fpe:   _gfortran_set_fpe.   (line   6)
19890* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
19891                                                              (line   6)
19892* libgfortran initialization, set_options: _gfortran_set_options.
19893                                                              (line   6)
19894* libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
19895                                                              (line   6)
19896* limits, largest number:                HUGE.                (line   6)
19897* limits, smallest number:               TINY.                (line   6)
19898* LINK:                                  LINK.                (line   6)
19899* linking, static:                       Link Options.        (line   6)
19900* LLE:                                   LLE.                 (line   6)
19901* LLT:                                   LLT.                 (line   6)
19902* LNBLNK:                                LNBLNK.              (line   6)
19903* LOC:                                   LOC.                 (line   6)
19904* location of a variable in memory:      LOC.                 (line   6)
19905* LOG:                                   LOG.                 (line   6)
19906* LOG10:                                 LOG10.               (line   6)
19907* LOG_GAMMA:                             LOG_GAMMA.           (line   6)
19908* logarithm function:                    LOG.                 (line   6)
19909* logarithm function with base 10:       LOG10.               (line   6)
19910* logarithm function, inverse:           EXP.                 (line   6)
19911* LOGICAL:                               LOGICAL.             (line   6)
19912* logical and, bitwise <1>:              IAND.                (line   6)
19913* logical and, bitwise:                  AND.                 (line   6)
19914* logical exclusive or, bitwise <1>:     XOR.                 (line   6)
19915* logical exclusive or, bitwise:         IEOR.                (line   6)
19916* logical not, bitwise:                  NOT.                 (line   6)
19917* logical or, bitwise <1>:               OR.                  (line   6)
19918* logical or, bitwise:                   IOR.                 (line   6)
19919* logical, variable representation:      Internal representation of LOGICAL variables.
19920                                                              (line   6)
19921* login name:                            GETLOG.              (line   6)
19922* LONG:                                  LONG.                (line   6)
19923* LSHIFT:                                LSHIFT.              (line   6)
19924* LSTAT:                                 LSTAT.               (line   6)
19925* LTIME:                                 LTIME.               (line   6)
19926* MALLOC:                                MALLOC.              (line   6)
19927* mask, left justified:                  MASKL.               (line   6)
19928* mask, right justified:                 MASKR.               (line   6)
19929* MASKL:                                 MASKL.               (line   6)
19930* MASKR:                                 MASKR.               (line   6)
19931* MATMUL:                                MATMUL.              (line   6)
19932* matrix multiplication:                 MATMUL.              (line   6)
19933* matrix, transpose:                     TRANSPOSE.           (line   6)
19934* MAX:                                   MAX.                 (line   6)
19935* MAX0:                                  MAX.                 (line   6)
19936* MAX1:                                  MAX.                 (line   6)
19937* MAXEXPONENT:                           MAXEXPONENT.         (line   6)
19938* maximum value <1>:                     MAXVAL.              (line   6)
19939* maximum value:                         MAX.                 (line   6)
19940* MAXLOC:                                MAXLOC.              (line   6)
19941* MAXVAL:                                MAXVAL.              (line   6)
19942* MCLOCK:                                MCLOCK.              (line   6)
19943* MCLOCK8:                               MCLOCK8.             (line   6)
19944* memory checking:                       Code Gen Options.    (line 143)
19945* MERGE:                                 MERGE.               (line   6)
19946* MERGE_BITS:                            MERGE_BITS.          (line   6)
19947* messages, error:                       Error and Warning Options.
19948                                                              (line   6)
19949* messages, warning:                     Error and Warning Options.
19950                                                              (line   6)
19951* MIN:                                   MIN.                 (line   6)
19952* MIN0:                                  MIN.                 (line   6)
19953* MIN1:                                  MIN.                 (line   6)
19954* MINEXPONENT:                           MINEXPONENT.         (line   6)
19955* minimum value <1>:                     MINVAL.              (line   6)
19956* minimum value:                         MIN.                 (line   6)
19957* MINLOC:                                MINLOC.              (line   6)
19958* MINVAL:                                MINVAL.              (line   6)
19959* Mixed-language programming:            Mixed-Language Programming.
19960                                                              (line   6)
19961* MOD:                                   MOD.                 (line   6)
19962* model representation, base:            RADIX.               (line   6)
19963* model representation, epsilon:         EPSILON.             (line   6)
19964* model representation, largest number:  HUGE.                (line   6)
19965* model representation, maximum exponent: MAXEXPONENT.        (line   6)
19966* model representation, minimum exponent: MINEXPONENT.        (line   6)
19967* model representation, precision:       PRECISION.           (line   6)
19968* model representation, radix:           RADIX.               (line   6)
19969* model representation, range:           RANGE.               (line   6)
19970* model representation, significant digits: DIGITS.           (line   6)
19971* model representation, smallest number: TINY.                (line   6)
19972* module entities:                       Fortran Dialect Options.
19973                                                              (line  52)
19974* module search path:                    Directory Options.   (line  14)
19975* modulo:                                MODULO.              (line   6)
19976* MODULO:                                MODULO.              (line   6)
19977* MOVE_ALLOC:                            MOVE_ALLOC.          (line   6)
19978* moving allocation:                     MOVE_ALLOC.          (line   6)
19979* multiply array elements:               PRODUCT.             (line   6)
19980* MVBITS:                                MVBITS.              (line   6)
19981* Namelist:                              Extensions to namelist.
19982                                                              (line   6)
19983* natural logarithm function:            LOG.                 (line   6)
19984* NEAREST:                               NEAREST.             (line   6)
19985* NEW_LINE:                              NEW_LINE.            (line   6)
19986* newline:                               NEW_LINE.            (line   6)
19987* NINT:                                  NINT.                (line   6)
19988* norm, Euclidean:                       NORM2.               (line   6)
19989* NORM2:                                 NORM2.               (line   6)
19990* NOT:                                   NOT.                 (line   6)
19991* NULL:                                  NULL.                (line   6)
19992* NUM_IMAGES:                            NUM_IMAGES.          (line   6)
19993* open, action:                          Files opened without an explicit ACTION= specifier.
19994                                                              (line   6)
19995* OpenACC <1>:                           OpenACC.             (line   6)
19996* OpenACC:                               Fortran Dialect Options.
19997                                                              (line  90)
19998* OpenMP <1>:                            OpenMP.              (line   6)
19999* OpenMP:                                Fortran Dialect Options.
20000                                                              (line 102)
20001* operators, unary:                      Unary operators.     (line   6)
20002* options inquiry function:              COMPILER_OPTIONS.    (line   6)
20003* options, code generation:              Code Gen Options.    (line   6)
20004* options, debugging:                    Debugging Options.   (line   6)
20005* options, dialect:                      Fortran Dialect Options.
20006                                                              (line   6)
20007* options, directory search:             Directory Options.   (line   6)
20008* options, errors:                       Error and Warning Options.
20009                                                              (line   6)
20010* options, Fortran dialect:              Fortran Dialect Options.
20011                                                              (line  11)
20012* options, gfortran command:             Invoking GNU Fortran.
20013                                                              (line   6)
20014* options, linking:                      Link Options.        (line   6)
20015* options, negative forms:               Invoking GNU Fortran.
20016                                                              (line  13)
20017* options, preprocessor:                 Preprocessing Options.
20018                                                              (line   6)
20019* options, real kind type promotion:     Fortran Dialect Options.
20020                                                              (line 161)
20021* options, run-time:                     Code Gen Options.    (line   6)
20022* options, runtime:                      Runtime Options.     (line   6)
20023* options, warnings:                     Error and Warning Options.
20024                                                              (line   6)
20025* OR:                                    OR.                  (line   6)
20026* output, newline:                       NEW_LINE.            (line   6)
20027* PACK:                                  PACK.                (line   6)
20028* parity:                                POPPAR.              (line   6)
20029* Parity:                                PARITY.              (line   6)
20030* PARITY:                                PARITY.              (line   6)
20031* paths, search:                         Directory Options.   (line  14)
20032* PERROR:                                PERROR.              (line   6)
20033* pointer checking:                      Code Gen Options.    (line 143)
20034* pointer, C address of pointers:        C_F_PROCPOINTER.     (line   6)
20035* pointer, C address of procedures:      C_FUNLOC.            (line   6)
20036* pointer, C association status:         C_ASSOCIATED.        (line   6)
20037* pointer, convert C to Fortran:         C_F_POINTER.         (line   6)
20038* pointer, cray <1>:                     MALLOC.              (line   6)
20039* pointer, cray:                         FREE.                (line   6)
20040* pointer, Cray:                         Cray pointers.       (line   6)
20041* pointer, disassociated:                NULL.                (line   6)
20042* pointer, status <1>:                   NULL.                (line   6)
20043* pointer, status:                       ASSOCIATED.          (line   6)
20044* POPCNT:                                POPCNT.              (line   6)
20045* POPPAR:                                POPPAR.              (line   6)
20046* positive difference:                   DIM.                 (line   6)
20047* PRECISION:                             PRECISION.           (line   6)
20048* Preprocessing:                         Preprocessing and conditional compilation.
20049                                                              (line   6)
20050* preprocessing, assertion:              Preprocessing Options.
20051                                                              (line 114)
20052* preprocessing, define macros:          Preprocessing Options.
20053                                                              (line 153)
20054* preprocessing, include path:           Preprocessing Options.
20055                                                              (line  70)
20056* preprocessing, keep comments:          Preprocessing Options.
20057                                                              (line 123)
20058* preprocessing, no linemarkers:         Preprocessing Options.
20059                                                              (line 181)
20060* preprocessing, undefine macros:        Preprocessing Options.
20061                                                              (line 187)
20062* preprocessor:                          Preprocessing Options.
20063                                                              (line   6)
20064* preprocessor, debugging:               Preprocessing Options.
20065                                                              (line  26)
20066* preprocessor, disable:                 Preprocessing Options.
20067                                                              (line  12)
20068* preprocessor, enable:                  Preprocessing Options.
20069                                                              (line  12)
20070* preprocessor, include file handling:   Preprocessing and conditional compilation.
20071                                                              (line   6)
20072* preprocessor, working directory:       Preprocessing Options.
20073                                                              (line  55)
20074* PRESENT:                               PRESENT.             (line   6)
20075* private:                               Fortran Dialect Options.
20076                                                              (line  52)
20077* procedure pointer, convert C to Fortran: C_LOC.             (line   6)
20078* process ID:                            GETPID.              (line   6)
20079* PRODUCT:                               PRODUCT.             (line   6)
20080* product, double-precision:             DPROD.               (line   6)
20081* product, matrix:                       MATMUL.              (line   6)
20082* product, vector:                       DOT_PRODUCT.         (line   6)
20083* program termination:                   EXIT.                (line   6)
20084* program termination, with core dump:   ABORT.               (line   6)
20085* PROTECTED statement:                   Fortran 2003 status. (line 116)
20086* Q exponent-letter:                     Q exponent-letter.   (line   6)
20087* RADIX:                                 RADIX.               (line   6)
20088* radix, real:                           SELECTED_REAL_KIND.  (line   6)
20089* RAN:                                   RAN.                 (line   6)
20090* RAND:                                  RAND.                (line   6)
20091* random number generation <1>:          RANDOM_NUMBER.       (line   6)
20092* random number generation <2>:          RAND.                (line   6)
20093* random number generation <3>:          RAN.                 (line   6)
20094* random number generation:              IRAND.               (line   6)
20095* random number generation, seeding <1>: SRAND.               (line   6)
20096* random number generation, seeding:     RANDOM_SEED.         (line   6)
20097* RANDOM_NUMBER:                         RANDOM_NUMBER.       (line   6)
20098* RANDOM_SEED:                           RANDOM_SEED.         (line   6)
20099* RANGE:                                 RANGE.               (line   6)
20100* range checking:                        Code Gen Options.    (line 143)
20101* rank:                                  RANK.                (line   6)
20102* RANK:                                  RANK.                (line   6)
20103* re-association of parenthesized expressions: Code Gen Options.
20104                                                              (line 328)
20105* read character, stream mode <1>:       FGETC.               (line   6)
20106* read character, stream mode:           FGET.                (line   6)
20107* REAL:                                  REAL.                (line   6)
20108* real kind:                             SELECTED_REAL_KIND.  (line   6)
20109* real number, exponent:                 EXPONENT.            (line   6)
20110* real number, fraction:                 FRACTION.            (line   6)
20111* real number, nearest different:        NEAREST.             (line   6)
20112* real number, relative spacing <1>:     SPACING.             (line   6)
20113* real number, relative spacing:         RRSPACING.           (line   6)
20114* real number, scale:                    SCALE.               (line   6)
20115* real number, set exponent:             SET_EXPONENT.        (line   6)
20116* Reallocate the LHS in assignments:     Code Gen Options.    (line 337)
20117* Reallocate the LHS in assignments, notification: Error and Warning Options.
20118                                                              (line 216)
20119* REALPART:                              REAL.                (line   6)
20120* RECORD:                                STRUCTURE and RECORD.
20121                                                              (line   6)
20122* Reduction, XOR:                        PARITY.              (line   6)
20123* remainder:                             MOD.                 (line   6)
20124* RENAME:                                RENAME.              (line   6)
20125* repacking arrays:                      Code Gen Options.    (line 244)
20126* REPEAT:                                REPEAT.              (line   6)
20127* RESHAPE:                               RESHAPE.             (line   6)
20128* REWIND:                                Read/Write after EOF marker.
20129                                                              (line   6)
20130* right shift, combined:                 DSHIFTR.             (line   6)
20131* root:                                  SQRT.                (line   6)
20132* rounding, ceiling <1>:                 CEILING.             (line   6)
20133* rounding, ceiling:                     ANINT.               (line   6)
20134* rounding, floor <1>:                   FLOOR.               (line   6)
20135* rounding, floor:                       AINT.                (line   6)
20136* rounding, nearest whole number:        NINT.                (line   6)
20137* RRSPACING:                             RRSPACING.           (line   6)
20138* RSHIFT:                                RSHIFT.              (line   6)
20139* run-time checking:                     Code Gen Options.    (line 143)
20140* SAME_TYPE_AS:                          SAME_TYPE_AS.        (line   6)
20141* SAVE statement:                        Code Gen Options.    (line  15)
20142* SCALE:                                 SCALE.               (line   6)
20143* SCAN:                                  SCAN.                (line   6)
20144* search path:                           Directory Options.   (line   6)
20145* search paths, for included files:      Directory Options.   (line  14)
20146* SECNDS:                                SECNDS.              (line   6)
20147* SECOND:                                SECOND.              (line   6)
20148* seeding a random number generator <1>: SRAND.               (line   6)
20149* seeding a random number generator:     RANDOM_SEED.         (line   6)
20150* SELECTED_CHAR_KIND:                    SELECTED_CHAR_KIND.  (line   6)
20151* SELECTED_INT_KIND:                     SELECTED_INT_KIND.   (line   6)
20152* SELECTED_REAL_KIND:                    SELECTED_REAL_KIND.  (line   6)
20153* SET_EXPONENT:                          SET_EXPONENT.        (line   6)
20154* SHAPE:                                 SHAPE.               (line   6)
20155* shift, left <1>:                       SHIFTL.              (line   6)
20156* shift, left:                           DSHIFTL.             (line   6)
20157* shift, right <1>:                      SHIFTR.              (line   6)
20158* shift, right:                          DSHIFTR.             (line   6)
20159* shift, right with fill:                SHIFTA.              (line   6)
20160* SHIFTA:                                SHIFTA.              (line   6)
20161* SHIFTL:                                SHIFTL.              (line   6)
20162* SHIFTR:                                SHIFTR.              (line   6)
20163* SHORT:                                 INT2.                (line   6)
20164* SIGN:                                  SIGN.                (line   6)
20165* sign copying:                          SIGN.                (line   6)
20166* SIGNAL:                                SIGNAL.              (line   6)
20167* SIN:                                   SIN.                 (line   6)
20168* sine:                                  SIN.                 (line   6)
20169* sine, hyperbolic:                      SINH.                (line   6)
20170* sine, hyperbolic, inverse:             ASINH.               (line   6)
20171* sine, inverse:                         ASIN.                (line   6)
20172* SINH:                                  SINH.                (line   6)
20173* SIZE:                                  SIZE.                (line   6)
20174* size of a variable, in bits:           BIT_SIZE.            (line   6)
20175* size of an expression <1>:             SIZEOF.              (line   6)
20176* size of an expression:                 C_SIZEOF.            (line   6)
20177* SIZEOF:                                SIZEOF.              (line   6)
20178* SLEEP:                                 SLEEP.               (line   6)
20179* SNGL:                                  REAL.                (line   6)
20180* SPACING:                               SPACING.             (line   6)
20181* SPREAD:                                SPREAD.              (line   6)
20182* SQRT:                                  SQRT.                (line   6)
20183* square-root:                           SQRT.                (line   6)
20184* SRAND:                                 SRAND.               (line   6)
20185* Standards:                             Standards.           (line   6)
20186* STAT:                                  STAT.                (line   6)
20187* statement, ENUM:                       Fortran 2003 status. (line  93)
20188* statement, ENUMERATOR:                 Fortran 2003 status. (line  93)
20189* statement, FLUSH:                      Fortran 2003 status. (line  89)
20190* statement, IMPORT:                     Fortran 2003 status. (line 122)
20191* statement, ISO_FORTRAN_ENV:            Fortran 2003 status. (line 130)
20192* statement, PROTECTED:                  Fortran 2003 status. (line 116)
20193* statement, SAVE:                       Code Gen Options.    (line  15)
20194* statement, USE, INTRINSIC:             Fortran 2003 status. (line 130)
20195* statement, VALUE:                      Fortran 2003 status. (line 118)
20196* statement, VOLATILE:                   Fortran 2003 status. (line 120)
20197* storage size:                          STORAGE_SIZE.        (line   6)
20198* STORAGE_SIZE:                          STORAGE_SIZE.        (line   6)
20199* STREAM I/O:                            Fortran 2003 status. (line 105)
20200* stream mode, read character <1>:       FGETC.               (line   6)
20201* stream mode, read character:           FGET.                (line   6)
20202* stream mode, write character <1>:      FPUTC.               (line   6)
20203* stream mode, write character:          FPUT.                (line   6)
20204* string, adjust left:                   ADJUSTL.             (line   6)
20205* string, adjust right:                  ADJUSTR.             (line   6)
20206* string, comparison <1>:                LLT.                 (line   6)
20207* string, comparison <2>:                LLE.                 (line   6)
20208* string, comparison <3>:                LGT.                 (line   6)
20209* string, comparison:                    LGE.                 (line   6)
20210* string, concatenate:                   REPEAT.              (line   6)
20211* string, find missing set:              VERIFY.              (line   6)
20212* string, find non-blank character:      LNBLNK.              (line   6)
20213* string, find subset:                   SCAN.                (line   6)
20214* string, find substring:                INDEX intrinsic.     (line   6)
20215* string, length:                        LEN.                 (line   6)
20216* string, length, without trailing whitespace: LEN_TRIM.      (line   6)
20217* string, remove trailing whitespace:    TRIM.                (line   6)
20218* string, repeat:                        REPEAT.              (line   6)
20219* strings, varying length:               Varying Length Character Strings.
20220                                                              (line   6)
20221* STRUCTURE:                             STRUCTURE and RECORD.
20222                                                              (line   6)
20223* structure packing:                     Code Gen Options.    (line 238)
20224* subscript checking:                    Code Gen Options.    (line 143)
20225* substring position:                    INDEX intrinsic.     (line   6)
20226* SUM:                                   SUM.                 (line   6)
20227* sum array elements:                    SUM.                 (line   6)
20228* suppressing warnings:                  Error and Warning Options.
20229                                                              (line   6)
20230* symbol names:                          Fortran Dialect Options.
20231                                                              (line  34)
20232* symbol names, transforming:            Code Gen Options.    (line  54)
20233* symbol names, underscores:             Code Gen Options.    (line  54)
20234* SYMLNK:                                SYMLNK.              (line   6)
20235* syntax checking:                       Error and Warning Options.
20236                                                              (line  33)
20237* SYSTEM:                                SYSTEM.              (line   6)
20238* system, error handling <1>:            PERROR.              (line   6)
20239* system, error handling <2>:            IERRNO.              (line   6)
20240* system, error handling:                GERROR.              (line   6)
20241* system, group ID:                      GETGID.              (line   6)
20242* system, host name:                     HOSTNM.              (line   6)
20243* system, login name:                    GETLOG.              (line   6)
20244* system, process ID:                    GETPID.              (line   6)
20245* system, signal handling:               SIGNAL.              (line   6)
20246* system, system call <1>:               SYSTEM.              (line   6)
20247* system, system call:                   EXECUTE_COMMAND_LINE.
20248                                                              (line   6)
20249* system, terminal <1>:                  TTYNAM.              (line   6)
20250* system, terminal:                      ISATTY.              (line   6)
20251* system, user ID:                       GETUID.              (line   6)
20252* system, working directory <1>:         GETCWD.              (line   6)
20253* system, working directory:             CHDIR.               (line   6)
20254* SYSTEM_CLOCK:                          SYSTEM_CLOCK.        (line   6)
20255* tabulators:                            Error and Warning Options.
20256                                                              (line 171)
20257* TAN:                                   TAN.                 (line   6)
20258* tangent:                               TAN.                 (line   6)
20259* tangent, hyperbolic:                   TANH.                (line   6)
20260* tangent, hyperbolic, inverse:          ATANH.               (line   6)
20261* tangent, inverse <1>:                  ATAN2.               (line   6)
20262* tangent, inverse:                      ATAN.                (line   6)
20263* TANH:                                  TANH.                (line   6)
20264* terminate program:                     EXIT.                (line   6)
20265* terminate program, with core dump:     ABORT.               (line   6)
20266* THIS_IMAGE:                            THIS_IMAGE.          (line   6)
20267* thread-safety, threads:                Thread-safety of the runtime library.
20268                                                              (line   6)
20269* TIME:                                  TIME.                (line   6)
20270* time, clock ticks <1>:                 SYSTEM_CLOCK.        (line   6)
20271* time, clock ticks <2>:                 MCLOCK8.             (line   6)
20272* time, clock ticks:                     MCLOCK.              (line   6)
20273* time, conversion to GMT info:          GMTIME.              (line   6)
20274* time, conversion to local time info:   LTIME.               (line   6)
20275* time, conversion to string:            CTIME.               (line   6)
20276* time, current <1>:                     TIME8.               (line   6)
20277* time, current <2>:                     TIME.                (line   6)
20278* time, current <3>:                     ITIME.               (line   6)
20279* time, current <4>:                     FDATE.               (line   6)
20280* time, current:                         DATE_AND_TIME.       (line   6)
20281* time, elapsed <1>:                     SECOND.              (line   6)
20282* time, elapsed <2>:                     SECNDS.              (line   6)
20283* time, elapsed <3>:                     ETIME.               (line   6)
20284* time, elapsed <4>:                     DTIME.               (line   6)
20285* time, elapsed:                         CPU_TIME.            (line   6)
20286* TIME8:                                 TIME8.               (line   6)
20287* TINY:                                  TINY.                (line   6)
20288* TR 15581:                              Fortran 2003 status. (line  98)
20289* trace:                                 Debugging Options.   (line  62)
20290* TRAILZ:                                TRAILZ.              (line   6)
20291* TRANSFER:                              TRANSFER.            (line   6)
20292* transforming symbol names:             Code Gen Options.    (line  54)
20293* transpose:                             TRANSPOSE.           (line   6)
20294* TRANSPOSE:                             TRANSPOSE.           (line   6)
20295* trigonometric function, cosine:        COS.                 (line   6)
20296* trigonometric function, cosine, inverse: ACOS.              (line   6)
20297* trigonometric function, sine:          SIN.                 (line   6)
20298* trigonometric function, sine, inverse: ASIN.                (line   6)
20299* trigonometric function, tangent:       TAN.                 (line   6)
20300* trigonometric function, tangent, inverse <1>: ATAN2.        (line   6)
20301* trigonometric function, tangent, inverse: ATAN.             (line   6)
20302* TRIM:                                  TRIM.                (line   6)
20303* TTYNAM:                                TTYNAM.              (line   6)
20304* type cast:                             TRANSFER.            (line   6)
20305* UBOUND:                                UBOUND.              (line   6)
20306* UCOBOUND:                              UCOBOUND.            (line   6)
20307* UMASK:                                 UMASK.               (line   6)
20308* underflow:                             Error and Warning Options.
20309                                                              (line 179)
20310* underscore:                            Code Gen Options.    (line  54)
20311* UNLINK:                                UNLINK.              (line   6)
20312* UNPACK:                                UNPACK.              (line   6)
20313* unused dummy argument:                 Error and Warning Options.
20314                                                              (line 195)
20315* unused parameter:                      Error and Warning Options.
20316                                                              (line 199)
20317* USE, INTRINSIC statement:              Fortran 2003 status. (line 130)
20318* user id:                               GETUID.              (line   6)
20319* VALUE statement:                       Fortran 2003 status. (line 118)
20320* Varying length character strings:      Varying Length Character Strings.
20321                                                              (line   6)
20322* Varying length strings:                Varying Length Character Strings.
20323                                                              (line   6)
20324* vector product:                        DOT_PRODUCT.         (line   6)
20325* VERIFY:                                VERIFY.              (line   6)
20326* version of the compiler:               COMPILER_VERSION.    (line   6)
20327* VOLATILE:                              Volatile COMMON blocks.
20328                                                              (line   6)
20329* VOLATILE statement:                    Fortran 2003 status. (line 120)
20330* warning, C binding type:               Error and Warning Options.
20331                                                              (line  99)
20332* warnings, aliasing:                    Error and Warning Options.
20333                                                              (line  69)
20334* warnings, alignment of COMMON blocks:  Error and Warning Options.
20335                                                              (line 206)
20336* warnings, all:                         Error and Warning Options.
20337                                                              (line  61)
20338* warnings, ampersand:                   Error and Warning Options.
20339                                                              (line  86)
20340* warnings, array temporaries:           Error and Warning Options.
20341                                                              (line  94)
20342* warnings, character truncation:        Error and Warning Options.
20343                                                              (line 106)
20344* warnings, conversion:                  Error and Warning Options.
20345                                                              (line 115)
20346* warnings, extra:                       Error and Warning Options.
20347                                                              (line 123)
20348* warnings, function elimination:        Error and Warning Options.
20349                                                              (line 212)
20350* warnings, implicit interface:          Error and Warning Options.
20351                                                              (line 128)
20352* warnings, implicit procedure:          Error and Warning Options.
20353                                                              (line 134)
20354* warnings, intrinsic:                   Error and Warning Options.
20355                                                              (line 184)
20356* warnings, intrinsics of other standards: Error and Warning Options.
20357                                                              (line 138)
20358* warnings, line truncation:             Error and Warning Options.
20359                                                              (line 109)
20360* warnings, non-standard intrinsics:     Error and Warning Options.
20361                                                              (line 138)
20362* warnings, q exponent-letter:           Error and Warning Options.
20363                                                              (line 145)
20364* warnings, suppressing:                 Error and Warning Options.
20365                                                              (line   6)
20366* warnings, suspicious code:             Error and Warning Options.
20367                                                              (line 149)
20368* warnings, tabs:                        Error and Warning Options.
20369                                                              (line 171)
20370* warnings, to errors:                   Error and Warning Options.
20371                                                              (line 246)
20372* warnings, underflow:                   Error and Warning Options.
20373                                                              (line 179)
20374* warnings, unused dummy argument:       Error and Warning Options.
20375                                                              (line 195)
20376* warnings, unused parameter:            Error and Warning Options.
20377                                                              (line 199)
20378* warnings, use statements:              Error and Warning Options.
20379                                                              (line 191)
20380* write character, stream mode <1>:      FPUTC.               (line   6)
20381* write character, stream mode:          FPUT.                (line   6)
20382* XOR:                                   XOR.                 (line   6)
20383* XOR reduction:                         PARITY.              (line   6)
20384* ZABS:                                  ABS.                 (line   6)
20385* ZCOS:                                  COS.                 (line   6)
20386* zero bits <1>:                         TRAILZ.              (line   6)
20387* zero bits:                             LEADZ.               (line   6)
20388* ZEXP:                                  EXP.                 (line   6)
20389* ZLOG:                                  LOG.                 (line   6)
20390* ZSIN:                                  SIN.                 (line   6)
20391* ZSQRT:                                 SQRT.                (line   6)
20392
20393
20394
20395Tag Table:
20396Node: Top2004
20397Node: Introduction3415
20398Node: About GNU Fortran4164
20399Node: GNU Fortran and GCC8153
20400Node: Preprocessing and conditional compilation10267
20401Node: GNU Fortran and G7711911
20402Node: Project Status12484
20403Node: Standards15187
20404Node: Varying Length Character Strings16480
20405Node: Invoking GNU Fortran17231
20406Node: Option Summary18954
20407Node: Fortran Dialect Options22387
20408Node: Preprocessing Options31660
20409Node: Error and Warning Options39891
20410Node: Debugging Options50437
20411Node: Directory Options53909
20412Node: Link Options55344
20413Node: Runtime Options55968
20414Node: Code Gen Options57873
20415Node: Environment Variables74028
20416Node: Runtime74633
20417Node: TMPDIR75735
20418Node: GFORTRAN_STDIN_UNIT76404
20419Node: GFORTRAN_STDOUT_UNIT76786
20420Node: GFORTRAN_STDERR_UNIT77187
20421Node: GFORTRAN_UNBUFFERED_ALL77589
20422Node: GFORTRAN_UNBUFFERED_PRECONNECTED78120
20423Node: GFORTRAN_SHOW_LOCUS78764
20424Node: GFORTRAN_OPTIONAL_PLUS79260
20425Node: GFORTRAN_DEFAULT_RECL79736
20426Node: GFORTRAN_LIST_SEPARATOR80225
20427Node: GFORTRAN_CONVERT_UNIT80834
20428Node: GFORTRAN_ERROR_BACKTRACE83697
20429Node: Fortran 2003 and 2008 status84254
20430Node: Fortran 2003 status84514
20431Node: Fortran 2008 status89755
20432Node: TS 29113 status94605
20433Node: Compiler Characteristics95582
20434Node: KIND Type Parameters96173
20435Node: Internal representation of LOGICAL variables97602
20436Node: Thread-safety of the runtime library98462
20437Node: Data consistency and durability100866
20438Node: Files opened without an explicit ACTION= specifier103967
20439Node: Extensions104619
20440Node: Extensions implemented in GNU Fortran105224
20441Node: Old-style kind specifications106626
20442Node: Old-style variable initialization107733
20443Node: Extensions to namelist109045
20444Node: X format descriptor without count field111347
20445Node: Commas in FORMAT specifications111874
20446Node: Missing period in FORMAT specifications112391
20447Node: I/O item lists112953
20448Node: `Q' exponent-letter113340
20449Node: BOZ literal constants113940
20450Node: Real array indices116519
20451Node: Unary operators116818
20452Node: Implicitly convert LOGICAL and INTEGER values117232
20453Node: Hollerith constants support118192
20454Node: Cray pointers119964
20455Node: CONVERT specifier125411
20456Node: OpenMP127409
20457Node: OpenACC129667
20458Node: Argument list functions130977
20459Node: Read/Write after EOF marker132621
20460Node: Extensions not implemented in GNU Fortran133194
20461Node: STRUCTURE and RECORD134143
20462Node: ENCODE and DECODE statements136579
20463Node: Variable FORMAT expressions137939
20464Node: Alternate complex function syntax139044
20465Node: Volatile COMMON blocks139595
20466Node: Mixed-Language Programming140071
20467Node: Interoperability with C140654
20468Node: Intrinsic Types141992
20469Node: Derived Types and struct142988
20470Node: Interoperable Global Variables144345
20471Node: Interoperable Subroutines and Functions145621
20472Node: Working with Pointers149417
20473Node: Further Interoperability of Fortran with C153893
20474Node: GNU Fortran Compiler Directives157242
20475Node: Non-Fortran Main Program160496
20476Node: _gfortran_set_args162686
20477Node: _gfortran_set_options163621
20478Node: _gfortran_set_convert166988
20479Node: _gfortran_set_record_marker167852
20480Node: _gfortran_set_fpe168660
20481Node: _gfortran_set_max_subrecord_length169852
20482Node: Naming and argument-passing conventions170772
20483Node: Naming conventions171491
20484Node: Argument passing conventions172961
20485Node: Coarray Programming177457
20486Node: Type and enum ABI Documentation177704
20487Node: caf_token_t177946
20488Node: caf_register_t178181
20489Node: Function ABI Documentation178635
20490Node: _gfortran_caf_init180378
20491Node: _gfortran_caf_finish181815
20492Node: _gfortran_caf_this_image182754
20493Node: _gfortran_caf_num_images183505
20494Node: _gfortran_caf_register184606
20495Node: _gfortran_caf_deregister187790
20496Node: _gfortran_caf_send188855
20497Node: _gfortran_caf_get191649
20498Node: _gfortran_caf_sendget194318
20499Node: _gfortran_caf_lock197734
20500Node: _gfortran_caf_unlock199453
20501Node: _gfortran_caf_event_post200886
20502Node: _gfortran_caf_event_wait202285
20503Node: _gfortran_caf_event_query204332
20504Node: _gfortran_caf_sync_all205624
20505Node: _gfortran_caf_sync_images206538
20506Node: _gfortran_caf_sync_memory208035
20507Node: _gfortran_caf_error_stop209007
20508Node: _gfortran_caf_error_stop_str209603
20509Node: _gfortran_caf_atomic_define210271
20510Node: _gfortran_caf_atomic_ref211531
20511Node: _gfortran_caf_atomic_cas212811
20512Node: _gfortran_caf_atomic_op214507
20513Node: _gfortran_caf_co_broadcast216538
20514Node: _gfortran_caf_co_max217603
20515Node: _gfortran_caf_co_min219153
20516Node: _gfortran_caf_co_sum220697
20517Node: _gfortran_caf_co_reduce222153
20518Node: Intrinsic Procedures224644
20519Node: Introduction to Intrinsics241124
20520Node: ABORT243476
20521Node: ABS244222
20522Node: ACCESS245839
20523Node: ACHAR247760
20524Node: ACOS248961
20525Node: ACOSH250198
20526Node: ADJUSTL251186
20527Node: ADJUSTR252127
20528Node: AIMAG253074
20529Node: AINT254455
20530Node: ALARM256042
20531Node: ALL257676
20532Node: ALLOCATED259594
20533Node: AND260731
20534Node: ANINT262028
20535Node: ANY263506
20536Node: ASIN265436
20537Node: ASINH266662
20538Node: ASSOCIATED267660
20539Node: ATAN270665
20540Node: ATAN2272084
20541Node: ATANH273856
20542Node: ATOMIC_ADD274853
20543Node: ATOMIC_AND276392
20544Node: ATOMIC_CAS277987
20545Node: ATOMIC_DEFINE279850
20546Node: ATOMIC_FETCH_ADD281557
20547Node: ATOMIC_FETCH_AND283344
20548Node: ATOMIC_FETCH_OR285140
20549Node: ATOMIC_FETCH_XOR286928
20550Node: ATOMIC_OR288717
20551Node: ATOMIC_REF290309
20552Node: ATOMIC_XOR292211
20553Node: BACKTRACE293803
20554Node: BESSEL_J0294382
20555Node: BESSEL_J1295390
20556Node: BESSEL_JN296399
20557Node: BESSEL_Y0298281
20558Node: BESSEL_Y1299227
20559Node: BESSEL_YN300173
20560Node: BGE302005
20561Node: BGT302694
20562Node: BIT_SIZE303341
20563Node: BLE304162
20564Node: BLT304841
20565Node: BTEST305476
20566Node: C_ASSOCIATED306359
20567Node: C_F_POINTER307568
20568Node: C_F_PROCPOINTER308992
20569Node: C_FUNLOC310493
20570Node: C_LOC311862
20571Node: C_SIZEOF313139
20572Node: CEILING314549
20573Node: CHAR315554
20574Node: CHDIR316758
20575Node: CHMOD317926
20576Node: CMPLX319789
20577Node: CO_BROADCAST321243
20578Node: CO_MAX323007
20579Node: CO_MIN324879
20580Node: CO_REDUCE326737
20581Node: CO_SUM330214
20582Node: COMMAND_ARGUMENT_COUNT332113
20583Node: COMPILER_OPTIONS333037
20584Node: COMPILER_VERSION334063
20585Node: COMPLEX335027
20586Node: CONJG336164
20587Node: COS337235
20588Node: COSH338681
20589Node: COUNT339846
20590Node: CPU_TIME341862
20591Node: CSHIFT343216
20592Node: CTIME344872
20593Node: DATE_AND_TIME346382
20594Node: DBLE348842
20595Node: DCMPLX349635
20596Node: DIGITS350829
20597Node: DIM351795
20598Node: DOT_PRODUCT353053
20599Node: DPROD354709
20600Node: DREAL355626
20601Node: DSHIFTL356292
20602Node: DSHIFTR357612
20603Node: DTIME358933
20604Node: EOSHIFT361736
20605Node: EPSILON363809
20606Node: ERF364535
20607Node: ERFC365309
20608Node: ERFC_SCALED366113
20609Node: ETIME366805
20610Node: EXECUTE_COMMAND_LINE369046
20611Node: EXIT371626
20612Node: EXP372500
20613Node: EXPONENT373773
20614Node: EXTENDS_TYPE_OF374533
20615Node: FDATE375386
20616Node: FGET376868
20617Node: FGETC378686
20618Node: FLOOR380485
20619Node: FLUSH381471
20620Node: FNUM383348
20621Node: FPUT384072
20622Node: FPUTC385699
20623Node: FRACTION387472
20624Node: FREE388375
20625Node: FSEEK389212
20626Node: FSTAT391508
20627Node: FTELL392590
20628Node: GAMMA393570
20629Node: GERROR394613
20630Node: GETARG395334
20631Node: GET_COMMAND397100
20632Node: GET_COMMAND_ARGUMENT398466
20633Node: GETCWD400502
20634Node: GETENV401476
20635Node: GET_ENVIRONMENT_VARIABLE402901
20636Node: GETGID405054
20637Node: GETLOG405591
20638Node: GETPID406451
20639Node: GETUID407181
20640Node: GMTIME407697
20641Node: HOSTNM409186
20642Node: HUGE410104
20643Node: HYPOT410825
20644Node: IACHAR411645
20645Node: IALL412825
20646Node: IAND414302
20647Node: IANY415286
20648Node: IARGC416772
20649Node: IBCLR417793
20650Node: IBITS418454
20651Node: IBSET419369
20652Node: ICHAR420025
20653Node: IDATE422197
20654Node: IEOR423224
20655Node: IERRNO424100
20656Node: IMAGE_INDEX424649
20657Node: INDEX intrinsic425673
20658Node: INT427214
20659Node: INT2428946
20660Node: INT8429711
20661Node: IOR430423
20662Node: IPARITY431275
20663Node: IRAND432799
20664Node: IS_IOSTAT_END434155
20665Node: IS_IOSTAT_EOR435252
20666Node: ISATTY436379
20667Node: ISHFT437162
20668Node: ISHFTC438142
20669Node: ISNAN439358
20670Node: ITIME440106
20671Node: KILL441131
20672Node: KIND442035
20673Node: LBOUND442880
20674Node: LCOBOUND444213
20675Node: LEADZ445343
20676Node: LEN446203
20677Node: LEN_TRIM447484
20678Node: LGE448466
20679Node: LGT449968
20680Node: LINK451435
20681Node: LLE452470
20682Node: LLT453964
20683Node: LNBLNK455424
20684Node: LOC456200
20685Node: LOG456931
20686Node: LOG10458331
20687Node: LOG_GAMMA459305
20688Node: LOGICAL460394
20689Node: LONG461202
20690Node: LSHIFT461958
20691Node: LSTAT463043
20692Node: LTIME464237
20693Node: MALLOC465648
20694Node: MASKL467107
20695Node: MASKR467870
20696Node: MATMUL468636
20697Node: MAX469725
20698Node: MAXEXPONENT471224
20699Node: MAXLOC472040
20700Node: MAXVAL474059
20701Node: MCLOCK475692
20702Node: MCLOCK8476716
20703Node: MERGE477949
20704Node: MERGE_BITS478698
20705Node: MIN479559
20706Node: MINEXPONENT481060
20707Node: MINLOC481690
20708Node: MINVAL483709
20709Node: MOD485361
20710Node: MODULO487106
20711Node: MOVE_ALLOC488406
20712Node: MVBITS489435
20713Node: NEAREST490494
20714Node: NEW_LINE491590
20715Node: NINT492361
20716Node: NORM2493764
20717Node: NOT494902
20718Node: NULL495486
20719Node: NUM_IMAGES496391
20720Node: OR498101
20721Node: PACK499385
20722Node: PARITY501378
20723Node: PERROR502593
20724Node: POPCNT503214
20725Node: POPPAR504085
20726Node: PRECISION505136
20727Node: PRESENT506022
20728Node: PRODUCT507128
20729Node: RADIX508653
20730Node: RAN509465
20731Node: RAND509921
20732Node: RANDOM_NUMBER511253
20733Node: RANDOM_SEED512970
20734Node: RANGE516782
20735Node: RANK517478
20736Node: REAL518258
20737Node: RENAME520033
20738Node: REPEAT521052
20739Node: RESHAPE521778
20740Node: RRSPACING523247
20741Node: RSHIFT523940
20742Node: SAME_TYPE_AS525078
20743Node: SCALE525908
20744Node: SCAN526688
20745Node: SECNDS528238
20746Node: SECOND529326
20747Node: SELECTED_CHAR_KIND530202
20748Node: SELECTED_INT_KIND531793
20749Node: SELECTED_REAL_KIND532968
20750Node: SET_EXPONENT535634
20751Node: SHAPE536630
20752Node: SHIFTA538045
20753Node: SHIFTL539006
20754Node: SHIFTR539841
20755Node: SIGN540677
20756Node: SIGNAL541961
20757Node: SIN543458
20758Node: SINH544556
20759Node: SIZE545552
20760Node: SIZEOF546860
20761Node: SLEEP548510
20762Node: SPACING549070
20763Node: SPREAD550083
20764Node: SQRT551228
20765Node: SRAND552582
20766Node: STAT553750
20767Node: STORAGE_SIZE556917
20768Node: SUM557796
20769Node: SYMLNK559279
20770Node: SYSTEM560411
20771Node: SYSTEM_CLOCK561662
20772Node: TAN564489
20773Node: TANH565461
20774Node: THIS_IMAGE566618
20775Node: TIME568907
20776Node: TIME8570032
20777Node: TINY571182
20778Node: TRAILZ571782
20779Node: TRANSFER572599
20780Node: TRANSPOSE574633
20781Node: TRIM575320
20782Node: TTYNAM576177
20783Node: UBOUND577092
20784Node: UCOBOUND578482
20785Node: UMASK579614
20786Node: UNLINK580292
20787Node: UNPACK581269
20788Node: VERIFY582557
20789Node: XOR584278
20790Node: Intrinsic Modules585650
20791Node: ISO_FORTRAN_ENV585939
20792Node: ISO_C_BINDING590325
20793Node: IEEE modules594516
20794Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS595661
20795Node: OpenACC Module OPENACC597205
20796Node: Contributing598132
20797Node: Contributors598986
20798Node: Projects600653
20799Node: Proposed Extensions601458
20800Node: Copying603469
20801Node: GNU Free Documentation License641033
20802Node: Funding666176
20803Node: Option Index668701
20804Node: Keyword Index684113
20805
20806End Tag Table
20807