1This is gfortran.info, produced by makeinfo version 6.5 from
2gfortran.texi.
3
4Copyright (C) 1999-2018 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 funds
22for GNU development.
23INFO-DIR-SECTION Software development
24START-INFO-DIR-ENTRY
25* gfortran: (gfortran).                  The GNU Fortran Compiler.
26END-INFO-DIR-ENTRY
27
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-2018 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 funds
52for 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 standards status::      Fortran 2003, 2008 and 2018 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, 2008 and 2018 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 instructions
121     written in Fortran 77, Fortran 90, Fortran 95, Fortran 2003,
122     Fortran 2008 or Fortran 2018.  This file contains "source code".
123
124   * Translate the user's program into instructions a computer can carry
125     out more quickly than it takes to translate the instructions in the
126     first place.  The result after compilation of a program is "machine
127     code", code designed to be efficiently translated and processed by
128     a machine such as your computer.  Humans usually are not as good
129     writing machine code as they are at writing Fortran (or C++, Ada,
130     or Java), because it is easy to make tiny mistakes writing machine
131     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 an
138     "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 the
142     computer to do something questionable.  This kind of diagnostics
143     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 compiler
149     output.  It also helps developers to find bugs in the compiler
150     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 actions
157     requested by statements in the user's program.  This machine code
158     is organized into "modules" and is located and "linked" to the user
159     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 language
178     that are not directly provided by the machine code generated by the
179     'gfortran' compilation phase, such as intrinsic functions and
180     subroutines, and routines for interaction with files and the
181     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 provides
199optimization, and then passed to one of a collection of back ends which
200generate code for different computer architectures and operating
201systems.
202
203   Functionally, this is implemented with a driver program ('gcc') which
204provides the command-line interface for the compiler.  It calls the
205relevant compiler front-end program (e.g., 'f951' for Fortran) for each
206file in the source code, and then calls the assembler and linker as
207appropriate to produce the compiled output.  In a copy of GCC which has
208been 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.  A
211'gfortran' driver program is also provided, which is identical to 'gcc'
212except that it automatically links the Fortran runtime libraries into
213the compiled program.
214
215   Source files with '.f', '.for', '.fpp', '.ftn', '.F', '.FOR', '.FPP',
216and '.FTN' extensions are treated as fixed form.  Source files with
217'.f90', '.f95', '.f03', '.f08', '.F90', '.F95', '.F03' and '.F08'
218extensions are treated as free form.  The capitalized versions of either
219form are run through preprocessing.  Source files with the lower case
220'.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 of
224GCC 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 the
227GNU 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 of
238GNU Fortran, this is the GNU C Preprocessor in the traditional mode.  On
239systems with case-preserving file names, the preprocessor is
240automatically invoked if the filename extension is '.F', '.FOR', '.FTN',
241'.fpp', '.FPP', '.F90', '.F95', '.F03' or '.F08'.  To manually invoke
242the preprocessor on any file, use '-cpp', to disable preprocessing on
243files where the preprocessor is run automatically, use '-nocpp'.
244
245   If a preprocessed file includes another file with the Fortran
246'INCLUDE' statement, the included file is not preprocessed.  To
247preprocess included files, use the equivalent preprocessor statement
248'#include'.
249
250   If GNU Fortran invokes the preprocessor, '__GFORTRAN__' is defined
251and '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be used
252to determine the version of the compiler.  See *note Overview: (cpp)Top.
253for details.
254
255   While CPP is the de-facto standard for preprocessing Fortran code,
256Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
257Conditional Compilation, which is not widely used and not directly
258supported by the GNU Fortran compiler.  You can use the program coco to
259preprocess such files (<http://www.daniellnagle.com/coco.html>).
260
261
262File: gfortran.info,  Node: GNU Fortran and G77,  Next: Project Status,  Prev: Preprocessing and conditional compilation,  Up: Introduction
263
2641.4 GNU Fortran and G77
265=======================
266
267The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front
268end included in GCC prior to version 4.  It is an entirely new program
269that has been designed to provide Fortran 95 support and extensibility
270for future Fortran language standards, as well as providing backwards
271compatibility for Fortran 77 and nearly all of the GNU language
272extensions supported by 'g77'.
273
274
275File: gfortran.info,  Node: Project Status,  Next: Standards,  Prev: GNU Fortran and G77,  Up: Introduction
276
2771.5 Project Status
278==================
279
280     As soon as 'gfortran' can parse all of the statements correctly, it
281     will be in the "larva" state.  When we generate code, the "puppa"
282     state.  When 'gfortran' is done, we'll see if it will be a
283     beautiful butterfly, or just a big bug....
284
285     -Andy Vaught, April 2000
286
287   The start of the GNU Fortran 95 project was announced on the GCC
288homepage in March 18, 2000 (even though Andy had already been working on
289it for a while, of course).
290
291   The GNU Fortran compiler is able to compile nearly all
292standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
293including a number of standard and non-standard extensions, and can be
294used on real-world programs.  In particular, the supported extensions
295include OpenMP, Cray-style pointers, some old vendor extensions, and
296several Fortran 2003 and Fortran 2008 features, including TR 15581.
297However, it is still under development and has a few remaining rough
298edges.  There also is initial support for OpenACC. Note that this is an
299experimental feature, incomplete, and subject to change in future
300versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC> for more
301information.
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 a
320few 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,
327Fortran 2008 and Fortran 2018.
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
339The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95).  As
340such, it can also compile essentially all standard-compliant Fortran 90
341and 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 found
349in the *note Fortran 2003 status::, *note Fortran 2008 status::, *note
350TS 29113 status::, *note TS 18508 status:: and *note Fortran 2018
351status:: sections of the documentation.
352
353   Additionally, the GNU Fortran compilers supports the OpenMP
354specification (version 4.0 and most of the features of the 4.5 version,
355<http://openmp.org/wp/openmp-specifications/>).  There also is initial
356support for the OpenACC specification (targeting version 2.0,
357<http://www.openacc.org/>).  Note that this is an experimental feature,
358incomplete, and subject to change in future versions of GCC. See
359<https://gcc.gnu.org/wiki/OpenACC> for more information.
360
361
362File: gfortran.info,  Node: Varying Length Character Strings,  Up: Standards
363
3641.6.1 Varying Length Character Strings
365--------------------------------------
366
367The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
368varying length character strings.  While GNU Fortran currently does not
369support such strings directly, there exist two Fortran implementations
370for them, which work with GNU Fortran.  They can be found at
371<http://www.fortran.com/iso_varying_string.f95> and at
372<ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>.
373
374   Deferred-length character strings of Fortran 2003 supports part of
375the features of 'ISO_VARYING_STRING' and should be considered as
376replacement.  (Namely, allocatable or pointers of the type
377'character(len=:)'.)
378
379
380File: gfortran.info,  Node: Invoking GNU Fortran,  Next: Runtime,  Prev: Introduction,  Up: Top
381
3822 GNU Fortran Command Options
383*****************************
384
385The 'gfortran' command supports all the options supported by the 'gcc'
386command.  Only options specific to GNU Fortran are documented here.
387
388   *Note GCC Command Options: (gcc)Invoking GCC, for information on the
389non-Fortran-specific aspects of the 'gcc' command (and, therefore, the
390'gfortran' command).
391
392   All GCC and GNU Fortran options are accepted both by 'gfortran' and
393by 'gcc' (as well as any other drivers built at the same time, such as
394'g++'), since adding GNU Fortran to the GCC distribution enables
395acceptance of GNU Fortran options by all of the relevant drivers.
396
397   In some cases, options have positive and negative forms; the negative
398form of '-ffoo' would be '-fno-foo'.  This manual documents only one of
399these two forms, whichever one is not the default.
400
401* Menu:
402
403* Option Summary::      Brief list of all 'gfortran' options,
404                        without explanations.
405* Fortran Dialect Options::  Controlling the variant of Fortran language
406                             compiled.
407* Preprocessing Options::  Enable and customize preprocessing.
408* Error and Warning Options::     How picky should the compiler be?
409* Debugging Options::   Symbol tables, measurements, and debugging dumps.
410* Directory Options::   Where to find module files
411* Link Options ::       Influencing the linking step
412* Runtime Options::     Influencing runtime behavior
413* Code Gen Options::    Specifying conventions for function calls, data layout
414                        and register usage.
415* Interoperability Options::  Options for interoperability with other
416                              languages.
417* Environment Variables:: Environment variables that affect 'gfortran'.
418
419
420File: gfortran.info,  Node: Option Summary,  Next: Fortran Dialect Options,  Up: Invoking GNU Fortran
421
4222.1 Option summary
423==================
424
425Here is a summary of all the options specific to GNU Fortran, grouped by
426type.  Explanations are in the following sections.
427
428_Fortran Language Options_
429     *Note Options controlling Fortran dialect: Fortran Dialect Options.
430          -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code
431          -fd-lines-as-comments
432          -fdec -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math
433          -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8
434          -fdefault-real-10 -fdefault-real-16 -fdollar-ok -ffixed-line-length-N
435          -ffixed-line-length-none -ffree-form -ffree-line-length-N
436          -ffree-line-length-none -fimplicit-none -finteger-4-integer-8
437          -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check
438          -fopenacc -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8
439          -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=STD
440          -ftest-forall-temp
441
442
443_Preprocessing Options_
444     *Note Enable and customize preprocessing: Preprocessing Options.
445          -A-QUESTION[=ANSWER]
446          -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
447          -H -P
448          -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
449          -imultilib DIR
450          -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
451          -nostdinc
452          -undef
453
454
455_Error and Warning Options_
456     *Note Options to request or suppress errors and warnings: Error and
457     Warning Options.
458          -Waliasing -Wall -Wampersand -Wargument-mismatch -Warray-bounds
459          -Wc-binding-type -Wcharacter-truncation -Wconversion
460          -Wdo-subscript -Wfunction-elimination -Wimplicit-interface
461          -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std
462          -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant
463          -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs
464          -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime
465          -fmax-errors=N -fsyntax-only -pedantic -pedantic-errors
466
467
468_Debugging Options_
469     *Note Options for debugging your program or GNU Fortran: Debugging
470     Options.
471          -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
472          -fdump-parse-tree -ffpe-trap=LIST -ffpe-summary=LIST
473
474
475_Directory Options_
476     *Note Options for directory search: Directory Options.
477          -IDIR  -JDIR -fintrinsic-modules-path DIR
478
479_Link Options_
480     *Note Options for influencing the linking step: Link Options.
481          -static-libgfortran
482
483_Runtime Options_
484     *Note Options for influencing runtime behavior: Runtime Options.
485          -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
486          -frecord-marker=LENGTH -fsign-zero
487
488
489_Interoperability Options_
490     *Note Options for interoperability: Interoperability Options.
491          -fc-prototypes
492
493_Code Generation Options_
494     *Note Options for code generation conventions: Code Gen Options.
495          -faggressive-function-elimination -fblas-matmul-limit=N
496          -fbounds-check -ftail-call-workaround -ftail-call-workaround=N
497          -fcheck-array-temporaries
498          -fcheck=<ALL|ARRAY-TEMPS|BOUNDS|DO|MEM|POINTER|RECURSION>
499          -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
500          -ffrontend-loop-interchange
501          -ffrontend-optimize
502          -finit-character=N -finit-integer=N -finit-local-zero
503          -finit-derived
504          -finit-logical=<TRUE|FALSE>
505          -finit-real=<ZERO|INF|-INF|NAN|SNAN>
506          -finline-matmul-limit=N
507          -fmax-array-constructor=N -fmax-stack-var-size=N
508          -fno-align-commons
509          -fno-automatic -fno-protect-parens -fno-underscoring
510          -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive
511          -frepack-arrays -fshort-enums -fstack-arrays
512
513
514
515File: gfortran.info,  Node: Fortran Dialect Options,  Next: Preprocessing Options,  Prev: Option Summary,  Up: Invoking GNU Fortran
516
5172.2 Options controlling Fortran dialect
518=======================================
519
520The following options control the details of the Fortran dialect
521accepted by the compiler:
522
523'-ffree-form'
524'-ffixed-form'
525     Specify the layout used by the source file.  The free form layout
526     was introduced in Fortran 90.  Fixed form was traditionally used in
527     older Fortran programs.  When neither option is specified, the
528     source form is determined by the file extension.
529
530'-fall-intrinsics'
531     This option causes all intrinsic procedures (including the
532     GNU-specific extensions) to be accepted.  This can be useful with
533     '-std=f95' to force standard-compliance but get access to the full
534     range of intrinsics available with 'gfortran'.  As a consequence,
535     '-Wintrinsics-std' will be ignored and no user-defined procedure
536     with the same name as any intrinsic will be called except when it
537     is explicitly declared 'EXTERNAL'.
538
539'-fd-lines-as-code'
540'-fd-lines-as-comments'
541     Enable special treatment for lines beginning with 'd' or 'D' in
542     fixed form sources.  If the '-fd-lines-as-code' option is given
543     they are treated as if the first column contained a blank.  If the
544     '-fd-lines-as-comments' option is given, they are treated as
545     comment lines.
546
547'-fdec'
548     DEC compatibility mode.  Enables extensions and other features that
549     mimic the default behavior of older compilers (such as DEC). These
550     features are non-standard and should be avoided at all costs.  For
551     details on GNU Fortran's implementation of these extensions see the
552     full documentation.
553
554     Other flags enabled by this switch are: '-fdollar-ok'
555     '-fcray-pointer' '-fdec-structure' '-fdec-intrinsic-ints'
556     '-fdec-static' '-fdec-math'
557
558     If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then
559     '-fdec' also sets '-fd-lines-as-comments'.
560
561'-fdec-structure'
562     Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and
563     dot ('.')  as a member separator (in addition to '%').  This is
564     provided for compatibility only; Fortran 90 derived types should be
565     used instead where possible.
566
567'-fdec-intrinsic-ints'
568     Enable B/I/J/K kind variants of existing integer functions (e.g.
569     BIAND, IIAND, JIAND, etc...).  For a complete list of intrinsics
570     see the full documentation.
571
572'-fdec-math'
573     Enable legacy math intrinsics such as COTAN and degree-valued
574     trigonometric functions (e.g.  TAND, ATAND, etc...)  for
575     compatability with older code.
576
577'-fdec-static'
578     Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
579     specify the storage of variables and other objects.
580
581'-fdollar-ok'
582     Allow '$' as a valid non-first character in a symbol name.  Symbols
583     that start with '$' are rejected since it is unclear which rules to
584     apply to implicit typing as different vendors implement different
585     rules.  Using '$' in 'IMPLICIT' statements is also rejected.
586
587'-fbackslash'
588     Change the interpretation of backslashes in string literals from a
589     single backslash character to "C-style" escape characters.  The
590     following combinations are expanded '\a', '\b', '\f', '\n', '\r',
591     '\t', '\v', '\\', and '\0' to the ASCII characters alert,
592     backspace, form feed, newline, carriage return, horizontal tab,
593     vertical tab, backslash, and NUL, respectively.  Additionally,
594     '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal
595     digit) are translated into the Unicode characters corresponding to
596     the specified code points.  All other combinations of a character
597     preceded by \ are unexpanded.
598
599'-fmodule-private'
600     Set the default accessibility of module entities to 'PRIVATE'.
601     Use-associated entities will not be accessible unless they are
602     explicitly declared as 'PUBLIC'.
603
604'-ffixed-line-length-N'
605     Set column after which characters are ignored in typical fixed-form
606     lines in the source file, and through which spaces are assumed (as
607     if padded to that length) after the ends of short fixed-form lines.
608
609     Popular values for N include 72 (the standard and the default), 80
610     (card image), and 132 (corresponding to "extended-source" options
611     in some popular compilers).  N may also be 'none', meaning that the
612     entire line is meaningful and that continued character constants
613     never have implicit spaces appended to them to fill out the line.
614     '-ffixed-line-length-0' means the same thing as
615     '-ffixed-line-length-none'.
616
617'-ffree-line-length-N'
618     Set column after which characters are ignored in typical free-form
619     lines in the source file.  The default value is 132.  N may be
620     'none', meaning that the entire line is meaningful.
621     '-ffree-line-length-0' means the same thing as
622     '-ffree-line-length-none'.
623
624'-fmax-identifier-length=N'
625     Specify the maximum allowed identifier length.  Typical values are
626     31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
627
628'-fimplicit-none'
629     Specify that no implicit typing is allowed, unless overridden by
630     explicit 'IMPLICIT' statements.  This is the equivalent of adding
631     'implicit none' to the start of every procedure.
632
633'-fcray-pointer'
634     Enable the Cray pointer extension, which provides C-like pointer
635     functionality.
636
637'-fopenacc'
638     Enable the OpenACC extensions.  This includes OpenACC '!$acc'
639     directives in free form and 'c$acc', '*$acc' and '!$acc' directives
640     in fixed form, '!$' conditional compilation sentinels in free form
641     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
642     arranges for the OpenACC runtime library to be linked in.
643
644     Note that this is an experimental feature, incomplete, and subject
645     to change in future versions of GCC. See
646     <https://gcc.gnu.org/wiki/OpenACC> for more information.
647
648'-fopenmp'
649     Enable the OpenMP extensions.  This includes OpenMP '!$omp'
650     directives in free form and 'c$omp', '*$omp' and '!$omp' directives
651     in fixed form, '!$' conditional compilation sentinels in free form
652     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
653     arranges for the OpenMP runtime library to be linked in.  The
654     option '-fopenmp' implies '-frecursive'.
655
656'-fno-range-check'
657     Disable range checking on results of simplification of constant
658     expressions during compilation.  For example, GNU Fortran will give
659     an error at compile time when simplifying 'a = 1. / 0'.  With this
660     option, no error will be given and 'a' will be assigned the value
661     '+Infinity'.  If an expression evaluates to a value outside of the
662     relevant range of ['-HUGE()':'HUGE()'], then the expression will be
663     replaced by '-Inf' or '+Inf' as appropriate.  Similarly, 'DATA
664     i/Z'FFFFFFFF'/' will result in an integer overflow on most systems,
665     but with '-fno-range-check' the value will "wrap around" and 'i'
666     will be initialized to -1 instead.
667
668'-fdefault-integer-8'
669     Set the default integer and logical types to an 8 byte wide type.
670     This option also affects the kind of integer constants like '42'.
671     Unlike '-finteger-4-integer-8', it does not promote variables with
672     explicit kind declaration.
673
674'-fdefault-real-8'
675     Set the default real type to an 8 byte wide type.  This option also
676     affects the kind of non-double real constants like '1.0', and does
677     promote the default width of 'DOUBLE PRECISION' to 16 bytes if
678     possible, unless '-fdefault-double-8' is given, too.  Unlike
679     '-freal-4-real-8', it does not promote variables with explicit kind
680     declaration.
681
682'-fdefault-real-10'
683     Set the default real type to a 10 byte wide type.  This option also
684     affects the kind of non-double real constants like '1.0', and does
685     promote the default width of 'DOUBLE PRECISION' to 16 bytes if
686     possible, unless '-fdefault-double-8' is given.  Unlike
687     '-freal-4-real-10', it does not promote variables with explicit
688     kind declaration.
689
690'-fdefault-real-16'
691     Set the default real type to a 16 byte wide type.  This option also
692     affects the kind of non-double real constants like '1.0', and does
693     promote the default width of 'DOUBLE PRECISION' to 16 bytes if
694     possible, unless '-fdefault-double-8' is given.  Unlike
695     '-freal-4-real-16', it does not promote variables with explicit
696     kind declaration.
697
698'-fdefault-double-8'
699     Set the 'DOUBLE PRECISION' type to an 8 byte wide type.  Do nothing
700     if this is already the default.  If '-fdefault-real-8' is given,
701     'DOUBLE PRECISION' would instead be promoted to 16 bytes if
702     possible, and '-fdefault-double-8' can be used to prevent this.
703     The kind of real constants like '1.d0' will not be changed by
704     '-fdefault-real-8' though, so also '-fdefault-double-8' does not
705     affect it.
706
707'-finteger-4-integer-8'
708     Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)'
709     entities.  If 'KIND=8' is unavailable, then an error will be
710     issued.  This option should be used with care and may not be
711     suitable for your codes.  Areas of possible concern include calls
712     to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON',
713     generic interfaces, BOZ literal constant conversion, and I/O.
714     Inspection of the intermediate representation of the translated
715     Fortran code, produced by '-fdump-tree-original', is suggested.
716
717'-freal-4-real-8'
718'-freal-4-real-10'
719'-freal-4-real-16'
720'-freal-8-real-4'
721'-freal-8-real-10'
722'-freal-8-real-16'
723     Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities.  If
724     'REAL(KIND=N)' is unavailable, then an error will be issued.  All
725     other real kind types are unaffected by this option.  These options
726     should be used with care and may not be suitable for your codes.
727     Areas of possible concern include calls to external procedures,
728     alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ
729     literal constant conversion, and I/O. Inspection of the
730     intermediate representation of the translated Fortran code,
731     produced by '-fdump-tree-original', is suggested.
732
733'-std=STD'
734     Specify the standard to which the program is expected to conform,
735     which may be one of 'f95', 'f2003', 'f2008', 'f2018', 'gnu', or
736     'legacy'.  The default value for STD is 'gnu', which specifies a
737     superset of the latest Fortran standard that includes all of the
738     extensions supported by GNU Fortran, although warnings will be
739     given for obsolete extensions not recommended for use in new code.
740     The 'legacy' value is equivalent but without the warnings for
741     obsolete extensions, and may be useful for old non-standard
742     programs.  The 'f95', 'f2003', 'f2008', and 'f2018' values specify
743     strict conformance to the Fortran 95, Fortran 2003, Fortran 2008
744     and Fortran 2018 standards, respectively; errors are given for all
745     extensions beyond the relevant language standard, and warnings are
746     given for the Fortran 77 features that are permitted but
747     obsolescent in later standards.  '-std=f2008ts' allows the Fortran
748     2008 standard including the additions of the Technical
749     Specification (TS) 29113 on Further Interoperability of Fortran
750     with C and TS 18508 on Additional Parallel Features in Fortran.
751
752'-ftest-forall-temp'
753     Enhance test coverage by forcing most forall assignments to use
754     temporary.
755
756
757File: gfortran.info,  Node: Preprocessing Options,  Next: Error and Warning Options,  Prev: Fortran Dialect Options,  Up: Invoking GNU Fortran
758
7592.3 Enable and customize preprocessing
760======================================
761
762Preprocessor related options.  See section *note Preprocessing and
763conditional compilation:: for more detailed information on preprocessing
764in 'gfortran'.
765
766'-cpp'
767'-nocpp'
768     Enable preprocessing.  The preprocessor is automatically invoked if
769     the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90',
770     '.F95', '.F03' or '.F08'.  Use this option to manually enable
771     preprocessing of any kind of Fortran file.
772
773     To disable preprocessing of files with any of the above listed
774     extensions, use the negative form: '-nocpp'.
775
776     The preprocessor is run in traditional mode.  Any restrictions of
777     the file-format, especially the limits on line length, apply for
778     preprocessed output as well, so it might be advisable to use the
779     '-ffree-line-length-none' or '-ffixed-line-length-none' options.
780
781'-dM'
782     Instead of the normal output, generate a list of ''#define''
783     directives for all the macros defined during the execution of the
784     preprocessor, including predefined macros.  This gives you a way of
785     finding out what is predefined in your version of the preprocessor.
786     Assuming you have no file 'foo.f90', the command
787            touch foo.f90; gfortran -cpp -E -dM foo.f90
788     will show all the predefined macros.
789
790'-dD'
791     Like '-dM' except in two respects: it does not include the
792     predefined macros, and it outputs both the '#define' directives and
793     the result of preprocessing.  Both kinds of output go to the
794     standard output file.
795
796'-dN'
797     Like '-dD', but emit only the macro names, not their expansions.
798
799'-dU'
800     Like 'dD' except that only macros that are expanded, or whose
801     definedness is tested in preprocessor directives, are output; the
802     output is delayed until the use or test of the macro; and
803     ''#undef'' directives are also output for macros tested but
804     undefined at the time.
805
806'-dI'
807     Output ''#include'' directives in addition to the result of
808     preprocessing.
809
810'-fworking-directory'
811     Enable generation of linemarkers in the preprocessor output that
812     will let the compiler know the current working directory at the
813     time of preprocessing.  When this option is enabled, the
814     preprocessor will emit, after the initial linemarker, a second
815     linemarker with the current working directory followed by two
816     slashes.  GCC will use this directory, when it is present in the
817     preprocessed input, as the directory emitted as the current working
818     directory in some debugging information formats.  This option is
819     implicitly enabled if debugging information is enabled, but this
820     can be inhibited with the negated form '-fno-working-directory'.
821     If the '-P' flag is present in the command line, this option has no
822     effect, since no '#line' directives are emitted whatsoever.
823
824'-idirafter DIR'
825     Search DIR for include files, but do it after all directories
826     specified with '-I' and the standard system directories have been
827     exhausted.  DIR is treated as a system include directory.  If dir
828     begins with '=', then the '=' will be replaced by the sysroot
829     prefix; see '--sysroot' and '-isysroot'.
830
831'-imultilib DIR'
832     Use DIR as a subdirectory of the directory containing
833     target-specific C++ headers.
834
835'-iprefix PREFIX'
836     Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
837     If the PREFIX represents a directory, you should include the final
838     ''/''.
839
840'-isysroot DIR'
841     This option is like the '--sysroot' option, but applies only to
842     header files.  See the '--sysroot' option for more information.
843
844'-iquote DIR'
845     Search DIR only for header files requested with '#include "file"';
846     they are not searched for '#include <file>', before all directories
847     specified by '-I' and before the standard system directories.  If
848     DIR begins with '=', then the '=' will be replaced by the sysroot
849     prefix; see '--sysroot' and '-isysroot'.
850
851'-isystem DIR'
852     Search DIR for header files, after all directories specified by
853     '-I' but before the standard system directories.  Mark it as a
854     system directory, so that it gets the same special treatment as is
855     applied to the standard system directories.  If DIR begins with
856     '=', then the '=' will be replaced by the sysroot prefix; see
857     '--sysroot' and '-isysroot'.
858
859'-nostdinc'
860     Do not search the standard system directories for header files.
861     Only the directories you have specified with '-I' options (and the
862     directory of the current file, if appropriate) are searched.
863
864'-undef'
865     Do not predefine any system-specific or GCC-specific macros.  The
866     standard predefined macros remain defined.
867
868'-APREDICATE=ANSWER'
869     Make an assertion with the predicate PREDICATE and answer ANSWER.
870     This form is preferred to the older form -A predicate(answer),
871     which is still supported, because it does not use shell special
872     characters.
873
874'-A-PREDICATE=ANSWER'
875     Cancel an assertion with the predicate PREDICATE and answer ANSWER.
876
877'-C'
878     Do not discard comments.  All comments are passed through to the
879     output file, except for comments in processed directives, which are
880     deleted along with the directive.
881
882     You should be prepared for side effects when using '-C'; it causes
883     the preprocessor to treat comments as tokens in their own right.
884     For example, comments appearing at the start of what would be a
885     directive line have the effect of turning that line into an
886     ordinary source line, since the first token on the line is no
887     longer a ''#''.
888
889     Warning: this currently handles C-Style comments only.  The
890     preprocessor does not yet recognize Fortran-style comments.
891
892'-CC'
893     Do not discard comments, including during macro expansion.  This is
894     like '-C', except that comments contained within macros are also
895     passed through to the output file where the macro is expanded.
896
897     In addition to the side-effects of the '-C' option, the '-CC'
898     option causes all C++-style comments inside a macro to be converted
899     to C-style comments.  This is to prevent later use of that macro
900     from inadvertently commenting out the remainder of the source line.
901     The '-CC' option is generally used to support lint comments.
902
903     Warning: this currently handles C- and C++-Style comments only.
904     The preprocessor does not yet recognize Fortran-style comments.
905
906'-DNAME'
907     Predefine name as a macro, with definition '1'.
908
909'-DNAME=DEFINITION'
910     The contents of DEFINITION are tokenized and processed as if they
911     appeared during translation phase three in a ''#define'' directive.
912     In particular, the definition will be truncated by embedded newline
913     characters.
914
915     If you are invoking the preprocessor from a shell or shell-like
916     program you may need to use the shell's quoting syntax to protect
917     characters such as spaces that have a meaning in the shell syntax.
918
919     If you wish to define a function-like macro on the command line,
920     write its argument list with surrounding parentheses before the
921     equals sign (if any).  Parentheses are meaningful to most shells,
922     so you will need to quote the option.  With sh and csh,
923     '-D'name(args...)=definition'' works.
924
925     '-D' and '-U' options are processed in the order they are given on
926     the command line.  All -imacros file and -include file options are
927     processed after all -D and -U options.
928
929'-H'
930     Print the name of each header file used, in addition to other
931     normal activities.  Each name is indented to show how deep in the
932     ''#include'' stack it is.
933
934'-P'
935     Inhibit generation of linemarkers in the output from the
936     preprocessor.  This might be useful when running the preprocessor
937     on something that is not C code, and will be sent to a program
938     which might be confused by the linemarkers.
939
940'-UNAME'
941     Cancel any previous definition of NAME, either built in or provided
942     with a '-D' option.
943
944
945File: gfortran.info,  Node: Error and Warning Options,  Next: Debugging Options,  Prev: Preprocessing Options,  Up: Invoking GNU Fortran
946
9472.4 Options to request or suppress errors and warnings
948======================================================
949
950Errors are diagnostic messages that report that the GNU Fortran compiler
951cannot compile the relevant piece of source code.  The compiler will
952continue to process the program in an attempt to report further errors
953to aid in debugging, but will not produce any compiled output.
954
955   Warnings are diagnostic messages that report constructions which are
956not inherently erroneous but which are risky or suggest there is likely
957to be a bug in the program.  Unless '-Werror' is specified, they do not
958prevent compilation of the program.
959
960   You can request many specific warnings with options beginning '-W',
961for example '-Wimplicit' to request warnings on implicit declarations.
962Each of these specific warning options also has a negative form
963beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'.
964This manual lists only one of the two forms, whichever is not the
965default.
966
967   These options control the amount and kinds of errors and warnings
968produced by GNU Fortran:
969
970'-fmax-errors=N'
971     Limits the maximum number of error messages to N, at which point
972     GNU Fortran bails out rather than attempting to continue processing
973     the source code.  If N is 0, there is no limit on the number of
974     error messages produced.
975
976'-fsyntax-only'
977     Check the code for syntax errors, but do not actually compile it.
978     This will generate module files for each module present in the
979     code, but no other output file.
980
981'-Wpedantic'
982'-pedantic'
983     Issue warnings for uses of extensions to Fortran.  '-pedantic' also
984     applies to C-language constructs where they occur in GNU Fortran
985     source files, such as use of '\e' in a character constant within a
986     directive like '#include'.
987
988     Valid Fortran programs should compile properly with or without this
989     option.  However, without this option, certain GNU extensions and
990     traditional Fortran features are supported as well.  With this
991     option, many of them are rejected.
992
993     Some users try to use '-pedantic' to check programs for
994     conformance.  They soon find that it does not do quite what they
995     want--it finds some nonstandard practices, but not all.  However,
996     improvements to GNU Fortran in this area are welcome.
997
998     This should be used in conjunction with '-std=f95', '-std=f2003',
999     '-std=f2008' or '-std=f2018'.
1000
1001'-pedantic-errors'
1002     Like '-pedantic', except that errors are produced rather than
1003     warnings.
1004
1005'-Wall'
1006     Enables commonly used warning options pertaining to usage that we
1007     recommend avoiding and that we believe are easy to avoid.  This
1008     currently includes '-Waliasing', '-Wampersand', '-Wconversion',
1009     '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs',
1010     '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime',
1011     '-Winteger-division', '-Wreal-q-constant', '-Wunused' and
1012     '-Wundefined-do-loop'.
1013
1014'-Waliasing'
1015     Warn about possible aliasing of dummy arguments.  Specifically, it
1016     warns if the same actual argument is associated with a dummy
1017     argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)'
1018     in a call with an explicit interface.
1019
1020     The following example will trigger the warning.
1021            interface
1022              subroutine bar(a,b)
1023                integer, intent(in) :: a
1024                integer, intent(out) :: b
1025              end subroutine
1026            end interface
1027            integer :: a
1028
1029            call bar(a,a)
1030
1031'-Wampersand'
1032     Warn about missing ampersand in continued character constants.  The
1033     warning is given with '-Wampersand', '-pedantic', '-std=f95',
1034     '-std=f2003', '-std=f2008' and '-std=f2018'.  Note: With no
1035     ampersand given in a continued character constant, GNU Fortran
1036     assumes continuation at the first non-comment, non-whitespace
1037     character after the ampersand that initiated the continuation.
1038
1039'-Wargument-mismatch'
1040     Warn about type, rank, and other mismatches between formal
1041     parameters and actual arguments to functions and subroutines.
1042     These warnings are recommended and thus enabled by default.
1043
1044'-Warray-temporaries'
1045     Warn about array temporaries generated by the compiler.  The
1046     information generated by this warning is sometimes useful in
1047     optimization, in order to avoid such temporaries.
1048
1049'-Wc-binding-type'
1050     Warn if the a variable might not be C interoperable.  In
1051     particular, warn if the variable has been declared using an
1052     intrinsic type with default kind instead of using a kind parameter
1053     defined for C interoperability in the intrinsic 'ISO_C_Binding'
1054     module.  This option is implied by '-Wall'.
1055
1056'-Wcharacter-truncation'
1057     Warn when a character assignment will truncate the assigned string.
1058
1059'-Wline-truncation'
1060     Warn when a source code line will be truncated.  This option is
1061     implied by '-Wall'.  For free-form source code, the default is
1062     '-Werror=line-truncation' such that truncations are reported as
1063     error.
1064
1065'-Wconversion'
1066     Warn about implicit conversions that are likely to change the value
1067     of the expression after conversion.  Implied by '-Wall'.
1068
1069'-Wconversion-extra'
1070     Warn about implicit conversions between different types and kinds.
1071     This option does _not_ imply '-Wconversion'.
1072
1073'-Wextra'
1074     Enables some warning options for usages of language features which
1075     may be problematic.  This currently includes '-Wcompare-reals',
1076     '-Wunused-parameter' and '-Wdo-subscript'.
1077
1078'-Wfrontend-loop-interchange'
1079     Enable warning for loop interchanges performed by the
1080     '-ffrontend-loop-interchange' option.
1081
1082'-Wimplicit-interface'
1083     Warn if a procedure is called without an explicit interface.  Note
1084     this only checks that an explicit interface is present.  It does
1085     not check that the declared interfaces are consistent across
1086     program units.
1087
1088'-Wimplicit-procedure'
1089     Warn if a procedure is called that has neither an explicit
1090     interface nor has been declared as 'EXTERNAL'.
1091
1092'-Winteger-division'
1093     Warn if a constant integer division truncates it result.  As an
1094     example, 3/5 evaluates to 0.
1095
1096'-Wintrinsics-std'
1097     Warn if 'gfortran' finds a procedure named like an intrinsic not
1098     available in the currently selected standard (with '-std') and
1099     treats it as 'EXTERNAL' procedure because of this.
1100     '-fall-intrinsics' can be used to never trigger this behavior and
1101     always link to the intrinsic regardless of the selected standard.
1102
1103'-Wreal-q-constant'
1104     Produce a warning if a real-literal-constant contains a 'q'
1105     exponent-letter.
1106
1107'-Wsurprising'
1108     Produce a warning when "suspicious" code constructs are
1109     encountered.  While technically legal these usually indicate that
1110     an error has been made.
1111
1112     This currently produces a warning under the following
1113     circumstances:
1114
1115        * An INTEGER SELECT construct has a CASE that can never be
1116          matched as its lower value is greater than its upper value.
1117
1118        * A LOGICAL SELECT construct has three CASE statements.
1119
1120        * A TRANSFER specifies a source that is shorter than the
1121          destination.
1122
1123        * The type of a function result is declared more than once with
1124          the same type.  If '-pedantic' or standard-conforming mode is
1125          enabled, this is an error.
1126
1127        * A 'CHARACTER' variable is declared with negative length.
1128
1129'-Wtabs'
1130     By default, tabs are accepted as whitespace, but tabs are not
1131     members of the Fortran Character Set.  For continuation lines, a
1132     tab followed by a digit between 1 and 9 is supported.  '-Wtabs'
1133     will cause a warning to be issued if a tab is encountered.  Note,
1134     '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003',
1135     '-std=f2008', '-std=f2008ts', '-std=f2018' and '-Wall'.
1136
1137'-Wundefined-do-loop'
1138     Warn if a DO loop with step either 1 or -1 yields an underflow or
1139     an overflow during iteration of an induction variable of the loop.
1140     This option is implied by '-Wall'.
1141
1142'-Wunderflow'
1143     Produce a warning when numerical constant expressions are
1144     encountered, which yield an UNDERFLOW during compilation.  Enabled
1145     by default.
1146
1147'-Wintrinsic-shadow'
1148     Warn if a user-defined procedure or module procedure has the same
1149     name as an intrinsic; in this case, an explicit interface or
1150     'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls
1151     later resolved to the desired intrinsic/procedure.  This option is
1152     implied by '-Wall'.
1153
1154'-Wuse-without-only'
1155     Warn if a 'USE' statement has no 'ONLY' qualifier and thus
1156     implicitly imports all public entities of the used module.
1157
1158'-Wunused-dummy-argument'
1159     Warn about unused dummy arguments.  This option is implied by
1160     '-Wall'.
1161
1162'-Wunused-parameter'
1163     Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s
1164     implementation of this option does not warn about unused dummy
1165     arguments (see '-Wunused-dummy-argument'), but about unused
1166     'PARAMETER' values.  '-Wunused-parameter' is implied by '-Wextra'
1167     if also '-Wunused' or '-Wall' is used.
1168
1169'-Walign-commons'
1170     By default, 'gfortran' warns about any occasion of variables being
1171     padded for proper alignment inside a 'COMMON' block.  This warning
1172     can be turned off via '-Wno-align-commons'.  See also
1173     '-falign-commons'.
1174
1175'-Wfunction-elimination'
1176     Warn if any calls to functions are eliminated by the optimizations
1177     enabled by the '-ffrontend-optimize' option.
1178
1179'-Wrealloc-lhs'
1180     Warn when the compiler might insert code to for allocation or
1181     reallocation of an allocatable array variable of intrinsic type in
1182     intrinsic assignments.  In hot loops, the Fortran 2003 reallocation
1183     feature may reduce the performance.  If the array is already
1184     allocated with the correct shape, consider using a whole-array
1185     array-spec (e.g.  '(:,:,:)') for the variable on the left-hand side
1186     to prevent the reallocation check.  Note that in some cases the
1187     warning is shown, even if the compiler will optimize reallocation
1188     checks away.  For instance, when the right-hand side contains the
1189     same variable multiplied by a scalar.  See also '-frealloc-lhs'.
1190
1191'-Wrealloc-lhs-all'
1192     Warn when the compiler inserts code to for allocation or
1193     reallocation of an allocatable variable; this includes scalars and
1194     derived types.
1195
1196'-Wcompare-reals'
1197     Warn when comparing real or complex types for equality or
1198     inequality.  This option is implied by '-Wextra'.
1199
1200'-Wtarget-lifetime'
1201     Warn if the pointer in a pointer assignment might be longer than
1202     the its target.  This option is implied by '-Wall'.
1203
1204'-Wzerotrip'
1205     Warn if a 'DO' loop is known to execute zero times at compile time.
1206     This option is implied by '-Wall'.
1207
1208'-Wdo-subscript'
1209     Warn if an array subscript inside a DO loop could lead to an
1210     out-of-bounds access even if the compiler can not prove that the
1211     statement is actually executed, in cases like
1212            real a(3)
1213            do i=1,4
1214              if (condition(i)) then
1215                a(i) = 1.2
1216              end if
1217            end do
1218     This option is implied by '-Wextra'.
1219
1220'-Werror'
1221     Turns all warnings into errors.
1222
1223   *Note Options to Request or Suppress Errors and Warnings:
1224(gcc)Warning Options, for information on more options offered by the GBE
1225shared by 'gfortran', 'gcc' and other GNU compilers.
1226
1227   Some of these have no effect when compiling programs written in
1228Fortran.
1229
1230
1231File: gfortran.info,  Node: Debugging Options,  Next: Directory Options,  Prev: Error and Warning Options,  Up: Invoking GNU Fortran
1232
12332.5 Options for debugging your program or GNU Fortran
1234=====================================================
1235
1236GNU Fortran has various special options that are used for debugging
1237either your program or the GNU Fortran compiler.
1238
1239'-fdump-fortran-original'
1240     Output the internal parse tree after translating the source program
1241     into internal representation.  This option is mostly useful for
1242     debugging the GNU Fortran compiler itself.  The output generated by
1243     this option might change between releases.  This option may also
1244     generate internal compiler errors for features which have only
1245     recently been added.
1246
1247'-fdump-fortran-optimized'
1248     Output the parse tree after front-end optimization.  Mostly useful
1249     for debugging the GNU Fortran compiler itself.  The output
1250     generated by this option might change between releases.  This
1251     option may also generate internal compiler errors for features
1252     which have only recently been added.
1253
1254'-fdump-parse-tree'
1255     Output the internal parse tree after translating the source program
1256     into internal representation.  Mostly useful for debugging the GNU
1257     Fortran compiler itself.  The output generated by this option might
1258     change between releases.  This option may also generate internal
1259     compiler errors for features which have only recently been added.
1260     This option is deprecated; use '-fdump-fortran-original' instead.
1261
1262'-ffpe-trap=LIST'
1263     Specify a list of floating point exception traps to enable.  On
1264     most systems, if a floating point exception occurs and the trap for
1265     that exception is enabled, a SIGFPE signal will be sent and the
1266     program being aborted, producing a core file useful for debugging.
1267     LIST is a (possibly empty) comma-separated list of the following
1268     exceptions: 'invalid' (invalid floating point operation, such as
1269     'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a
1270     floating point operation), 'underflow' (underflow in a floating
1271     point operation), 'inexact' (loss of precision during operation),
1272     and 'denormal' (operation performed on a denormal value).  The
1273     first five exceptions correspond to the five IEEE 754 exceptions,
1274     whereas the last one ('denormal') is not part of the IEEE 754
1275     standard but is available on some common architectures such as x86.
1276
1277     The first three exceptions ('invalid', 'zero', and 'overflow')
1278     often indicate serious errors, and unless the program has
1279     provisions for dealing with these exceptions, enabling traps for
1280     these three exceptions is probably a good idea.
1281
1282     Many, if not most, floating point operations incur loss of
1283     precision due to rounding, and hence the 'ffpe-trap=inexact' is
1284     likely to be uninteresting in practice.
1285
1286     By default no exception traps are enabled.
1287
1288'-ffpe-summary=LIST'
1289     Specify a list of floating-point exceptions, whose flag status is
1290     printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'.
1291     LIST can be either 'none', 'all' or a comma-separated list of the
1292     following exceptions: 'invalid', 'zero', 'overflow', 'underflow',
1293     'inexact' and 'denormal'.  (See '-ffpe-trap' for a description of
1294     the exceptions.)
1295
1296     By default, a summary for all exceptions but 'inexact' is shown.
1297
1298'-fno-backtrace'
1299     When a serious runtime error is encountered or a deadly signal is
1300     emitted (segmentation fault, illegal instruction, bus error,
1301     floating-point exception, and the other POSIX signals that have the
1302     action 'core'), the Fortran runtime library tries to output a
1303     backtrace of the error.  '-fno-backtrace' disables the backtrace
1304     generation.  This option only has influence for compilation of the
1305     Fortran main program.
1306
1307   *Note Options for Debugging Your Program or GCC: (gcc)Debugging
1308Options, for more information on debugging options.
1309
1310
1311File: gfortran.info,  Node: Directory Options,  Next: Link Options,  Prev: Debugging Options,  Up: Invoking GNU Fortran
1312
13132.6 Options for directory search
1314================================
1315
1316These options affect how GNU Fortran searches for files specified by the
1317'INCLUDE' directive and where it searches for previously compiled
1318modules.
1319
1320   It also affects the search paths used by 'cpp' when used to
1321preprocess Fortran source.
1322
1323'-IDIR'
1324     These affect interpretation of the 'INCLUDE' directive (as well as
1325     of the '#include' directive of the 'cpp' preprocessor).
1326
1327     Also note that the general behavior of '-I' and 'INCLUDE' is pretty
1328     much the same as of '-I' with '#include' in the 'cpp' preprocessor,
1329     with regard to looking for 'header.gcc' files and other such
1330     things.
1331
1332     This path is also used to search for '.mod' files when previously
1333     compiled modules are required by a 'USE' statement.
1334
1335     *Note Options for Directory Search: (gcc)Directory Options, for
1336     information on the '-I' option.
1337
1338'-JDIR'
1339     This option specifies where to put '.mod' files for compiled
1340     modules.  It is also added to the list of directories to searched
1341     by an 'USE' statement.
1342
1343     The default is the current directory.
1344
1345'-fintrinsic-modules-path DIR'
1346     This option specifies the location of pre-compiled intrinsic
1347     modules, if they are not in the default location expected by the
1348     compiler.
1349
1350
1351File: gfortran.info,  Node: Link Options,  Next: Runtime Options,  Prev: Directory Options,  Up: Invoking GNU Fortran
1352
13532.7 Influencing the linking step
1354================================
1355
1356These options come into play when the compiler links object files into
1357an executable output file.  They are meaningless if the compiler is not
1358doing a link step.
1359
1360'-static-libgfortran'
1361     On systems that provide 'libgfortran' as a shared and a static
1362     library, this option forces the use of the static version.  If no
1363     shared version of 'libgfortran' was built when the compiler was
1364     configured, this option has no effect.
1365
1366
1367File: gfortran.info,  Node: Runtime Options,  Next: Code Gen Options,  Prev: Link Options,  Up: Invoking GNU Fortran
1368
13692.8 Influencing runtime behavior
1370================================
1371
1372These options affect the runtime behavior of programs compiled with GNU
1373Fortran.
1374
1375'-fconvert=CONVERSION'
1376     Specify the representation of data for unformatted files.  Valid
1377     values for conversion are: 'native', the default; 'swap', swap
1378     between big- and little-endian; 'big-endian', use big-endian
1379     representation for unformatted files; 'little-endian', use
1380     little-endian representation for unformatted files.
1381
1382     _This option has an effect only when used in the main program.  The
1383     'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
1384     variable override the default specified by '-fconvert'._
1385
1386'-frecord-marker=LENGTH'
1387     Specify the length of record markers for unformatted files.  Valid
1388     values for LENGTH are 4 and 8.  Default is 4.  _This is different
1389     from previous versions of 'gfortran'_, which specified a default
1390     record marker length of 8 on most systems.  If you want to read or
1391     write files compatible with earlier versions of 'gfortran', use
1392     '-frecord-marker=8'.
1393
1394'-fmax-subrecord-length=LENGTH'
1395     Specify the maximum length for a subrecord.  The maximum permitted
1396     value for length is 2147483639, which is also the default.  Only
1397     really useful for use by the gfortran testsuite.
1398
1399'-fsign-zero'
1400     When enabled, floating point numbers of value zero with the sign
1401     bit set are written as negative number in formatted output and
1402     treated as negative in the 'SIGN' intrinsic.  '-fno-sign-zero' does
1403     not print the negative sign of zero values (or values rounded to
1404     zero for I/O) and regards zero as positive number in the 'SIGN'
1405     intrinsic for compatibility with Fortran 77.  The default is
1406     '-fsign-zero'.
1407
1408
1409File: gfortran.info,  Node: Code Gen Options,  Next: Interoperability Options,  Prev: Runtime Options,  Up: Invoking GNU Fortran
1410
14112.9 Options for code generation conventions
1412===========================================
1413
1414These machine-independent options control the interface conventions used
1415in code generation.
1416
1417   Most of them have both positive and negative forms; the negative form
1418of '-ffoo' would be '-fno-foo'.  In the table below, only one of the
1419forms is listed--the one which is not the default.  You can figure out
1420the other form by either removing 'no-' or adding it.
1421
1422'-fno-automatic'
1423     Treat each program unit (except those marked as RECURSIVE) as if
1424     the 'SAVE' statement were specified for every local variable and
1425     array referenced in it.  Does not affect common blocks.  (Some
1426     Fortran compilers provide this option under the name '-static' or
1427     '-save'.)  The default, which is '-fautomatic', uses the stack for
1428     local variables smaller than the value given by
1429     '-fmax-stack-var-size'.  Use the option '-frecursive' to use no
1430     static memory.
1431
1432'-ff2c'
1433     Generate code designed to be compatible with code generated by
1434     'g77' and 'f2c'.
1435
1436     The calling conventions used by 'g77' (originally implemented in
1437     'f2c') require functions that return type default 'REAL' to
1438     actually return the C type 'double', and functions that return type
1439     'COMPLEX' to return the values via an extra argument in the calling
1440     sequence that points to where to store the return value.  Under the
1441     default GNU calling conventions, such functions simply return their
1442     results as they would in GNU C--default 'REAL' functions return the
1443     C type 'float', and 'COMPLEX' functions return the GNU C type
1444     'complex'.  Additionally, this option implies the
1445     '-fsecond-underscore' option, unless '-fno-second-underscore' is
1446     explicitly requested.
1447
1448     This does not affect the generation of code that interfaces with
1449     the 'libgfortran' library.
1450
1451     _Caution:_ It is not a good idea to mix Fortran code compiled with
1452     '-ff2c' with code compiled with the default '-fno-f2c' calling
1453     conventions as, calling 'COMPLEX' or default 'REAL' functions
1454     between program parts which were compiled with different calling
1455     conventions will break at execution time.
1456
1457     _Caution:_ This will break code which passes intrinsic functions of
1458     type default 'REAL' or 'COMPLEX' as actual arguments, as the
1459     library implementations use the '-fno-f2c' calling conventions.
1460
1461'-fno-underscoring'
1462     Do not transform names of entities specified in the Fortran source
1463     file by appending underscores to them.
1464
1465     With '-funderscoring' in effect, GNU Fortran appends one underscore
1466     to external names with no underscores.  This is done to ensure
1467     compatibility with code produced by many UNIX Fortran compilers.
1468
1469     _Caution_: The default behavior of GNU Fortran is incompatible with
1470     'f2c' and 'g77', please use the '-ff2c' option if you want object
1471     files compiled with GNU Fortran to be compatible with object code
1472     created with these tools.
1473
1474     Use of '-fno-underscoring' is not recommended unless you are
1475     experimenting with issues such as integration of GNU Fortran into
1476     existing system environments (vis-a`-vis existing libraries, tools,
1477     and so on).
1478
1479     For example, with '-funderscoring', and assuming that 'j()' and
1480     'max_count()' are external functions while 'my_var' and 'lvar' are
1481     local variables, a statement like
1482          I = J() + MAX_COUNT (MY_VAR, LVAR)
1483     is implemented as something akin to:
1484          i = j_() + max_count__(&my_var__, &lvar);
1485
1486     With '-fno-underscoring', the same statement is implemented as:
1487
1488          i = j() + max_count(&my_var, &lvar);
1489
1490     Use of '-fno-underscoring' allows direct specification of
1491     user-defined names while debugging and when interfacing GNU Fortran
1492     code with other languages.
1493
1494     Note that just because the names match does _not_ mean that the
1495     interface implemented by GNU Fortran for an external name matches
1496     the interface implemented by some other language for that same
1497     name.  That is, getting code produced by GNU Fortran to link to
1498     code produced by some other compiler using this or any other method
1499     can be only a small part of the overall solution--getting the code
1500     generated by both compilers to agree on issues other than naming
1501     can require significant effort, and, unlike naming disagreements,
1502     linkers normally cannot detect disagreements in these other areas.
1503
1504     Also, note that with '-fno-underscoring', the lack of appended
1505     underscores introduces the very real possibility that a
1506     user-defined external name will conflict with a name in a system
1507     library, which could make finding unresolved-reference bugs quite
1508     difficult in some cases--they might occur at program run time, and
1509     show up only as buggy behavior at run time.
1510
1511     In future versions of GNU Fortran we hope to improve naming and
1512     linking issues so that debugging always involves using the names as
1513     they appear in the source, even if the names as seen by the linker
1514     are mangled to prevent accidental linking between procedures with
1515     incompatible interfaces.
1516
1517'-fsecond-underscore'
1518     By default, GNU Fortran appends an underscore to external names.
1519     If this option is used GNU Fortran appends two underscores to names
1520     with underscores and one underscore to external names with no
1521     underscores.  GNU Fortran also appends two underscores to internal
1522     names with underscores to avoid naming collisions with external
1523     names.
1524
1525     This option has no effect if '-fno-underscoring' is in effect.  It
1526     is implied by the '-ff2c' option.
1527
1528     Otherwise, with this option, an external name such as 'MAX_COUNT'
1529     is implemented as a reference to the link-time external symbol
1530     'max_count__', instead of 'max_count_'.  This is required for
1531     compatibility with 'g77' and 'f2c', and is implied by use of the
1532     '-ff2c' option.
1533
1534'-fcoarray=<KEYWORD>'
1535
1536     'none'
1537          Disable coarray support; using coarray declarations and
1538          image-control statements will produce a compile-time error.
1539          (Default)
1540
1541     'single'
1542          Single-image mode, i.e.  'num_images()' is always one.
1543
1544     'lib'
1545          Library-based coarray parallelization; a suitable GNU Fortran
1546          coarray library needs to be linked.
1547
1548'-fcheck=<KEYWORD>'
1549
1550     Enable the generation of run-time checks; the argument shall be a
1551     comma-delimited list of the following keywords.  Prefixing a check
1552     with 'no-' disables it if it was activated by a previous
1553     specification.
1554
1555     'all'
1556          Enable all run-time test of '-fcheck'.
1557
1558     'array-temps'
1559          Warns at run time when for passing an actual argument a
1560          temporary array had to be generated.  The information
1561          generated by this warning is sometimes useful in optimization,
1562          in order to avoid such temporaries.
1563
1564          Note: The warning is only printed once per location.
1565
1566     'bounds'
1567          Enable generation of run-time checks for array subscripts and
1568          against the declared minimum and maximum values.  It also
1569          checks array indices for assumed and deferred shape arrays
1570          against the actual allocated bounds and ensures that all
1571          string lengths are equal for character array constructors
1572          without an explicit typespec.
1573
1574          Some checks require that '-fcheck=bounds' is set for the
1575          compilation of the main program.
1576
1577          Note: In the future this may also include other forms of
1578          checking, e.g., checking substring references.
1579
1580     'do'
1581          Enable generation of run-time checks for invalid modification
1582          of loop iteration variables.
1583
1584     'mem'
1585          Enable generation of run-time checks for memory allocation.
1586          Note: This option does not affect explicit allocations using
1587          the 'ALLOCATE' statement, which will be always checked.
1588
1589     'pointer'
1590          Enable generation of run-time checks for pointers and
1591          allocatables.
1592
1593     'recursion'
1594          Enable generation of run-time checks for recursively called
1595          subroutines and functions which are not marked as recursive.
1596          See also '-frecursive'.  Note: This check does not work for
1597          OpenMP programs and is disabled if used together with
1598          '-frecursive' and '-fopenmp'.
1599
1600     Example: Assuming you have a file 'foo.f90', the command
1601            gfortran -fcheck=all,no-array-temps foo.f90
1602     will compile the file with all checks enabled as specified above
1603     except warnings for generated array temporaries.
1604
1605'-fbounds-check'
1606     Deprecated alias for '-fcheck=bounds'.
1607
1608'-ftail-call-workaround'
1609'-ftail-call-workaround=N'
1610     Some C interfaces to Fortran codes violate the gfortran ABI by
1611     omitting the hidden character length arguments as described in
1612     *Note Argument passing conventions::.  This can lead to crashes
1613     because pushing arguments for tail calls can overflow the stack.
1614
1615     To provide a workaround for existing binary packages, this option
1616     disables tail call optimization for gfortran procedures with
1617     character arguments.  With '-ftail-call-workaround=2' tail call
1618     optimization is disabled in all gfortran procedures with character
1619     arguments, with '-ftail-call-workaround=1' or equivalent
1620     '-ftail-call-workaround' only in gfortran procedures with character
1621     arguments that call implicitly prototyped procedures.
1622
1623     Using this option can lead to problems including crashes due to
1624     insufficient stack space.
1625
1626     It is _very strongly_ recommended to fix the code in question.  The
1627     '-fc-prototypes-external' option can be used to generate prototypes
1628     which conform to gfortran's ABI, for inclusion in the source code.
1629
1630     Support for this option will likely be withdrawn in a future
1631     release of gfortran.
1632
1633     The negative form, '-fno-tail-call-workaround' or equivalent
1634     '-ftail-call-workaround=0', can be used to disable this option.
1635
1636     Default is currently '-ftail-call-workaround', this will change in
1637     future releases.
1638
1639'-fcheck-array-temporaries'
1640     Deprecated alias for '-fcheck=array-temps'.
1641
1642'-fmax-array-constructor=N'
1643     This option can be used to increase the upper limit permitted in
1644     array constructors.  The code below requires this option to expand
1645     the array at compile time.
1646
1647          program test
1648          implicit none
1649          integer j
1650          integer, parameter :: n = 100000
1651          integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
1652          print '(10(I0,1X))', i
1653          end program test
1654
1655     _Caution: This option can lead to long compile times and
1656     excessively large object files._
1657
1658     The default value for N is 65535.
1659
1660'-fmax-stack-var-size=N'
1661     This option specifies the size in bytes of the largest array that
1662     will be put on the stack; if the size is exceeded static memory is
1663     used (except in procedures marked as RECURSIVE). Use the option
1664     '-frecursive' to allow for recursive procedures which do not have a
1665     RECURSIVE attribute or for parallel programs.  Use '-fno-automatic'
1666     to never use the stack.
1667
1668     This option currently only affects local arrays declared with
1669     constant bounds, and may not apply to all character variables.
1670     Future versions of GNU Fortran may improve this behavior.
1671
1672     The default value for N is 32768.
1673
1674'-fstack-arrays'
1675     Adding this option will make the Fortran compiler put all arrays of
1676     unknown size and array temporaries onto stack memory.  If your
1677     program uses very large local arrays it is possible that you will
1678     have to extend your runtime limits for stack memory on some
1679     operating systems.  This flag is enabled by default at optimization
1680     level '-Ofast' unless '-fmax-stack-var-size' is specified.
1681
1682'-fpack-derived'
1683     This option tells GNU Fortran to pack derived type members as
1684     closely as possible.  Code compiled with this option is likely to
1685     be incompatible with code compiled without this option, and may
1686     execute slower.
1687
1688'-frepack-arrays'
1689     In some circumstances GNU Fortran may pass assumed shape array
1690     sections via a descriptor describing a noncontiguous area of
1691     memory.  This option adds code to the function prologue to repack
1692     the data into a contiguous block at runtime.
1693
1694     This should result in faster accesses to the array.  However it can
1695     introduce significant overhead to the function call, especially
1696     when the passed data is noncontiguous.
1697
1698'-fshort-enums'
1699     This option is provided for interoperability with C code that was
1700     compiled with the '-fshort-enums' option.  It will make GNU Fortran
1701     choose the smallest 'INTEGER' kind a given enumerator set will fit
1702     in, and give all its enumerators this kind.
1703
1704'-fexternal-blas'
1705     This option will make 'gfortran' generate calls to BLAS functions
1706     for some matrix operations like 'MATMUL', instead of using our own
1707     algorithms, if the size of the matrices involved is larger than a
1708     given limit (see '-fblas-matmul-limit').  This may be profitable if
1709     an optimized vendor BLAS library is available.  The BLAS library
1710     will have to be specified at link time.
1711
1712'-fblas-matmul-limit=N'
1713     Only significant when '-fexternal-blas' is in effect.  Matrix
1714     multiplication of matrices with size larger than (or equal to) N
1715     will be performed by calls to BLAS functions, while others will be
1716     handled by 'gfortran' internal algorithms.  If the matrices
1717     involved are not square, the size comparison is performed using the
1718     geometric mean of the dimensions of the argument and result
1719     matrices.
1720
1721     The default value for N is 30.
1722
1723'-finline-matmul-limit=N'
1724     When front-end optimiztion is active, some calls to the 'MATMUL'
1725     intrinsic function will be inlined.  This may result in code size
1726     increase if the size of the matrix cannot be determined at compile
1727     time, as code for both cases is generated.  Setting
1728     '-finline-matmul-limit=0' will disable inlining in all cases.
1729     Setting this option with a value of N will produce inline code for
1730     matrices with size up to N.  If the matrices involved are not
1731     square, the size comparison is performed using the geometric mean
1732     of the dimensions of the argument and result matrices.
1733
1734     The default value for N is 30.  The '-fblas-matmul-limit' can be
1735     used to change this value.
1736
1737'-frecursive'
1738     Allow indirect recursion by forcing all local arrays to be
1739     allocated on the stack.  This flag cannot be used together with
1740     '-fmax-stack-var-size=' or '-fno-automatic'.
1741
1742'-finit-local-zero'
1743'-finit-derived'
1744'-finit-integer=N'
1745'-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
1746'-finit-logical=<TRUE|FALSE>'
1747'-finit-character=N'
1748     The '-finit-local-zero' option instructs the compiler to initialize
1749     local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL'
1750     variables to false, and 'CHARACTER' variables to a string of null
1751     bytes.  Finer-grained initialization options are provided by the
1752     '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which
1753     also initializes the real and imaginary parts of local 'COMPLEX'
1754     variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N'
1755     (where N is an ASCII character value) options.
1756
1757     With '-finit-derived', components of derived type variables will be
1758     initialized according to these flags.  Components whose type is not
1759     covered by an explicit '-finit-*' flag will be treated as described
1760     above with '-finit-local-zero'.
1761
1762     These options do not initialize
1763        * objects with the POINTER attribute
1764        * allocatable arrays
1765        * variables that appear in an 'EQUIVALENCE' statement.
1766     (These limitations may be removed in future releases).
1767
1768     Note that the '-finit-real=nan' option initializes 'REAL' and
1769     'COMPLEX' variables with a quiet NaN. For a signalling NaN use
1770     '-finit-real=snan'; note, however, that compile-time optimizations
1771     may convert them into quiet NaN and that trapping needs to be
1772     enabled (e.g.  via '-ffpe-trap').
1773
1774     Finally, note that enabling any of the '-finit-*' options will
1775     silence warnings that would have been emitted by '-Wuninitialized'
1776     for the affected local variables.
1777
1778'-falign-commons'
1779     By default, 'gfortran' enforces proper alignment of all variables
1780     in a 'COMMON' block by padding them as needed.  On certain
1781     platforms this is mandatory, on others it increases performance.
1782     If a 'COMMON' block is not declared with consistent data types
1783     everywhere, this padding can cause trouble, and
1784     '-fno-align-commons' can be used to disable automatic alignment.
1785     The same form of this option should be used for all files that
1786     share a 'COMMON' block.  To avoid potential alignment issues in
1787     'COMMON' blocks, it is recommended to order objects from largest to
1788     smallest.
1789
1790'-fno-protect-parens'
1791     By default the parentheses in expression are honored for all
1792     optimization levels such that the compiler does not do any
1793     re-association.  Using '-fno-protect-parens' allows the compiler to
1794     reorder 'REAL' and 'COMPLEX' expressions to produce faster code.
1795     Note that for the re-association optimization '-fno-signed-zeros'
1796     and '-fno-trapping-math' need to be in effect.  The parentheses
1797     protection is enabled by default, unless '-Ofast' is given.
1798
1799'-frealloc-lhs'
1800     An allocatable left-hand side of an intrinsic assignment is
1801     automatically (re)allocated if it is either unallocated or has a
1802     different shape.  The option is enabled by default except when
1803     '-std=f95' is given.  See also '-Wrealloc-lhs'.
1804
1805'-faggressive-function-elimination'
1806     Functions with identical argument lists are eliminated within
1807     statements, regardless of whether these functions are marked 'PURE'
1808     or not.  For example, in
1809            a = f(b,c) + f(b,c)
1810     there will only be a single call to 'f'.  This option only works if
1811     '-ffrontend-optimize' is in effect.
1812
1813'-ffrontend-optimize'
1814     This option performs front-end optimization, based on manipulating
1815     parts the Fortran parse tree.  Enabled by default by any '-O'
1816     option.  Optimizations enabled by this option include inlining
1817     calls to 'MATMUL', elimination of identical function calls within
1818     expressions, removing unnecessary calls to 'TRIM' in comparisons
1819     and assignments and replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))'.
1820     It can be deselected by specifying '-fno-frontend-optimize'.
1821
1822'-ffrontend-loop-interchange'
1823     Attempt to interchange loops in the Fortran front end where
1824     profitable.  Enabled by default by any '-O' option.  At the moment,
1825     this option only affects 'FORALL' and 'DO CONCURRENT' statements
1826     with several forall triplets.
1827
1828   *Note Options for Code Generation Conventions: (gcc)Code Gen Options,
1829for information on more options offered by the GBE shared by 'gfortran',
1830'gcc', and other GNU compilers.
1831
1832
1833File: gfortran.info,  Node: Interoperability Options,  Next: Environment Variables,  Prev: Code Gen Options,  Up: Invoking GNU Fortran
1834
18352.10 Options for interoperability with other languages
1836======================================================
1837
1838-fc-prototypes
1839     This option will generate C prototypes from 'BIND(C)' variable
1840     declarations, types and procedure interfaces and writes them to
1841     standard output.  'ENUM' is not yet supported.
1842
1843     The generated prototypes may need inclusion of an appropriate
1844     header, such as '<stdint.h>' or '<stdlib.h>'.  For types which are
1845     not specified using the appropriate kind from the 'iso_c_binding'
1846     module, a warning is added as a comment to the code.
1847
1848     For function pointers, a pointer to a function returning 'int'
1849     without an explicit argument list is generated.
1850
1851     Example of use:
1852          $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h
1853     where the C code intended for interoperating with the Fortran code
1854     then uses '#include "foo.h"'.
1855
1856
1857File: gfortran.info,  Node: Environment Variables,  Prev: Interoperability Options,  Up: Invoking GNU Fortran
1858
18592.11 Environment variables affecting 'gfortran'
1860===============================================
1861
1862The 'gfortran' compiler currently does not make use of any environment
1863variables to control its operation above and beyond those that affect
1864the operation of 'gcc'.
1865
1866   *Note Environment Variables Affecting GCC: (gcc)Environment
1867Variables, for information on environment variables.
1868
1869   *Note Runtime::, for environment variables that affect the run-time
1870behavior of programs compiled with GNU Fortran.
1871
1872
1873File: gfortran.info,  Node: Runtime,  Next: Fortran standards status,  Prev: Invoking GNU Fortran,  Up: Top
1874
18753 Runtime: Influencing runtime behavior with environment variables
1876******************************************************************
1877
1878The behavior of the 'gfortran' can be influenced by environment
1879variables.
1880
1881   Malformed environment variables are silently ignored.
1882
1883* Menu:
1884
1885* TMPDIR:: Directory for scratch files
1886* GFORTRAN_STDIN_UNIT:: Unit number for standard input
1887* GFORTRAN_STDOUT_UNIT:: Unit number for standard output
1888* GFORTRAN_STDERR_UNIT:: Unit number for standard error
1889* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units.
1890* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
1891* GFORTRAN_SHOW_LOCUS::  Show location for runtime errors
1892* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
1893* GFORTRAN_LIST_SEPARATOR::  Separator for list output
1894* GFORTRAN_CONVERT_UNIT::  Set endianness for unformatted I/O
1895* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
1896
1897
1898File: gfortran.info,  Node: TMPDIR,  Next: GFORTRAN_STDIN_UNIT,  Up: Runtime
1899
19003.1 'TMPDIR'--Directory for scratch files
1901=========================================
1902
1903When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create
1904the file in one of the potential directories by testing each directory
1905in the order below.
1906
1907  1. The environment variable 'TMPDIR', if it exists.
1908
1909  2. On the MinGW target, the directory returned by the 'GetTempPath'
1910     function.  Alternatively, on the Cygwin target, the 'TMP' and
1911     'TEMP' environment variables, if they exist, in that order.
1912
1913  3. The 'P_tmpdir' macro if it is defined, otherwise the directory
1914     '/tmp'.
1915
1916
1917File: gfortran.info,  Node: GFORTRAN_STDIN_UNIT,  Next: GFORTRAN_STDOUT_UNIT,  Prev: TMPDIR,  Up: Runtime
1918
19193.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input
1920=========================================================
1921
1922This environment variable can be used to select the unit number
1923preconnected to standard input.  This must be a positive integer.  The
1924default value is 5.
1925
1926
1927File: gfortran.info,  Node: GFORTRAN_STDOUT_UNIT,  Next: GFORTRAN_STDERR_UNIT,  Prev: GFORTRAN_STDIN_UNIT,  Up: Runtime
1928
19293.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output
1930===========================================================
1931
1932This environment variable can be used to select the unit number
1933preconnected to standard output.  This must be a positive integer.  The
1934default value is 6.
1935
1936
1937File: gfortran.info,  Node: GFORTRAN_STDERR_UNIT,  Next: GFORTRAN_UNBUFFERED_ALL,  Prev: GFORTRAN_STDOUT_UNIT,  Up: Runtime
1938
19393.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error
1940==========================================================
1941
1942This environment variable can be used to select the unit number
1943preconnected to standard error.  This must be a positive integer.  The
1944default value is 0.
1945
1946
1947File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_ALL,  Next: GFORTRAN_UNBUFFERED_PRECONNECTED,  Prev: GFORTRAN_STDERR_UNIT,  Up: Runtime
1948
19493.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
1950=============================================================
1951
1952This environment variable controls whether all I/O is unbuffered.  If
1953the first letter is 'y', 'Y' or '1', all I/O is unbuffered.  This will
1954slow down small sequential reads and writes.  If the first letter is
1955'n', 'N' or '0', I/O is buffered.  This is the default.
1956
1957
1958File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_PRECONNECTED,  Next: GFORTRAN_SHOW_LOCUS,  Prev: GFORTRAN_UNBUFFERED_ALL,  Up: Runtime
1959
19603.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
1961===============================================================================
1962
1963The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED'
1964controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
1965unbuffered.  If the first letter is 'y', 'Y' or '1', I/O is unbuffered.
1966This will slow down small sequential reads and writes.  If the first
1967letter is 'n', 'N' or '0', I/O is buffered.  This is the default.
1968
1969
1970File: gfortran.info,  Node: GFORTRAN_SHOW_LOCUS,  Next: GFORTRAN_OPTIONAL_PLUS,  Prev: GFORTRAN_UNBUFFERED_PRECONNECTED,  Up: Runtime
1971
19723.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
1973===========================================================
1974
1975If the first letter is 'y', 'Y' or '1', filename and line numbers for
1976runtime errors are printed.  If the first letter is 'n', 'N' or '0', do
1977not print filename and line numbers for runtime errors.  The default is
1978to print the location.
1979
1980
1981File: gfortran.info,  Node: GFORTRAN_OPTIONAL_PLUS,  Next: GFORTRAN_LIST_SEPARATOR,  Prev: GFORTRAN_SHOW_LOCUS,  Up: Runtime
1982
19833.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
1984=============================================================
1985
1986If the first letter is 'y', 'Y' or '1', a plus sign is printed where
1987permitted by the Fortran standard.  If the first letter is 'n', 'N' or
1988'0', a plus sign is not printed in most cases.  Default is not to print
1989plus signs.
1990
1991
1992File: gfortran.info,  Node: GFORTRAN_LIST_SEPARATOR,  Next: GFORTRAN_CONVERT_UNIT,  Prev: GFORTRAN_OPTIONAL_PLUS,  Up: Runtime
1993
19943.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output
1995========================================================
1996
1997This environment variable specifies the separator when writing
1998list-directed output.  It may contain any number of spaces and at most
1999one comma.  If you specify this on the command line, be sure to quote
2000spaces, as in
2001     $ GFORTRAN_LIST_SEPARATOR='  ,  ' ./a.out
2002   when 'a.out' is the compiled Fortran program that you want to run.
2003Default is a single space.
2004
2005
2006File: gfortran.info,  Node: GFORTRAN_CONVERT_UNIT,  Next: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_LIST_SEPARATOR,  Up: Runtime
2007
20083.10 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
2009================================================================
2010
2011By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to
2012change the representation of data for unformatted files.  The syntax for
2013the 'GFORTRAN_CONVERT_UNIT' variable is:
2014     GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
2015     mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
2016     exception: mode ':' unit_list | unit_list ;
2017     unit_list: unit_spec | unit_list unit_spec ;
2018     unit_spec: INTEGER | INTEGER '-' INTEGER ;
2019   The variable consists of an optional default mode, followed by a list
2020of optional exceptions, which are separated by semicolons from the
2021preceding default and each other.  Each exception consists of a format
2022and a comma-separated list of units.  Valid values for the modes are the
2023same as for the 'CONVERT' specifier:
2024
2025     'NATIVE' Use the native format.  This is the default.
2026     'SWAP' Swap between little- and big-endian.
2027     'LITTLE_ENDIAN' Use the little-endian format for unformatted files.
2028     'BIG_ENDIAN' Use the big-endian format for unformatted files.
2029   A missing mode for an exception is taken to mean 'BIG_ENDIAN'.
2030Examples of values for 'GFORTRAN_CONVERT_UNIT' are:
2031     ''big_endian'' Do all unformatted I/O in big_endian mode.
2032     ''little_endian;native:10-20,25'' Do all unformatted I/O in
2033     little_endian mode, except for units 10 to 20 and 25, which are in
2034     native format.
2035     ''10-20'' Units 10 to 20 are big-endian, the rest is native.
2036
2037   Setting the environment variables should be done on the command line
2038or via the 'export' command for 'sh'-compatible shells and via 'setenv'
2039for 'csh'-compatible shells.
2040
2041   Example for 'sh':
2042     $ gfortran foo.f90
2043     $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
2044
2045   Example code for 'csh':
2046     % gfortran foo.f90
2047     % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
2048     % ./a.out
2049
2050   Using anything but the native representation for unformatted data
2051carries a significant speed overhead.  If speed in this area matters to
2052you, it is best if you use this only for data that needs to be portable.
2053
2054   *Note CONVERT specifier::, for an alternative way to specify the data
2055representation for unformatted files.  *Note Runtime Options::, for
2056setting a default data representation for the whole program.  The
2057'CONVERT' specifier overrides the '-fconvert' compile options.
2058
2059   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
2060environment variable will override the CONVERT specifier in the open
2061statement_.  This is to give control over data formats to users who do
2062not have the source code of their program available.
2063
2064
2065File: gfortran.info,  Node: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_CONVERT_UNIT,  Up: Runtime
2066
20673.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
2068==================================================================
2069
2070If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1'
2071(only the first letter is relevant) then a backtrace is printed when a
2072serious run-time error occurs.  To disable the backtracing, set the
2073variable to 'n', 'N', '0'.  Default is to print a backtrace unless the
2074'-fno-backtrace' compile option was used.
2075
2076
2077File: gfortran.info,  Node: Fortran standards status,  Next: Compiler Characteristics,  Prev: Runtime,  Up: Top
2078
20794 Fortran standards status
2080**************************
2081
2082* Menu:
2083
2084* Fortran 2003 status::
2085* Fortran 2008 status::
2086* TS 29113 status::
2087* TS 18508 status::
2088* Fortran 2018 status::
2089
2090
2091File: gfortran.info,  Node: Fortran 2003 status,  Next: Fortran 2008 status,  Up: Fortran standards status
2092
20934.1 Fortran 2003 status
2094=======================
2095
2096GNU Fortran supports several Fortran 2003 features; an incomplete list
2097can be found below.  See also the wiki page
2098(https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
2099
2100   * Procedure pointers including procedure-pointer components with
2101     'PASS' attribute.
2102
2103   * Procedures which are bound to a derived type (type-bound
2104     procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and
2105     operators bound to a type.
2106
2107   * Abstract interfaces and type extension with the possibility to
2108     override type-bound procedures or to have deferred binding.
2109
2110   * Polymorphic entities ("'CLASS'") for derived types and unlimited
2111     polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS',
2112     'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and
2113     finalization.
2114
2115   * Generic interface names, which have the same name as derived types,
2116     are now supported.  This allows one to write constructor functions.
2117     Note that Fortran does not support static constructor functions.
2118     For static variables, only default initialization or
2119     structure-constructor initialization are available.
2120
2121   * The 'ASSOCIATE' construct.
2122
2123   * Interoperability with C including enumerations,
2124
2125   * In structure constructors the components with default values may be
2126     omitted.
2127
2128   * Extensions to the 'ALLOCATE' statement, allowing for a
2129     type-specification with type parameter and for allocation and
2130     initialization from a 'SOURCE=' expression; 'ALLOCATE' and
2131     'DEALLOCATE' optionally return an error message string via
2132     'ERRMSG='.
2133
2134   * Reallocation on assignment: If an intrinsic assignment is used, an
2135     allocatable variable on the left-hand side is automatically
2136     allocated (if unallocated) or reallocated (if the shape is
2137     different).  Currently, scalar deferred character length left-hand
2138     sides are correctly handled but arrays are not yet fully
2139     implemented.
2140
2141   * Deferred-length character variables and scalar deferred-length
2142     character components of derived types are supported.  (Note that
2143     array-valued compoents are not yet implemented.)
2144
2145   * Transferring of allocations via 'MOVE_ALLOC'.
2146
2147   * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to
2148     derived-type components.
2149
2150   * In pointer assignments, the lower bound may be specified and the
2151     remapping of elements is supported.
2152
2153   * For pointers an 'INTENT' may be specified which affect the
2154     association status not the value of the pointer target.
2155
2156   * Intrinsics 'command_argument_count', 'get_command',
2157     'get_command_argument', and 'get_environment_variable'.
2158
2159   * Support for Unicode characters (ISO 10646) and UTF-8, including the
2160     'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions.
2161
2162   * Support for binary, octal and hexadecimal (BOZ) constants in the
2163     intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'.
2164
2165   * Support for namelist variables with allocatable and pointer
2166     attribute and nonconstant length type parameter.
2167
2168   * Array constructors using square brackets.  That is, '[...]' rather
2169     than '(/.../)'.  Type-specification for array constructors like '(/
2170     some-type :: ... /)'.
2171
2172   * Extensions to the specification and initialization expressions,
2173     including the support for intrinsics with real and complex
2174     arguments.
2175
2176   * Support for the asynchronous input/output syntax; however, the data
2177     transfer is currently always synchronously performed.
2178
2179   * 'FLUSH' statement.
2180
2181   * 'IOMSG=' specifier for I/O statements.
2182
2183   * Support for the declaration of enumeration constants via the 'ENUM'
2184     and 'ENUMERATOR' statements.  Interoperability with 'gcc' is
2185     guaranteed also for the case where the '-fshort-enums' command line
2186     option is given.
2187
2188   * TR 15581:
2189        * 'ALLOCATABLE' dummy arguments.
2190        * 'ALLOCATABLE' function results
2191        * 'ALLOCATABLE' components of derived types
2192
2193   * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier,
2194     allowing I/O without any record structure.
2195
2196   * Namelist input/output for internal files.
2197
2198   * Minor I/O features: Rounding during formatted output, using of a
2199     decimal comma instead of a decimal point, setting whether a plus
2200     sign should appear for positive numbers.  On systems where 'strtod'
2201     honours the rounding mode, the rounding mode is also supported for
2202     input.
2203
2204   * The 'PROTECTED' statement and attribute.
2205
2206   * The 'VALUE' statement and attribute.
2207
2208   * The 'VOLATILE' statement and attribute.
2209
2210   * The 'IMPORT' statement, allowing to import host-associated derived
2211     types.
2212
2213   * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which
2214     contains parameters of the I/O units, storage sizes.  Additionally,
2215     procedures for C interoperability are available in the
2216     'ISO_C_BINDING' module.
2217
2218   * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute;
2219     supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING',
2220     'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'.
2221
2222   * Renaming of operators in the 'USE' statement.
2223
2224
2225File: gfortran.info,  Node: Fortran 2008 status,  Next: TS 29113 status,  Prev: Fortran 2003 status,  Up: Fortran standards status
2226
22274.2 Fortran 2008 status
2228=======================
2229
2230The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
2231informally known as Fortran 2008.  The official version is available
2232from International Organization for Standardization (ISO) or its
2233national member organizations.  The the final draft (FDIS) can be
2234downloaded free of charge from
2235<http://www.nag.co.uk/sc22wg5/links.html>.  Fortran is developed by the
2236Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
2237of the International Organization for Standardization and the
2238International Electrotechnical Commission (IEC). This group is known as
2239WG5 (http://www.nag.co.uk/sc22wg5/).
2240
2241   The GNU Fortran compiler supports several of the new features of
2242Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
2243some information about the current Fortran 2008 implementation status.
2244In particular, the following is implemented.
2245
2246   * The '-std=f2008' option and support for the file extensions '.f08'
2247     and '.F08'.
2248
2249   * The 'OPEN' statement now supports the 'NEWUNIT=' option, which
2250     returns a unique file unit, thus preventing inadvertent use of the
2251     same unit in different parts of the program.
2252
2253   * The 'g0' format descriptor and unlimited format items.
2254
2255   * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF',
2256     'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1',
2257     'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT',
2258     'NORM2', and 'ERFC_SCALED'.
2259
2260   * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN',
2261     'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for
2262     'ATAN2'(Y,X).
2263
2264   * Support of the 'PARITY' intrinsic functions.
2265
2266   * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the
2267     number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for
2268     counting the number of one bits and returning the parity; 'BGE',
2269     'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and
2270     'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR'
2271     for simple left and right justified masks, 'MERGE_BITS' for a
2272     bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for
2273     shift operations, and the transformational bit intrinsics 'IALL',
2274     'IANY' and 'IPARITY'.
2275
2276   * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine.
2277
2278   * Support for the 'STORAGE_SIZE' intrinsic inquiry function.
2279
2280   * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and
2281     the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS',
2282     'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module
2283     'ISO_FORTRAN_ENV'.
2284
2285   * The module procedures 'C_SIZEOF' of the intrinsic module
2286     'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of
2287     'ISO_FORTRAN_ENV'.
2288
2289   * Coarray support for serial programs with '-fcoarray=single' flag
2290     and experimental support for multiple images with the
2291     '-fcoarray=lib' flag.
2292
2293   * Submodules are supported.  It should noted that 'MODULEs' do not
2294     produce the smod file needed by the descendent 'SUBMODULEs' unless
2295     they contain at least one 'MODULE PROCEDURE' interface.  The reason
2296     for this is that 'SUBMODULEs' are useless without 'MODULE
2297     PROCEDUREs'.  See http://j3-fortran.org/doc/meeting/207/15-209.txt
2298     for a discussion and a draft interpretation.  Adopting this
2299     interpretation has the advantage that code that does not use
2300     submodules does not generate smod files.
2301
2302   * The 'DO CONCURRENT' construct is supported.
2303
2304   * The 'BLOCK' construct is supported.
2305
2306   * The 'STOP' and the new 'ERROR STOP' statements now support all
2307     constant expressions.  Both show the signals which were signaling
2308     at termination.
2309
2310   * Support for the 'CONTIGUOUS' attribute.
2311
2312   * Support for 'ALLOCATE' with 'MOLD'.
2313
2314   * Support for the 'IMPURE' attribute for procedures, which allows for
2315     'ELEMENTAL' procedures without the restrictions of 'PURE'.
2316
2317   * Null pointers (including 'NULL()') and not-allocated variables can
2318     be used as actual argument to optional non-pointer, non-allocatable
2319     dummy arguments, denoting an absent argument.
2320
2321   * Non-pointer variables with 'TARGET' attribute can be used as actual
2322     argument to 'POINTER' dummies with 'INTENT(IN)'.
2323
2324   * Pointers including procedure pointers and those in a derived type
2325     (pointer components) can now be initialized by a target instead of
2326     only by 'NULL'.
2327
2328   * The 'EXIT' statement (with construct-name) can be now be used to
2329     leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF',
2330     'SELECT CASE' and 'SELECT TYPE' constructs.
2331
2332   * Internal procedures can now be used as actual argument.
2333
2334   * Minor features: obsolesce diagnostics for 'ENTRY' with
2335     '-std=f2008'; a line may start with a semicolon; for internal and
2336     module procedures 'END' can be used instead of 'END SUBROUTINE' and
2337     'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX'
2338     argument; intrinsic types are supported for
2339     'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
2340     declared in a single 'PROCEDURE' statement; implied-shape arrays
2341     are supported for named constants ('PARAMETER').
2342
2343
2344File: gfortran.info,  Node: TS 29113 status,  Next: TS 18508 status,  Prev: Fortran 2008 status,  Up: Fortran standards status
2345
23464.3 Technical Specification 29113 Status
2347========================================
2348
2349GNU Fortran supports some of the new features of the Technical
2350Specification (TS) 29113 on Further Interoperability of Fortran with C.
2351The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
2352about the current TS 29113 implementation status.  In particular, the
2353following is implemented.
2354
2355   See also *note Further Interoperability of Fortran with C::.
2356
2357   * The '-std=f2008ts' option.
2358
2359   * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C)
2360     procedures.'
2361
2362   * The 'RANK' intrinsic is supported.
2363
2364   * GNU Fortran's implementation for variables with 'ASYNCHRONOUS'
2365     attribute is compatible with TS 29113.
2366
2367   * Assumed types ('TYPE(*)').
2368
2369   * Assumed-rank ('DIMENSION(..)').  However, the array descriptor of
2370     the TS is not yet supported.
2371
2372
2373File: gfortran.info,  Node: TS 18508 status,  Next: Fortran 2018 status,  Prev: TS 29113 status,  Up: Fortran standards status
2374
23754.4 Technical Specification 18508 Status
2376========================================
2377
2378GNU Fortran supports the following new features of the Technical
2379Specification 18508 on Additional Parallel Features in Fortran:
2380
2381   * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR
2382     intrinsics.
2383
2384   * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics.  And the
2385     'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not
2386     support polymorphic types or types with allocatable, pointer or
2387     polymorphic components.
2388
2389   * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY')
2390
2391   * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES',
2392     'STOPPED_IMAGES')
2393
2394
2395File: gfortran.info,  Node: Fortran 2018 status,  Prev: TS 18508 status,  Up: Fortran standards status
2396
23974.5 Status of Fortran 2018 support
2398==================================
2399
2400So far very little work has been done to support Fortran 2018.
2401
2402   * ERROR STOP in a PURE procedure An 'ERROR STOP' statement is
2403     permitted in a 'PURE' procedure.
2404
2405   * IMPLICIT NONE with a spec-list Support the 'IMPLICIT NONE'
2406     statement with an 'implicit-none-spec-list'.
2407
2408   * Behavior of INQUIRE with the RECL= specifier
2409
2410     The behavior of the 'INQUIRE' statement with the 'RECL=' specifier
2411     now conforms to Fortran 2018.
2412
2413
2414File: gfortran.info,  Node: Compiler Characteristics,  Next: Extensions,  Prev: Fortran standards status,  Up: Top
2415
24165 Compiler Characteristics
2417**************************
2418
2419This chapter describes certain characteristics of the GNU Fortran
2420compiler, that are not specified by the Fortran standard, but which
2421might in some way or another become visible to the programmer.
2422
2423* Menu:
2424
2425* KIND Type Parameters::
2426* Internal representation of LOGICAL variables::
2427* Thread-safety of the runtime library::
2428* Data consistency and durability::
2429* Files opened without an explicit ACTION= specifier::
2430* File operations on symbolic links::
2431* File format of unformatted sequential files::
2432
2433
2434File: gfortran.info,  Node: KIND Type Parameters,  Next: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2435
24365.1 KIND Type Parameters
2437========================
2438
2439The 'KIND' type parameters supported by GNU Fortran for the primitive
2440data types are:
2441
2442'INTEGER'
2443     1, 2, 4, 8*, 16*, default: 4**
2444
2445'LOGICAL'
2446     1, 2, 4, 8*, 16*, default: 4**
2447
2448'REAL'
2449     4, 8, 10*, 16*, default: 4***
2450
2451'COMPLEX'
2452     4, 8, 10*, 16*, default: 4***
2453
2454'DOUBLE PRECISION'
2455     4, 8, 10*, 16*, default: 8***
2456
2457'CHARACTER'
2458     1, 4, default: 1
2459
2460* not available on all systems
2461** unless '-fdefault-integer-8' is used
2462*** unless '-fdefault-real-8' is used (see *note Fortran Dialect
2463Options::)
2464
2465The 'KIND' value matches the storage size in bytes, except for 'COMPLEX'
2466where the storage size is twice as much (or both real and imaginary part
2467are a real value of the given size).  It is recommended to use the *note
2468SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note
2469SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32',
2470'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the
2471'ISO_FORTRAN_ENV' module instead of the concrete values.  The available
2472kind parameters can be found in the constant arrays 'CHARACTER_KINDS',
2473'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note
2474ISO_FORTRAN_ENV:: module.  For C interoperability, the kind parameters
2475of the *note ISO_C_BINDING:: module should be used.
2476
2477
2478File: gfortran.info,  Node: Internal representation of LOGICAL variables,  Next: Thread-safety of the runtime library,  Prev: KIND Type Parameters,  Up: Compiler Characteristics
2479
24805.2 Internal representation of LOGICAL variables
2481================================================
2482
2483The Fortran standard does not specify how variables of 'LOGICAL' type
2484are represented, beyond requiring that 'LOGICAL' variables of default
2485kind have the same storage size as default 'INTEGER' and 'REAL'
2486variables.  The GNU Fortran internal representation is as follows.
2487
2488   A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)'
2489variable, however, with only two permissible values: '1' for '.TRUE.'
2490and '0' for '.FALSE.'.  Any other integer value results in undefined
2491behavior.
2492
2493   See also *note Argument passing conventions:: and *note
2494Interoperability with C::.
2495
2496
2497File: gfortran.info,  Node: Thread-safety of the runtime library,  Next: Data consistency and durability,  Prev: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2498
24995.3 Thread-safety of the runtime library
2500========================================
2501
2502GNU Fortran can be used in programs with multiple threads, e.g. by using
2503OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING'
2504facility, or by GNU Fortran compiled library code being called from a
2505multi-threaded program.
2506
2507   The GNU Fortran runtime library, ('libgfortran'), supports being
2508called concurrently from multiple threads with the following exceptions.
2509
2510   During library initialization, the C 'getenv' function is used, which
2511need not be thread-safe.  Similarly, the 'getenv' function is used to
2512implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics.  It is
2513the responsibility of the user to ensure that the environment is not
2514being updated concurrently when any of these actions are taking place.
2515
2516   The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented
2517with the 'system' function, which need not be thread-safe.  It is the
2518responsibility of the user to ensure that 'system' is not called
2519concurrently.
2520
2521   For platforms not supporting thread-safe POSIX functions, further
2522functionality might not be thread-safe.  For details, please consult the
2523documentation for your operating system.
2524
2525   The GNU Fortran runtime library uses various C library functions that
2526depend on the locale, such as 'strtod' and 'snprintf'.  In order to work
2527correctly in locale-aware programs that set the locale using
2528'setlocale', the locale is reset to the default "C" locale while
2529executing a formatted 'READ' or 'WRITE' statement.  On targets
2530supporting the POSIX 2008 per-thread locale functions (e.g.
2531'newlocale', 'uselocale', 'freelocale'), these are used and thus the
2532global locale set using 'setlocale' or the per-thread locales in other
2533threads are not affected.  However, on targets lacking this
2534functionality, the global LC_NUMERIC locale is set to "C" during the
2535formatted I/O. Thus, on such targets it's not safe to call 'setlocale'
2536concurrently from another thread while a Fortran formatted I/O operation
2537is in progress.  Also, other threads doing something dependent on the
2538LC_NUMERIC locale might not work correctly if a formatted I/O operation
2539is in progress in another thread.
2540
2541
2542File: 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
2543
25445.4 Data consistency and durability
2545===================================
2546
2547This section contains a brief overview of data and metadata consistency
2548and durability issues when doing I/O.
2549
2550   With respect to durability, GNU Fortran makes no effort to ensure
2551that data is committed to stable storage.  If this is required, the GNU
2552Fortran programmer can use the intrinsic 'FNUM' to retrieve the low
2553level file descriptor corresponding to an open Fortran unit.  Then,
2554using e.g.  the 'ISO_C_BINDING' feature, one can call the underlying
2555system call to flush dirty data to stable storage, such as 'fsync' on
2556POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
2557The following example shows how to call fsync:
2558
2559       ! Declare the interface for POSIX fsync function
2560       interface
2561         function fsync (fd) bind(c,name="fsync")
2562         use iso_c_binding, only: c_int
2563           integer(c_int), value :: fd
2564           integer(c_int) :: fsync
2565         end function fsync
2566       end interface
2567
2568       ! Variable declaration
2569       integer :: ret
2570
2571       ! Opening unit 10
2572       open (10,file="foo")
2573
2574       ! ...
2575       ! Perform I/O on unit 10
2576       ! ...
2577
2578       ! Flush and sync
2579       flush(10)
2580       ret = fsync(fnum(10))
2581
2582       ! Handle possible error
2583       if (ret /= 0) stop "Error calling FSYNC"
2584
2585   With respect to consistency, for regular files GNU Fortran uses
2586buffered I/O in order to improve performance.  This buffer is flushed
2587automatically when full and in some other situations, e.g.  when closing
2588a unit.  It can also be explicitly flushed with the 'FLUSH' statement.
2589Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL'
2590and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables.  Special
2591files, such as terminals and pipes, are always unbuffered.  Sometimes,
2592however, further things may need to be done in order to allow other
2593processes to see data that GNU Fortran has written, as follows.
2594
2595   The Windows platform supports a relaxed metadata consistency model,
2596where file metadata is written to the directory lazily.  This means
2597that, for instance, the 'dir' command can show a stale size for a file.
2598One can force a directory metadata update by closing the unit, or by
2599calling '_commit' on the file descriptor.  Note, though, that '_commit'
2600will force all dirty data to stable storage, which is often a very slow
2601operation.
2602
2603   The Network File System (NFS) implements a relaxed consistency model
2604called open-to-close consistency.  Closing a file forces dirty data and
2605metadata to be flushed to the server, and opening a file forces the
2606client to contact the server in order to revalidate cached data.
2607'fsync' will also force a flush of dirty data and metadata to the
2608server.  Similar to 'open' and 'close', acquiring and releasing 'fcntl'
2609file locks, if the server supports them, will also force cache
2610validation and flushing dirty data and metadata.
2611
2612
2613File: gfortran.info,  Node: Files opened without an explicit ACTION= specifier,  Next: File operations on symbolic links,  Prev: Data consistency and durability,  Up: Compiler Characteristics
2614
26155.5 Files opened without an explicit ACTION= specifier
2616======================================================
2617
2618The Fortran standard says that if an 'OPEN' statement is executed
2619without an explicit 'ACTION=' specifier, the default value is processor
2620dependent.  GNU Fortran behaves as follows:
2621
2622  1. Attempt to open the file with 'ACTION='READWRITE''
2623  2. If that fails, try to open with 'ACTION='READ''
2624  3. If that fails, try to open with 'ACTION='WRITE''
2625  4. If that fails, generate an error
2626
2627
2628File: gfortran.info,  Node: File operations on symbolic links,  Next: File format of unformatted sequential files,  Prev: Files opened without an explicit ACTION= specifier,  Up: Compiler Characteristics
2629
26305.6 File operations on symbolic links
2631=====================================
2632
2633This section documents the behavior of GNU Fortran for file operations
2634on symbolic links, on systems that support them.
2635
2636   * Results of INQUIRE statements of the "inquire by file" form will
2637     relate to the target of the symbolic link.  For example,
2638     'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a
2639     symbolic link pointing to an existing file, and .FALSE. if FOO
2640     points to an non-existing file ("dangling" symbolic link).
2641
2642   * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a
2643     symbolic link will result in an error condition, whether the
2644     symbolic link points to an existing target or is dangling.
2645
2646   * If a symbolic link was connected, using the 'CLOSE' statement with
2647     a 'STATUS="DELETE"' specifier will cause the symbolic link itself
2648     to be deleted, not its target.
2649
2650
2651File: gfortran.info,  Node: File format of unformatted sequential files,  Prev: File operations on symbolic links,  Up: Compiler Characteristics
2652
26535.7 File format of unformatted sequential files
2654===============================================
2655
2656Unformatted sequential files are stored as logical records using record
2657markers.  Each logical record consists of one of more subrecords.
2658
2659   Each subrecord consists of a leading record marker, the data written
2660by the user program, and a trailing record marker.  The record markers
2661are four-byte integers by default, and eight-byte integers if the
2662'-fmax-subrecord-length=8' option (which exists for backwards
2663compability only) is in effect.
2664
2665   The representation of the record markers is that of unformatted files
2666given with the '-fconvert' option, the *note CONVERT specifier:: in an
2667open statement or the *note GFORTRAN_CONVERT_UNIT:: environment
2668variable.
2669
2670   The maximum number of bytes of user data in a subrecord is 2147483639
2671(2 GiB - 9) for a four-byte record marker.  This limit can be lowered
2672with the '-fmax-subrecord-length' option, altough this is rarely useful.
2673If the length of a logical record exceeds this limit, the data is
2674distributed among several subrecords.
2675
2676   The absolute of the number stored in the record markers is the number
2677of bytes of user data in the corresponding subrecord.  If the leading
2678record marker of a subrecord contains a negative number, another
2679subrecord follows the current one.  If the trailing record marker
2680contains a negative number, then there is a preceding subrecord.
2681
2682   In the most simple case, with only one subrecord per logical record,
2683both record markers contain the number of bytes of user data in the
2684record,
2685
2686   The format for unformatted sequential data can be duplicated using
2687unformatted stream, as shown in the example program for an unformatted
2688record containing a single subrecord:
2689
2690     program main
2691       use iso_fortran_env, only: int32
2692       implicit none
2693       integer(int32) :: i
2694       real, dimension(10) :: a, b
2695       call random_number(a)
2696       open (10,file='test.dat',form='unformatted',access='stream')
2697       inquire (iolength=i) a
2698       write (10) i, a, i
2699       close (10)
2700       open (10,file='test.dat',form='unformatted')
2701       read (10) b
2702       if (all (a == b)) print *,'success!'
2703     end program main
2704
2705
2706File: gfortran.info,  Node: Extensions,  Next: Mixed-Language Programming,  Prev: Compiler Characteristics,  Up: Top
2707
27086 Extensions
2709************
2710
2711The two sections below detail the extensions to standard Fortran that
2712are implemented in GNU Fortran, as well as some of the popular or
2713historically important extensions that are not (or not yet) implemented.
2714For the latter case, we explain the alternatives available to GNU
2715Fortran users, including replacement by standard-conforming code or GNU
2716extensions.
2717
2718* Menu:
2719
2720* Extensions implemented in GNU Fortran::
2721* Extensions not implemented in GNU Fortran::
2722
2723
2724File: gfortran.info,  Node: Extensions implemented in GNU Fortran,  Next: Extensions not implemented in GNU Fortran,  Up: Extensions
2725
27266.1 Extensions implemented in GNU Fortran
2727=========================================
2728
2729GNU Fortran implements a number of extensions over standard Fortran.
2730This chapter contains information on their syntax and meaning.  There
2731are currently two categories of GNU Fortran extensions, those that
2732provide functionality beyond that provided by any standard, and those
2733that are supported by GNU Fortran purely for backward compatibility with
2734legacy compilers.  By default, '-std=gnu' allows the compiler to accept
2735both types of extensions, but to warn about the use of the latter.
2736Specifying either '-std=f95', '-std=f2003', '-std=f2008', or
2737'-std=f2018' disables both types of extensions, and '-std=legacy' allows
2738both without warning.  The special compile flag '-fdec' enables
2739additional compatibility extensions along with those enabled by
2740'-std=legacy'.
2741
2742* Menu:
2743
2744* Old-style kind specifications::
2745* Old-style variable initialization::
2746* Extensions to namelist::
2747* X format descriptor without count field::
2748* Commas in FORMAT specifications::
2749* Missing period in FORMAT specifications::
2750* I/O item lists::
2751* Q exponent-letter::
2752* BOZ literal constants::
2753* Real array indices::
2754* Unary operators::
2755* Implicitly convert LOGICAL and INTEGER values::
2756* Hollerith constants support::
2757* Cray pointers::
2758* CONVERT specifier::
2759* OpenMP::
2760* OpenACC::
2761* Argument list functions::
2762* Read/Write after EOF marker::
2763* STRUCTURE and RECORD::
2764* UNION and MAP::
2765* Type variants for integer intrinsics::
2766* AUTOMATIC and STATIC attributes::
2767* Extended math intrinsics::
2768* Form feed as whitespace::
2769* TYPE as an alias for PRINT::
2770* %LOC as an rvalue::
2771* .XOR. operator::
2772* Bitwise logical operators::
2773* Extended I/O specifiers::
2774* Legacy PARAMETER statements::
2775* Default exponents::
2776
2777
2778File: gfortran.info,  Node: Old-style kind specifications,  Next: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2779
27806.1.1 Old-style kind specifications
2781-----------------------------------
2782
2783GNU Fortran allows old-style kind specifications in declarations.  These
2784look like:
2785           TYPESPEC*size x,y,z
2786where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where
2787'size' is a byte count corresponding to the storage size of a valid kind
2788for that type.  (For 'COMPLEX' variables, 'size' is the total size of
2789the real and imaginary parts.)  The statement then declares 'x', 'y' and
2790'z' to be of type 'TYPESPEC' with the appropriate kind.  This is
2791equivalent to the standard-conforming declaration
2792           TYPESPEC(k) x,y,z
2793where 'k' is the kind parameter suitable for the intended precision.  As
2794kind parameters are implementation-dependent, use the 'KIND',
2795'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the
2796correct value, for instance 'REAL*8 x' can be replaced by:
2797     INTEGER, PARAMETER :: dbl = KIND(1.0d0)
2798     REAL(KIND=dbl) :: x
2799
2800
2801File: gfortran.info,  Node: Old-style variable initialization,  Next: Extensions to namelist,  Prev: Old-style kind specifications,  Up: Extensions implemented in GNU Fortran
2802
28036.1.2 Old-style variable initialization
2804---------------------------------------
2805
2806GNU Fortran allows old-style initialization of variables of the form:
2807           INTEGER i/1/,j/2/
2808           REAL x(2,2) /3*0.,1./
2809   The syntax for the initializers is as for the 'DATA' statement, but
2810unlike in a 'DATA' statement, an initializer only applies to the
2811variable immediately preceding the initialization.  In other words,
2812something like 'INTEGER I,J/2,3/' is not valid.  This style of
2813initialization is only allowed in declarations without double colons
2814('::'); the double colons were introduced in Fortran 90, which also
2815introduced a standard syntax for initializing variables in type
2816declarations.
2817
2818   Examples of standard-conforming code equivalent to the above example
2819are:
2820     ! Fortran 90
2821           INTEGER :: i = 1, j = 2
2822           REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
2823     ! Fortran 77
2824           INTEGER i, j
2825           REAL x(2,2)
2826           DATA i/1/, j/2/, x/3*0.,1./
2827
2828   Note that variables which are explicitly initialized in declarations
2829or in 'DATA' statements automatically acquire the 'SAVE' attribute.
2830
2831
2832File: gfortran.info,  Node: Extensions to namelist,  Next: X format descriptor without count field,  Prev: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2833
28346.1.3 Extensions to namelist
2835----------------------------
2836
2837GNU Fortran fully supports the Fortran 95 standard for namelist I/O
2838including array qualifiers, substrings and fully qualified derived
2839types.  The output from a namelist write is compatible with namelist
2840read.  The output has all names in upper case and indentation to column
28411 after the namelist name.  Two extensions are permitted:
2842
2843   Old-style use of '$' instead of '&'
2844     $MYNML
2845      X(:)%Y(2) = 1.0 2.0 3.0
2846      CH(1:4) = "abcd"
2847     $END
2848
2849   It should be noted that the default terminator is '/' rather than
2850'&END'.
2851
2852   Querying of the namelist when inputting from stdin.  After at least
2853one space, entering '?' sends to stdout the namelist name and the names
2854of the variables in the namelist:
2855      ?
2856
2857     &mynml
2858      x
2859      x%y
2860      ch
2861     &end
2862
2863   Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML =
2864mynml)' had been called:
2865     =?
2866
2867     &MYNML
2868      X(1)%Y=  0.000000    ,  1.000000    ,  0.000000    ,
2869      X(2)%Y=  0.000000    ,  2.000000    ,  0.000000    ,
2870      X(3)%Y=  0.000000    ,  3.000000    ,  0.000000    ,
2871      CH=abcd,  /
2872
2873   To aid this dialog, when input is from stdin, errors send their
2874messages to stderr and execution continues, even if 'IOSTAT' is set.
2875
2876   'PRINT' namelist is permitted.  This causes an error if '-std=f95' is
2877used.
2878     PROGRAM test_print
2879       REAL, dimension (4)  ::  x = (/1.0, 2.0, 3.0, 4.0/)
2880       NAMELIST /mynml/ x
2881       PRINT mynml
2882     END PROGRAM test_print
2883
2884   Expanded namelist reads are permitted.  This causes an error if
2885'-std=f95' is used.  In the following example, the first element of the
2886array will be given the value 0.00 and the two succeeding elements will
2887be given the values 1.00 and 2.00.
2888     &MYNML
2889       X(1,1) = 0.00 , 1.00 , 2.00
2890     /
2891
2892   When writing a namelist, if no 'DELIM=' is specified, by default a
2893double quote is used to delimit character strings.  If -std=F95, F2003,
2894or F2008, etc, the delim status is set to 'none'.  Defaulting to quotes
2895ensures that namelists with character strings can be subsequently read
2896back in accurately.
2897
2898
2899File: gfortran.info,  Node: X format descriptor without count field,  Next: Commas in FORMAT specifications,  Prev: Extensions to namelist,  Up: Extensions implemented in GNU Fortran
2900
29016.1.4 'X' format descriptor without count field
2902-----------------------------------------------
2903
2904To support legacy codes, GNU Fortran permits the count field of the 'X'
2905edit descriptor in 'FORMAT' statements to be omitted.  When omitted, the
2906count is implicitly assumed to be one.
2907
2908            PRINT 10, 2, 3
2909     10     FORMAT (I1, X, I1)
2910
2911
2912File: 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
2913
29146.1.5 Commas in 'FORMAT' specifications
2915---------------------------------------
2916
2917To support legacy codes, GNU Fortran allows the comma separator to be
2918omitted immediately before and after character string edit descriptors
2919in 'FORMAT' statements.
2920
2921            PRINT 10, 2, 3
2922     10     FORMAT ('FOO='I1' BAR='I2)
2923
2924
2925File: gfortran.info,  Node: Missing period in FORMAT specifications,  Next: I/O item lists,  Prev: Commas in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
2926
29276.1.6 Missing period in 'FORMAT' specifications
2928-----------------------------------------------
2929
2930To support legacy codes, GNU Fortran allows missing periods in format
2931specifications if and only if '-std=legacy' is given on the command
2932line.  This is considered non-conforming code and is discouraged.
2933
2934            REAL :: value
2935            READ(*,10) value
2936     10     FORMAT ('F4')
2937
2938
2939File: gfortran.info,  Node: I/O item lists,  Next: Q exponent-letter,  Prev: Missing period in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
2940
29416.1.7 I/O item lists
2942--------------------
2943
2944To support legacy codes, GNU Fortran allows the input item list of the
2945'READ' statement, and the output item lists of the 'WRITE' and 'PRINT'
2946statements, to start with a comma.
2947
2948
2949File: gfortran.info,  Node: Q exponent-letter,  Next: BOZ literal constants,  Prev: I/O item lists,  Up: Extensions implemented in GNU Fortran
2950
29516.1.8 'Q' exponent-letter
2952-------------------------
2953
2954GNU Fortran accepts real literal constants with an exponent-letter of
2955'Q', for example, '1.23Q45'.  The constant is interpreted as a
2956'REAL(16)' entity on targets that support this type.  If the target does
2957not support 'REAL(16)' but has a 'REAL(10)' type, then the
2958real-literal-constant will be interpreted as a 'REAL(10)' entity.  In
2959the absence of 'REAL(16)' and 'REAL(10)', an error will occur.
2960
2961
2962File: gfortran.info,  Node: BOZ literal constants,  Next: Real array indices,  Prev: Q exponent-letter,  Up: Extensions implemented in GNU Fortran
2963
29646.1.9 BOZ literal constants
2965---------------------------
2966
2967Besides decimal constants, Fortran also supports binary ('b'), octal
2968('o') and hexadecimal ('z') integer constants.  The syntax is: 'prefix
2969quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is
2970either ''' or '"' and the digits are for binary '0' or '1', for octal
2971between '0' and '7', and for hexadecimal between '0' and 'F'.  (Example:
2972'b'01011101''.)
2973
2974   Up to Fortran 95, BOZ literals were only allowed to initialize
2975integer variables in DATA statements.  Since Fortran 2003 BOZ literals
2976are also allowed as argument of 'REAL', 'DBLE', 'INT' and 'CMPLX'; the
2977result is the same as if the integer BOZ literal had been converted by
2978'TRANSFER' to, respectively, 'real', 'double precision', 'integer' or
2979'complex'.  As GNU Fortran extension the intrinsic procedures 'FLOAT',
2980'DFLOAT', 'COMPLEX' and 'DCMPLX' are treated alike.
2981
2982   As an extension, GNU Fortran allows hexadecimal BOZ literal constants
2983to be specified using the 'X' prefix, in addition to the standard 'Z'
2984prefix.  The BOZ literal can also be specified by adding a suffix to the
2985string, for example, 'Z'ABC'' and ''ABC'Z' are equivalent.
2986
2987   Furthermore, GNU Fortran allows using BOZ literal constants outside
2988DATA statements and the four intrinsic functions allowed by Fortran
29892003.  In DATA statements, in direct assignments, where the right-hand
2990side only contains a BOZ literal constant, and for old-style
2991initializers of the form 'integer i /o'0173'/', the constant is
2992transferred as if 'TRANSFER' had been used; for 'COMPLEX' numbers, only
2993the real part is initialized unless 'CMPLX' is used.  In all other
2994cases, the BOZ literal constant is converted to an 'INTEGER' value with
2995the largest decimal representation.  This value is then converted
2996numerically to the type and kind of the variable in question.  (For
2997instance, 'real :: r = b'0000001' + 1' initializes 'r' with '2.0'.)  As
2998different compilers implement the extension differently, one should be
2999careful when doing bitwise initialization of non-integer variables.
3000
3001   Note that initializing an 'INTEGER' variable with a statement such as
3002'DATA i/Z'FFFFFFFF'/' will give an integer overflow error rather than
3003the desired result of -1 when 'i' is a 32-bit integer on a system that
3004supports 64-bit integers.  The '-fno-range-check' option can be used as
3005a workaround for legacy code that initializes integers in this manner.
3006
3007
3008File: gfortran.info,  Node: Real array indices,  Next: Unary operators,  Prev: BOZ literal constants,  Up: Extensions implemented in GNU Fortran
3009
30106.1.10 Real array indices
3011-------------------------
3012
3013As an extension, GNU Fortran allows the use of 'REAL' expressions or
3014variables as array indices.
3015
3016
3017File: gfortran.info,  Node: Unary operators,  Next: Implicitly convert LOGICAL and INTEGER values,  Prev: Real array indices,  Up: Extensions implemented in GNU Fortran
3018
30196.1.11 Unary operators
3020----------------------
3021
3022As an extension, GNU Fortran allows unary plus and unary minus operators
3023to appear as the second operand of binary arithmetic operators without
3024the need for parenthesis.
3025
3026            X = Y * -Z
3027
3028
3029File: gfortran.info,  Node: Implicitly convert LOGICAL and INTEGER values,  Next: Hollerith constants support,  Prev: Unary operators,  Up: Extensions implemented in GNU Fortran
3030
30316.1.12 Implicitly convert 'LOGICAL' and 'INTEGER' values
3032--------------------------------------------------------
3033
3034As an extension for backwards compatibility with other compilers, GNU
3035Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER'
3036values and vice versa.  When converting from a 'LOGICAL' to an
3037'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted
3038as one.  When converting from 'INTEGER' to 'LOGICAL', the value zero is
3039interpreted as '.FALSE.' and any nonzero value is interpreted as
3040'.TRUE.'.
3041
3042             LOGICAL :: l
3043             l = 1
3044             INTEGER :: i
3045             i = .TRUE.
3046
3047   However, there is no implicit conversion of 'INTEGER' values in
3048'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations.
3049
3050
3051File: gfortran.info,  Node: Hollerith constants support,  Next: Cray pointers,  Prev: Implicitly convert LOGICAL and INTEGER values,  Up: Extensions implemented in GNU Fortran
3052
30536.1.13 Hollerith constants support
3054----------------------------------
3055
3056GNU Fortran supports Hollerith constants in assignments, function
3057arguments, and 'DATA' and 'ASSIGN' statements.  A Hollerith constant is
3058written as a string of characters preceded by an integer constant
3059indicating the character count, and the letter 'H' or 'h', and stored in
3060bytewise fashion in a numeric ('INTEGER', 'REAL', or 'complex') or
3061'LOGICAL' variable.  The constant will be padded or truncated to fit the
3062size of the variable in which it is stored.
3063
3064   Examples of valid uses of Hollerith constants:
3065           complex*16 x(2)
3066           data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
3067           x(1) = 16HABCDEFGHIJKLMNOP
3068           call foo (4h abc)
3069
3070   Invalid Hollerith constants examples:
3071           integer*4 a
3072           a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
3073           a = 0H         ! At least one character is needed.
3074
3075   In general, Hollerith constants were used to provide a rudimentary
3076facility for handling character strings in early Fortran compilers,
3077prior to the introduction of 'CHARACTER' variables in Fortran 77; in
3078those cases, the standard-compliant equivalent is to convert the program
3079to use proper character strings.  On occasion, there may be a case where
3080the intent is specifically to initialize a numeric variable with a given
3081byte sequence.  In these cases, the same result can be obtained by using
3082the 'TRANSFER' statement, as in this example.
3083           INTEGER(KIND=4) :: a
3084           a = TRANSFER ("abcd", a)     ! equivalent to: a = 4Habcd
3085
3086
3087File: gfortran.info,  Node: Cray pointers,  Next: CONVERT specifier,  Prev: Hollerith constants support,  Up: Extensions implemented in GNU Fortran
3088
30896.1.14 Cray pointers
3090--------------------
3091
3092Cray pointers are part of a non-standard extension that provides a
3093C-like pointer in Fortran.  This is accomplished through a pair of
3094variables: an integer "pointer" that holds a memory address, and a
3095"pointee" that is used to dereference the pointer.
3096
3097   Pointer/pointee pairs are declared in statements of the form:
3098             pointer ( <pointer> , <pointee> )
3099   or,
3100             pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
3101   The pointer is an integer that is intended to hold a memory address.
3102The pointee may be an array or scalar.  A pointee can be an assumed size
3103array--that is, the last dimension may be left unspecified by using a
3104'*' in place of a value--but a pointee cannot be an assumed shape array.
3105No space is allocated for the pointee.
3106
3107   The pointee may have its type declared before or after the pointer
3108statement, and its array specification (if any) may be declared before,
3109during, or after the pointer statement.  The pointer may be declared as
3110an integer prior to the pointer statement.  However, some machines have
3111default integer sizes that are different than the size of a pointer, and
3112so the following code is not portable:
3113             integer ipt
3114             pointer (ipt, iarr)
3115   If a pointer is declared with a kind that is too small, the compiler
3116will issue a warning; the resulting binary will probably not work
3117correctly, because the memory addresses stored in the pointers may be
3118truncated.  It is safer to omit the first line of the above example; if
3119explicit declaration of ipt's type is omitted, then the compiler will
3120ensure that ipt is an integer variable large enough to hold a pointer.
3121
3122   Pointer arithmetic is valid with Cray pointers, but it is not the
3123same as C pointer arithmetic.  Cray pointers are just ordinary integers,
3124so the user is responsible for determining how many bytes to add to a
3125pointer in order to increment it.  Consider the following example:
3126             real target(10)
3127             real pointee(10)
3128             pointer (ipt, pointee)
3129             ipt = loc (target)
3130             ipt = ipt + 1
3131   The last statement does not set 'ipt' to the address of 'target(1)',
3132as it would in C pointer arithmetic.  Adding '1' to 'ipt' just adds one
3133byte to the address stored in 'ipt'.
3134
3135   Any expression involving the pointee will be translated to use the
3136value stored in the pointer as the base address.
3137
3138   To get the address of elements, this extension provides an intrinsic
3139function 'LOC()'.  The 'LOC()' function is equivalent to the '&'
3140operator in C, except the address is cast to an integer type:
3141             real ar(10)
3142             pointer(ipt, arpte(10))
3143             real arpte
3144             ipt = loc(ar)  ! Makes arpte is an alias for ar
3145             arpte(1) = 1.0 ! Sets ar(1) to 1.0
3146   The pointer can also be set by a call to the 'MALLOC' intrinsic (see
3147*note MALLOC::).
3148
3149   Cray pointees often are used to alias an existing variable.  For
3150example:
3151             integer target(10)
3152             integer iarr(10)
3153             pointer (ipt, iarr)
3154             ipt = loc(target)
3155   As long as 'ipt' remains unchanged, 'iarr' is now an alias for
3156'target'.  The optimizer, however, will not detect this aliasing, so it
3157is unsafe to use 'iarr' and 'target' simultaneously.  Using a pointee in
3158any way that violates the Fortran aliasing rules or assumptions is
3159illegal.  It is the user's responsibility to avoid doing this; the
3160compiler works under the assumption that no such aliasing occurs.
3161
3162   Cray pointers will work correctly when there is no aliasing (i.e.,
3163when they are used to access a dynamically allocated block of memory),
3164and also in any routine where a pointee is used, but any variable with
3165which it shares storage is not used.  Code that violates these rules may
3166not run as the user intends.  This is not a bug in the optimizer; any
3167code that violates the aliasing rules is illegal.  (Note that this is
3168not unique to GNU Fortran; any Fortran compiler that supports Cray
3169pointers will "incorrectly" optimize code with illegal aliasing.)
3170
3171   There are a number of restrictions on the attributes that can be
3172applied to Cray pointers and pointees.  Pointees may not have the
3173'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or
3174'POINTER' attributes.  Pointers may not have the 'DIMENSION', 'POINTER',
3175'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may
3176they be function results.  Pointees may not occur in more than one
3177pointer statement.  A pointee cannot be a pointer.  Pointees cannot
3178occur in equivalence, common, or data statements.
3179
3180   A Cray pointer may also point to a function or a subroutine.  For
3181example, the following excerpt is valid:
3182       implicit none
3183       external sub
3184       pointer (subptr,subpte)
3185       external subpte
3186       subptr = loc(sub)
3187       call subpte()
3188       [...]
3189       subroutine sub
3190       [...]
3191       end subroutine sub
3192
3193   A pointer may be modified during the course of a program, and this
3194will change the location to which the pointee refers.  However, when
3195pointees are passed as arguments, they are treated as ordinary variables
3196in the invoked function.  Subsequent changes to the pointer will not
3197change the base address of the array that was passed.
3198
3199
3200File: gfortran.info,  Node: CONVERT specifier,  Next: OpenMP,  Prev: Cray pointers,  Up: Extensions implemented in GNU Fortran
3201
32026.1.15 'CONVERT' specifier
3203--------------------------
3204
3205GNU Fortran allows the conversion of unformatted data between little-
3206and big-endian representation to facilitate moving of data between
3207different systems.  The conversion can be indicated with the 'CONVERT'
3208specifier on the 'OPEN' statement.  *Note GFORTRAN_CONVERT_UNIT::, for
3209an alternative way of specifying the data format via an environment
3210variable.
3211
3212   Valid values for 'CONVERT' are:
3213     'CONVERT='NATIVE'' Use the native format.  This is the default.
3214     'CONVERT='SWAP'' Swap between little- and big-endian.
3215     'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
3216     unformatted files.
3217     'CONVERT='BIG_ENDIAN'' Use the big-endian representation for
3218     unformatted files.
3219
3220   Using the option could look like this:
3221       open(file='big.dat',form='unformatted',access='sequential', &
3222            convert='big_endian')
3223
3224   The value of the conversion can be queried by using
3225'INQUIRE(CONVERT=ch)'.  The values returned are ''BIG_ENDIAN'' and
3226''LITTLE_ENDIAN''.
3227
3228   'CONVERT' works between big- and little-endian for 'INTEGER' values
3229of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8.
3230Conversion between different "extended double" types on different
3231architectures such as m68k and x86_64, which GNU Fortran supports as
3232'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work.
3233
3234   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
3235environment variable will override the CONVERT specifier in the open
3236statement_.  This is to give control over data formats to users who do
3237not have the source code of their program available.
3238
3239   Using anything but the native representation for unformatted data
3240carries a significant speed overhead.  If speed in this area matters to
3241you, it is best if you use this only for data that needs to be portable.
3242
3243
3244File: gfortran.info,  Node: OpenMP,  Next: OpenACC,  Prev: CONVERT specifier,  Up: Extensions implemented in GNU Fortran
3245
32466.1.16 OpenMP
3247-------------
3248
3249OpenMP (Open Multi-Processing) is an application programming interface
3250(API) that supports multi-platform shared memory multiprocessing
3251programming in C/C++ and Fortran on many architectures, including Unix
3252and Microsoft Windows platforms.  It consists of a set of compiler
3253directives, library routines, and environment variables that influence
3254run-time behavior.
3255
3256   GNU Fortran strives to be compatible to the OpenMP Application
3257Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/).
3258
3259   To enable the processing of the OpenMP directive '!$omp' in free-form
3260source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form;
3261the '!$' conditional compilation sentinels in free form; and the 'c$',
3262'*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked
3263with the '-fopenmp'.  This also arranges for automatic linking of the
3264GNU Offloading and Multi Processing Runtime Library *note libgomp:
3265(libgomp)Top.
3266
3267   The OpenMP Fortran runtime library routines are provided both in a
3268form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran
3269'include' file named 'omp_lib.h'.
3270
3271   An example of a parallelized loop taken from Appendix A.1 of the
3272OpenMP Application Program Interface v2.5:
3273     SUBROUTINE A1(N, A, B)
3274       INTEGER I, N
3275       REAL B(N), A(N)
3276     !$OMP PARALLEL DO !I is private by default
3277       DO I=2,N
3278         B(I) = (A(I) + A(I-1)) / 2.0
3279       ENDDO
3280     !$OMP END PARALLEL DO
3281     END SUBROUTINE A1
3282
3283   Please note:
3284   * '-fopenmp' implies '-frecursive', i.e., all local arrays will be
3285     allocated on the stack.  When porting existing code to OpenMP, this
3286     may lead to surprising results, especially to segmentation faults
3287     if the stacksize is limited.
3288
3289   * On glibc-based systems, OpenMP enabled applications cannot be
3290     statically linked due to limitations of the underlying
3291     pthreads-implementation.  It might be possible to get a working
3292     solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
3293     is added to the command line.  However, this is not supported by
3294     'gcc' and thus not recommended.
3295
3296
3297File: gfortran.info,  Node: OpenACC,  Next: Argument list functions,  Prev: OpenMP,  Up: Extensions implemented in GNU Fortran
3298
32996.1.17 OpenACC
3300--------------
3301
3302OpenACC is an application programming interface (API) that supports
3303offloading of code to accelerator devices.  It consists of a set of
3304compiler directives, library routines, and environment variables that
3305influence run-time behavior.
3306
3307   GNU Fortran strives to be compatible to the OpenACC Application
3308Programming Interface v2.0 (http://www.openacc.org/).
3309
3310   To enable the processing of the OpenACC directive '!$acc' in
3311free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in
3312fixed form; the '!$' conditional compilation sentinels in free form; and
3313the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be
3314invoked with the '-fopenacc'.  This also arranges for automatic linking
3315of the GNU Offloading and Multi Processing Runtime Library *note
3316libgomp: (libgomp)Top.
3317
3318   The OpenACC Fortran runtime library routines are provided both in a
3319form of a Fortran 90 module named 'openacc' and in a form of a Fortran
3320'include' file named 'openacc_lib.h'.
3321
3322   Note that this is an experimental feature, incomplete, and subject to
3323change in future versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC>
3324for more information.
3325
3326
3327File: gfortran.info,  Node: Argument list functions,  Next: Read/Write after EOF marker,  Prev: OpenACC,  Up: Extensions implemented in GNU Fortran
3328
33296.1.18 Argument list functions '%VAL', '%REF' and '%LOC'
3330--------------------------------------------------------
3331
3332GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC'
3333statements, for backward compatibility with g77.  It is recommended that
3334these should be used only for code that is accessing facilities outside
3335of GNU Fortran, such as operating system or windowing facilities.  It is
3336best to constrain such uses to isolated portions of a program-portions
3337that deal specifically and exclusively with low-level, system-dependent
3338facilities.  Such portions might well provide a portable interface for
3339use by the program as a whole, but are themselves not portable, and
3340should be thoroughly tested each time they are rebuilt using a new
3341compiler or version of a compiler.
3342
3343   '%VAL' passes a scalar argument by value, '%REF' passes it by
3344reference and '%LOC' passes its memory location.  Since gfortran already
3345passes scalar arguments by reference, '%REF' is in effect a do-nothing.
3346'%LOC' has the same effect as a Fortran pointer.
3347
3348   An example of passing an argument by value to a C subroutine foo.:
3349     C
3350     C prototype      void foo_ (float x);
3351     C
3352           external foo
3353           real*4 x
3354           x = 3.14159
3355           call foo (%VAL (x))
3356           end
3357
3358   For details refer to the g77 manual
3359<https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>.
3360
3361   Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran
3362testsuite are worth a look.
3363
3364
3365File: gfortran.info,  Node: Read/Write after EOF marker,  Next: STRUCTURE and RECORD,  Prev: Argument list functions,  Up: Extensions implemented in GNU Fortran
3366
33676.1.19 Read/Write after EOF marker
3368----------------------------------
3369
3370Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file
3371marker in order to find the end of a file.  GNU Fortran normally rejects
3372these codes with a run-time error message and suggests the user consider
3373'BACKSPACE' or 'REWIND' to properly position the file before the EOF
3374marker.  As an extension, the run-time error may be disabled using
3375-std=legacy.
3376
3377
3378File: gfortran.info,  Node: STRUCTURE and RECORD,  Next: UNION and MAP,  Prev: Read/Write after EOF marker,  Up: Extensions implemented in GNU Fortran
3379
33806.1.20 'STRUCTURE' and 'RECORD'
3381-------------------------------
3382
3383Record structures are a pre-Fortran-90 vendor extension to create
3384user-defined aggregate data types.  Support for record structures in GNU
3385Fortran can be enabled with the '-fdec-structure' compile flag.  If you
3386have a choice, you should instead use Fortran 90's "derived types",
3387which have a different syntax.
3388
3389   In many cases, record structures can easily be converted to derived
3390types.  To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE'
3391TYPE-NAME.  Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by
3392'TYPE('TYPE-NAME')'.  Finally, in the component access, replace the
3393period ('.') by the percent sign ('%').
3394
3395   Here is an example of code using the non portable record structure
3396syntax:
3397
3398     ! Declaring a structure named ``item'' and containing three fields:
3399     ! an integer ID, an description string and a floating-point price.
3400     STRUCTURE /item/
3401       INTEGER id
3402       CHARACTER(LEN=200) description
3403       REAL price
3404     END STRUCTURE
3405
3406     ! Define two variables, an single record of type ``item''
3407     ! named ``pear'', and an array of items named ``store_catalog''
3408     RECORD /item/ pear, store_catalog(100)
3409
3410     ! We can directly access the fields of both variables
3411     pear.id = 92316
3412     pear.description = "juicy D'Anjou pear"
3413     pear.price = 0.15
3414     store_catalog(7).id = 7831
3415     store_catalog(7).description = "milk bottle"
3416     store_catalog(7).price = 1.2
3417
3418     ! We can also manipulate the whole structure
3419     store_catalog(12) = pear
3420     print *, store_catalog(12)
3421
3422This code can easily be rewritten in the Fortran 90 syntax as following:
3423
3424     ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
3425     ! ``TYPE name ... END TYPE''
3426     TYPE item
3427       INTEGER id
3428       CHARACTER(LEN=200) description
3429       REAL price
3430     END TYPE
3431
3432     ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
3433     TYPE(item) pear, store_catalog(100)
3434
3435     ! Instead of using a dot (.) to access fields of a record, the
3436     ! standard syntax uses a percent sign (%)
3437     pear%id = 92316
3438     pear%description = "juicy D'Anjou pear"
3439     pear%price = 0.15
3440     store_catalog(7)%id = 7831
3441     store_catalog(7)%description = "milk bottle"
3442     store_catalog(7)%price = 1.2
3443
3444     ! Assignments of a whole variable do not change
3445     store_catalog(12) = pear
3446     print *, store_catalog(12)
3447
3448GNU Fortran implements STRUCTURES like derived types with the following
3449rules and exceptions:
3450
3451   * Structures act like derived types with the 'SEQUENCE' attribute.
3452     Otherwise they may contain no specifiers.
3453
3454   * Structures may contain a special field with the name '%FILL'.  This
3455     will create an anonymous component which cannot be accessed but
3456     occupies space just as if a component of the same type was declared
3457     in its place, useful for alignment purposes.  As an example, the
3458     following structure will consist of at least sixteen bytes:
3459
3460          structure /padded/
3461            character(4) start
3462            character(8) %FILL
3463            character(4) end
3464          end structure
3465
3466   * Structures may share names with other symbols.  For example, the
3467     following is invalid for derived types, but valid for structures:
3468
3469          structure /header/
3470            ! ...
3471          end structure
3472          record /header/ header
3473
3474   * Structure types may be declared nested within another parent
3475     structure.  The syntax is:
3476          structure /type-name/
3477              ...
3478              structure [/<type-name>/] <field-list>
3479          ...
3480
3481     The type name may be ommitted, in which case the structure type
3482     itself is anonymous, and other structures of the same type cannot
3483     be instantiated.  The following shows some examples:
3484
3485          structure /appointment/
3486            ! nested structure definition: app_time is an array of two 'time'
3487            structure /time/ app_time (2)
3488              integer(1) hour, minute
3489            end structure
3490            character(10) memo
3491          end structure
3492
3493          ! The 'time' structure is still usable
3494          record /time/ now
3495          now = time(5, 30)
3496
3497          ...
3498
3499          structure /appointment/
3500            ! anonymous nested structure definition
3501            structure start, end
3502              integer(1) hour, minute
3503            end structure
3504            character(10) memo
3505          end structure
3506
3507   * Structures may contain 'UNION' blocks.  For more detail see the
3508     section on *note UNION and MAP::.
3509
3510   * Structures support old-style initialization of components, like
3511     those described in *note Old-style variable initialization::.  For
3512     array initializers, an initializer may contain a repeat
3513     specification of the form '<literal-integer> *
3514     <constant-initializer>'.  The value of the integer indicates the
3515     number of times to repeat the constant initializer when expanding
3516     the initializer list.
3517
3518
3519File: gfortran.info,  Node: UNION and MAP,  Next: Type variants for integer intrinsics,  Prev: STRUCTURE and RECORD,  Up: Extensions implemented in GNU Fortran
3520
35216.1.21 'UNION' and 'MAP'
3522------------------------
3523
3524Unions are an old vendor extension which were commonly used with the
3525non-standard *note STRUCTURE and RECORD:: extensions.  Use of 'UNION'
3526and 'MAP' is automatically enabled with '-fdec-structure'.
3527
3528   A 'UNION' declaration occurs within a structure; within the
3529definition of each union is a number of 'MAP' blocks.  Each 'MAP' shares
3530storage with its sibling maps (in the same union), and the size of the
3531union is the size of the largest map within it, just as with unions in
3532C. The major difference is that component references do not indicate
3533which union or map the component is in (the compiler gets to figure that
3534out).
3535
3536   Here is a small example:
3537     structure /myunion/
3538     union
3539       map
3540         character(2) w0, w1, w2
3541       end map
3542       map
3543         character(6) long
3544       end map
3545     end union
3546     end structure
3547
3548     record /myunion/ rec
3549     ! After this assignment...
3550     rec.long = 'hello!'
3551
3552     ! The following is true:
3553     ! rec.w0 === 'he'
3554     ! rec.w1 === 'll'
3555     ! rec.w2 === 'o!'
3556
3557   The two maps share memory, and the size of the union is ultimately
3558six bytes:
3559
3560     0    1    2    3    4   5   6     Byte offset
3561     -------------------------------
3562     |    |    |    |    |    |    |
3563     -------------------------------
3564
3565     ^    W0   ^    W1   ^    W2   ^
3566      \-------/ \-------/ \-------/
3567
3568     ^             LONG            ^
3569      \---------------------------/
3570
3571   Following is an example mirroring the layout of an Intel x86_64
3572register:
3573
3574     structure /reg/
3575       union ! U0                ! rax
3576         map
3577           character(16) rx
3578         end map
3579         map
3580           character(8) rh         ! rah
3581           union ! U1
3582             map
3583               character(8) rl     ! ral
3584             end map
3585             map
3586               character(8) ex     ! eax
3587             end map
3588             map
3589               character(4) eh     ! eah
3590               union ! U2
3591                 map
3592                   character(4) el ! eal
3593                 end map
3594                 map
3595                   character(4) x  ! ax
3596                 end map
3597                 map
3598                   character(2) h  ! ah
3599                   character(2) l  ! al
3600                 end map
3601               end union
3602             end map
3603           end union
3604         end map
3605       end union
3606     end structure
3607     record /reg/ a
3608
3609     ! After this assignment...
3610     a.rx     =     'AAAAAAAA.BBB.C.D'
3611
3612     ! The following is true:
3613     a.rx === 'AAAAAAAA.BBB.C.D'
3614     a.rh === 'AAAAAAAA'
3615     a.rl ===         '.BBB.C.D'
3616     a.ex ===         '.BBB.C.D'
3617     a.eh ===         '.BBB'
3618     a.el ===             '.C.D'
3619     a.x  ===             '.C.D'
3620     a.h  ===             '.C'
3621     a.l  ===               '.D'
3622
3623
3624File: gfortran.info,  Node: Type variants for integer intrinsics,  Next: AUTOMATIC and STATIC attributes,  Prev: UNION and MAP,  Up: Extensions implemented in GNU Fortran
3625
36266.1.22 Type variants for integer intrinsics
3627-------------------------------------------
3628
3629Similar to the D/C prefixes to real functions to specify the
3630input/output types, GNU Fortran offers B/I/J/K prefixes to integer
3631functions for compatibility with DEC programs.  The types implied by
3632each are:
3633
3634     B - INTEGER(kind=1)
3635     I - INTEGER(kind=2)
3636     J - INTEGER(kind=4)
3637     K - INTEGER(kind=8)
3638
3639   GNU Fortran supports these with the flag '-fdec-intrinsic-ints'.
3640Intrinsics for which prefixed versions are available and in what form
3641are noted in *note Intrinsic Procedures::.  The complete list of
3642supported intrinsics is here:
3643
3644Intrinsic      B              I              J              K
3645
3646---------------------------------------------------------------------------
3647'*note ABS::'  'BABS'         'IIABS'        'JIABS'        'KIABS'
3648'*note BTEST::''BBTEST'       'BITEST'       'BJTEST'       'BKTEST'
3649'*note IAND::' 'BIAND'        'IIAND'        'JIAND'        'KIAND'
3650'*note IBCLR::''BBCLR'        'IIBCLR'       'JIBCLR'       'KIBCLR'
3651'*note IBITS::''BBITS'        'IIBITS'       'JIBITS'       'KIBITS'
3652'*note IBSET::''BBSET'        'IIBSET'       'JIBSET'       'KIBSET'
3653'*note IEOR::' 'BIEOR'        'IIEOR'        'JIEOR'        'KIEOR'
3654'*note IOR::'  'BIOR'         'IIOR'         'JIOR'         'KIOR'
3655'*note ISHFT::''BSHFT'        'IISHFT'       'JISHFT'       'KISHFT'
3656'*note ISHFTC::''BSHFTC'      'IISHFTC'      'JISHFTC'      'KISHFTC'
3657'*note MOD::'  'BMOD'         'IMOD'         'JMOD'         'KMOD'
3658'*note NOT::'  'BNOT'         'INOT'         'JNOT'         'KNOT'
3659'*note REAL::' '--'           'FLOATI'       'FLOATJ'       'FLOATK'
3660
3661
3662File: gfortran.info,  Node: AUTOMATIC and STATIC attributes,  Next: Extended math intrinsics,  Prev: Type variants for integer intrinsics,  Up: Extensions implemented in GNU Fortran
3663
36646.1.23 'AUTOMATIC' and 'STATIC' attributes
3665------------------------------------------
3666
3667With '-fdec-static' GNU Fortran supports the DEC extended attributes
3668'STATIC' and 'AUTOMATIC' to provide explicit specification of entity
3669storage.  These follow the syntax of the Fortran standard 'SAVE'
3670attribute.
3671
3672   'STATIC' is exactly equivalent to 'SAVE', and specifies that an
3673entity should be allocated in static memory.  As an example, 'STATIC'
3674local variables will retain their values across multiple calls to a
3675function.
3676
3677   Entities marked 'AUTOMATIC' will be stack automatic whenever
3678possible.  'AUTOMATIC' is the default for local variables smaller than
3679'-fmax-stack-var-size', unless '-fno-automatic' is given.  This
3680attribute overrides '-fno-automatic', '-fmax-stack-var-size', and
3681blanket 'SAVE' statements.
3682
3683   Examples:
3684
3685     subroutine f
3686       integer, automatic :: i  ! automatic variable
3687       integer x, y             ! static variables
3688       save
3689       ...
3690     endsubroutine
3691     subroutine f
3692       integer a, b, c, x, y, z
3693       static :: x
3694       save y
3695       automatic z, c
3696       ! a, b, c, and z are automatic
3697       ! x and y are static
3698     endsubroutine
3699     ! Compiled with -fno-automatic
3700     subroutine f
3701       integer a, b, c, d
3702       automatic :: a
3703       ! a is automatic; b, c, and d are static
3704     endsubroutine
3705
3706
3707File: gfortran.info,  Node: Extended math intrinsics,  Next: Form feed as whitespace,  Prev: AUTOMATIC and STATIC attributes,  Up: Extensions implemented in GNU Fortran
3708
37096.1.24 Extended math intrinsics
3710-------------------------------
3711
3712GNU Fortran supports an extended list of mathematical intrinsics with
3713the compile flag '-fdec-math' for compatability with legacy code.  These
3714intrinsics are described fully in *note Intrinsic Procedures:: where it
3715is noted that they are extensions and should be avoided whenever
3716possible.
3717
3718   Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and
3719trigonometric intrinsics which accept or produce values in degrees
3720instead of radians.  Here is a summary of the new intrinsics:
3721
3722Radians                              Degrees
3723--------------------------------------------------------------------------
3724'*note ACOS::'                       '*note ACOSD::'*
3725'*note ASIN::'                       '*note ASIND::'*
3726'*note ATAN::'                       '*note ATAND::'*
3727'*note ATAN2::'                      '*note ATAN2D::'*
3728'*note COS::'                        '*note COSD::'*
3729'*note COTAN::'*                     '*note COTAND::'*
3730'*note SIN::'                        '*note SIND::'*
3731'*note TAN::'                        '*note TAND::'*
3732
3733   * Enabled with '-fdec-math'.
3734
3735   For advanced users, it may be important to know the implementation of
3736these functions.  They are simply wrappers around the standard radian
3737functions, which have more accurate builtin versions.  These functions
3738convert their arguments (or results) to degrees (or radians) by taking
3739the value modulus 360 (or 2*pi) and then multiplying it by a constant
3740radian-to-degree (or degree-to-radian) factor, as appropriate.  The
3741factor is computed at compile-time as 180/pi (or pi/180).
3742
3743
3744File: gfortran.info,  Node: Form feed as whitespace,  Next: TYPE as an alias for PRINT,  Prev: Extended math intrinsics,  Up: Extensions implemented in GNU Fortran
3745
37466.1.25 Form feed as whitespace
3747------------------------------
3748
3749Historically, legacy compilers allowed insertion of form feed characters
3750('\f', ASCII 0xC) at the beginning of lines for formatted output to line
3751printers, though the Fortran standard does not mention this.  GNU
3752Fortran supports the interpretation of form feed characters in source as
3753whitespace for compatibility.
3754
3755
3756File: gfortran.info,  Node: TYPE as an alias for PRINT,  Next: %LOC as an rvalue,  Prev: Form feed as whitespace,  Up: Extensions implemented in GNU Fortran
3757
37586.1.26 TYPE as an alias for PRINT
3759---------------------------------
3760
3761For compatibility, GNU Fortran will interpret 'TYPE' statements as
3762'PRINT' statements with the flag '-fdec'.  With this flag asserted, the
3763following two examples are equivalent:
3764
3765     TYPE *, 'hello world'
3766
3767     PRINT *, 'hello world'
3768
3769
3770File: gfortran.info,  Node: %LOC as an rvalue,  Next: .XOR. operator,  Prev: TYPE as an alias for PRINT,  Up: Extensions implemented in GNU Fortran
3771
37726.1.27 %LOC as an rvalue
3773------------------------
3774
3775Normally '%LOC' is allowed only in parameter lists.  However the
3776intrinsic function 'LOC' does the same thing, and is usable as the
3777right-hand-side of assignments.  For compatibility, GNU Fortran supports
3778the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'.
3779With this feature enabled the following two examples are equivalent:
3780
3781     integer :: i, l
3782     l = %loc(i)
3783     call sub(l)
3784
3785     integer :: i
3786     call sub(%loc(i))
3787
3788
3789File: gfortran.info,  Node: .XOR. operator,  Next: Bitwise logical operators,  Prev: %LOC as an rvalue,  Up: Extensions implemented in GNU Fortran
3790
37916.1.28 .XOR. operator
3792---------------------
3793
3794GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy'
3795for compatibility with legacy code.  '.XOR.' is equivalent to '.NEQV.'.
3796That is, the output is true if and only if the inputs differ.
3797
3798
3799File: gfortran.info,  Node: Bitwise logical operators,  Next: Extended I/O specifiers,  Prev: .XOR. operator,  Up: Extensions implemented in GNU Fortran
3800
38016.1.29 Bitwise logical operators
3802--------------------------------
3803
3804With '-fdec', GNU Fortran relaxes the type constraints on logical
3805operators to allow integer operands, and performs the corresponding
3806bitwise operation instead.  This flag is for compatibility only, and
3807should be avoided in new code.  Consider:
3808
3809       INTEGER :: i, j
3810       i = z'33'
3811       j = z'cc'
3812       print *, i .AND. j
3813
3814   In this example, compiled with '-fdec', GNU Fortran will replace the
3815'.AND.' operation with a call to the intrinsic '*note IAND::' function,
3816yielding the bitwise-and of 'i' and 'j'.
3817
3818   Note that this conversion will occur if at least one operand is of
3819integral type.  As a result, a logical operand will be converted to an
3820integer when the other operand is an integer in a logical operation.  In
3821this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'.
3822
3823   Here is the mapping of logical operator to bitwise intrinsic used
3824with '-fdec':
3825
3826Operator           Intrinsic          Bitwise operation
3827---------------------------------------------------------------------------
3828'.NOT.'            '*note NOT::'      complement
3829'.AND.'            '*note IAND::'     intersection
3830'.OR.'             '*note IOR::'      union
3831'.NEQV.'           '*note IEOR::'     exclusive or
3832'.EQV.'            '*note NOT::(*note IEOR::)'complement of exclusive or
3833
3834
3835File: gfortran.info,  Node: Extended I/O specifiers,  Next: Legacy PARAMETER statements,  Prev: Bitwise logical operators,  Up: Extensions implemented in GNU Fortran
3836
38376.1.30 Extended I/O specifiers
3838------------------------------
3839
3840GNU Fortran supports the additional legacy I/O specifiers
3841'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag
3842'-fdec', for compatibility.
3843
3844'CARRIAGECONTROL'
3845     The 'CARRIAGECONTROL' specifier allows a user to control line
3846     termination settings between output records for an I/O unit.  The
3847     specifier has no meaning for readonly files.  When
3848     'CARRAIGECONTROL' is specified upon opening a unit for formatted
3849     writing, the exact 'CARRIAGECONTROL' setting determines what
3850     characters to write between output records.  The syntax is:
3851
3852          OPEN(..., CARRIAGECONTROL=cc)
3853
3854     Where _cc_ is a character expression that evaluates to one of the
3855     following values:
3856
3857     ''LIST''       One line feed between records (default)
3858     ''FORTRAN''    Legacy interpretation of the first character (see below)
3859     ''NONE''       No separator between records
3860
3861     With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the
3862     first character of the input record is not written, and instead
3863     determines the output record separator as follows:
3864
3865     Leading character      Meaning                Output separating
3866                                                   character(s)
3867     ----------------------------------------------------------------------------
3868     ''+''                  Overprinting           Carriage return only
3869     ''-''                  New line               Line feed and carriage
3870                                                   return
3871     ''0''                  Skip line              Two line feeds and carriage
3872                                                   return
3873     ''1''                  New page               Form feed and carriage
3874                                                   return
3875     ''$''                  Prompting              Line feed (no carriage
3876                                                   return)
3877     'CHAR(0)'              Overprinting (no       None
3878                            advance)
3879
3880'READONLY'
3881     The 'READONLY' specifier may be given upon opening a unit, and is
3882     equivalent to specifying 'ACTION='READ'', except that the file may
3883     not be deleted on close (i.e.  'CLOSE' with 'STATUS="DELETE"').
3884     The syntax is:
3885
3886          OPEN(..., READONLY)
3887
3888'SHARE'
3889     The 'SHARE' specifier allows system-level locking on a unit upon
3890     opening it for controlled access from multiple processes/threads.
3891     The 'SHARE' specifier has several forms:
3892
3893          OPEN(..., SHARE=sh)
3894          OPEN(..., SHARED)
3895          OPEN(..., NOSHARED)
3896
3897     Where _sh_ in the first form is a character expression that
3898     evaluates to a value as seen in the table below.  The latter two
3899     forms are aliases for particular values of _sh_:
3900
3901     Explicit form          Short form             Meaning
3902     ----------------------------------------------------------------------------
3903     'SHARE='DENYRW''       'NOSHARED'             Exclusive (write) lock
3904     'SHARE='DENYNONE''     'SHARED'               Shared (read) lock
3905
3906     In general only one process may hold an exclusive (write) lock for
3907     a given file at a time, whereas many processes may hold shared
3908     (read) locks for the same file.
3909
3910     The behavior of locking may vary with your operating system.  On
3911     POSIX systems, locking is implemented with 'fcntl'.  Consult your
3912     corresponding operating system's manual pages for further details.
3913     Locking via 'SHARE=' is not supported on other systems.
3914
3915
3916File: gfortran.info,  Node: Legacy PARAMETER statements,  Next: Default exponents,  Prev: Extended I/O specifiers,  Up: Extensions implemented in GNU Fortran
3917
39186.1.31 Legacy PARAMETER statements
3919----------------------------------
3920
3921For compatibility, GNU Fortran supports legacy PARAMETER statements
3922without parentheses with '-std=legacy'.  A warning is emitted if used
3923with '-std=gnu', and an error is acknowledged with a real Fortran
3924standard flag ('-std=f95', etc...).  These statements take the following
3925form:
3926
3927     implicit real (E)
3928     parameter e = 2.718282
3929     real c
3930     parameter c = 3.0e8
3931
3932
3933File: gfortran.info,  Node: Default exponents,  Prev: Legacy PARAMETER statements,  Up: Extensions implemented in GNU Fortran
3934
39356.1.32 Default exponents
3936------------------------
3937
3938For compatibility, GNU Fortran supports a default exponent of zero in
3939real constants with '-fdec'.  For example, '9e' would be interpreted as
3940'9e0', rather than an error.
3941
3942
3943File: gfortran.info,  Node: Extensions not implemented in GNU Fortran,  Prev: Extensions implemented in GNU Fortran,  Up: Extensions
3944
39456.2 Extensions not implemented in GNU Fortran
3946=============================================
3947
3948The long history of the Fortran language, its wide use and broad
3949userbase, the large number of different compiler vendors and the lack of
3950some features crucial to users in the first standards have lead to the
3951existence of a number of important extensions to the language.  While
3952some of the most useful or popular extensions are supported by the GNU
3953Fortran compiler, not all existing extensions are supported.  This
3954section aims at listing these extensions and offering advice on how best
3955make code that uses them running with the GNU Fortran compiler.
3956
3957* Menu:
3958
3959* ENCODE and DECODE statements::
3960* Variable FORMAT expressions::
3961* Alternate complex function syntax::
3962* Volatile COMMON blocks::
3963* OPEN( ... NAME=)::
3964
3965
3966File: gfortran.info,  Node: ENCODE and DECODE statements,  Next: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
3967
39686.2.1 'ENCODE' and 'DECODE' statements
3969--------------------------------------
3970
3971GNU Fortran does not support the 'ENCODE' and 'DECODE' statements.
3972These statements are best replaced by 'READ' and 'WRITE' statements
3973involving internal files ('CHARACTER' variables and arrays), which have
3974been part of the Fortran standard since Fortran 77.  For example,
3975replace a code fragment like
3976
3977           INTEGER*1 LINE(80)
3978           REAL A, B, C
3979     c     ... Code that sets LINE
3980           DECODE (80, 9000, LINE) A, B, C
3981      9000 FORMAT (1X, 3(F10.5))
3982
3983with the following:
3984
3985           CHARACTER(LEN=80) LINE
3986           REAL A, B, C
3987     c     ... Code that sets LINE
3988           READ (UNIT=LINE, FMT=9000) A, B, C
3989      9000 FORMAT (1X, 3(F10.5))
3990
3991   Similarly, replace a code fragment like
3992
3993           INTEGER*1 LINE(80)
3994           REAL A, B, C
3995     c     ... Code that sets A, B and C
3996           ENCODE (80, 9000, LINE) A, B, C
3997      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
3998
3999with the following:
4000
4001           CHARACTER(LEN=80) LINE
4002           REAL A, B, C
4003     c     ... Code that sets A, B and C
4004           WRITE (UNIT=LINE, FMT=9000) A, B, C
4005      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
4006
4007
4008File: gfortran.info,  Node: Variable FORMAT expressions,  Next: Alternate complex function syntax,  Prev: ENCODE and DECODE statements,  Up: Extensions not implemented in GNU Fortran
4009
40106.2.2 Variable 'FORMAT' expressions
4011-----------------------------------
4012
4013A variable 'FORMAT' expression is format statement which includes angle
4014brackets enclosing a Fortran expression: 'FORMAT(I<N>)'.  GNU Fortran
4015does not support this legacy extension.  The effect of variable format
4016expressions can be reproduced by using the more powerful (and standard)
4017combination of internal output and string formats.  For example, replace
4018a code fragment like this:
4019
4020           WRITE(6,20) INT1
4021      20   FORMAT(I<N+1>)
4022
4023with the following:
4024
4025     c     Variable declaration
4026           CHARACTER(LEN=20) FMT
4027     c
4028     c     Other code here...
4029     c
4030           WRITE(FMT,'("(I", I0, ")")') N+1
4031           WRITE(6,FMT) INT1
4032
4033or with:
4034
4035     c     Variable declaration
4036           CHARACTER(LEN=20) FMT
4037     c
4038     c     Other code here...
4039     c
4040           WRITE(FMT,*) N+1
4041           WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
4042
4043
4044File: gfortran.info,  Node: Alternate complex function syntax,  Next: Volatile COMMON blocks,  Prev: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
4045
40466.2.3 Alternate complex function syntax
4047---------------------------------------
4048
4049Some Fortran compilers, including 'g77', let the user declare complex
4050functions with the syntax 'COMPLEX FUNCTION name*16()', as well as
4051'COMPLEX*16 FUNCTION name()'.  Both are non-standard, legacy extensions.
4052'gfortran' accepts the latter form, which is more common, but not the
4053former.
4054
4055
4056File: gfortran.info,  Node: Volatile COMMON blocks,  Next: OPEN( ... NAME=),  Prev: Alternate complex function syntax,  Up: Extensions not implemented in GNU Fortran
4057
40586.2.4 Volatile 'COMMON' blocks
4059------------------------------
4060
4061Some Fortran compilers, including 'g77', let the user declare 'COMMON'
4062with the 'VOLATILE' attribute.  This is invalid standard Fortran syntax
4063and is not supported by 'gfortran'.  Note that 'gfortran' accepts
4064'VOLATILE' variables in 'COMMON' blocks since revision 4.3.
4065
4066
4067File: gfortran.info,  Node: OPEN( ... NAME=),  Prev: Volatile COMMON blocks,  Up: Extensions not implemented in GNU Fortran
4068
40696.2.5 'OPEN( ... NAME=)'
4070------------------------
4071
4072Some Fortran compilers, including 'g77', let the user declare 'OPEN( ...
4073NAME=)'.  This is invalid standard Fortran syntax and is not supported
4074by 'gfortran'.  'OPEN( ... NAME=)' should be replaced with 'OPEN( ...
4075FILE=)'.
4076
4077
4078File: gfortran.info,  Node: Mixed-Language Programming,  Next: Coarray Programming,  Prev: Extensions,  Up: Top
4079
40807 Mixed-Language Programming
4081****************************
4082
4083* Menu:
4084
4085* Interoperability with C::
4086* GNU Fortran Compiler Directives::
4087* Non-Fortran Main Program::
4088* Naming and argument-passing conventions::
4089
4090This chapter is about mixed-language interoperability, but also applies
4091if one links Fortran code compiled by different compilers.  In most
4092cases, use of the C Binding features of the Fortran 2003 standard is
4093sufficient, and their use is highly recommended.
4094
4095
4096File: gfortran.info,  Node: Interoperability with C,  Next: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4097
40987.1 Interoperability with C
4099===========================
4100
4101* Menu:
4102
4103* Intrinsic Types::
4104* Derived Types and struct::
4105* Interoperable Global Variables::
4106* Interoperable Subroutines and Functions::
4107* Working with Pointers::
4108* Further Interoperability of Fortran with C::
4109
4110Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way
4111to generate procedure and derived-type declarations and global variables
4112which are interoperable with C (ISO/IEC 9899:1999).  The 'bind(C)'
4113attribute has been added to inform the compiler that a symbol shall be
4114interoperable with C; also, some constraints are added.  Note, however,
4115that not all C features have a Fortran equivalent or vice versa.  For
4116instance, neither C's unsigned integers nor C's functions with variable
4117number of arguments have an equivalent in Fortran.
4118
4119   Note that array dimensions are reversely ordered in C and that arrays
4120in C always start with index 0 while in Fortran they start by default
4121with 1.  Thus, an array declaration 'A(n,m)' in Fortran matches
4122'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'.
4123The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in
4124memory is 'A(i+1,j)' (C: 'A[j-1][i]').
4125
4126
4127File: gfortran.info,  Node: Intrinsic Types,  Next: Derived Types and struct,  Up: Interoperability with C
4128
41297.1.1 Intrinsic Types
4130---------------------
4131
4132In order to ensure that exactly the same variable type and kind is used
4133in C and Fortran, the named constants shall be used which are defined in
4134the 'ISO_C_BINDING' intrinsic module.  That module contains named
4135constants for kind parameters and character named constants for the
4136escape sequences in C. For a list of the constants, see *note
4137ISO_C_BINDING::.
4138
4139   For logical types, please note that the Fortran standard only
4140guarantees interoperability between C99's '_Bool' and Fortran's
4141'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and
4142'false' the value 0.  Using any other integer value with GNU Fortran's
4143'LOGICAL' (with any kind parameter) gives an undefined result.  (Passing
4144other integer values than 0 and 1 to GCC's '_Bool' is also undefined,
4145unless the integer is explicitly or implicitly casted to '_Bool'.)
4146
4147
4148File: gfortran.info,  Node: Derived Types and struct,  Next: Interoperable Global Variables,  Prev: Intrinsic Types,  Up: Interoperability with C
4149
41507.1.2 Derived Types and struct
4151------------------------------
4152
4153For compatibility of derived types with 'struct', one needs to use the
4154'BIND(C)' attribute in the type declaration.  For instance, the
4155following type declaration
4156
4157      USE ISO_C_BINDING
4158      TYPE, BIND(C) :: myType
4159        INTEGER(C_INT) :: i1, i2
4160        INTEGER(C_SIGNED_CHAR) :: i3
4161        REAL(C_DOUBLE) :: d1
4162        COMPLEX(C_FLOAT_COMPLEX) :: c1
4163        CHARACTER(KIND=C_CHAR) :: str(5)
4164      END TYPE
4165
4166   matches the following 'struct' declaration in C
4167
4168      struct {
4169        int i1, i2;
4170        /* Note: "char" might be signed or unsigned.  */
4171        signed char i3;
4172        double d1;
4173        float _Complex c1;
4174        char str[5];
4175      } myType;
4176
4177   Derived types with the C binding attribute shall not have the
4178'sequence' attribute, type parameters, the 'extends' attribute, nor
4179type-bound procedures.  Every component must be of interoperable type
4180and kind and may not have the 'pointer' or 'allocatable' attribute.  The
4181names of the components are irrelevant for interoperability.
4182
4183   As there exist no direct Fortran equivalents, neither unions nor
4184structs with bit field or variable-length array members are
4185interoperable.
4186
4187
4188File: gfortran.info,  Node: Interoperable Global Variables,  Next: Interoperable Subroutines and Functions,  Prev: Derived Types and struct,  Up: Interoperability with C
4189
41907.1.3 Interoperable Global Variables
4191------------------------------------
4192
4193Variables can be made accessible from C using the C binding attribute,
4194optionally together with specifying a binding name.  Those variables
4195have to be declared in the declaration part of a 'MODULE', be of
4196interoperable type, and have neither the 'pointer' nor the 'allocatable'
4197attribute.
4198
4199       MODULE m
4200         USE myType_module
4201         USE ISO_C_BINDING
4202         integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
4203         type(myType), bind(C) :: tp
4204       END MODULE
4205
4206   Here, '_MyProject_flags' is the case-sensitive name of the variable
4207as seen from C programs while 'global_flag' is the case-insensitive name
4208as seen from Fortran.  If no binding name is specified, as for TP, the C
4209binding name is the (lowercase) Fortran binding name.  If a binding name
4210is specified, only a single variable may be after the double colon.
4211Note of warning: You cannot use a global variable to access ERRNO of the
4212C library as the C standard allows it to be a macro.  Use the 'IERRNO'
4213intrinsic (GNU extension) instead.
4214
4215
4216File: gfortran.info,  Node: Interoperable Subroutines and Functions,  Next: Working with Pointers,  Prev: Interoperable Global Variables,  Up: Interoperability with C
4217
42187.1.4 Interoperable Subroutines and Functions
4219---------------------------------------------
4220
4221Subroutines and functions have to have the 'BIND(C)' attribute to be
4222compatible with C. The dummy argument declaration is relatively
4223straightforward.  However, one needs to be careful because C uses
4224call-by-value by default while Fortran behaves usually similar to
4225call-by-reference.  Furthermore, strings and pointers are handled
4226differently.  Note that in Fortran 2003 and 2008 only explicit size and
4227assumed-size arrays are supported but not assumed-shape or
4228deferred-shape (i.e.  allocatable or pointer) arrays.  However, those
4229are allowed since the Technical Specification 29113, see *note Further
4230Interoperability of Fortran with C::
4231
4232   To pass a variable by value, use the 'VALUE' attribute.  Thus, the
4233following C prototype
4234
4235     int func(int i, int *j)
4236
4237   matches the Fortran declaration
4238
4239       integer(c_int) function func(i,j)
4240         use iso_c_binding, only: c_int
4241         integer(c_int), VALUE :: i
4242         integer(c_int) :: j
4243
4244   Note that pointer arguments also frequently need the 'VALUE'
4245attribute, see *note Working with Pointers::.
4246
4247   Strings are handled quite differently in C and Fortran.  In C a
4248string is a 'NUL'-terminated array of characters while in Fortran each
4249string has a length associated with it and is thus not terminated (by
4250e.g.  'NUL').  For example, if one wants to use the following C
4251function,
4252
4253       #include <stdio.h>
4254       void print_C(char *string) /* equivalent: char string[]  */
4255       {
4256          printf("%s\n", string);
4257       }
4258
4259   to print "Hello World" from Fortran, one can call it using
4260
4261       use iso_c_binding, only: C_CHAR, C_NULL_CHAR
4262       interface
4263         subroutine print_c(string) bind(C, name="print_C")
4264           use iso_c_binding, only: c_char
4265           character(kind=c_char) :: string(*)
4266         end subroutine print_c
4267       end interface
4268       call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
4269
4270   As the example shows, one needs to ensure that the string is 'NUL'
4271terminated.  Additionally, the dummy argument STRING of 'print_C' is a
4272length-one assumed-size array; using 'character(len=*)' is not allowed.
4273The example above uses 'c_char_"Hello World"' to ensure the string
4274literal has the right type; typically the default character kind and
4275'c_char' are the same and thus '"Hello World"' is equivalent.  However,
4276the standard does not guarantee this.
4277
4278   The use of strings is now further illustrated using the C library
4279function 'strncpy', whose prototype is
4280
4281       char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
4282
4283   The function 'strncpy' copies at most N characters from string S2 to
4284S1 and returns S1.  In the following example, we ignore the return
4285value:
4286
4287       use iso_c_binding
4288       implicit none
4289       character(len=30) :: str,str2
4290       interface
4291         ! Ignore the return value of strncpy -> subroutine
4292         ! "restrict" is always assumed if we do not pass a pointer
4293         subroutine strncpy(dest, src, n) bind(C)
4294           import
4295           character(kind=c_char),  intent(out) :: dest(*)
4296           character(kind=c_char),  intent(in)  :: src(*)
4297           integer(c_size_t), value, intent(in) :: n
4298         end subroutine strncpy
4299       end interface
4300       str = repeat('X',30) ! Initialize whole string with 'X'
4301       call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
4302                    len(c_char_"Hello World",kind=c_size_t))
4303       print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
4304       end
4305
4306   The intrinsic procedures are described in *note Intrinsic
4307Procedures::.
4308
4309
4310File: gfortran.info,  Node: Working with Pointers,  Next: Further Interoperability of Fortran with C,  Prev: Interoperable Subroutines and Functions,  Up: Interoperability with C
4311
43127.1.5 Working with Pointers
4313---------------------------
4314
4315C pointers are represented in Fortran via the special opaque derived
4316type 'type(c_ptr)' (with private components).  Thus one needs to use
4317intrinsic conversion procedures to convert from or to C pointers.
4318
4319   For some applications, using an assumed type ('TYPE(*)') can be an
4320alternative to a C pointer; see *note Further Interoperability of
4321Fortran with C::.
4322
4323   For example,
4324
4325       use iso_c_binding
4326       type(c_ptr) :: cptr1, cptr2
4327       integer, target :: array(7), scalar
4328       integer, pointer :: pa(:), ps
4329       cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
4330                               ! array is contiguous if required by the C
4331                               ! procedure
4332       cptr2 = c_loc(scalar)
4333       call c_f_pointer(cptr2, ps)
4334       call c_f_pointer(cptr2, pa, shape=[7])
4335
4336   When converting C to Fortran arrays, the one-dimensional 'SHAPE'
4337argument has to be passed.
4338
4339   If a pointer is a dummy-argument of an interoperable procedure, it
4340usually has to be declared using the 'VALUE' attribute.  'void*' matches
4341'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'.
4342
4343   Procedure pointers are handled analogously to pointers; the C type is
4344'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
4345'C_F_PROCPOINTER' and 'C_FUNLOC'.
4346
4347   Let us consider two examples of actually passing a procedure pointer
4348from C to Fortran and vice versa.  Note that these examples are also
4349very similar to passing ordinary pointers between both languages.
4350First, consider this code in C:
4351
4352     /* Procedure implemented in Fortran.  */
4353     void get_values (void (*)(double));
4354
4355     /* Call-back routine we want called from Fortran.  */
4356     void
4357     print_it (double x)
4358     {
4359       printf ("Number is %f.\n", x);
4360     }
4361
4362     /* Call Fortran routine and pass call-back to it.  */
4363     void
4364     foobar ()
4365     {
4366       get_values (&print_it);
4367     }
4368
4369   A matching implementation for 'get_values' in Fortran, that correctly
4370receives the procedure pointer from C and is able to call it, is given
4371in the following 'MODULE':
4372
4373     MODULE m
4374       IMPLICIT NONE
4375
4376       ! Define interface of call-back routine.
4377       ABSTRACT INTERFACE
4378         SUBROUTINE callback (x)
4379           USE, INTRINSIC :: ISO_C_BINDING
4380           REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
4381         END SUBROUTINE callback
4382       END INTERFACE
4383
4384     CONTAINS
4385
4386       ! Define C-bound procedure.
4387       SUBROUTINE get_values (cproc) BIND(C)
4388         USE, INTRINSIC :: ISO_C_BINDING
4389         TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
4390
4391         PROCEDURE(callback), POINTER :: proc
4392
4393         ! Convert C to Fortran procedure pointer.
4394         CALL C_F_PROCPOINTER (cproc, proc)
4395
4396         ! Call it.
4397         CALL proc (1.0_C_DOUBLE)
4398         CALL proc (-42.0_C_DOUBLE)
4399         CALL proc (18.12_C_DOUBLE)
4400       END SUBROUTINE get_values
4401
4402     END MODULE m
4403
4404   Next, we want to call a C routine that expects a procedure pointer
4405argument and pass it a Fortran procedure (which clearly must be
4406interoperable!).  Again, the C function may be:
4407
4408     int
4409     call_it (int (*func)(int), int arg)
4410     {
4411       return func (arg);
4412     }
4413
4414   It can be used as in the following Fortran code:
4415
4416     MODULE m
4417       USE, INTRINSIC :: ISO_C_BINDING
4418       IMPLICIT NONE
4419
4420       ! Define interface of C function.
4421       INTERFACE
4422         INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
4423           USE, INTRINSIC :: ISO_C_BINDING
4424           TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
4425           INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4426         END FUNCTION call_it
4427       END INTERFACE
4428
4429     CONTAINS
4430
4431       ! Define procedure passed to C function.
4432       ! It must be interoperable!
4433       INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
4434         INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4435         double_it = arg + arg
4436       END FUNCTION double_it
4437
4438       ! Call C function.
4439       SUBROUTINE foobar ()
4440         TYPE(C_FUNPTR) :: cproc
4441         INTEGER(KIND=C_INT) :: i
4442
4443         ! Get C procedure pointer.
4444         cproc = C_FUNLOC (double_it)
4445
4446         ! Use it.
4447         DO i = 1_C_INT, 10_C_INT
4448           PRINT *, call_it (cproc, i)
4449         END DO
4450       END SUBROUTINE foobar
4451
4452     END MODULE m
4453
4454
4455File: gfortran.info,  Node: Further Interoperability of Fortran with C,  Prev: Working with Pointers,  Up: Interoperability with C
4456
44577.1.6 Further Interoperability of Fortran with C
4458------------------------------------------------
4459
4460The Technical Specification ISO/IEC TS 29113:2012 on further
4461interoperability of Fortran with C extends the interoperability support
4462of Fortran 2003 and Fortran 2008.  Besides removing some restrictions
4463and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank
4464('dimension') variables and allows for interoperability of
4465assumed-shape, assumed-rank and deferred-shape arrays, including
4466allocatables and pointers.
4467
4468   Note: Currently, GNU Fortran does not support the array descriptor
4469(dope vector) as specified in the Technical Specification, but uses an
4470array descriptor with different fields.  The Chasm Language
4471Interoperability Tools, <http://chasm-interop.sourceforge.net/>, provide
4472an interface to GNU Fortran's array descriptor.
4473
4474   The Technical Specification adds the following new features, which
4475are supported by GNU Fortran:
4476
4477   * The 'ASYNCHRONOUS' attribute has been clarified and extended to
4478     allow its use with asynchronous communication in user-provided
4479     libraries such as in implementations of the Message Passing
4480     Interface specification.
4481
4482   * Many constraints have been relaxed, in particular for the 'C_LOC'
4483     and 'C_F_POINTER' intrinsics.
4484
4485   * The 'OPTIONAL' attribute is now allowed for dummy arguments; an
4486     absent argument matches a 'NULL' pointer.
4487
4488   * Assumed types ('TYPE(*)') have been added, which may only be used
4489     for dummy arguments.  They are unlimited polymorphic but contrary
4490     to 'CLASS(*)' they do not contain any type information, similar to
4491     C's 'void *' pointers.  Expressions of any type and kind can be
4492     passed; thus, it can be used as replacement for 'TYPE(C_PTR)',
4493     avoiding the use of 'C_LOC' in the caller.
4494
4495     Note, however, that 'TYPE(*)' only accepts scalar arguments, unless
4496     the 'DIMENSION' is explicitly specified.  As 'DIMENSION(*)' only
4497     supports array (including array elements) but no scalars, it is not
4498     a full replacement for 'C_LOC'.  On the other hand, assumed-type
4499     assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for
4500     both scalars and arrays, but require special code on the callee
4501     side to handle the array descriptor.
4502
4503   * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that
4504     scalars and arrays of any rank can be passed as actual argument.
4505     As the Technical Specification does not provide for direct means to
4506     operate with them, they have to be used either from the C side or
4507     be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays
4508     of a specific rank.  The rank can be determined using the 'RANK'
4509     intrinisic.
4510
4511   Currently unimplemented:
4512
4513   * GNU Fortran always uses an array descriptor, which does not match
4514     the one of the Technical Specification.  The
4515     'ISO_Fortran_binding.h' header file and the C functions it
4516     specifies are not available.
4517
4518   * Using assumed-shape, assumed-rank and deferred-shape arrays in
4519     'BIND(C)' procedures is not fully supported.  In particular, C
4520     interoperable strings of other length than one are not supported as
4521     this requires the new array descriptor.
4522
4523
4524File: gfortran.info,  Node: GNU Fortran Compiler Directives,  Next: Non-Fortran Main Program,  Prev: Interoperability with C,  Up: Mixed-Language Programming
4525
45267.2 GNU Fortran Compiler Directives
4527===================================
4528
4529* Menu:
4530
4531* ATTRIBUTES directive::
4532* UNROLL directive::
4533
4534
4535File: gfortran.info,  Node: ATTRIBUTES directive,  Next: UNROLL directive,  Up: GNU Fortran Compiler Directives
4536
45377.2.1 ATTRIBUTES directive
4538--------------------------
4539
4540The Fortran standard describes how a conforming program shall behave;
4541however, the exact implementation is not standardized.  In order to
4542allow the user to choose specific implementation details, compiler
4543directives can be used to set attributes of variables and procedures
4544which are not part of the standard.  Whether a given attribute is
4545supported and its exact effects depend on both the operating system and
4546on the processor; see *note C Extensions: (gcc)Top. for details.
4547
4548   For procedures and procedure pointers, the following attributes can
4549be used to change the calling convention:
4550
4551   * 'CDECL' - standard C calling convention
4552   * 'STDCALL' - convention where the called procedure pops the stack
4553   * 'FASTCALL' - part of the arguments are passed via registers instead
4554     using the stack
4555
4556   Besides changing the calling convention, the attributes also
4557influence the decoration of the symbol name, e.g., by a leading
4558underscore or by a trailing at-sign followed by the number of bytes on
4559the stack.  When assigning a procedure to a procedure pointer, both
4560should use the same calling convention.
4561
4562   On some systems, procedures and global variables (module variables
4563and 'COMMON' blocks) need special handling to be accessible when they
4564are in a shared library.  The following attributes are available:
4565
4566   * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL
4567   * 'DLLIMPORT' - reference the function or variable using a global
4568     pointer
4569
4570   For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in
4571other compilers, it is also known as 'IGNORE_TKR'.  For dummy arguments
4572with this attribute actual arguments of any type and kind (similar to
4573'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
4574standard) are accepted.  As with 'TYPE(*)', the argument is unlimited
4575polymorphic and no type information is available.  Additionally, the
4576argument may only be passed to dummy arguments with the 'NO_ARG_CHECK'
4577attribute and as argument to the 'PRESENT' intrinsic function and to
4578'C_LOC' of the 'ISO_C_BINDING' module.
4579
4580   Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type
4581('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or
4582'COMPLEX'.  They shall not have the 'ALLOCATE', 'CODIMENSION',
4583'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall
4584be either scalar or of assumed-size ('dimension(*)').  As 'TYPE(*)', the
4585'NO_ARG_CHECK' attribute requires an explicit interface.
4586
4587   * 'NO_ARG_CHECK' - disable the type, kind and rank checking
4588
4589   The attributes are specified using the syntax
4590
4591   '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST
4592
4593   where in free-form source code only whitespace is allowed before
4594'!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall
4595start in the first column.
4596
4597   For procedures, the compiler directives shall be placed into the body
4598of the procedure; for variables and procedure pointers, they shall be in
4599the same declaration part as the variable or procedure pointer.
4600
4601
4602File: gfortran.info,  Node: UNROLL directive,  Prev: ATTRIBUTES directive,  Up: GNU Fortran Compiler Directives
4603
46047.2.2 UNROLL directive
4605----------------------
4606
4607The syntax of the directive is
4608
4609   '!GCC$ unroll N'
4610
4611   You can use this directive to control how many times a loop should be
4612unrolled.  It must be placed immediately before a 'DO' loop and applies
4613only to the loop that follows.  N is an integer constant specifying the
4614unrolling factor.  The values of 0 and 1 block any unrolling of the
4615loop.
4616
4617
4618File: gfortran.info,  Node: Non-Fortran Main Program,  Next: Naming and argument-passing conventions,  Prev: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4619
46207.3 Non-Fortran Main Program
4621============================
4622
4623* Menu:
4624
4625* _gfortran_set_args:: Save command-line arguments
4626* _gfortran_set_options:: Set library option flags
4627* _gfortran_set_convert:: Set endian conversion
4628* _gfortran_set_record_marker:: Set length of record markers
4629* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
4630* _gfortran_set_max_subrecord_length:: Set subrecord length
4631
4632Even if you are doing mixed-language programming, it is very likely that
4633you do not need to know or use the information in this section.  Since
4634it is about the internal structure of GNU Fortran, it may also change in
4635GCC minor releases.
4636
4637   When you compile a 'PROGRAM' with GNU Fortran, a function with the
4638name 'main' (in the symbol table of the object file) is generated, which
4639initializes the libgfortran library and then calls the actual program
4640which uses the name 'MAIN__', for historic reasons.  If you link GNU
4641Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran
4642program compiled by a different compiler, the libgfortran library is not
4643initialized and thus a few intrinsic procedures do not work properly,
4644e.g.  those for obtaining the command-line arguments.
4645
4646   Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the
4647GNU Fortran compiled procedures require intrinsics relying on the
4648library initialization, you need to initialize the library yourself.
4649Using the default options, gfortran calls '_gfortran_set_args' and
4650'_gfortran_set_options'.  The initialization of the former is needed if
4651the called procedures access the command line (and for backtracing); the
4652latter sets some flags based on the standard chosen or to enable
4653backtracing.  In typical programs, it is not necessary to call any
4654initialization function.
4655
4656   If your 'PROGRAM' is compiled with GNU Fortran, you shall not call
4657any of the following functions.  The libgfortran initialization
4658functions are shown in C syntax but using C bindings they are also
4659accessible from Fortran.
4660
4661
4662File: gfortran.info,  Node: _gfortran_set_args,  Next: _gfortran_set_options,  Up: Non-Fortran Main Program
4663
46647.3.1 '_gfortran_set_args' -- Save command-line arguments
4665---------------------------------------------------------
4666
4667_Description_:
4668     '_gfortran_set_args' saves the command-line arguments; this
4669     initialization is required if any of the command-line intrinsics is
4670     called.  Additionally, it shall be called if backtracing is enabled
4671     (see '_gfortran_set_options').
4672
4673_Syntax_:
4674     'void _gfortran_set_args (int argc, char *argv[])'
4675
4676_Arguments_:
4677     ARGC        number of command line argument strings
4678     ARGV        the command-line argument strings; argv[0] is
4679                 the pathname of the executable itself.
4680
4681_Example_:
4682          int main (int argc, char *argv[])
4683          {
4684            /* Initialize libgfortran.  */
4685            _gfortran_set_args (argc, argv);
4686            return 0;
4687          }
4688
4689
4690File: gfortran.info,  Node: _gfortran_set_options,  Next: _gfortran_set_convert,  Prev: _gfortran_set_args,  Up: Non-Fortran Main Program
4691
46927.3.2 '_gfortran_set_options' -- Set library option flags
4693---------------------------------------------------------
4694
4695_Description_:
4696     '_gfortran_set_options' sets several flags related to the Fortran
4697     standard to be used, whether backtracing should be enabled and
4698     whether range checks should be performed.  The syntax allows for
4699     upward compatibility since the number of passed flags is specified;
4700     for non-passed flags, the default value is used.  See also *note
4701     Code Gen Options::.  Please note that not all flags are actually
4702     used.
4703
4704_Syntax_:
4705     'void _gfortran_set_options (int num, int options[])'
4706
4707_Arguments_:
4708     NUM         number of options passed
4709     ARGV        The list of flag values
4710
4711_option flag list_:
4712     OPTION[0]   Allowed standard; can give run-time errors if
4713                 e.g.  an input-output edit descriptor is invalid
4714                 in a given standard.  Possible values are
4715                 (bitwise or-ed) 'GFC_STD_F77' (1),
4716                 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4),
4717                 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16),
4718                 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64),
4719                 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS'
4720                 (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018'
4721                 (1024), 'GFC_STD_F2018_OBS' (2048), and
4722                 'GFC_STD=F2018_DEL' (4096).  Default:
4723                 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95
4724                 | GFC_STD_F2003 | GFC_STD_F2008 |
4725                 GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
4726                 GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS
4727                 | GFC_STD_F2018_DEL | GFC_STD_GNU |
4728                 GFC_STD_LEGACY'.
4729     OPTION[1]   Standard-warning flag; prints a warning to
4730                 standard error.  Default: 'GFC_STD_F95_DEL |
4731                 GFC_STD_LEGACY'.
4732     OPTION[2]   If non zero, enable pedantic checking.  Default:
4733                 off.
4734     OPTION[3]   Unused.
4735     OPTION[4]   If non zero, enable backtracing on run-time
4736                 errors.  Default: off.  (Default in the
4737                 compiler: on.)  Note: Installs a signal handler
4738                 and requires command-line initialization using
4739                 '_gfortran_set_args'.
4740     OPTION[5]   If non zero, supports signed zeros.  Default:
4741                 enabled.
4742     OPTION[6]   Enables run-time checking.  Possible values are
4743                 (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
4744                 GFC_RTCHECK_ARRAY_TEMPS (2),
4745                 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16),
4746                 GFC_RTCHECK_POINTER (32).  Default: disabled.
4747     OPTION[7]   Unused.
4748     OPTION[8]   Show a warning when invoking 'STOP' and 'ERROR
4749                 STOP' if a floating-point exception occurred.
4750                 Possible values are (bitwise or-ed)
4751                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
4752                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
4753                 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT'
4754                 (32).  Default: None (0).  (Default in the
4755                 compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL |
4756                 GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
4757                 GFC_FPE_UNDERFLOW'.)
4758
4759_Example_:
4760            /* Use gfortran 4.9 default options.  */
4761            static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
4762            _gfortran_set_options (9, &options);
4763
4764
4765File: gfortran.info,  Node: _gfortran_set_convert,  Next: _gfortran_set_record_marker,  Prev: _gfortran_set_options,  Up: Non-Fortran Main Program
4766
47677.3.3 '_gfortran_set_convert' -- Set endian conversion
4768------------------------------------------------------
4769
4770_Description_:
4771     '_gfortran_set_convert' set the representation of data for
4772     unformatted files.
4773
4774_Syntax_:
4775     'void _gfortran_set_convert (int conv)'
4776
4777_Arguments_:
4778     CONV        Endian conversion, possible values:
4779                 GFC_CONVERT_NATIVE (0, default),
4780                 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
4781                 GFC_CONVERT_LITTLE (3).
4782
4783_Example_:
4784          int main (int argc, char *argv[])
4785          {
4786            /* Initialize libgfortran.  */
4787            _gfortran_set_args (argc, argv);
4788            _gfortran_set_convert (1);
4789            return 0;
4790          }
4791
4792
4793File: gfortran.info,  Node: _gfortran_set_record_marker,  Next: _gfortran_set_fpe,  Prev: _gfortran_set_convert,  Up: Non-Fortran Main Program
4794
47957.3.4 '_gfortran_set_record_marker' -- Set length of record markers
4796-------------------------------------------------------------------
4797
4798_Description_:
4799     '_gfortran_set_record_marker' sets the length of record markers for
4800     unformatted files.
4801
4802_Syntax_:
4803     'void _gfortran_set_record_marker (int val)'
4804
4805_Arguments_:
4806     VAL         Length of the record marker; valid values are 4
4807                 and 8.  Default is 4.
4808
4809_Example_:
4810          int main (int argc, char *argv[])
4811          {
4812            /* Initialize libgfortran.  */
4813            _gfortran_set_args (argc, argv);
4814            _gfortran_set_record_marker (8);
4815            return 0;
4816          }
4817
4818
4819File: gfortran.info,  Node: _gfortran_set_fpe,  Next: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_record_marker,  Up: Non-Fortran Main Program
4820
48217.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps
4822------------------------------------------------------------------
4823
4824_Description_:
4825     '_gfortran_set_fpe' enables floating point exception traps for the
4826     specified exceptions.  On most systems, this will result in a
4827     SIGFPE signal being sent and the program being aborted.
4828
4829_Syntax_:
4830     'void _gfortran_set_fpe (int val)'
4831
4832_Arguments_:
4833     OPTION[0]   IEEE exceptions.  Possible values are (bitwise
4834                 or-ed) zero (0, default) no trapping,
4835                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
4836                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
4837                 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT'
4838                 (32).
4839
4840_Example_:
4841          int main (int argc, char *argv[])
4842          {
4843            /* Initialize libgfortran.  */
4844            _gfortran_set_args (argc, argv);
4845            /* FPE for invalid operations such as SQRT(-1.0).  */
4846            _gfortran_set_fpe (1);
4847            return 0;
4848          }
4849
4850
4851File: gfortran.info,  Node: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_fpe,  Up: Non-Fortran Main Program
4852
48537.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length
4854------------------------------------------------------------------
4855
4856_Description_:
4857     '_gfortran_set_max_subrecord_length' set the maximum length for a
4858     subrecord.  This option only makes sense for testing and debugging
4859     of unformatted I/O.
4860
4861_Syntax_:
4862     'void _gfortran_set_max_subrecord_length (int val)'
4863
4864_Arguments_:
4865     VAL         the maximum length for a subrecord; the maximum
4866                 permitted value is 2147483639, which is also the
4867                 default.
4868
4869_Example_:
4870          int main (int argc, char *argv[])
4871          {
4872            /* Initialize libgfortran.  */
4873            _gfortran_set_args (argc, argv);
4874            _gfortran_set_max_subrecord_length (8);
4875            return 0;
4876          }
4877
4878
4879File: gfortran.info,  Node: Naming and argument-passing conventions,  Prev: Non-Fortran Main Program,  Up: Mixed-Language Programming
4880
48817.4 Naming and argument-passing conventions
4882===========================================
4883
4884This section gives an overview about the naming convention of procedures
4885and global variables and about the argument passing conventions used by
4886GNU Fortran.  If a C binding has been specified, the naming convention
4887and some of the argument-passing conventions change.  If possible,
4888mixed-language and mixed-compiler projects should use the better defined
4889C binding for interoperability.  See *note Interoperability with C::.
4890
4891* Menu:
4892
4893* Naming conventions::
4894* Argument passing conventions::
4895
4896
4897File: gfortran.info,  Node: Naming conventions,  Next: Argument passing conventions,  Up: Naming and argument-passing conventions
4898
48997.4.1 Naming conventions
4900------------------------
4901
4902According the Fortran standard, valid Fortran names consist of a letter
4903between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores
4904('_') with the restriction that names may only start with a letter.  As
4905vendor extension, the dollar sign ('$') is additionally permitted with
4906the option '-fdollar-ok', but not as first character and only if the
4907target system supports it.
4908
4909   By default, the procedure name is the lower-cased Fortran name with
4910an appended underscore ('_'); using '-fno-underscoring' no underscore is
4911appended while '-fsecond-underscore' appends two underscores.  Depending
4912on the target system and the calling convention, the procedure might be
4913additionally dressed; for instance, on 32bit Windows with 'stdcall', an
4914at-sign '@' followed by an integer number is appended.  For the changing
4915the calling convention, see *note GNU Fortran Compiler Directives::.
4916
4917   For common blocks, the same convention is used, i.e.  by default an
4918underscore is appended to the lower-cased Fortran name.  Blank commons
4919have the name '__BLNK__'.
4920
4921   For procedures and variables declared in the specification space of a
4922module, the name is formed by '__', followed by the lower-cased module
4923name, '_MOD_', and the lower-cased Fortran name.  Note that no
4924underscore is appended.
4925
4926
4927File: gfortran.info,  Node: Argument passing conventions,  Prev: Naming conventions,  Up: Naming and argument-passing conventions
4928
49297.4.2 Argument passing conventions
4930----------------------------------
4931
4932Subroutines do not return a value (matching C99's 'void') while
4933functions either return a value as specified in the platform ABI or the
4934result variable is passed as hidden argument to the function and no
4935result is returned.  A hidden result variable is used when the result
4936variable is an array or of type 'CHARACTER'.
4937
4938   Arguments are passed according to the platform ABI. In particular,
4939complex arguments might not be compatible to a struct with two real
4940components for the real and imaginary part.  The argument passing
4941matches the one of C99's '_Complex'.  Functions with scalar complex
4942result variables return their value and do not use a by-reference
4943argument.  Note that with the '-ff2c' option, the argument passing is
4944modified and no longer completely matches the platform ABI. Some other
4945Fortran compilers use 'f2c' semantic by default; this might cause
4946problems with interoperablility.
4947
4948   GNU Fortran passes most arguments by reference, i.e.  by passing a
4949pointer to the data.  Note that the compiler might use a temporary
4950variable into which the actual argument has been copied, if required
4951semantically (copy-in/copy-out).
4952
4953   For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including
4954procedure pointers), a pointer to the pointer is passed such that the
4955pointer address can be modified in the procedure.
4956
4957   For dummy arguments with the 'VALUE' attribute: Scalar arguments of
4958the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value
4959according to the platform ABI. (As vendor extension and not recommended,
4960using '%VAL()' in the call to a procedure has the same effect.)  For
4961'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such
4962that it can be modified without affecting the caller.
4963
4964   For Boolean ('LOGICAL') arguments, please note that GCC expects only
4965the integer value 0 and 1.  If a GNU Fortran 'LOGICAL' variable contains
4966another integer value, the result is undefined.  As some other Fortran
4967compilers use -1 for '.TRUE.', extra care has to be taken - such as
4968passing the value as 'INTEGER'.  (The same value restriction also
4969applies to other front ends of GCC, e.g.  to GCC's C99 compiler for
4970'_Bool' or GCC's Ada compiler for 'Boolean'.)
4971
4972   For arguments of 'CHARACTER' type, the character length is passed as
4973a hidden argument at the end of the argument list.  For deferred-length
4974strings, the value is passed by reference, otherwise by value.  The
4975character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in
4976Fortran).  Note that this is different to older versions of the GNU
4977Fortran compiler, where the type of the hidden character length argument
4978was a C 'int'.  In order to retain compatibility with older versions,
4979one can e.g.  for the following Fortran procedure
4980
4981     subroutine fstrlen (s, a)
4982        character(len=*) :: s
4983        integer :: a
4984        print*, len(s)
4985     end subroutine fstrlen
4986
4987   define the corresponding C prototype as follows:
4988
4989     #if __GNUC__ > 7
4990     typedef size_t fortran_charlen_t;
4991     #else
4992     typedef int fortran_charlen_t;
4993     #endif
4994
4995     void fstrlen_ (char*, int*, fortran_charlen_t);
4996
4997   In order to avoid such compiler-specific details, for new code it is
4998instead recommended to use the ISO_C_BINDING feature.
4999
5000   Note with C binding, 'CHARACTER(len=1)' result variables are returned
5001according to the platform ABI and no hidden length argument is used for
5002dummy arguments; with 'VALUE', those variables are passed by value.
5003
5004   For 'OPTIONAL' dummy arguments, an absent argument is denoted by a
5005NULL pointer, except for scalar dummy arguments of type 'INTEGER',
5006'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute.  For
5007those, a hidden Boolean argument ('logical(kind=C_bool),value') is used
5008to indicate whether the argument is present.
5009
5010   Arguments which are assumed-shape, assumed-rank or deferred-rank
5011arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an
5012array descriptor.  All other arrays pass the address of the first
5013element of the array.  With '-fcoarray=lib', the token and the offset
5014belonging to nonallocatable coarrays dummy arguments are passed as
5015hidden argument along the character length hidden arguments.  The token
5016is an oparque pointer identifying the coarray and the offset is a
5017passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset
5018between the base address of the coarray and the passed scalar or first
5019element of the passed array.
5020
5021   The arguments are passed in the following order
5022   * Result variable, when the function result is passed by reference
5023   * Character length of the function result, if it is a of type
5024     'CHARACTER' and no C binding is used
5025   * The arguments in the order in which they appear in the Fortran
5026     declaration
5027   * The the present status for optional arguments with value attribute,
5028     which are internally passed by value
5029   * The character length and/or coarray token and offset for the first
5030     argument which is a 'CHARACTER' or a nonallocatable coarray dummy
5031     argument, followed by the hidden arguments of the next dummy
5032     argument of such a type
5033
5034
5035File: gfortran.info,  Node: Coarray Programming,  Next: Intrinsic Procedures,  Prev: Mixed-Language Programming,  Up: Top
5036
50378 Coarray Programming
5038*********************
5039
5040* Menu:
5041
5042* Type and enum ABI Documentation::
5043* Function ABI Documentation::
5044
5045
5046File: gfortran.info,  Node: Type and enum ABI Documentation,  Next: Function ABI Documentation,  Up: Coarray Programming
5047
50488.1 Type and enum ABI Documentation
5049===================================
5050
5051* Menu:
5052
5053* caf_token_t::
5054* caf_register_t::
5055* caf_deregister_t::
5056* caf_reference_t::
5057* caf_team_t::
5058
5059
5060File: gfortran.info,  Node: caf_token_t,  Next: caf_register_t,  Up: Type and enum ABI Documentation
5061
50628.1.1 'caf_token_t'
5063-------------------
5064
5065Typedef of type 'void *' on the compiler side.  Can be any data type on
5066the library side.
5067
5068
5069File: gfortran.info,  Node: caf_register_t,  Next: caf_deregister_t,  Prev: caf_token_t,  Up: Type and enum ABI Documentation
5070
50718.1.2 'caf_register_t'
5072----------------------
5073
5074Indicates which kind of coarray variable should be registered.
5075
5076typedef enum caf_register_t {
5077  CAF_REGTYPE_COARRAY_STATIC,
5078  CAF_REGTYPE_COARRAY_ALLOC,
5079  CAF_REGTYPE_LOCK_STATIC,
5080  CAF_REGTYPE_LOCK_ALLOC,
5081  CAF_REGTYPE_CRITICAL,
5082  CAF_REGTYPE_EVENT_STATIC,
5083  CAF_REGTYPE_EVENT_ALLOC,
5084  CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY,
5085  CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY
5086}
5087caf_register_t;
5088
5089   The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and
5090'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components
5091in derived type coarrays only.  The first one sets up the token without
5092allocating memory for allocatable component.  The latter one only
5093allocates the memory for an allocatable component in a derived type
5094coarray.  The token needs to be setup previously by the REGISTER_ONLY.
5095This allows to have allocatable components un-allocated on some images.
5096The status whether an allocatable component is allocated on a remote
5097image can be queried by '_caf_is_present' which used internally by the
5098'ALLOCATED' intrinsic.
5099
5100
5101File: gfortran.info,  Node: caf_deregister_t,  Next: caf_reference_t,  Prev: caf_register_t,  Up: Type and enum ABI Documentation
5102
51038.1.3 'caf_deregister_t'
5104------------------------
5105
5106typedef enum caf_deregister_t {
5107  CAF_DEREGTYPE_COARRAY_DEREGISTER,
5108  CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
5109}
5110caf_deregister_t;
5111
5112   Allows to specifiy the type of deregistration of a coarray object.
5113The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for
5114allocatable components in derived type coarrays.
5115
5116
5117File: gfortran.info,  Node: caf_reference_t,  Next: caf_team_t,  Prev: caf_deregister_t,  Up: Type and enum ABI Documentation
5118
51198.1.4 'caf_reference_t'
5120-----------------------
5121
5122The structure used for implementing arbitrary reference chains.  A
5123'CAF_REFERENCE_T' allows to specify a component reference or any kind of
5124array reference of any rank supported by gfortran.  For array references
5125all kinds as known by the compiler/Fortran standard are supported
5126indicated by a 'MODE'.
5127
5128typedef enum caf_ref_type_t {
5129  /* Reference a component of a derived type, either regular one or an
5130     allocatable or pointer type.  For regular ones idx in caf_reference_t is
5131     set to -1.  */
5132  CAF_REF_COMPONENT,
5133  /* Reference an allocatable array.  */
5134  CAF_REF_ARRAY,
5135  /* Reference a non-allocatable/non-pointer array.  I.e., the coarray object
5136     has no array descriptor associated and the addressing is done
5137     completely using the ref.  */
5138  CAF_REF_STATIC_ARRAY
5139} caf_ref_type_t;
5140
5141typedef enum caf_array_ref_t {
5142  /* No array ref.  This terminates the array ref.  */
5143  CAF_ARR_REF_NONE = 0,
5144  /* Reference array elements given by a vector.  Only for this mode
5145     caf_reference_t.u.a.dim[i].v is valid.  */
5146  CAF_ARR_REF_VECTOR,
5147  /* A full array ref (:).  */
5148  CAF_ARR_REF_FULL,
5149  /* Reference a range on elements given by start, end and stride.  */
5150  CAF_ARR_REF_RANGE,
5151  /* Only a single item is referenced given in the start member.  */
5152  CAF_ARR_REF_SINGLE,
5153  /* An array ref of the kind (i:), where i is an arbitrary valid index in the
5154     array.  The index i is given in the start member.  */
5155  CAF_ARR_REF_OPEN_END,
5156  /* An array ref of the kind (:i), where the lower bound of the array ref
5157     is given by the remote side.  The index i is given in the end member.  */
5158  CAF_ARR_REF_OPEN_START
5159} caf_array_ref_t;
5160
5161/* References to remote components of a derived type.  */
5162typedef struct caf_reference_t {
5163  /* A pointer to the next ref or NULL.  */
5164  struct caf_reference_t *next;
5165  /* The type of the reference.  */
5166  /* caf_ref_type_t, replaced by int to allow specification in fortran FE.  */
5167  int type;
5168  /* The size of an item referenced in bytes.  I.e. in an array ref this is
5169     the factor to advance the array pointer with to get to the next item.
5170     For component refs this gives just the size of the element referenced.  */
5171  size_t item_size;
5172  union {
5173    struct {
5174      /* The offset (in bytes) of the component in the derived type.
5175         Unused for allocatable or pointer components.  */
5176      ptrdiff_t offset;
5177      /* The offset (in bytes) to the caf_token associated with this
5178         component.  NULL, when not allocatable/pointer ref.  */
5179      ptrdiff_t caf_token_offset;
5180    } c;
5181    struct {
5182      /* The mode of the array ref.  See CAF_ARR_REF_*.  */
5183      /* caf_array_ref_t, replaced by unsigend char to allow specification in
5184         fortran FE.  */
5185     unsigned char mode[GFC_MAX_DIMENSIONS];
5186      /* The type of a static array.  Unset for array's with descriptors.  */
5187      int static_array_type;
5188      /* Subscript refs (s) or vector refs (v).  */
5189      union {
5190        struct {
5191          /* The start and end boundary of the ref and the stride.  */
5192          index_type start, end, stride;
5193        } s;
5194        struct {
5195          /* nvec entries of kind giving the elements to reference.  */
5196          void *vector;
5197          /* The number of entries in vector.  */
5198          size_t nvec;
5199          /* The integer kind used for the elements in vector.  */
5200          int kind;
5201        } v;
5202      } dim[GFC_MAX_DIMENSIONS];
5203    } a;
5204  } u;
5205} caf_reference_t;
5206
5207   The references make up a single linked list of reference operations.
5208The 'NEXT' member links to the next reference or NULL to indicate the
5209end of the chain.  Component and array refs can be arbitrarly mixed as
5210long as they comply to the Fortran standard.
5211
5212   _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE'
5213is 'CAF_REF_STATIC_ARRAY'.  The member gives the type of the data
5214referenced.  Because no array descriptor is available for a
5215descriptor-less array and type conversion still needs to take place the
5216type is transported here.
5217
5218   At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front
5219end for descriptor-less arrays.  The library caf_single has untested
5220support for it.
5221
5222
5223File: gfortran.info,  Node: caf_team_t,  Prev: caf_reference_t,  Up: Type and enum ABI Documentation
5224
52258.1.5 'caf_team_t'
5226------------------
5227
5228Opaque pointer to represent a team-handle.  This type is a stand-in for
5229the future implementation of teams.  It is about to change without
5230further notice.
5231
5232
5233File: gfortran.info,  Node: Function ABI Documentation,  Prev: Type and enum ABI Documentation,  Up: Coarray Programming
5234
52358.2 Function ABI Documentation
5236==============================
5237
5238* Menu:
5239
5240* _gfortran_caf_init:: Initialiation function
5241* _gfortran_caf_finish:: Finalization function
5242* _gfortran_caf_this_image:: Querying the image number
5243* _gfortran_caf_num_images:: Querying the maximal number of images
5244* _gfortran_caf_image_status :: Query the status of an image
5245* _gfortran_caf_failed_images :: Get an array of the indexes of the failed images
5246* _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images
5247* _gfortran_caf_register:: Registering coarrays
5248* _gfortran_caf_deregister:: Deregistering coarrays
5249* _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated
5250* _gfortran_caf_send:: Sending data from a local image to a remote image
5251* _gfortran_caf_get:: Getting data from a remote image
5252* _gfortran_caf_sendget:: Sending data between remote images
5253* _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references
5254* _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references
5255* _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references
5256* _gfortran_caf_lock:: Locking a lock variable
5257* _gfortran_caf_unlock:: Unlocking a lock variable
5258* _gfortran_caf_event_post:: Post an event
5259* _gfortran_caf_event_wait:: Wait that an event occurred
5260* _gfortran_caf_event_query:: Query event count
5261* _gfortran_caf_sync_all:: All-image barrier
5262* _gfortran_caf_sync_images:: Barrier for selected images
5263* _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
5264* _gfortran_caf_error_stop:: Error termination with exit code
5265* _gfortran_caf_error_stop_str:: Error termination with string
5266* _gfortran_caf_fail_image :: Mark the image failed and end its execution
5267* _gfortran_caf_atomic_define:: Atomic variable assignment
5268* _gfortran_caf_atomic_ref:: Atomic variable reference
5269* _gfortran_caf_atomic_cas:: Atomic compare and swap
5270* _gfortran_caf_atomic_op:: Atomic operation
5271* _gfortran_caf_co_broadcast:: Sending data to all images
5272* _gfortran_caf_co_max:: Collective maximum reduction
5273* _gfortran_caf_co_min:: Collective minimum reduction
5274* _gfortran_caf_co_sum:: Collective summing reduction
5275* _gfortran_caf_co_reduce:: Generic collective reduction
5276
5277
5278File: gfortran.info,  Node: _gfortran_caf_init,  Next: _gfortran_caf_finish,  Up: Function ABI Documentation
5279
52808.2.1 '_gfortran_caf_init' -- Initialiation function
5281----------------------------------------------------
5282
5283_Description_:
5284     This function is called at startup of the program before the
5285     Fortran main program, if the latter has been compiled with
5286     '-fcoarray=lib'.  It takes as arguments the command-line arguments
5287     of the program.  It is permitted to pass two 'NULL' pointers as
5288     argument; if non-'NULL', the library is permitted to modify the
5289     arguments.
5290
5291_Syntax_:
5292     'void _gfortran_caf_init (int *argc, char ***argv)'
5293
5294_Arguments_:
5295     ARGC        intent(inout) An integer pointer with the number
5296                 of arguments passed to the program or 'NULL'.
5297     ARGV        intent(inout) A pointer to an array of strings
5298                 with the command-line arguments or 'NULL'.
5299
5300_NOTES_
5301     The function is modelled after the initialization function of the
5302     Message Passing Interface (MPI) specification.  Due to the way
5303     coarray registration works, it might not be the first call to the
5304     library.  If the main program is not written in Fortran and only a
5305     library uses coarrays, it can happen that this function is never
5306     called.  Therefore, it is recommended that the library does not
5307     rely on the passed arguments and whether the call has been done.
5308
5309
5310File: gfortran.info,  Node: _gfortran_caf_finish,  Next: _gfortran_caf_this_image,  Prev: _gfortran_caf_init,  Up: Function ABI Documentation
5311
53128.2.2 '_gfortran_caf_finish' -- Finalization function
5313-----------------------------------------------------
5314
5315_Description_:
5316     This function is called at the end of the Fortran main program, if
5317     it has been compiled with the '-fcoarray=lib' option.
5318
5319_Syntax_:
5320     'void _gfortran_caf_finish (void)'
5321
5322_NOTES_
5323     For non-Fortran programs, it is recommended to call the function at
5324     the end of the main program.  To ensure that the shutdown is also
5325     performed for programs where this function is not explicitly
5326     invoked, for instance non-Fortran programs or calls to the system's
5327     exit() function, the library can use a destructor function.  Note
5328     that programs can also be terminated using the STOP and ERROR STOP
5329     statements; those use different library calls.
5330
5331
5332File: gfortran.info,  Node: _gfortran_caf_this_image,  Next: _gfortran_caf_num_images,  Prev: _gfortran_caf_finish,  Up: Function ABI Documentation
5333
53348.2.3 '_gfortran_caf_this_image' -- Querying the image number
5335-------------------------------------------------------------
5336
5337_Description_:
5338     This function returns the current image number, which is a positive
5339     number.
5340
5341_Syntax_:
5342     'int _gfortran_caf_this_image (int distance)'
5343
5344_Arguments_:
5345     DISTANCE    As specified for the 'this_image' intrinsic in
5346                 TS18508.  Shall be a non-negative number.
5347
5348_NOTES_
5349     If the Fortran intrinsic 'this_image' is invoked without an
5350     argument, which is the only permitted form in Fortran 2008, GCC
5351     passes '0' as first argument.
5352
5353
5354File: gfortran.info,  Node: _gfortran_caf_num_images,  Next: _gfortran_caf_image_status,  Prev: _gfortran_caf_this_image,  Up: Function ABI Documentation
5355
53568.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images
5357-------------------------------------------------------------------------
5358
5359_Description_:
5360     This function returns the number of images in the current team, if
5361     DISTANCE is 0 or the number of images in the parent team at the
5362     specified distance.  If failed is -1, the function returns the
5363     number of all images at the specified distance; if it is 0, the
5364     function returns the number of nonfailed images, and if it is 1, it
5365     returns the number of failed images.
5366
5367_Syntax_:
5368     'int _gfortran_caf_num_images(int distance, int failed)'
5369
5370_Arguments_:
5371     DISTANCE    the distance from this image to the ancestor.
5372                 Shall be positive.
5373     FAILED      shall be -1, 0, or 1
5374
5375_NOTES_
5376     This function follows TS18508.  If the num_image intrinsic has no
5377     arguments, then the compiler passes 'distance=0' and 'failed=-1' to
5378     the function.
5379
5380
5381File: gfortran.info,  Node: _gfortran_caf_image_status,  Next: _gfortran_caf_failed_images,  Prev: _gfortran_caf_num_images,  Up: Function ABI Documentation
5382
53838.2.5 '_gfortran_caf_image_status' -- Query the status of an image
5384------------------------------------------------------------------
5385
5386_Description_:
5387     Get the status of the image given by the id IMAGE of the team given
5388     by TEAM.  Valid results are zero, for image is ok,
5389     'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate
5390     that the image has been stopped and 'STAT_FAILED_IMAGE' also from
5391     ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL
5392     IMAGE' statement.
5393
5394_Syntax_:
5395     'int _gfortran_caf_image_status (int image, caf_team_t * team)'
5396
5397_Arguments_:
5398     IMAGE       the positive scalar id of the image in the
5399                 current TEAM.
5400     TEAM        optional; team on the which the inquiry is to be
5401                 performed.
5402
5403_NOTES_
5404     This function follows TS18508.  Because team-functionality is not
5405     yet implemented a null-pointer is passed for the TEAM argument at
5406     the moment.
5407
5408
5409File: gfortran.info,  Node: _gfortran_caf_failed_images,  Next: _gfortran_caf_stopped_images,  Prev: _gfortran_caf_image_status,  Up: Function ABI Documentation
5410
54118.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images
5412---------------------------------------------------------------------------------------
5413
5414_Description_:
5415     Get an array of image indexes in the current TEAM that have failed.
5416     The array is sorted ascendingly.  When TEAM is not provided the
5417     current team is to be used.  When KIND is provided then the
5418     resulting array is of that integer kind else it is of default
5419     integer kind.  The returns an unallocated size zero array when no
5420     images have failed.
5421
5422_Syntax_:
5423     'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)'
5424
5425_Arguments_:
5426     TEAM        optional; team on the which the inquiry is to be
5427                 performed.
5428     IMAGE       optional; the kind of the resulting integer
5429                 array.
5430
5431_NOTES_
5432     This function follows TS18508.  Because team-functionality is not
5433     yet implemented a null-pointer is passed for the TEAM argument at
5434     the moment.
5435
5436
5437File: gfortran.info,  Node: _gfortran_caf_stopped_images,  Next: _gfortran_caf_register,  Prev: _gfortran_caf_failed_images,  Up: Function ABI Documentation
5438
54398.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images
5440-----------------------------------------------------------------------------------------
5441
5442_Description_:
5443     Get an array of image indexes in the current TEAM that have
5444     stopped.  The array is sorted ascendingly.  When TEAM is not
5445     provided the current team is to be used.  When KIND is provided
5446     then the resulting array is of that integer kind else it is of
5447     default integer kind.  The returns an unallocated size zero array
5448     when no images have failed.
5449
5450_Syntax_:
5451     'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)'
5452
5453_Arguments_:
5454     TEAM        optional; team on the which the inquiry is to be
5455                 performed.
5456     IMAGE       optional; the kind of the resulting integer
5457                 array.
5458
5459_NOTES_
5460     This function follows TS18508.  Because team-functionality is not
5461     yet implemented a null-pointer is passed for the TEAM argument at
5462     the moment.
5463
5464
5465File: gfortran.info,  Node: _gfortran_caf_register,  Next: _gfortran_caf_deregister,  Prev: _gfortran_caf_stopped_images,  Up: Function ABI Documentation
5466
54678.2.8 '_gfortran_caf_register' -- Registering coarrays
5468------------------------------------------------------
5469
5470_Description_:
5471     Registers memory for a coarray and creates a token to identify the
5472     coarray.  The routine is called for both coarrays with 'SAVE'
5473     attribute and using an explicit 'ALLOCATE' statement.  If an error
5474     occurs and STAT is a 'NULL' pointer, the function shall abort with
5475     printing an error message and starting the error termination.  If
5476     no error occurs and STAT is present, it shall be set to zero.
5477     Otherwise, it shall be set to a positive value and, if not-'NULL',
5478     ERRMSG shall be set to a string describing the failure.  The
5479     routine shall register the memory provided in the 'DATA'-component
5480     of the array descriptor DESC, when that component is non-'NULL',
5481     else it shall allocate sufficient memory and provide a pointer to
5482     it in the 'DATA'-component of DESC.  The array descriptor has rank
5483     zero, when a scalar object is to be registered and the array
5484     descriptor may be invalid after the call to
5485     '_gfortran_caf_register'.  When an array is to be allocated the
5486     descriptor persists.
5487
5488     For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC',
5489     the passed size is the byte size requested.  For
5490     'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and
5491     'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
5492
5493     When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a
5494     token for an allocatable or pointer component is created.  The
5495     'SIZE' parameter is not used then.  On the contrary when
5496     'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the
5497     TOKEN needs to be registered by a previous call with regtype
5498     'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory
5499     specified in the DESC's data-ptr is registered or allocate when the
5500     data-ptr is 'NULL'.
5501
5502_Syntax_:
5503     'void caf_register (size_t size, caf_register_t type, caf_token_t
5504     *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t
5505     errmsg_len)'
5506
5507_Arguments_:
5508     SIZE        For normal coarrays, the byte size of the
5509                 coarray to be allocated; for lock types and
5510                 event types, the number of elements.
5511     TYPE        one of the caf_register_t types.
5512     TOKEN       intent(out) An opaque pointer identifying the
5513                 coarray.
5514     DESC        intent(inout) The (pseudo) array descriptor.
5515     STAT        intent(out) For allocatable coarrays, stores the
5516                 STAT=; may be 'NULL'
5517     ERRMSG      intent(out) When an error occurs, this will be
5518                 set to an error message; may be 'NULL'
5519     ERRMSG_LEN  the buffer size of errmsg.
5520
5521_NOTES_
5522     Nonallocatable coarrays have to be registered prior use from remote
5523     images.  In order to guarantee this, they have to be registered
5524     before the main program.  This can be achieved by creating
5525     constructor functions.  That is what GCC does such that also for
5526     nonallocatable coarrays the memory is allocated and no static
5527     memory is used.  The token permits to identify the coarray; to the
5528     processor, the token is a nonaliasing pointer.  The library can,
5529     for instance, store the base address of the coarray in the token,
5530     some handle or a more complicated struct.  The library may also
5531     store the array descriptor DESC when its rank is non-zero.
5532
5533     For lock types, the value shall only be used for checking the
5534     allocation status.  Note that for critical blocks, the locking is
5535     only required on one image; in the locking statement, the processor
5536     shall always pass an image index of one for critical-block lock
5537     variables ('CAF_REGTYPE_CRITICAL').  For lock types and
5538     critical-block variables, the initial value shall be unlocked (or,
5539     respecitively, not in critical section) such as the value false;
5540     for event types, the initial state should be no event, e.g.  zero.
5541
5542
5543File: gfortran.info,  Node: _gfortran_caf_deregister,  Next: _gfortran_caf_is_present,  Prev: _gfortran_caf_register,  Up: Function ABI Documentation
5544
55458.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays
5546----------------------------------------------------------
5547
5548_Description_:
5549     Called to free or deregister the memory of a coarray; the processor
5550     calls this function for automatic and explicit deallocation.  In
5551     case of an error, this function shall fail with an error message,
5552     unless the STAT variable is not null.  The library is only expected
5553     to free memory it allocated itself during a call to
5554     '_gfortran_caf_register'.
5555
5556_Syntax_:
5557     'void caf_deregister (caf_token_t *token, caf_deregister_t type,
5558     int *stat, char *errmsg, size_t errmsg_len)'
5559
5560_Arguments_:
5561     TOKEN       the token to free.
5562     TYPE        the type of action to take for the coarray.  A
5563                 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is
5564                 allowed only for allocatable or pointer
5565                 components of derived type coarrays.  The action
5566                 only deallocates the local memory without
5567                 deleting the token.
5568     STAT        intent(out) Stores the STAT=; may be NULL
5569     ERRMSG      intent(out) When an error occurs, this will be
5570                 set to an error message; may be NULL
5571     ERRMSG_LEN  the buffer size of errmsg.
5572
5573_NOTES_
5574     For nonalloatable coarrays this function is never called.  If a
5575     cleanup is required, it has to be handled via the finish, stop and
5576     error stop functions, and via destructors.
5577
5578
5579File: gfortran.info,  Node: _gfortran_caf_is_present,  Next: _gfortran_caf_send,  Prev: _gfortran_caf_deregister,  Up: Function ABI Documentation
5580
55818.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated
5582-----------------------------------------------------------------------------------------------------------------------------
5583
5584_Description_:
5585     Used to query the coarray library whether an allocatable component
5586     in a derived type coarray is allocated on a remote image.
5587
5588_Syntax_:
5589     'void _gfortran_caf_is_present (caf_token_t token, int image_index,
5590     gfc_reference_t *ref)'
5591
5592_Arguments_:
5593     TOKEN       An opaque pointer identifying the coarray.
5594     IMAGE_INDEX The ID of the remote image; must be a positive
5595                 number.
5596     REF         A chain of references to address the allocatable
5597                 or pointer component in the derived type
5598                 coarray.  The object reference needs to be a
5599                 scalar or a full array reference, respectively.
5600
5601
5602File: gfortran.info,  Node: _gfortran_caf_send,  Next: _gfortran_caf_get,  Prev: _gfortran_caf_is_present,  Up: Function ABI Documentation
5603
56048.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image
5605--------------------------------------------------------------------------------
5606
5607_Description_:
5608     Called to send a scalar, an array section or a whole array from a
5609     local to a remote image identified by the image_index.
5610
5611_Syntax_:
5612     'void _gfortran_caf_send (caf_token_t token, size_t offset, int
5613     image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
5614     gfc_descriptor_t *src, int dst_kind, int src_kind, bool
5615     may_require_tmp, int *stat)'
5616
5617_Arguments_:
5618     TOKEN       intent(in) An opaque pointer identifying the
5619                 coarray.
5620     OFFSET      intent(in) By which amount of bytes the actual
5621                 data is shifted compared to the base address of
5622                 the coarray.
5623     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5624                 positive number.
5625     DEST        intent(in) Array descriptor for the remote image
5626                 for the bounds and the size.  The 'base_addr'
5627                 shall not be accessed.
5628     DST_VECTOR  intent(in) If not NULL, it contains the vector
5629                 subscript of the destination array; the values
5630                 are relative to the dimension triplet of the
5631                 dest argument.
5632     SRC         intent(in) Array descriptor of the local array
5633                 to be transferred to the remote image
5634     DST_KIND    intent(in) Kind of the destination argument
5635     SRC_KIND    intent(in) Kind of the source argument
5636     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5637                 known at compile time that the DEST and SRC
5638                 either cannot overlap or overlap (fully or
5639                 partially) such that walking SRC and DEST in
5640                 element wise element order (honoring the stride
5641                 value) will not lead to wrong results.
5642                 Otherwise, the value is 'true'.
5643     STAT        intent(out) when non-NULL give the result of the
5644                 operation, i.e., zero on success and non-zero on
5645                 error.  When NULL and an error occurs, then an
5646                 error message is printed and the program is
5647                 terminated.
5648
5649_NOTES_
5650     It is permitted to have IMAGE_INDEX equal the current image; the
5651     memory of the send-to and the send-from might (partially) overlap
5652     in that case.  The implementation has to take care that it handles
5653     this case, e.g.  using 'memmove' which handles (partially)
5654     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5655     additionally create a temporary variable, unless additional checks
5656     show that this is not required (e.g.  because walking backward is
5657     possible or because both arrays are contiguous and 'memmove' takes
5658     care of overlap issues).
5659
5660     Note that the assignment of a scalar to an array is permitted.  In
5661     addition, the library has to handle numeric-type conversion and for
5662     strings, padding and different character kinds.
5663
5664
5665File: gfortran.info,  Node: _gfortran_caf_get,  Next: _gfortran_caf_sendget,  Prev: _gfortran_caf_send,  Up: Function ABI Documentation
5666
56678.2.12 '_gfortran_caf_get' -- Getting data from a remote image
5668--------------------------------------------------------------
5669
5670_Description_:
5671     Called to get an array section or a whole array from a remote,
5672     image identified by the image_index.
5673
5674_Syntax_:
5675     'void _gfortran_caf_get (caf_token_t token, size_t offset, int
5676     image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
5677     gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
5678     may_require_tmp, int *stat)'
5679
5680_Arguments_:
5681     TOKEN       intent(in) An opaque pointer identifying the
5682                 coarray.
5683     OFFSET      intent(in) By which amount of bytes the actual
5684                 data is shifted compared to the base address of
5685                 the coarray.
5686     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5687                 positive number.
5688     DEST        intent(out) Array descriptor of the local array
5689                 to store the data retrieved from the remote
5690                 image
5691     SRC         intent(in) Array descriptor for the remote image
5692                 for the bounds and the size.  The 'base_addr'
5693                 shall not be accessed.
5694     SRC_VECTOR  intent(in) If not NULL, it contains the vector
5695                 subscript of the source array; the values are
5696                 relative to the dimension triplet of the SRC
5697                 argument.
5698     DST_KIND    intent(in) Kind of the destination argument
5699     SRC_KIND    intent(in) Kind of the source argument
5700     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5701                 known at compile time that the DEST and SRC
5702                 either cannot overlap or overlap (fully or
5703                 partially) such that walking SRC and DEST in
5704                 element wise element order (honoring the stride
5705                 value) will not lead to wrong results.
5706                 Otherwise, the value is 'true'.
5707     STAT        intent(out) When non-NULL give the result of the
5708                 operation, i.e., zero on success and non-zero on
5709                 error.  When NULL and an error occurs, then an
5710                 error message is printed and the program is
5711                 terminated.
5712
5713_NOTES_
5714     It is permitted to have IMAGE_INDEX equal the current image; the
5715     memory of the send-to and the send-from might (partially) overlap
5716     in that case.  The implementation has to take care that it handles
5717     this case, e.g.  using 'memmove' which handles (partially)
5718     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5719     additionally create a temporary variable, unless additional checks
5720     show that this is not required (e.g.  because walking backward is
5721     possible or because both arrays are contiguous and 'memmove' takes
5722     care of overlap issues).
5723
5724     Note that the library has to handle numeric-type conversion and for
5725     strings, padding and different character kinds.
5726
5727
5728File: gfortran.info,  Node: _gfortran_caf_sendget,  Next: _gfortran_caf_send_by_ref,  Prev: _gfortran_caf_get,  Up: Function ABI Documentation
5729
57308.2.13 '_gfortran_caf_sendget' -- Sending data between remote images
5731--------------------------------------------------------------------
5732
5733_Description_:
5734     Called to send a scalar, an array section or a whole array from a
5735     remote image identified by the SRC_IMAGE_INDEX to a remote image
5736     identified by the DST_IMAGE_INDEX.
5737
5738_Syntax_:
5739     'void _gfortran_caf_sendget (caf_token_t dst_token, size_t
5740     dst_offset, int dst_image_index, gfc_descriptor_t *dest,
5741     caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset,
5742     int src_image_index, gfc_descriptor_t *src, caf_vector_t
5743     *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int
5744     *stat)'
5745
5746_Arguments_:
5747     DST_TOKEN   intent(in) An opaque pointer identifying the
5748                 destination coarray.
5749     DST_OFFSET  intent(in) By which amount of bytes the actual
5750                 data is shifted compared to the base address of
5751                 the destination coarray.
5752     DST_IMAGE_INDEXintent(in) The ID of the destination remote
5753                 image; must be a positive number.
5754     DEST        intent(in) Array descriptor for the destination
5755                 remote image for the bounds and the size.  The
5756                 'base_addr' shall not be accessed.
5757     DST_VECTOR  intent(int) If not NULL, it contains the vector
5758                 subscript of the destination array; the values
5759                 are relative to the dimension triplet of the
5760                 DEST argument.
5761     SRC_TOKEN   intent(in) An opaque pointer identifying the
5762                 source coarray.
5763     SRC_OFFSET  intent(in) By which amount of bytes the actual
5764                 data is shifted compared to the base address of
5765                 the source coarray.
5766     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
5767                 must be a positive number.
5768     SRC         intent(in) Array descriptor of the local array
5769                 to be transferred to the remote image.
5770     SRC_VECTOR  intent(in) Array descriptor of the local array
5771                 to be transferred to the remote image
5772     DST_KIND    intent(in) Kind of the destination argument
5773     SRC_KIND    intent(in) Kind of the source argument
5774     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5775                 known at compile time that the DEST and SRC
5776                 either cannot overlap or overlap (fully or
5777                 partially) such that walking SRC and DEST in
5778                 element wise element order (honoring the stride
5779                 value) will not lead to wrong results.
5780                 Otherwise, the value is 'true'.
5781     STAT        intent(out) when non-NULL give the result of the
5782                 operation, i.e., zero on success and non-zero on
5783                 error.  When NULL and an error occurs, then an
5784                 error message is printed and the program is
5785                 terminated.
5786
5787_NOTES_
5788     It is permitted to have the same image index for both
5789     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
5790     the send-from might (partially) overlap in that case.  The
5791     implementation has to take care that it handles this case, e.g.
5792     using 'memmove' which handles (partially) overlapping memory.  If
5793     MAY_REQUIRE_TMP is true, the library might additionally create a
5794     temporary variable, unless additional checks show that this is not
5795     required (e.g.  because walking backward is possible or because
5796     both arrays are contiguous and 'memmove' takes care of overlap
5797     issues).
5798
5799     Note that the assignment of a scalar to an array is permitted.  In
5800     addition, the library has to handle numeric-type conversion and for
5801     strings, padding and different character kinds.
5802
5803
5804File: gfortran.info,  Node: _gfortran_caf_send_by_ref,  Next: _gfortran_caf_get_by_ref,  Prev: _gfortran_caf_sendget,  Up: Function ABI Documentation
5805
58068.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options
5807-------------------------------------------------------------------------------------------------------------------------
5808
5809_Description_:
5810     Called to send a scalar, an array section or a whole array from a
5811     local to a remote image identified by the IMAGE_INDEX.
5812
5813_Syntax_:
5814     'void _gfortran_caf_send_by_ref (caf_token_t token, int
5815     image_index, gfc_descriptor_t *src, caf_reference_t *refs, int
5816     dst_kind, int src_kind, bool may_require_tmp, bool
5817     dst_reallocatable, int *stat, int dst_type)'
5818
5819_Arguments_:
5820     TOKEN       intent(in) An opaque pointer identifying the
5821                 coarray.
5822     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5823                 positive number.
5824     SRC         intent(in) Array descriptor of the local array
5825                 to be transferred to the remote image
5826     REFS        intent(in) The references on the remote array to
5827                 store the data given by src.  Guaranteed to have
5828                 at least one entry.
5829     DST_KIND    intent(in) Kind of the destination argument
5830     SRC_KIND    intent(in) Kind of the source argument
5831     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5832                 known at compile time that the DEST and SRC
5833                 either cannot overlap or overlap (fully or
5834                 partially) such that walking SRC and DEST in
5835                 element wise element order (honoring the stride
5836                 value) will not lead to wrong results.
5837                 Otherwise, the value is 'true'.
5838     DST_REALLOCATABLEintent(in) Set when the destination is of
5839                 allocatable or pointer type and the refs will
5840                 allow reallocation, i.e., the ref is a full
5841                 array or component ref.
5842     STAT        intent(out) When non-'NULL' give the result of
5843                 the operation, i.e., zero on success and
5844                 non-zero on error.  When 'NULL' and an error
5845                 occurs, then an error message is printed and the
5846                 program is terminated.
5847     DST_TYPE    intent(in) Give the type of the destination.
5848                 When the destination is not an array, than the
5849                 precise type, e.g.  of a component in a derived
5850                 type, is not known, but provided here.
5851
5852_NOTES_
5853     It is permitted to have IMAGE_INDEX equal the current image; the
5854     memory of the send-to and the send-from might (partially) overlap
5855     in that case.  The implementation has to take care that it handles
5856     this case, e.g.  using 'memmove' which handles (partially)
5857     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5858     additionally create a temporary variable, unless additional checks
5859     show that this is not required (e.g.  because walking backward is
5860     possible or because both arrays are contiguous and 'memmove' takes
5861     care of overlap issues).
5862
5863     Note that the assignment of a scalar to an array is permitted.  In
5864     addition, the library has to handle numeric-type conversion and for
5865     strings, padding and different character kinds.
5866
5867     Because of the more complicated references possible some operations
5868     may be unsupported by certain libraries.  The library is expected
5869     to issue a precise error message why the operation is not
5870     permitted.
5871
5872
5873File: gfortran.info,  Node: _gfortran_caf_get_by_ref,  Next: _gfortran_caf_sendget_by_ref,  Prev: _gfortran_caf_send_by_ref,  Up: Function ABI Documentation
5874
58758.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references
5876-----------------------------------------------------------------------------------------------
5877
5878_Description_:
5879     Called to get a scalar, an array section or a whole array from a
5880     remote image identified by the IMAGE_INDEX.
5881
5882_Syntax_:
5883     'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index,
5884     caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int
5885     src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat,
5886     int src_type)'
5887
5888_Arguments_:
5889     TOKEN       intent(in) An opaque pointer identifying the
5890                 coarray.
5891     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5892                 positive number.
5893     REFS        intent(in) The references to apply to the remote
5894                 structure to get the data.
5895     DST         intent(in) Array descriptor of the local array
5896                 to store the data transferred from the remote
5897                 image.  May be reallocated where needed and when
5898                 DST_REALLOCATABLE allows it.
5899     DST_KIND    intent(in) Kind of the destination argument
5900     SRC_KIND    intent(in) Kind of the source argument
5901     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5902                 known at compile time that the DEST and SRC
5903                 either cannot overlap or overlap (fully or
5904                 partially) such that walking SRC and DEST in
5905                 element wise element order (honoring the stride
5906                 value) will not lead to wrong results.
5907                 Otherwise, the value is 'true'.
5908     DST_REALLOCATABLEintent(in) Set when DST is of allocatable or
5909                 pointer type and its refs allow reallocation,
5910                 i.e., the full array or a component is
5911                 referenced.
5912     STAT        intent(out) When non-'NULL' give the result of
5913                 the operation, i.e., zero on success and
5914                 non-zero on error.  When 'NULL' and an error
5915                 occurs, then an error message is printed and the
5916                 program is terminated.
5917     SRC_TYPE    intent(in) Give the type of the source.  When
5918                 the source is not an array, than the precise
5919                 type, e.g.  of a component in a derived type, is
5920                 not known, but provided here.
5921
5922_NOTES_
5923     It is permitted to have 'image_index' equal the current image; the
5924     memory of the send-to and the send-from might (partially) overlap
5925     in that case.  The implementation has to take care that it handles
5926     this case, e.g.  using 'memmove' which handles (partially)
5927     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5928     additionally create a temporary variable, unless additional checks
5929     show that this is not required (e.g.  because walking backward is
5930     possible or because both arrays are contiguous and 'memmove' takes
5931     care of overlap issues).
5932
5933     Note that the library has to handle numeric-type conversion and for
5934     strings, padding and different character kinds.
5935
5936     Because of the more complicated references possible some operations
5937     may be unsupported by certain libraries.  The library is expected
5938     to issue a precise error message why the operation is not
5939     permitted.
5940
5941
5942File: gfortran.info,  Node: _gfortran_caf_sendget_by_ref,  Next: _gfortran_caf_lock,  Prev: _gfortran_caf_get_by_ref,  Up: Function ABI Documentation
5943
59448.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides
5945-------------------------------------------------------------------------------------------------------------------
5946
5947_Description_:
5948     Called to send a scalar, an array section or a whole array from a
5949     remote image identified by the SRC_IMAGE_INDEX to a remote image
5950     identified by the DST_IMAGE_INDEX.
5951
5952_Syntax_:
5953     'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int
5954     dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token,
5955     int src_image_index, caf_reference_t *src_refs, int dst_kind, int
5956     src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int
5957     dst_type, int src_type)'
5958
5959_Arguments_:
5960     DST_TOKEN   intent(in) An opaque pointer identifying the
5961                 destination coarray.
5962     DST_IMAGE_INDEXintent(in) The ID of the destination remote
5963                 image; must be a positive number.
5964     DST_REFS    intent(in) The references on the remote array to
5965                 store the data given by the source.  Guaranteed
5966                 to have at least one entry.
5967     SRC_TOKEN   intent(in) An opaque pointer identifying the
5968                 source coarray.
5969     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
5970                 must be a positive number.
5971     SRC_REFS    intent(in) The references to apply to the remote
5972                 structure to get the data.
5973     DST_KIND    intent(in) Kind of the destination argument
5974     SRC_KIND    intent(in) Kind of the source argument
5975     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5976                 known at compile time that the DEST and SRC
5977                 either cannot overlap or overlap (fully or
5978                 partially) such that walking SRC and DEST in
5979                 element wise element order (honoring the stride
5980                 value) will not lead to wrong results.
5981                 Otherwise, the value is 'true'.
5982     DST_STAT    intent(out) when non-'NULL' give the result of
5983                 the send-operation, i.e., zero on success and
5984                 non-zero on error.  When 'NULL' and an error
5985                 occurs, then an error message is printed and the
5986                 program is terminated.
5987     SRC_STAT    intent(out) When non-'NULL' give the result of
5988                 the get-operation, i.e., zero on success and
5989                 non-zero on error.  When 'NULL' and an error
5990                 occurs, then an error message is printed and the
5991                 program is terminated.
5992     DST_TYPE    intent(in) Give the type of the destination.
5993                 When the destination is not an array, than the
5994                 precise type, e.g.  of a component in a derived
5995                 type, is not known, but provided here.
5996     SRC_TYPE    intent(in) Give the type of the source.  When
5997                 the source is not an array, than the precise
5998                 type, e.g.  of a component in a derived type, is
5999                 not known, but provided here.
6000
6001_NOTES_
6002     It is permitted to have the same image index for both
6003     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
6004     the send-from might (partially) overlap in that case.  The
6005     implementation has to take care that it handles this case, e.g.
6006     using 'memmove' which handles (partially) overlapping memory.  If
6007     MAY_REQUIRE_TMP is true, the library might additionally create a
6008     temporary variable, unless additional checks show that this is not
6009     required (e.g.  because walking backward is possible or because
6010     both arrays are contiguous and 'memmove' takes care of overlap
6011     issues).
6012
6013     Note that the assignment of a scalar to an array is permitted.  In
6014     addition, the library has to handle numeric-type conversion and for
6015     strings, padding and different character kinds.
6016
6017     Because of the more complicated references possible some operations
6018     may be unsupported by certain libraries.  The library is expected
6019     to issue a precise error message why the operation is not
6020     permitted.
6021
6022
6023File: gfortran.info,  Node: _gfortran_caf_lock,  Next: _gfortran_caf_unlock,  Prev: _gfortran_caf_sendget_by_ref,  Up: Function ABI Documentation
6024
60258.2.17 '_gfortran_caf_lock' -- Locking a lock variable
6026------------------------------------------------------
6027
6028_Description_:
6029     Acquire a lock on the given image on a scalar locking variable or
6030     for the given array element for an array-valued variable.  If the
6031     AQUIRED_LOCK is 'NULL', the function returns after having obtained
6032     the lock.  If it is non-'NULL', then ACQUIRED_LOCK is assigned the
6033     value true (one) when the lock could be obtained and false (zero)
6034     otherwise.  Locking a lock variable which has already been locked
6035     by the same image is an error.
6036
6037_Syntax_:
6038     'void _gfortran_caf_lock (caf_token_t token, size_t index, int
6039     image_index, int *aquired_lock, int *stat, char *errmsg, size_t
6040     errmsg_len)'
6041
6042_Arguments_:
6043     TOKEN       intent(in) An opaque pointer identifying the
6044                 coarray.
6045     INDEX       intent(in) Array index; first array index is 0.
6046                 For scalars, it is always 0.
6047     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6048                 positive number.
6049     AQUIRED_LOCKintent(out) If not NULL, it returns whether lock
6050                 could be obtained.
6051     STAT        intent(out) Stores the STAT=; may be NULL.
6052     ERRMSG      intent(out) When an error occurs, this will be
6053                 set to an error message; may be NULL.
6054     ERRMSG_LEN  intent(in) the buffer size of errmsg
6055
6056_NOTES_
6057     This function is also called for critical blocks; for those, the
6058     array index is always zero and the image index is one.  Libraries
6059     are permitted to use other images for critical-block locking
6060     variables.
6061
6062
6063File: gfortran.info,  Node: _gfortran_caf_unlock,  Next: _gfortran_caf_event_post,  Prev: _gfortran_caf_lock,  Up: Function ABI Documentation
6064
60658.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable
6066--------------------------------------------------------
6067
6068_Description_:
6069     Release a lock on the given image on a scalar locking variable or
6070     for the given array element for an array-valued variable.
6071     Unlocking a lock variable which is unlocked or has been locked by a
6072     different image is an error.
6073
6074_Syntax_:
6075     'void _gfortran_caf_unlock (caf_token_t token, size_t index, int
6076     image_index, int *stat, char *errmsg, size_t errmsg_len)'
6077
6078_Arguments_:
6079     TOKEN       intent(in) An opaque pointer identifying the
6080                 coarray.
6081     INDEX       intent(in) Array index; first array index is 0.
6082                 For scalars, it is always 0.
6083     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6084                 positive number.
6085     STAT        intent(out) For allocatable coarrays, stores the
6086                 STAT=; may be NULL.
6087     ERRMSG      intent(out) When an error occurs, this will be
6088                 set to an error message; may be NULL.
6089     ERRMSG_LEN  intent(in) the buffer size of errmsg
6090
6091_NOTES_
6092     This function is also called for critical block; for those, the
6093     array index is always zero and the image index is one.  Libraries
6094     are permitted to use other images for critical-block locking
6095     variables.
6096
6097
6098File: gfortran.info,  Node: _gfortran_caf_event_post,  Next: _gfortran_caf_event_wait,  Prev: _gfortran_caf_unlock,  Up: Function ABI Documentation
6099
61008.2.19 '_gfortran_caf_event_post' -- Post an event
6101--------------------------------------------------
6102
6103_Description_:
6104     Increment the event count of the specified event variable.
6105
6106_Syntax_:
6107     'void _gfortran_caf_event_post (caf_token_t token, size_t index,
6108     int image_index, int *stat, char *errmsg, size_t errmsg_len)'
6109
6110_Arguments_:
6111     TOKEN       intent(in) An opaque pointer identifying the
6112                 coarray.
6113     INDEX       intent(in) Array index; first array index is 0.
6114                 For scalars, it is always 0.
6115     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6116                 positive number; zero indicates the current
6117                 image, when accessed noncoindexed.
6118     STAT        intent(out) Stores the STAT=; may be NULL.
6119     ERRMSG      intent(out) When an error occurs, this will be
6120                 set to an error message; may be NULL.
6121     ERRMSG_LEN  intent(in) the buffer size of errmsg
6122
6123_NOTES_
6124     This acts like an atomic add of one to the remote image's event
6125     variable.  The statement is an image-control statement but does not
6126     imply sync memory.  Still, all preceeding push communications of
6127     this image to the specified remote image have to be completed
6128     before 'event_wait' on the remote image returns.
6129
6130
6131File: gfortran.info,  Node: _gfortran_caf_event_wait,  Next: _gfortran_caf_event_query,  Prev: _gfortran_caf_event_post,  Up: Function ABI Documentation
6132
61338.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred
6134----------------------------------------------------------------
6135
6136_Description_:
6137     Wait until the event count has reached at least the specified
6138     UNTIL_COUNT; if so, atomically decrement the event variable by this
6139     amount and return.
6140
6141_Syntax_:
6142     'void _gfortran_caf_event_wait (caf_token_t token, size_t index,
6143     int until_count, int *stat, char *errmsg, size_t errmsg_len)'
6144
6145_Arguments_:
6146     TOKEN       intent(in) An opaque pointer identifying the
6147                 coarray.
6148     INDEX       intent(in) Array index; first array index is 0.
6149                 For scalars, it is always 0.
6150     UNTIL_COUNT intent(in) The number of events which have to be
6151                 available before the function returns.
6152     STAT        intent(out) Stores the STAT=; may be NULL.
6153     ERRMSG      intent(out) When an error occurs, this will be
6154                 set to an error message; may be NULL.
6155     ERRMSG_LEN  intent(in) the buffer size of errmsg
6156
6157_NOTES_
6158     This function only operates on a local coarray.  It acts like a
6159     loop checking atomically the value of the event variable, breaking
6160     if the value is greater or equal the requested number of counts.
6161     Before the function returns, the event variable has to be
6162     decremented by the requested UNTIL_COUNT value.  A possible
6163     implementation would be a busy loop for a certain number of spins
6164     (possibly depending on the number of threads relative to the number
6165     of available cores) followed by another waiting strategy such as a
6166     sleeping wait (possibly with an increasing number of sleep time)
6167     or, if possible, a futex wait.
6168
6169     The statement is an image-control statement but does not imply sync
6170     memory.  Still, all preceeding push communications of this image to
6171     the specified remote image have to be completed before 'event_wait'
6172     on the remote image returns.
6173
6174
6175File: gfortran.info,  Node: _gfortran_caf_event_query,  Next: _gfortran_caf_sync_all,  Prev: _gfortran_caf_event_wait,  Up: Function ABI Documentation
6176
61778.2.21 '_gfortran_caf_event_query' -- Query event count
6178-------------------------------------------------------
6179
6180_Description_:
6181     Return the event count of the specified event variable.
6182
6183_Syntax_:
6184     'void _gfortran_caf_event_query (caf_token_t token, size_t index,
6185     int image_index, int *count, int *stat)'
6186
6187_Arguments_:
6188     TOKEN       intent(in) An opaque pointer identifying the
6189                 coarray.
6190     INDEX       intent(in) Array index; first array index is 0.
6191                 For scalars, it is always 0.
6192     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6193                 positive number; zero indicates the current
6194                 image when accessed noncoindexed.
6195     COUNT       intent(out) The number of events currently
6196                 posted to the event variable.
6197     STAT        intent(out) Stores the STAT=; may be NULL.
6198
6199_NOTES_
6200     The typical use is to check the local event variable to only call
6201     'event_wait' when the data is available.  However, a coindexed
6202     variable is permitted; there is no ordering or synchronization
6203     implied.  It acts like an atomic fetch of the value of the event
6204     variable.
6205
6206
6207File: gfortran.info,  Node: _gfortran_caf_sync_all,  Next: _gfortran_caf_sync_images,  Prev: _gfortran_caf_event_query,  Up: Function ABI Documentation
6208
62098.2.22 '_gfortran_caf_sync_all' -- All-image barrier
6210----------------------------------------------------
6211
6212_Description_:
6213     Synchronization of all images in the current team; the program only
6214     continues on a given image after this function has been called on
6215     all images of the current team.  Additionally, it ensures that all
6216     pending data transfers of previous segment have completed.
6217
6218_Syntax_:
6219     'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t
6220     errmsg_len)'
6221
6222_Arguments_:
6223     STAT        intent(out) Stores the status STAT= and may be
6224                 NULL.
6225     ERRMSG      intent(out) When an error occurs, this will be
6226                 set to an error message; may be NULL.
6227     ERRMSG_LEN  intent(in) the buffer size of errmsg
6228
6229
6230File: gfortran.info,  Node: _gfortran_caf_sync_images,  Next: _gfortran_caf_sync_memory,  Prev: _gfortran_caf_sync_all,  Up: Function ABI Documentation
6231
62328.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images
6233-----------------------------------------------------------------
6234
6235_Description_:
6236     Synchronization between the specified images; the program only
6237     continues on a given image after this function has been called on
6238     all images specified for that image.  Note that one image can wait
6239     for all other images in the current team (e.g.  via 'sync
6240     images(*)') while those only wait for that specific image.
6241     Additionally, 'sync images' ensures that all pending data transfers
6242     of previous segments have completed.
6243
6244_Syntax_:
6245     'void _gfortran_caf_sync_images (int count, int images[], int
6246     *stat, char *errmsg, size_t errmsg_len)'
6247
6248_Arguments_:
6249     COUNT       intent(in) The number of images which are
6250                 provided in the next argument.  For a zero-sized
6251                 array, the value is zero.  For 'sync images
6252                 (*)', the value is -1.
6253     IMAGES      intent(in) An array with the images provided by
6254                 the user.  If COUNT is zero, a NULL pointer is
6255                 passed.
6256     STAT        intent(out) Stores the status STAT= and may be
6257                 NULL.
6258     ERRMSG      intent(out) When an error occurs, this will be
6259                 set to an error message; may be NULL.
6260     ERRMSG_LEN  intent(in) the buffer size of errmsg
6261
6262
6263File: gfortran.info,  Node: _gfortran_caf_sync_memory,  Next: _gfortran_caf_error_stop,  Prev: _gfortran_caf_sync_images,  Up: Function ABI Documentation
6264
62658.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
6266--------------------------------------------------------------------------------------
6267
6268_Description_:
6269     Acts as optimization barrier between different segments.  It also
6270     ensures that all pending memory operations of this image have been
6271     completed.
6272
6273_Syntax_:
6274     'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t
6275     errmsg_len)'
6276
6277_Arguments_:
6278     STAT        intent(out) Stores the status STAT= and may be
6279                 NULL.
6280     ERRMSG      intent(out) When an error occurs, this will be
6281                 set to an error message; may be NULL.
6282     ERRMSG_LEN  intent(in) the buffer size of errmsg
6283
6284_NOTE_ A simple implementation could be
6285     '__asm__ __volatile__ ("":::"memory")' to prevent code movements.
6286
6287
6288File: gfortran.info,  Node: _gfortran_caf_error_stop,  Next: _gfortran_caf_error_stop_str,  Prev: _gfortran_caf_sync_memory,  Up: Function ABI Documentation
6289
62908.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code
6291---------------------------------------------------------------------
6292
6293_Description_:
6294     Invoked for an 'ERROR STOP' statement which has an integer
6295     argument.  The function should terminate the program with the
6296     specified exit code.
6297
6298_Syntax_:
6299     'void _gfortran_caf_error_stop (int error)'
6300
6301_Arguments_:
6302     ERROR       intent(in) The exit status to be used.
6303
6304
6305File: gfortran.info,  Node: _gfortran_caf_error_stop_str,  Next: _gfortran_caf_fail_image,  Prev: _gfortran_caf_error_stop,  Up: Function ABI Documentation
6306
63078.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string
6308----------------------------------------------------------------------
6309
6310_Description_:
6311     Invoked for an 'ERROR STOP' statement which has a string as
6312     argument.  The function should terminate the program with a
6313     nonzero-exit code.
6314
6315_Syntax_:
6316     'void _gfortran_caf_error_stop (const char *string, size_t len)'
6317
6318_Arguments_:
6319     STRING      intent(in) the error message (not zero
6320                 terminated)
6321     LEN         intent(in) the length of the string
6322
6323
6324File: gfortran.info,  Node: _gfortran_caf_fail_image,  Next: _gfortran_caf_atomic_define,  Prev: _gfortran_caf_error_stop_str,  Up: Function ABI Documentation
6325
63268.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution
6327--------------------------------------------------------------------------------
6328
6329_Description_:
6330     Invoked for an 'FAIL IMAGE' statement.  The function should
6331     terminate the current image.
6332
6333_Syntax_:
6334     'void _gfortran_caf_fail_image ()'
6335
6336_NOTES_
6337     This function follows TS18508.
6338
6339
6340File: gfortran.info,  Node: _gfortran_caf_atomic_define,  Next: _gfortran_caf_atomic_ref,  Prev: _gfortran_caf_fail_image,  Up: Function ABI Documentation
6341
63428.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment
6343------------------------------------------------------------------
6344
6345_Description_:
6346     Assign atomically a value to an integer or logical variable.
6347
6348_Syntax_:
6349     'void _gfortran_caf_atomic_define (caf_token_t token, size_t
6350     offset, int image_index, void *value, int *stat, int type, int
6351     kind)'
6352
6353_Arguments_:
6354     TOKEN       intent(in) An opaque pointer identifying the
6355                 coarray.
6356     OFFSET      intent(in) By which amount of bytes the actual
6357                 data is shifted compared to the base address of
6358                 the coarray.
6359     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6360                 positive number; zero indicates the current
6361                 image when used noncoindexed.
6362     VALUE       intent(in) the value to be assigned, passed by
6363                 reference
6364     STAT        intent(out) Stores the status STAT= and may be
6365                 NULL.
6366     TYPE        intent(in) The data type, i.e.  'BT_INTEGER' (1)
6367                 or 'BT_LOGICAL' (2).
6368     KIND        intent(in) The kind value (only 4; always 'int')
6369
6370
6371File: gfortran.info,  Node: _gfortran_caf_atomic_ref,  Next: _gfortran_caf_atomic_cas,  Prev: _gfortran_caf_atomic_define,  Up: Function ABI Documentation
6372
63738.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference
6374--------------------------------------------------------------
6375
6376_Description_:
6377     Reference atomically a value of a kind-4 integer or logical
6378     variable.
6379
6380_Syntax_:
6381     'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
6382     int image_index, void *value, int *stat, int type, int kind)'
6383
6384_Arguments_:
6385     TOKEN       intent(in) An opaque pointer identifying the
6386                 coarray.
6387     OFFSET      intent(in) By which amount of bytes the actual
6388                 data is shifted compared to the base address of
6389                 the coarray.
6390     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6391                 positive number; zero indicates the current
6392                 image when used noncoindexed.
6393     VALUE       intent(out) The variable assigned the atomically
6394                 referenced variable.
6395     STAT        intent(out) Stores the status STAT= and may be
6396                 NULL.
6397     TYPE        the data type, i.e.  'BT_INTEGER' (1) or
6398                 'BT_LOGICAL' (2).
6399     KIND        The kind value (only 4; always 'int')
6400
6401
6402File: gfortran.info,  Node: _gfortran_caf_atomic_cas,  Next: _gfortran_caf_atomic_op,  Prev: _gfortran_caf_atomic_ref,  Up: Function ABI Documentation
6403
64048.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap
6405------------------------------------------------------------
6406
6407_Description_:
6408     Atomic compare and swap of a kind-4 integer or logical variable.
6409     Assigns atomically the specified value to the atomic variable, if
6410     the latter has the value specified by the passed condition value.
6411
6412_Syntax_:
6413     'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
6414     int image_index, void *old, void *compare, void *new_val, int
6415     *stat, int type, int kind)'
6416
6417_Arguments_:
6418     TOKEN       intent(in) An opaque pointer identifying the
6419                 coarray.
6420     OFFSET      intent(in) By which amount of bytes the actual
6421                 data is shifted compared to the base address of
6422                 the coarray.
6423     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6424                 positive number; zero indicates the current
6425                 image when used noncoindexed.
6426     OLD         intent(out) The value which the atomic variable
6427                 had just before the cas operation.
6428     COMPARE     intent(in) The value used for comparision.
6429     NEW_VAL     intent(in) The new value for the atomic
6430                 variable, assigned to the atomic variable, if
6431                 'compare' equals the value of the atomic
6432                 variable.
6433     STAT        intent(out) Stores the status STAT= and may be
6434                 NULL.
6435     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6436                 or 'BT_LOGICAL' (2).
6437     KIND        intent(in) The kind value (only 4; always 'int')
6438
6439
6440File: gfortran.info,  Node: _gfortran_caf_atomic_op,  Next: _gfortran_caf_co_broadcast,  Prev: _gfortran_caf_atomic_cas,  Up: Function ABI Documentation
6441
64428.2.31 '_gfortran_caf_atomic_op' -- Atomic operation
6443----------------------------------------------------
6444
6445_Description_:
6446     Apply an operation atomically to an atomic integer or logical
6447     variable.  After the operation, OLD contains the value just before
6448     the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
6449     atomically the 'value' to the atomic integer variable or does a
6450     bitwise AND, OR or exclusive OR between the atomic variable and
6451     VALUE; the result is then stored in the atomic variable.
6452
6453_Syntax_:
6454     'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
6455     offset, int image_index, void *value, void *old, int *stat, int
6456     type, int kind)'
6457
6458_Arguments_:
6459     OP          intent(in) the operation to be performed;
6460                 possible values 'GFC_CAF_ATOMIC_ADD' (1),
6461                 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR'
6462                 (3), 'GFC_CAF_ATOMIC_XOR' (4).
6463     TOKEN       intent(in) An opaque pointer identifying the
6464                 coarray.
6465     OFFSET      intent(in) By which amount of bytes the actual
6466                 data is shifted compared to the base address of
6467                 the coarray.
6468     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6469                 positive number; zero indicates the current
6470                 image when used noncoindexed.
6471     OLD         intent(out) The value which the atomic variable
6472                 had just before the atomic operation.
6473     VAL         intent(in) The new value for the atomic
6474                 variable, assigned to the atomic variable, if
6475                 'compare' equals the value of the atomic
6476                 variable.
6477     STAT        intent(out) Stores the status STAT= and may be
6478                 NULL.
6479     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6480                 or 'BT_LOGICAL' (2)
6481     KIND        intent(in) the kind value (only 4; always 'int')
6482
6483
6484File: gfortran.info,  Node: _gfortran_caf_co_broadcast,  Next: _gfortran_caf_co_max,  Prev: _gfortran_caf_atomic_op,  Up: Function ABI Documentation
6485
64868.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images
6487-----------------------------------------------------------------
6488
6489_Description_:
6490     Distribute a value from a given image to all other images in the
6491     team.  Has to be called collectively.
6492
6493_Syntax_:
6494     'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
6495     source_image, int *stat, char *errmsg, size_t errmsg_len)'
6496
6497_Arguments_:
6498     A           intent(inout) An array descriptor with the data
6499                 to be broadcasted (on SOURCE_IMAGE) or to be
6500                 received (other images).
6501     SOURCE_IMAGEintent(in) The ID of the image from which the
6502                 data should be broadcasted.
6503     STAT        intent(out) Stores the status STAT= and may be
6504                 NULL.
6505     ERRMSG      intent(out) When an error occurs, this will be
6506                 set to an error message; may be NULL.
6507     ERRMSG_LEN  intent(in) the buffer size of errmsg.
6508
6509
6510File: gfortran.info,  Node: _gfortran_caf_co_max,  Next: _gfortran_caf_co_min,  Prev: _gfortran_caf_co_broadcast,  Up: Function ABI Documentation
6511
65128.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction
6513-------------------------------------------------------------
6514
6515_Description_:
6516     Calculates for each array element of the variable A the maximum
6517     value for that element in the current team; if RESULT_IMAGE has the
6518     value 0, the result shall be stored on all images, otherwise, only
6519     on the specified image.  This function operates on numeric values
6520     and character strings.
6521
6522_Syntax_:
6523     'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
6524     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6525
6526_Arguments_:
6527     A           intent(inout) An array descriptor for the data
6528                 to be processed.  On the destination image(s)
6529                 the result overwrites the old content.
6530     RESULT_IMAGEintent(in) The ID of the image to which the
6531                 reduced value should be copied to; if zero, it
6532                 has to be copied to all images.
6533     STAT        intent(out) Stores the status STAT= and may be
6534                 NULL.
6535     ERRMSG      intent(out) When an error occurs, this will be
6536                 set to an error message; may be NULL.
6537     A_LEN       intent(in) the string length of argument A
6538     ERRMSG_LEN  intent(in) the buffer size of errmsg
6539
6540_NOTES_
6541     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6542     all images except of the specified one become undefined; hence, the
6543     library may make use of this.
6544
6545
6546File: gfortran.info,  Node: _gfortran_caf_co_min,  Next: _gfortran_caf_co_sum,  Prev: _gfortran_caf_co_max,  Up: Function ABI Documentation
6547
65488.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction
6549-------------------------------------------------------------
6550
6551_Description_:
6552     Calculates for each array element of the variable A the minimum
6553     value for that element in the current team; if RESULT_IMAGE has the
6554     value 0, the result shall be stored on all images, otherwise, only
6555     on the specified image.  This function operates on numeric values
6556     and character strings.
6557
6558_Syntax_:
6559     'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
6560     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6561
6562_Arguments_:
6563     A           intent(inout) An array descriptor for the data
6564                 to be processed.  On the destination image(s)
6565                 the result overwrites the old content.
6566     RESULT_IMAGEintent(in) The ID of the image to which the
6567                 reduced value should be copied to; if zero, it
6568                 has to be copied to all images.
6569     STAT        intent(out) Stores the status STAT= and may be
6570                 NULL.
6571     ERRMSG      intent(out) When an error occurs, this will be
6572                 set to an error message; may be NULL.
6573     A_LEN       intent(in) the string length of argument A
6574     ERRMSG_LEN  intent(in) the buffer size of errmsg
6575
6576_NOTES_
6577     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6578     all images except of the specified one become undefined; hence, the
6579     library may make use of this.
6580
6581
6582File: gfortran.info,  Node: _gfortran_caf_co_sum,  Next: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_min,  Up: Function ABI Documentation
6583
65848.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction
6585-------------------------------------------------------------
6586
6587_Description_:
6588     Calculates for each array element of the variable A the sum of all
6589     values for that element in the current team; if RESULT_IMAGE has
6590     the value 0, the result shall be stored on all images, otherwise,
6591     only on the specified image.  This function operates on numeric
6592     values only.
6593
6594_Syntax_:
6595     'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
6596     int *stat, char *errmsg, size_t errmsg_len)'
6597
6598_Arguments_:
6599     A           intent(inout) An array descriptor with the data
6600                 to be processed.  On the destination image(s)
6601                 the result overwrites the old content.
6602     RESULT_IMAGEintent(in) The ID of the image to which the
6603                 reduced value should be copied to; if zero, it
6604                 has to be copied to all images.
6605     STAT        intent(out) Stores the status STAT= and may be
6606                 NULL.
6607     ERRMSG      intent(out) When an error occurs, this will be
6608                 set to an error message; may be NULL.
6609     ERRMSG_LEN  intent(in) the buffer size of errmsg
6610
6611_NOTES_
6612     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6613     all images except of the specified one become undefined; hence, the
6614     library may make use of this.
6615
6616
6617File: gfortran.info,  Node: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_sum,  Up: Function ABI Documentation
6618
66198.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction
6620----------------------------------------------------------------
6621
6622_Description_:
6623     Calculates for each array element of the variable A the reduction
6624     value for that element in the current team; if RESULT_IMAGE has the
6625     value 0, the result shall be stored on all images, otherwise, only
6626     on the specified image.  The OPR is a pure function doing a
6627     mathematically commutative and associative operation.
6628
6629     The OPR_FLAGS denote the following; the values are bitwise ored.
6630     'GFC_CAF_BYREF' (1) if the result should be returned by reference;
6631     'GFC_CAF_HIDDENLEN' (2) whether the result and argument string
6632     lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE'
6633     (4) whether the arguments shall be passed by value,
6634     'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
6635     descriptor.
6636
6637_Syntax_:
6638     'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
6639     (void *, void *), int opr_flags, int result_image, int *stat, char
6640     *errmsg, int a_len, size_t errmsg_len)'
6641
6642_Arguments_:
6643     A           intent(inout) An array descriptor with the data
6644                 to be processed.  On the destination image(s)
6645                 the result overwrites the old content.
6646     OPR         intent(in) Function pointer to the reduction
6647                 function
6648     OPR_FLAGS   intent(in) Flags regarding the reduction
6649                 function
6650     RESULT_IMAGEintent(in) The ID of the image to which the
6651                 reduced value should be copied to; if zero, it
6652                 has to be copied to all images.
6653     STAT        intent(out) Stores the status STAT= and may be
6654                 NULL.
6655     ERRMSG      intent(out) When an error occurs, this will be
6656                 set to an error message; may be NULL.
6657     A_LEN       intent(in) the string length of argument A
6658     ERRMSG_LEN  intent(in) the buffer size of errmsg
6659
6660_NOTES_
6661     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6662     all images except of the specified one become undefined; hence, the
6663     library may make use of this.
6664
6665     For character arguments, the result is passed as first argument,
6666     followed by the result string length, next come the two string
6667     arguments, followed by the two hidden string length arguments.
6668     With C binding, there are no hidden arguments and by-reference
6669     passing and either only a single character is passed or an array
6670     descriptor.
6671
6672
6673File: gfortran.info,  Node: Intrinsic Procedures,  Next: Intrinsic Modules,  Prev: Coarray Programming,  Up: Top
6674
66759 Intrinsic Procedures
6676**********************
6677
6678* Menu:
6679
6680* Introduction:         Introduction to Intrinsics
6681* 'ABORT':         ABORT,     Abort the program
6682* 'ABS':           ABS,       Absolute value
6683* 'ACCESS':        ACCESS,    Checks file access modes
6684* 'ACHAR':         ACHAR,     Character in ASCII collating sequence
6685* 'ACOS':          ACOS,      Arccosine function
6686* 'ACOSD':         ACOSD,     Arccosine function, degrees
6687* 'ACOSH':         ACOSH,     Inverse hyperbolic cosine function
6688* 'ADJUSTL':       ADJUSTL,   Left adjust a string
6689* 'ADJUSTR':       ADJUSTR,   Right adjust a string
6690* 'AIMAG':         AIMAG,     Imaginary part of complex number
6691* 'AINT':          AINT,      Truncate to a whole number
6692* 'ALARM':         ALARM,     Set an alarm clock
6693* 'ALL':           ALL,       Determine if all values are true
6694* 'ALLOCATED':     ALLOCATED, Status of allocatable entity
6695* 'AND':           AND,       Bitwise logical AND
6696* 'ANINT':         ANINT,     Nearest whole number
6697* 'ANY':           ANY,       Determine if any values are true
6698* 'ASIN':          ASIN,      Arcsine function
6699* 'ASIND':         ASIND,     Arcsine function, degrees
6700* 'ASINH':         ASINH,     Inverse hyperbolic sine function
6701* 'ASSOCIATED':    ASSOCIATED, Status of a pointer or pointer/target pair
6702* 'ATAN':          ATAN,      Arctangent function
6703* 'ATAND':         ATAND,     Arctangent function, degrees
6704* 'ATAN2':         ATAN2,     Arctangent function
6705* 'ATAN2D':        ATAN2D,    Arctangent function, degrees
6706* 'ATANH':         ATANH,     Inverse hyperbolic tangent function
6707* 'ATOMIC_ADD':    ATOMIC_ADD, Atomic ADD operation
6708* 'ATOMIC_AND':    ATOMIC_AND, Atomic bitwise AND operation
6709* 'ATOMIC_CAS':    ATOMIC_CAS, Atomic compare and swap
6710* 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
6711* 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
6712* 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
6713* 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
6714* 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
6715* 'ATOMIC_OR':     ATOMIC_OR, Atomic bitwise OR operation
6716* 'ATOMIC_REF':    ATOMIC_REF, Obtaining the value of a variable atomically
6717* 'ATOMIC_XOR':    ATOMIC_XOR, Atomic bitwise OR operation
6718* 'BACKTRACE':     BACKTRACE, Show a backtrace
6719* 'BESSEL_J0':     BESSEL_J0, Bessel function of the first kind of order 0
6720* 'BESSEL_J1':     BESSEL_J1, Bessel function of the first kind of order 1
6721* 'BESSEL_JN':     BESSEL_JN, Bessel function of the first kind
6722* 'BESSEL_Y0':     BESSEL_Y0, Bessel function of the second kind of order 0
6723* 'BESSEL_Y1':     BESSEL_Y1, Bessel function of the second kind of order 1
6724* 'BESSEL_YN':     BESSEL_YN, Bessel function of the second kind
6725* 'BGE':           BGE,       Bitwise greater than or equal to
6726* 'BGT':           BGT,       Bitwise greater than
6727* 'BIT_SIZE':      BIT_SIZE,  Bit size inquiry function
6728* 'BLE':           BLE,       Bitwise less than or equal to
6729* 'BLT':           BLT,       Bitwise less than
6730* 'BTEST':         BTEST,     Bit test function
6731* 'C_ASSOCIATED':  C_ASSOCIATED, Status of a C pointer
6732* 'C_F_POINTER':   C_F_POINTER, Convert C into Fortran pointer
6733* 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
6734* 'C_FUNLOC':      C_FUNLOC,  Obtain the C address of a procedure
6735* 'C_LOC':         C_LOC,     Obtain the C address of an object
6736* 'C_SIZEOF':      C_SIZEOF,  Size in bytes of an expression
6737* 'CEILING':       CEILING,   Integer ceiling function
6738* 'CHAR':          CHAR,      Integer-to-character conversion function
6739* 'CHDIR':         CHDIR,     Change working directory
6740* 'CHMOD':         CHMOD,     Change access permissions of files
6741* 'CMPLX':         CMPLX,     Complex conversion function
6742* 'CO_BROADCAST':  CO_BROADCAST, Copy a value to all images the current set of images
6743* 'CO_MAX':        CO_MAX,    Maximal value on the current set of images
6744* 'CO_MIN':        CO_MIN,    Minimal value on the current set of images
6745* 'CO_REDUCE':     CO_REDUCE, Reduction of values on the current set of images
6746* 'CO_SUM':        CO_SUM,    Sum of values on the current set of images
6747* 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
6748* 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
6749* 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string
6750* 'COMPLEX':       COMPLEX,   Complex conversion function
6751* 'CONJG':         CONJG,     Complex conjugate function
6752* 'COS':           COS,       Cosine function
6753* 'COSD':          COSD,      Cosine function, degrees
6754* 'COSH':          COSH,      Hyperbolic cosine function
6755* 'COTAN':         COTAN,     Cotangent function
6756* 'COTAND':        COTAND,    Cotangent function, degrees
6757* 'COUNT':         COUNT,     Count occurrences of TRUE in an array
6758* 'CPU_TIME':      CPU_TIME,  CPU time subroutine
6759* 'CSHIFT':        CSHIFT,    Circular shift elements of an array
6760* 'CTIME':         CTIME,     Subroutine (or function) to convert a time into a string
6761* 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
6762* 'DBLE':          DBLE,      Double precision conversion function
6763* 'DCMPLX':        DCMPLX,    Double complex conversion function
6764* 'DIGITS':        DIGITS,    Significant digits function
6765* 'DIM':           DIM,       Positive difference
6766* 'DOT_PRODUCT':   DOT_PRODUCT, Dot product function
6767* 'DPROD':         DPROD,     Double product function
6768* 'DREAL':         DREAL,     Double real part function
6769* 'DSHIFTL':       DSHIFTL,   Combined left shift
6770* 'DSHIFTR':       DSHIFTR,   Combined right shift
6771* 'DTIME':         DTIME,     Execution time subroutine (or function)
6772* 'EOSHIFT':       EOSHIFT,   End-off shift elements of an array
6773* 'EPSILON':       EPSILON,   Epsilon function
6774* 'ERF':           ERF,       Error function
6775* 'ERFC':          ERFC,      Complementary error function
6776* 'ERFC_SCALED':   ERFC_SCALED, Exponentially-scaled complementary error function
6777* 'ETIME':         ETIME,     Execution time subroutine (or function)
6778* 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred
6779* 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
6780* 'EXIT':          EXIT,      Exit the program with status.
6781* 'EXP':           EXP,       Exponential function
6782* 'EXPONENT':      EXPONENT,  Exponent function
6783* 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF,  Query dynamic type for extension
6784* 'FDATE':         FDATE,     Subroutine (or function) to get the current time as a string
6785* 'FGET':          FGET,      Read a single character in stream mode from stdin
6786* 'FGETC':         FGETC,     Read a single character in stream mode
6787* 'FLOOR':         FLOOR,     Integer floor function
6788* 'FLUSH':         FLUSH,     Flush I/O unit(s)
6789* 'FNUM':          FNUM,      File number function
6790* 'FPUT':          FPUT,      Write a single character in stream mode to stdout
6791* 'FPUTC':         FPUTC,     Write a single character in stream mode
6792* 'FRACTION':      FRACTION,  Fractional part of the model representation
6793* 'FREE':          FREE,      Memory de-allocation subroutine
6794* 'FSEEK':         FSEEK,     Low level file positioning subroutine
6795* 'FSTAT':         FSTAT,     Get file status
6796* 'FTELL':         FTELL,     Current stream position
6797* 'GAMMA':         GAMMA,     Gamma function
6798* 'GERROR':        GERROR,    Get last system error message
6799* 'GETARG':        GETARG,    Get command line arguments
6800* 'GET_COMMAND':   GET_COMMAND, Get the entire command line
6801* 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
6802* 'GETCWD':        GETCWD,    Get current working directory
6803* 'GETENV':        GETENV,    Get an environmental variable
6804* 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
6805* 'GETGID':        GETGID,    Group ID function
6806* 'GETLOG':        GETLOG,    Get login name
6807* 'GETPID':        GETPID,    Process ID function
6808* 'GETUID':        GETUID,    User ID function
6809* 'GMTIME':        GMTIME,    Convert time to GMT info
6810* 'HOSTNM':        HOSTNM,    Get system host name
6811* 'HUGE':          HUGE,      Largest number of a kind
6812* 'HYPOT':         HYPOT,     Euclidean distance function
6813* 'IACHAR':        IACHAR,    Code in ASCII collating sequence
6814* 'IALL':          IALL,      Bitwise AND of array elements
6815* 'IAND':          IAND,      Bitwise logical and
6816* 'IANY':          IANY,      Bitwise OR of array elements
6817* 'IARGC':         IARGC,     Get the number of command line arguments
6818* 'IBCLR':         IBCLR,     Clear bit
6819* 'IBITS':         IBITS,     Bit extraction
6820* 'IBSET':         IBSET,     Set bit
6821* 'ICHAR':         ICHAR,     Character-to-integer conversion function
6822* 'IDATE':         IDATE,     Current local time (day/month/year)
6823* 'IEOR':          IEOR,      Bitwise logical exclusive or
6824* 'IERRNO':        IERRNO,    Function to get the last system error number
6825* 'IMAGE_INDEX':   IMAGE_INDEX, Cosubscript to image index conversion
6826* 'INDEX':         INDEX intrinsic, Position of a substring within a string
6827* 'INT':           INT,       Convert to integer type
6828* 'INT2':          INT2,      Convert to 16-bit integer type
6829* 'INT8':          INT8,      Convert to 64-bit integer type
6830* 'IOR':           IOR,       Bitwise logical or
6831* 'IPARITY':       IPARITY,   Bitwise XOR of array elements
6832* 'IRAND':         IRAND,     Integer pseudo-random number
6833* 'IS_IOSTAT_END':  IS_IOSTAT_END, Test for end-of-file value
6834* 'IS_IOSTAT_EOR':  IS_IOSTAT_EOR, Test for end-of-record value
6835* 'ISATTY':        ISATTY,    Whether a unit is a terminal device
6836* 'ISHFT':         ISHFT,     Shift bits
6837* 'ISHFTC':        ISHFTC,    Shift bits circularly
6838* 'ISNAN':         ISNAN,     Tests for a NaN
6839* 'ITIME':         ITIME,     Current local time (hour/minutes/seconds)
6840* 'KILL':          KILL,      Send a signal to a process
6841* 'KIND':          KIND,      Kind of an entity
6842* 'LBOUND':        LBOUND,    Lower dimension bounds of an array
6843* 'LCOBOUND':      LCOBOUND,  Lower codimension bounds of an array
6844* 'LEADZ':         LEADZ,     Number of leading zero bits of an integer
6845* 'LEN':           LEN,       Length of a character entity
6846* 'LEN_TRIM':      LEN_TRIM,  Length of a character entity without trailing blank characters
6847* 'LGE':           LGE,       Lexical greater than or equal
6848* 'LGT':           LGT,       Lexical greater than
6849* 'LINK':          LINK,      Create a hard link
6850* 'LLE':           LLE,       Lexical less than or equal
6851* 'LLT':           LLT,       Lexical less than
6852* 'LNBLNK':        LNBLNK,    Index of the last non-blank character in a string
6853* 'LOC':           LOC,       Returns the address of a variable
6854* 'LOG':           LOG,       Logarithm function
6855* 'LOG10':         LOG10,     Base 10 logarithm function
6856* 'LOG_GAMMA':     LOG_GAMMA, Logarithm of the Gamma function
6857* 'LOGICAL':       LOGICAL,   Convert to logical type
6858* 'LONG':          LONG,      Convert to integer type
6859* 'LSHIFT':        LSHIFT,    Left shift bits
6860* 'LSTAT':         LSTAT,     Get file status
6861* 'LTIME':         LTIME,     Convert time to local time info
6862* 'MALLOC':        MALLOC,    Dynamic memory allocation function
6863* 'MASKL':         MASKL,     Left justified mask
6864* 'MASKR':         MASKR,     Right justified mask
6865* 'MATMUL':        MATMUL,    matrix multiplication
6866* 'MAX':           MAX,       Maximum value of an argument list
6867* 'MAXEXPONENT':   MAXEXPONENT, Maximum exponent of a real kind
6868* 'MAXLOC':        MAXLOC,    Location of the maximum value within an array
6869* 'MAXVAL':        MAXVAL,    Maximum value of an array
6870* 'MCLOCK':        MCLOCK,    Time function
6871* 'MCLOCK8':       MCLOCK8,   Time function (64-bit)
6872* 'MERGE':         MERGE,     Merge arrays
6873* 'MERGE_BITS':    MERGE_BITS, Merge of bits under mask
6874* 'MIN':           MIN,       Minimum value of an argument list
6875* 'MINEXPONENT':   MINEXPONENT, Minimum exponent of a real kind
6876* 'MINLOC':        MINLOC,    Location of the minimum value within an array
6877* 'MINVAL':        MINVAL,    Minimum value of an array
6878* 'MOD':           MOD,       Remainder function
6879* 'MODULO':        MODULO,    Modulo function
6880* 'MOVE_ALLOC':    MOVE_ALLOC, Move allocation from one object to another
6881* 'MVBITS':        MVBITS,    Move bits from one integer to another
6882* 'NEAREST':       NEAREST,   Nearest representable number
6883* 'NEW_LINE':      NEW_LINE,  New line character
6884* 'NINT':          NINT,      Nearest whole number
6885* 'NORM2':         NORM2,     Euclidean vector norm
6886* 'NOT':           NOT,       Logical negation
6887* 'NULL':          NULL,      Function that returns an disassociated pointer
6888* 'NUM_IMAGES':    NUM_IMAGES, Number of images
6889* 'OR':            OR,        Bitwise logical OR
6890* 'PACK':          PACK,      Pack an array into an array of rank one
6891* 'PARITY':        PARITY,    Reduction with exclusive OR
6892* 'PERROR':        PERROR,    Print system error message
6893* 'POPCNT':        POPCNT,    Number of bits set
6894* 'POPPAR':        POPPAR,    Parity of the number of bits set
6895* 'PRECISION':     PRECISION, Decimal precision of a real kind
6896* 'PRESENT':       PRESENT,   Determine whether an optional dummy argument is specified
6897* 'PRODUCT':       PRODUCT,   Product of array elements
6898* 'RADIX':         RADIX,     Base of a data model
6899* 'RAN':           RAN,       Real pseudo-random number
6900* 'RAND':          RAND,      Real pseudo-random number
6901* 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
6902* 'RANDOM_SEED':   RANDOM_SEED, Initialize a pseudo-random number sequence
6903* 'RANGE':         RANGE,     Decimal exponent range
6904* 'RANK' :         RANK,      Rank of a data object
6905* 'REAL':          REAL,      Convert to real type
6906* 'RENAME':        RENAME,    Rename a file
6907* 'REPEAT':        REPEAT,    Repeated string concatenation
6908* 'RESHAPE':       RESHAPE,   Function to reshape an array
6909* 'RRSPACING':     RRSPACING, Reciprocal of the relative spacing
6910* 'RSHIFT':        RSHIFT,    Right shift bits
6911* 'SAME_TYPE_AS':  SAME_TYPE_AS,  Query dynamic types for equality
6912* 'SCALE':         SCALE,     Scale a real value
6913* 'SCAN':          SCAN,      Scan a string for the presence of a set of characters
6914* 'SECNDS':        SECNDS,    Time function
6915* 'SECOND':        SECOND,    CPU time function
6916* 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND,  Choose character kind
6917* 'SELECTED_INT_KIND': SELECTED_INT_KIND,  Choose integer kind
6918* 'SELECTED_REAL_KIND': SELECTED_REAL_KIND,  Choose real kind
6919* 'SET_EXPONENT':  SET_EXPONENT, Set the exponent of the model
6920* 'SHAPE':         SHAPE,     Determine the shape of an array
6921* 'SHIFTA':        SHIFTA,    Right shift with fill
6922* 'SHIFTL':        SHIFTL,    Left shift
6923* 'SHIFTR':        SHIFTR,    Right shift
6924* 'SIGN':          SIGN,      Sign copying function
6925* 'SIGNAL':        SIGNAL,    Signal handling subroutine (or function)
6926* 'SIN':           SIN,       Sine function
6927* 'SIND':          SIND,      Sine function, degrees
6928* 'SINH':          SINH,      Hyperbolic sine function
6929* 'SIZE':          SIZE,      Function to determine the size of an array
6930* 'SIZEOF':        SIZEOF,    Determine the size in bytes of an expression
6931* 'SLEEP':         SLEEP,     Sleep for the specified number of seconds
6932* 'SPACING':       SPACING,   Smallest distance between two numbers of a given type
6933* 'SPREAD':        SPREAD,    Add a dimension to an array
6934* 'SQRT':          SQRT,      Square-root function
6935* 'SRAND':         SRAND,     Reinitialize the random number generator
6936* 'STAT':          STAT,      Get file status
6937* 'STORAGE_SIZE':  STORAGE_SIZE, Storage size in bits
6938* 'SUM':           SUM,       Sum of array elements
6939* 'SYMLNK':        SYMLNK,    Create a symbolic link
6940* 'SYSTEM':        SYSTEM,    Execute a shell command
6941* 'SYSTEM_CLOCK':  SYSTEM_CLOCK, Time function
6942* 'TAN':           TAN,       Tangent function
6943* 'TAND':          TAND,      Tangent function, degrees
6944* 'TANH':          TANH,      Hyperbolic tangent function
6945* 'THIS_IMAGE':    THIS_IMAGE, Cosubscript index of this image
6946* 'TIME':          TIME,      Time function
6947* 'TIME8':         TIME8,     Time function (64-bit)
6948* 'TINY':          TINY,      Smallest positive number of a real kind
6949* 'TRAILZ':        TRAILZ,    Number of trailing zero bits of an integer
6950* 'TRANSFER':      TRANSFER,  Transfer bit patterns
6951* 'TRANSPOSE':     TRANSPOSE, Transpose an array of rank two
6952* 'TRIM':          TRIM,      Remove trailing blank characters of a string
6953* 'TTYNAM':        TTYNAM,    Get the name of a terminal device.
6954* 'UBOUND':        UBOUND,    Upper dimension bounds of an array
6955* 'UCOBOUND':      UCOBOUND,  Upper codimension bounds of an array
6956* 'UMASK':         UMASK,     Set the file creation mask
6957* 'UNLINK':        UNLINK,    Remove a file from the file system
6958* 'UNPACK':        UNPACK,    Unpack an array of rank one into an array
6959* 'VERIFY':        VERIFY,    Scan a string for the absence of a set of characters
6960* 'XOR':           XOR,       Bitwise logical exclusive or
6961
6962
6963File: gfortran.info,  Node: Introduction to Intrinsics,  Next: ABORT,  Up: Intrinsic Procedures
6964
69659.1 Introduction to intrinsic procedures
6966========================================
6967
6968The intrinsic procedures provided by GNU Fortran include all of the
6969intrinsic procedures required by the Fortran 95 standard, a set of
6970intrinsic procedures for backwards compatibility with G77, and a
6971selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
6972standards.  Any conflict between a description here and a description in
6973either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
69742008 standard is unintentional, and the standard(s) should be considered
6975authoritative.
6976
6977   The enumeration of the 'KIND' type parameter is processor defined in
6978the Fortran 95 standard.  GNU Fortran defines the default integer type
6979and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)',
6980respectively.  The standard mandates that both data types shall have
6981another kind, which have more precision.  On typical target
6982architectures supported by 'gfortran', this kind type parameter is
6983'KIND=8'.  Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent.
6984In the description of generic intrinsic procedures, the kind type
6985parameter will be specified by 'KIND=*', and in the description of
6986specific names for an intrinsic procedure the kind type parameter will
6987be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)').  Finally,
6988for brevity the optional 'KIND=' syntax will be omitted.
6989
6990   Many of the intrinsic procedures take one or more optional arguments.
6991This document follows the convention used in the Fortran 95 standard,
6992and denotes such arguments by square brackets.
6993
6994   GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can
6995be used to restrict the set of intrinsic procedures to a given standard.
6996By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic
6997procedures described here are accepted.  There is one caveat.  For a
6998select group of intrinsic procedures, 'g77' implemented both a function
6999and a subroutine.  Both classes have been implemented in 'gfortran' for
7000backwards compatibility with 'g77'.  It is noted here that these
7001functions and subroutines cannot be intermixed in a given subprogram.
7002In the descriptions that follow, the applicable standard for each
7003intrinsic procedure is noted.
7004
7005
7006File: gfortran.info,  Node: ABORT,  Next: ABS,  Prev: Introduction to Intrinsics,  Up: Intrinsic Procedures
7007
70089.2 'ABORT' -- Abort the program
7009================================
7010
7011_Description_:
7012     'ABORT' causes immediate termination of the program.  On operating
7013     systems that support a core dump, 'ABORT' will produce a core dump.
7014     It will also print a backtrace, unless '-fno-backtrace' is given.
7015
7016_Standard_:
7017     GNU extension
7018
7019_Class_:
7020     Subroutine
7021
7022_Syntax_:
7023     'CALL ABORT'
7024
7025_Return value_:
7026     Does not return.
7027
7028_Example_:
7029          program test_abort
7030            integer :: i = 1, j = 2
7031            if (i /= j) call abort
7032          end program test_abort
7033
7034_See also_:
7035     *note EXIT::, *note KILL::, *note BACKTRACE::
7036
7037
7038File: gfortran.info,  Node: ABS,  Next: ACCESS,  Prev: ABORT,  Up: Intrinsic Procedures
7039
70409.3 'ABS' -- Absolute value
7041===========================
7042
7043_Description_:
7044     'ABS(A)' computes the absolute value of 'A'.
7045
7046_Standard_:
7047     Fortran 77 and later, has overloads that are GNU extensions
7048
7049_Class_:
7050     Elemental function
7051
7052_Syntax_:
7053     'RESULT = ABS(A)'
7054
7055_Arguments_:
7056     A           The type of the argument shall be an 'INTEGER',
7057                 'REAL', or 'COMPLEX'.
7058
7059_Return value_:
7060     The return value is of the same type and kind as the argument
7061     except the return value is 'REAL' for a 'COMPLEX' argument.
7062
7063_Example_:
7064          program test_abs
7065            integer :: i = -1
7066            real :: x = -1.e0
7067            complex :: z = (-1.e0,0.e0)
7068            i = abs(i)
7069            x = abs(x)
7070            x = abs(z)
7071          end program test_abs
7072
7073_Specific names_:
7074     Name           Argument       Return type    Standard
7075     'ABS(A)'       'REAL(4) A'    'REAL(4)'      Fortran 77 and
7076                                                  later
7077     'CABS(A)'      'COMPLEX(4)    'REAL(4)'      Fortran 77 and
7078                    A'                            later
7079     'DABS(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7080                                                  later
7081     'IABS(A)'      'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
7082                    A'                            later
7083     'BABS(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
7084                    A'
7085     'IIABS(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
7086                    A'
7087     'JIABS(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
7088                    A'
7089     'KIABS(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
7090                    A'
7091     'ZABS(A)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
7092                    A'
7093     'CDABS(A)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
7094                    A'
7095
7096
7097File: gfortran.info,  Node: ACCESS,  Next: ACHAR,  Prev: ABS,  Up: Intrinsic Procedures
7098
70999.4 'ACCESS' -- Checks file access modes
7100========================================
7101
7102_Description_:
7103     'ACCESS(NAME, MODE)' checks whether the file NAME exists, is
7104     readable, writable or executable.  Except for the executable check,
7105     'ACCESS' can be replaced by Fortran 95's 'INQUIRE'.
7106
7107_Standard_:
7108     GNU extension
7109
7110_Class_:
7111     Inquiry function
7112
7113_Syntax_:
7114     'RESULT = ACCESS(NAME, MODE)'
7115
7116_Arguments_:
7117     NAME        Scalar 'CHARACTER' of default kind with the file
7118                 name.  Tailing blank are ignored unless the
7119                 character 'achar(0)' is present, then all
7120                 characters up to and excluding 'achar(0)' are
7121                 used as file name.
7122     MODE        Scalar 'CHARACTER' of default kind with the file
7123                 access mode, may be any concatenation of '"r"'
7124                 (readable), '"w"' (writable) and '"x"'
7125                 (executable), or '" "' to check for existence.
7126
7127_Return value_:
7128     Returns a scalar 'INTEGER', which is '0' if the file is accessible
7129     in the given mode; otherwise or if an invalid argument has been
7130     given for 'MODE' the value '1' is returned.
7131
7132_Example_:
7133          program access_test
7134            implicit none
7135            character(len=*), parameter :: file  = 'test.dat'
7136            character(len=*), parameter :: file2 = 'test.dat  '//achar(0)
7137            if(access(file,' ') == 0) print *, trim(file),' is exists'
7138            if(access(file,'r') == 0) print *, trim(file),' is readable'
7139            if(access(file,'w') == 0) print *, trim(file),' is writable'
7140            if(access(file,'x') == 0) print *, trim(file),' is executable'
7141            if(access(file2,'rwx') == 0) &
7142              print *, trim(file2),' is readable, writable and executable'
7143          end program access_test
7144_Specific names_:
7145_See also_:
7146
7147
7148File: gfortran.info,  Node: ACHAR,  Next: ACOS,  Prev: ACCESS,  Up: Intrinsic Procedures
7149
71509.5 'ACHAR' -- Character in ASCII collating sequence
7151====================================================
7152
7153_Description_:
7154     'ACHAR(I)' returns the character located at position 'I' in the
7155     ASCII collating sequence.
7156
7157_Standard_:
7158     Fortran 77 and later, with KIND argument Fortran 2003 and later
7159
7160_Class_:
7161     Elemental function
7162
7163_Syntax_:
7164     'RESULT = ACHAR(I [, KIND])'
7165
7166_Arguments_:
7167     I           The type shall be 'INTEGER'.
7168     KIND        (Optional) An 'INTEGER' initialization
7169                 expression indicating the kind parameter of the
7170                 result.
7171
7172_Return value_:
7173     The return value is of type 'CHARACTER' with a length of one.  If
7174     the KIND argument is present, the return value is of the specified
7175     kind and of the default kind otherwise.
7176
7177_Example_:
7178          program test_achar
7179            character c
7180            c = achar(32)
7181          end program test_achar
7182
7183_Note_:
7184     See *note ICHAR:: for a discussion of converting between numerical
7185     values and formatted string representations.
7186
7187_See also_:
7188     *note CHAR::, *note IACHAR::, *note ICHAR::
7189
7190
7191File: gfortran.info,  Node: ACOS,  Next: ACOSD,  Prev: ACHAR,  Up: Intrinsic Procedures
7192
71939.6 'ACOS' -- Arccosine function
7194================================
7195
7196_Description_:
7197     'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)').
7198
7199_Standard_:
7200     Fortran 77 and later, for a complex argument Fortran 2008 or later
7201
7202_Class_:
7203     Elemental function
7204
7205_Syntax_:
7206     'RESULT = ACOS(X)'
7207
7208_Arguments_:
7209     X           The type shall either be 'REAL' with a magnitude
7210                 that is less than or equal to one - or the type
7211                 shall be 'COMPLEX'.
7212
7213_Return value_:
7214     The return value is of the same type and kind as X.  The real part
7215     of the result is in radians and lies in the range 0 \leq \Re
7216     \acos(x) \leq \pi.
7217
7218_Example_:
7219          program test_acos
7220            real(8) :: x = 0.866_8
7221            x = acos(x)
7222          end program test_acos
7223
7224_Specific names_:
7225     Name           Argument       Return type    Standard
7226     'ACOS(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
7227                                                  later
7228     'DACOS(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
7229                                                  later
7230
7231_See also_:
7232     Inverse function: *note COS:: Degrees function: *note ACOSD::
7233
7234
7235File: gfortran.info,  Node: ACOSD,  Next: ACOSH,  Prev: ACOS,  Up: Intrinsic Procedures
7236
72379.7 'ACOSD' -- Arccosine function, degrees
7238==========================================
7239
7240_Description_:
7241     'ACOSD(X)' computes the arccosine of X in degrees (inverse of
7242     'COSD(X)').
7243
7244     This function is for compatibility only and should be avoided in
7245     favor of standard constructs wherever possible.
7246
7247_Standard_:
7248     GNU Extension, enabled with '-fdec-math'
7249
7250_Class_:
7251     Elemental function
7252
7253_Syntax_:
7254     'RESULT = ACOSD(X)'
7255
7256_Arguments_:
7257     X           The type shall either be 'REAL' with a magnitude
7258                 that is less than or equal to one - or the type
7259                 shall be 'COMPLEX'.
7260
7261_Return value_:
7262     The return value is of the same type and kind as X.  The real part
7263     of the result is in degrees and lies in the range 0 \leq \Re
7264     \acos(x) \leq 180.
7265
7266_Example_:
7267          program test_acosd
7268            real(8) :: x = 0.866_8
7269            x = acosd(x)
7270          end program test_acosd
7271
7272_Specific names_:
7273     Name           Argument       Return type    Standard
7274     'ACOSD(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
7275     'DACOSD(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
7276
7277_See also_:
7278     Inverse function: *note COSD:: Radians function: *note ACOS::
7279
7280
7281File: gfortran.info,  Node: ACOSH,  Next: ADJUSTL,  Prev: ACOSD,  Up: Intrinsic Procedures
7282
72839.8 'ACOSH' -- Inverse hyperbolic cosine function
7284=================================================
7285
7286_Description_:
7287     'ACOSH(X)' computes the inverse hyperbolic cosine of X.
7288
7289_Standard_:
7290     Fortran 2008 and later
7291
7292_Class_:
7293     Elemental function
7294
7295_Syntax_:
7296     'RESULT = ACOSH(X)'
7297
7298_Arguments_:
7299     X           The type shall be 'REAL' or 'COMPLEX'.
7300
7301_Return value_:
7302     The return value has the same type and kind as X.  If X is complex,
7303     the imaginary part of the result is in radians and lies between 0
7304     \leq \Im \acosh(x) \leq \pi.
7305
7306_Example_:
7307          PROGRAM test_acosh
7308            REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
7309            WRITE (*,*) ACOSH(x)
7310          END PROGRAM
7311
7312_Specific names_:
7313     Name           Argument       Return type    Standard
7314     'DACOSH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
7315
7316_See also_:
7317     Inverse function: *note COSH::
7318
7319
7320File: gfortran.info,  Node: ADJUSTL,  Next: ADJUSTR,  Prev: ACOSH,  Up: Intrinsic Procedures
7321
73229.9 'ADJUSTL' -- Left adjust a string
7323=====================================
7324
7325_Description_:
7326     'ADJUSTL(STRING)' will left adjust a string by removing leading
7327     spaces.  Spaces are inserted at the end of the string as needed.
7328
7329_Standard_:
7330     Fortran 90 and later
7331
7332_Class_:
7333     Elemental function
7334
7335_Syntax_:
7336     'RESULT = ADJUSTL(STRING)'
7337
7338_Arguments_:
7339     STRING      The type shall be 'CHARACTER'.
7340
7341_Return value_:
7342     The return value is of type 'CHARACTER' and of the same kind as
7343     STRING where leading spaces are removed and the same number of
7344     spaces are inserted on the end of STRING.
7345
7346_Example_:
7347          program test_adjustl
7348            character(len=20) :: str = '   gfortran'
7349            str = adjustl(str)
7350            print *, str
7351          end program test_adjustl
7352
7353_See also_:
7354     *note ADJUSTR::, *note TRIM::
7355
7356
7357File: gfortran.info,  Node: ADJUSTR,  Next: AIMAG,  Prev: ADJUSTL,  Up: Intrinsic Procedures
7358
73599.10 'ADJUSTR' -- Right adjust a string
7360=======================================
7361
7362_Description_:
7363     'ADJUSTR(STRING)' will right adjust a string by removing trailing
7364     spaces.  Spaces are inserted at the start of the string as needed.
7365
7366_Standard_:
7367     Fortran 95 and later
7368
7369_Class_:
7370     Elemental function
7371
7372_Syntax_:
7373     'RESULT = ADJUSTR(STRING)'
7374
7375_Arguments_:
7376     STR         The type shall be 'CHARACTER'.
7377
7378_Return value_:
7379     The return value is of type 'CHARACTER' and of the same kind as
7380     STRING where trailing spaces are removed and the same number of
7381     spaces are inserted at the start of STRING.
7382
7383_Example_:
7384          program test_adjustr
7385            character(len=20) :: str = 'gfortran'
7386            str = adjustr(str)
7387            print *, str
7388          end program test_adjustr
7389
7390_See also_:
7391     *note ADJUSTL::, *note TRIM::
7392
7393
7394File: gfortran.info,  Node: AIMAG,  Next: AINT,  Prev: ADJUSTR,  Up: Intrinsic Procedures
7395
73969.11 'AIMAG' -- Imaginary part of complex number
7397================================================
7398
7399_Description_:
7400     'AIMAG(Z)' yields the imaginary part of complex argument 'Z'.  The
7401     'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for
7402     compatibility with 'g77', and their use in new code is strongly
7403     discouraged.
7404
7405_Standard_:
7406     Fortran 77 and later, has overloads that are GNU extensions
7407
7408_Class_:
7409     Elemental function
7410
7411_Syntax_:
7412     'RESULT = AIMAG(Z)'
7413
7414_Arguments_:
7415     Z           The type of the argument shall be 'COMPLEX'.
7416
7417_Return value_:
7418     The return value is of type 'REAL' with the kind type parameter of
7419     the argument.
7420
7421_Example_:
7422          program test_aimag
7423            complex(4) z4
7424            complex(8) z8
7425            z4 = cmplx(1.e0_4, 0.e0_4)
7426            z8 = cmplx(0.e0_8, 1.e0_8)
7427            print *, aimag(z4), dimag(z8)
7428          end program test_aimag
7429
7430_Specific names_:
7431     Name           Argument       Return type    Standard
7432     'AIMAG(Z)'     'COMPLEX Z'    'REAL'         GNU extension
7433     'DIMAG(Z)'     'COMPLEX(8)    'REAL(8)'      GNU extension
7434                    Z'
7435     'IMAG(Z)'      'COMPLEX Z'    'REAL'         GNU extension
7436     'IMAGPART(Z)'  'COMPLEX Z'    'REAL'         GNU extension
7437
7438
7439File: gfortran.info,  Node: AINT,  Next: ALARM,  Prev: AIMAG,  Up: Intrinsic Procedures
7440
74419.12 'AINT' -- Truncate to a whole number
7442=========================================
7443
7444_Description_:
7445     'AINT(A [, KIND])' truncates its argument to a whole number.
7446
7447_Standard_:
7448     Fortran 77 and later
7449
7450_Class_:
7451     Elemental function
7452
7453_Syntax_:
7454     'RESULT = AINT(A [, KIND])'
7455
7456_Arguments_:
7457     A           The type of the argument shall be 'REAL'.
7458     KIND        (Optional) An 'INTEGER' initialization
7459                 expression indicating the kind parameter of the
7460                 result.
7461
7462_Return value_:
7463     The return value is of type 'REAL' with the kind type parameter of
7464     the argument if the optional KIND is absent; otherwise, the kind
7465     type parameter will be given by KIND.  If the magnitude of X is
7466     less than one, 'AINT(X)' returns zero.  If the magnitude is equal
7467     to or greater than one then it returns the largest whole number
7468     that does not exceed its magnitude.  The sign is the same as the
7469     sign of X.
7470
7471_Example_:
7472          program test_aint
7473            real(4) x4
7474            real(8) x8
7475            x4 = 1.234E0_4
7476            x8 = 4.321_8
7477            print *, aint(x4), dint(x8)
7478            x8 = aint(x4,8)
7479          end program test_aint
7480
7481_Specific names_:
7482     Name           Argument       Return type    Standard
7483     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
7484                                                  later
7485     'DINT(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7486                                                  later
7487
7488
7489File: gfortran.info,  Node: ALARM,  Next: ALL,  Prev: AINT,  Up: Intrinsic Procedures
7490
74919.13 'ALARM' -- Execute a routine after a given delay
7492=====================================================
7493
7494_Description_:
7495     'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
7496     HANDLER to be executed after a delay of SECONDS by using 'alarm(2)'
7497     to set up a signal and 'signal(2)' to catch it.  If STATUS is
7498     supplied, it will be returned with the number of seconds remaining
7499     until any previously scheduled alarm was due to be delivered, or
7500     zero if there was no previously scheduled alarm.
7501
7502_Standard_:
7503     GNU extension
7504
7505_Class_:
7506     Subroutine
7507
7508_Syntax_:
7509     'CALL ALARM(SECONDS, HANDLER [, STATUS])'
7510
7511_Arguments_:
7512     SECONDS     The type of the argument shall be a scalar
7513                 'INTEGER'.  It is 'INTENT(IN)'.
7514     HANDLER     Signal handler ('INTEGER FUNCTION' or
7515                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
7516                 The scalar values may be either 'SIG_IGN=1' to
7517                 ignore the alarm generated or 'SIG_DFL=0' to set
7518                 the default action.  It is 'INTENT(IN)'.
7519     STATUS      (Optional) STATUS shall be a scalar variable of
7520                 the default 'INTEGER' kind.  It is
7521                 'INTENT(OUT)'.
7522
7523_Example_:
7524          program test_alarm
7525            external handler_print
7526            integer i
7527            call alarm (3, handler_print, i)
7528            print *, i
7529            call sleep(10)
7530          end program test_alarm
7531     This will cause the external routine HANDLER_PRINT to be called
7532     after 3 seconds.
7533
7534
7535File: gfortran.info,  Node: ALL,  Next: ALLOCATED,  Prev: ALARM,  Up: Intrinsic Procedures
7536
75379.14 'ALL' -- All values in MASK along DIM are true
7538===================================================
7539
7540_Description_:
7541     'ALL(MASK [, DIM])' determines if all the values are true in MASK
7542     in the array along dimension DIM.
7543
7544_Standard_:
7545     Fortran 95 and later
7546
7547_Class_:
7548     Transformational function
7549
7550_Syntax_:
7551     'RESULT = ALL(MASK [, DIM])'
7552
7553_Arguments_:
7554     MASK        The type of the argument shall be 'LOGICAL' and
7555                 it shall not be scalar.
7556     DIM         (Optional) DIM shall be a scalar integer with a
7557                 value that lies between one and the rank of
7558                 MASK.
7559
7560_Return value_:
7561     'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind
7562     type parameter is the same as the kind type parameter of MASK.  If
7563     DIM is present, then 'ALL(MASK, DIM)' returns an array with the
7564     rank of MASK minus 1.  The shape is determined from the shape of
7565     MASK where the DIM dimension is elided.
7566
7567     (A)
7568          'ALL(MASK)' is true if all elements of MASK are true.  It also
7569          is true if MASK has zero size; otherwise, it is false.
7570     (B)
7571          If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent
7572          to 'ALL(MASK)'.  If the rank is greater than one, then
7573          'ALL(MASK,DIM)' is determined by applying 'ALL' to the array
7574          sections.
7575
7576_Example_:
7577          program test_all
7578            logical l
7579            l = all((/.true., .true., .true./))
7580            print *, l
7581            call section
7582            contains
7583              subroutine section
7584                integer a(2,3), b(2,3)
7585                a = 1
7586                b = 1
7587                b(2,2) = 2
7588                print *, all(a .eq. b, 1)
7589                print *, all(a .eq. b, 2)
7590              end subroutine section
7591          end program test_all
7592
7593
7594File: gfortran.info,  Node: ALLOCATED,  Next: AND,  Prev: ALL,  Up: Intrinsic Procedures
7595
75969.15 'ALLOCATED' -- Status of an allocatable entity
7597===================================================
7598
7599_Description_:
7600     'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation
7601     status of ARRAY and SCALAR, respectively.
7602
7603_Standard_:
7604     Fortran 95 and later.  Note, the 'SCALAR=' keyword and allocatable
7605     scalar entities are available in Fortran 2003 and later.
7606
7607_Class_:
7608     Inquiry function
7609
7610_Syntax_:
7611     'RESULT = ALLOCATED(ARRAY)'
7612     'RESULT = ALLOCATED(SCALAR)'
7613
7614_Arguments_:
7615     ARRAY       The argument shall be an 'ALLOCATABLE' array.
7616     SCALAR      The argument shall be an 'ALLOCATABLE' scalar.
7617
7618_Return value_:
7619     The return value is a scalar 'LOGICAL' with the default logical
7620     kind type parameter.  If the argument is allocated, then the result
7621     is '.TRUE.'; otherwise, it returns '.FALSE.'
7622
7623_Example_:
7624          program test_allocated
7625            integer :: i = 4
7626            real(4), allocatable :: x(:)
7627            if (.not. allocated(x)) allocate(x(i))
7628          end program test_allocated
7629
7630
7631File: gfortran.info,  Node: AND,  Next: ANINT,  Prev: ALLOCATED,  Up: Intrinsic Procedures
7632
76339.16 'AND' -- Bitwise logical AND
7634=================================
7635
7636_Description_:
7637     Bitwise logical 'AND'.
7638
7639     This intrinsic routine is provided for backwards compatibility with
7640     GNU Fortran 77.  For integer arguments, programmers should consider
7641     the use of the *note IAND:: intrinsic defined by the Fortran
7642     standard.
7643
7644_Standard_:
7645     GNU extension
7646
7647_Class_:
7648     Function
7649
7650_Syntax_:
7651     'RESULT = AND(I, J)'
7652
7653_Arguments_:
7654     I           The type shall be either a scalar 'INTEGER' type
7655                 or a scalar 'LOGICAL' type.
7656     J           The type shall be the same as the type of I.
7657
7658_Return value_:
7659     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
7660     If the kind type parameters differ, then the smaller kind type is
7661     implicitly converted to larger kind, and the return has the larger
7662     kind.
7663
7664_Example_:
7665          PROGRAM test_and
7666            LOGICAL :: T = .TRUE., F = .FALSE.
7667            INTEGER :: a, b
7668            DATA a / Z'F' /, b / Z'3' /
7669
7670            WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
7671            WRITE (*,*) AND(a, b)
7672          END PROGRAM
7673
7674_See also_:
7675     Fortran 95 elemental function: *note IAND::
7676
7677
7678File: gfortran.info,  Node: ANINT,  Next: ANY,  Prev: AND,  Up: Intrinsic Procedures
7679
76809.17 'ANINT' -- Nearest whole number
7681====================================
7682
7683_Description_:
7684     'ANINT(A [, KIND])' rounds its argument to the nearest whole
7685     number.
7686
7687_Standard_:
7688     Fortran 77 and later
7689
7690_Class_:
7691     Elemental function
7692
7693_Syntax_:
7694     'RESULT = ANINT(A [, KIND])'
7695
7696_Arguments_:
7697     A           The type of the argument shall be 'REAL'.
7698     KIND        (Optional) An 'INTEGER' initialization
7699                 expression indicating the kind parameter of the
7700                 result.
7701
7702_Return value_:
7703     The return value is of type real with the kind type parameter of
7704     the argument if the optional KIND is absent; otherwise, the kind
7705     type parameter will be given by KIND.  If A is greater than zero,
7706     'ANINT(A)' returns 'AINT(X+0.5)'.  If A is less than or equal to
7707     zero then it returns 'AINT(X-0.5)'.
7708
7709_Example_:
7710          program test_anint
7711            real(4) x4
7712            real(8) x8
7713            x4 = 1.234E0_4
7714            x8 = 4.321_8
7715            print *, anint(x4), dnint(x8)
7716            x8 = anint(x4,8)
7717          end program test_anint
7718
7719_Specific names_:
7720     Name           Argument       Return type    Standard
7721     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
7722                                                  later
7723     'DNINT(A)'     'REAL(8) A'    'REAL(8)'      Fortran 77 and
7724                                                  later
7725
7726
7727File: gfortran.info,  Node: ANY,  Next: ASIN,  Prev: ANINT,  Up: Intrinsic Procedures
7728
77299.18 'ANY' -- Any value in MASK along DIM is true
7730=================================================
7731
7732_Description_:
7733     'ANY(MASK [, DIM])' determines if any of the values in the logical
7734     array MASK along dimension DIM are '.TRUE.'.
7735
7736_Standard_:
7737     Fortran 95 and later
7738
7739_Class_:
7740     Transformational function
7741
7742_Syntax_:
7743     'RESULT = ANY(MASK [, DIM])'
7744
7745_Arguments_:
7746     MASK        The type of the argument shall be 'LOGICAL' and
7747                 it shall not be scalar.
7748     DIM         (Optional) DIM shall be a scalar integer with a
7749                 value that lies between one and the rank of
7750                 MASK.
7751
7752_Return value_:
7753     'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind
7754     type parameter is the same as the kind type parameter of MASK.  If
7755     DIM is present, then 'ANY(MASK, DIM)' returns an array with the
7756     rank of MASK minus 1.  The shape is determined from the shape of
7757     MASK where the DIM dimension is elided.
7758
7759     (A)
7760          'ANY(MASK)' is true if any element of MASK is true; otherwise,
7761          it is false.  It also is false if MASK has zero size.
7762     (B)
7763          If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent
7764          to 'ANY(MASK)'.  If the rank is greater than one, then
7765          'ANY(MASK,DIM)' is determined by applying 'ANY' to the array
7766          sections.
7767
7768_Example_:
7769          program test_any
7770            logical l
7771            l = any((/.true., .true., .true./))
7772            print *, l
7773            call section
7774            contains
7775              subroutine section
7776                integer a(2,3), b(2,3)
7777                a = 1
7778                b = 1
7779                b(2,2) = 2
7780                print *, any(a .eq. b, 1)
7781                print *, any(a .eq. b, 2)
7782              end subroutine section
7783          end program test_any
7784
7785
7786File: gfortran.info,  Node: ASIN,  Next: ASIND,  Prev: ANY,  Up: Intrinsic Procedures
7787
77889.19 'ASIN' -- Arcsine function
7789===============================
7790
7791_Description_:
7792     'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)').
7793
7794_Standard_:
7795     Fortran 77 and later, for a complex argument Fortran 2008 or later
7796
7797_Class_:
7798     Elemental function
7799
7800_Syntax_:
7801     'RESULT = ASIN(X)'
7802
7803_Arguments_:
7804     X           The type shall be either 'REAL' and a magnitude
7805                 that is less than or equal to one - or be
7806                 'COMPLEX'.
7807
7808_Return value_:
7809     The return value is of the same type and kind as X.  The real part
7810     of the result is in radians and lies in the range -\pi/2 \leq \Re
7811     \asin(x) \leq \pi/2.
7812
7813_Example_:
7814          program test_asin
7815            real(8) :: x = 0.866_8
7816            x = asin(x)
7817          end program test_asin
7818
7819_Specific names_:
7820     Name           Argument       Return type    Standard
7821     'ASIN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
7822                                                  later
7823     'DASIN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
7824                                                  later
7825
7826_See also_:
7827     Inverse function: *note SIN:: Degrees function: *note ASIND::
7828
7829
7830File: gfortran.info,  Node: ASIND,  Next: ASINH,  Prev: ASIN,  Up: Intrinsic Procedures
7831
78329.20 'ASIND' -- Arcsine function, degrees
7833=========================================
7834
7835_Description_:
7836     'ASIND(X)' computes the arcsine of its X in degrees (inverse of
7837     'SIND(X)').
7838
7839     This function is for compatibility only and should be avoided in
7840     favor of standard constructs wherever possible.
7841
7842_Standard_:
7843     GNU Extension, enabled with '-fdec-math'.
7844
7845_Class_:
7846     Elemental function
7847
7848_Syntax_:
7849     'RESULT = ASIND(X)'
7850
7851_Arguments_:
7852     X           The type shall be either 'REAL' and a magnitude
7853                 that is less than or equal to one - or be
7854                 'COMPLEX'.
7855
7856_Return value_:
7857     The return value is of the same type and kind as X.  The real part
7858     of the result is in degrees and lies in the range -90 \leq \Re
7859     \asin(x) \leq 90.
7860
7861_Example_:
7862          program test_asind
7863            real(8) :: x = 0.866_8
7864            x = asind(x)
7865          end program test_asind
7866
7867_Specific names_:
7868     Name           Argument       Return type    Standard
7869     'ASIND(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
7870     'DASIND(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
7871
7872_See also_:
7873     Inverse function: *note SIND:: Radians function: *note ASIN::
7874
7875
7876File: gfortran.info,  Node: ASINH,  Next: ASSOCIATED,  Prev: ASIND,  Up: Intrinsic Procedures
7877
78789.21 'ASINH' -- Inverse hyperbolic sine function
7879================================================
7880
7881_Description_:
7882     'ASINH(X)' computes the inverse hyperbolic sine of X.
7883
7884_Standard_:
7885     Fortran 2008 and later
7886
7887_Class_:
7888     Elemental function
7889
7890_Syntax_:
7891     'RESULT = ASINH(X)'
7892
7893_Arguments_:
7894     X           The type shall be 'REAL' or 'COMPLEX'.
7895
7896_Return value_:
7897     The return value is of the same type and kind as X.  If X is
7898     complex, the imaginary part of the result is in radians and lies
7899     between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
7900
7901_Example_:
7902          PROGRAM test_asinh
7903            REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
7904            WRITE (*,*) ASINH(x)
7905          END PROGRAM
7906
7907_Specific names_:
7908     Name           Argument       Return type    Standard
7909     'DASINH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension.
7910
7911_See also_:
7912     Inverse function: *note SINH::
7913
7914
7915File: gfortran.info,  Node: ASSOCIATED,  Next: ATAN,  Prev: ASINH,  Up: Intrinsic Procedures
7916
79179.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair
7918===============================================================
7919
7920_Description_:
7921     'ASSOCIATED(POINTER [, TARGET])' determines the status of the
7922     pointer POINTER or if POINTER is associated with the target TARGET.
7923
7924_Standard_:
7925     Fortran 95 and later
7926
7927_Class_:
7928     Inquiry function
7929
7930_Syntax_:
7931     'RESULT = ASSOCIATED(POINTER [, TARGET])'
7932
7933_Arguments_:
7934     POINTER     POINTER shall have the 'POINTER' attribute and
7935                 it can be of any type.
7936     TARGET      (Optional) TARGET shall be a pointer or a
7937                 target.  It must have the same type, kind type
7938                 parameter, and array rank as POINTER.
7939     The association status of neither POINTER nor TARGET shall be
7940     undefined.
7941
7942_Return value_:
7943     'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'.
7944     There are several cases:
7945     (A) When the optional TARGET is not present then
7946          'ASSOCIATED(POINTER)' is true if POINTER is associated with a
7947          target; otherwise, it returns false.
7948     (B) If TARGET is present and a scalar target, the result is true if
7949          TARGET is not a zero-sized storage sequence and the target
7950          associated with POINTER occupies the same storage units.  If
7951          POINTER is disassociated, the result is false.
7952     (C) If TARGET is present and an array target, the result is true if
7953          TARGET and POINTER have the same shape, are not zero-sized
7954          arrays, are arrays whose elements are not zero-sized storage
7955          sequences, and TARGET and POINTER occupy the same storage
7956          units in array element order.  As in case(B), the result is
7957          false, if POINTER is disassociated.
7958     (D) If TARGET is present and an scalar pointer, the result is true
7959          if TARGET is associated with POINTER, the target associated
7960          with TARGET are not zero-sized storage sequences and occupy
7961          the same storage units.  The result is false, if either TARGET
7962          or POINTER is disassociated.
7963     (E) If TARGET is present and an array pointer, the result is true if
7964          target associated with POINTER and the target associated with
7965          TARGET have the same shape, are not zero-sized arrays, are
7966          arrays whose elements are not zero-sized storage sequences,
7967          and TARGET and POINTER occupy the same storage units in array
7968          element order.  The result is false, if either TARGET or
7969          POINTER is disassociated.
7970
7971_Example_:
7972          program test_associated
7973             implicit none
7974             real, target  :: tgt(2) = (/1., 2./)
7975             real, pointer :: ptr(:)
7976             ptr => tgt
7977             if (associated(ptr)     .eqv. .false.) call abort
7978             if (associated(ptr,tgt) .eqv. .false.) call abort
7979          end program test_associated
7980
7981_See also_:
7982     *note NULL::
7983
7984
7985File: gfortran.info,  Node: ATAN,  Next: ATAND,  Prev: ASSOCIATED,  Up: Intrinsic Procedures
7986
79879.23 'ATAN' -- Arctangent function
7988==================================
7989
7990_Description_:
7991     'ATAN(X)' computes the arctangent of X.
7992
7993_Standard_:
7994     Fortran 77 and later, for a complex argument and for two arguments
7995     Fortran 2008 or later
7996
7997_Class_:
7998     Elemental function
7999
8000_Syntax_:
8001     'RESULT = ATAN(X)'
8002     'RESULT = ATAN(Y, X)'
8003
8004_Arguments_:
8005     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8006                 present, X shall be REAL.
8007     Y shall
8008     be of the
8009     same type
8010     and kind
8011     as X.
8012
8013_Return value_:
8014     The return value is of the same type and kind as X.  If Y is
8015     present, the result is identical to 'ATAN2(Y,X)'.  Otherwise, it
8016     the arcus tangent of X, where the real part of the result is in
8017     radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
8018
8019_Example_:
8020          program test_atan
8021            real(8) :: x = 2.866_8
8022            x = atan(x)
8023          end program test_atan
8024
8025_Specific names_:
8026     Name           Argument       Return type    Standard
8027     'ATAN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
8028                                                  later
8029     'DATAN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
8030                                                  later
8031
8032_See also_:
8033     Inverse function: *note TAN:: Degrees function: *note ATAND::
8034
8035
8036File: gfortran.info,  Node: ATAND,  Next: ATAN2,  Prev: ATAN,  Up: Intrinsic Procedures
8037
80389.24 'ATAND' -- Arctangent function, degrees
8039============================================
8040
8041_Description_:
8042     'ATAND(X)' computes the arctangent of X in degrees (inverse of
8043     *note TAND::).
8044
8045     This function is for compatibility only and should be avoided in
8046     favor of standard constructs wherever possible.
8047
8048_Standard_:
8049     GNU Extension, enabled with '-fdec-math'.
8050
8051_Class_:
8052     Elemental function
8053
8054_Syntax_:
8055     'RESULT = ATAND(X)'
8056     'RESULT = ATAND(Y, X)'
8057
8058_Arguments_:
8059     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8060                 present, X shall be REAL.
8061     Y shall
8062     be of the
8063     same type
8064     and kind
8065     as X.
8066
8067_Return value_:
8068     The return value is of the same type and kind as X.  If Y is
8069     present, the result is identical to 'ATAND2(Y,X)'.  Otherwise, it
8070     is the arcus tangent of X, where the real part of the result is in
8071     degrees and lies in the range -90 \leq \Re \atand(x) \leq 90.
8072
8073_Example_:
8074          program test_atand
8075            real(8) :: x = 2.866_8
8076            x = atand(x)
8077          end program test_atand
8078
8079_Specific names_:
8080     Name           Argument       Return type    Standard
8081     'ATAND(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
8082     'DATAND(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
8083
8084_See also_:
8085     Inverse function: *note TAND:: Radians function: *note ATAN::
8086
8087
8088File: gfortran.info,  Node: ATAN2,  Next: ATAN2D,  Prev: ATAND,  Up: Intrinsic Procedures
8089
80909.25 'ATAN2' -- Arctangent function
8091===================================
8092
8093_Description_:
8094     'ATAN2(Y, X)' computes the principal value of the argument function
8095     of the complex number X + i Y. This function can be used to
8096     transform from Cartesian into polar coordinates and allows to
8097     determine the angle in the correct quadrant.
8098
8099_Standard_:
8100     Fortran 77 and later
8101
8102_Class_:
8103     Elemental function
8104
8105_Syntax_:
8106     'RESULT = ATAN2(Y, X)'
8107
8108_Arguments_:
8109     Y           The type shall be 'REAL'.
8110     X           The type and kind type parameter shall be the
8111                 same as Y.  If Y is zero, then X must be
8112                 nonzero.
8113
8114_Return value_:
8115     The return value has the same type and kind type parameter as Y.
8116     It is the principal value of the complex number X + i Y. If X is
8117     nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
8118     The sign is positive if Y is positive.  If Y is zero, then the
8119     return value is zero if X is strictly positive, \pi if X is
8120     negative and Y is positive zero (or the processor does not handle
8121     signed zeros), and -\pi if X is negative and Y is negative zero.
8122     Finally, if X is zero, then the magnitude of the result is \pi/2.
8123
8124_Example_:
8125          program test_atan2
8126            real(4) :: x = 1.e0_4, y = 0.5e0_4
8127            x = atan2(y,x)
8128          end program test_atan2
8129
8130_Specific names_:
8131     Name           Argument       Return type    Standard
8132     'ATAN2(X,      'REAL(4) X,    'REAL(4)'      Fortran 77 and
8133     Y)'            Y'                            later
8134     'DATAN2(X,     'REAL(8) X,    'REAL(8)'      Fortran 77 and
8135     Y)'            Y'                            later
8136
8137_See also_:
8138     Alias: *note ATAN:: Degrees function: *note ATAN2D::
8139
8140
8141File: gfortran.info,  Node: ATAN2D,  Next: ATANH,  Prev: ATAN2,  Up: Intrinsic Procedures
8142
81439.26 'ATAN2D' -- Arctangent function, degrees
8144=============================================
8145
8146_Description_:
8147     'ATAN2D(Y, X)' computes the principal value of the argument
8148     function of the complex number X + i Y in degrees.  This function
8149     can be used to transform from Cartesian into polar coordinates and
8150     allows to determine the angle in the correct quadrant.
8151
8152     This function is for compatibility only and should be avoided in
8153     favor of standard constructs wherever possible.
8154
8155_Standard_:
8156     GNU Extension, enabled with '-fdec-math'.
8157
8158_Class_:
8159     Elemental function
8160
8161_Syntax_:
8162     'RESULT = ATAN2D(Y, X)'
8163
8164_Arguments_:
8165     Y           The type shall be 'REAL'.
8166     X           The type and kind type parameter shall be the
8167                 same as Y.  If Y is zero, then X must be
8168                 nonzero.
8169
8170_Return value_:
8171     The return value has the same type and kind type parameter as Y.
8172     It is the principal value of the complex number X + i Y. If X is
8173     nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
8174     The sign is positive if Y is positive.  If Y is zero, then the
8175     return value is zero if X is strictly positive, 180 if X is
8176     negative and Y is positive zero (or the processor does not handle
8177     signed zeros), and -180 if X is negative and Y is negative zero.
8178     Finally, if X is zero, then the magnitude of the result is 90.
8179
8180_Example_:
8181          program test_atan2d
8182            real(4) :: x = 1.e0_4, y = 0.5e0_4
8183            x = atan2d(y,x)
8184          end program test_atan2d
8185
8186_Specific names_:
8187     Name           Argument       Return type    Standard
8188     'ATAN2D(X,     'REAL(4) X,    'REAL(4)'      GNU Extension
8189     Y)'            Y'
8190     'DATAN2D(X,    'REAL(8) X,    'REAL(8)'      GNU Extension
8191     Y)'            Y'
8192
8193_See also_:
8194     Alias: *note ATAND:: Radians function: *note ATAN2::
8195
8196
8197File: gfortran.info,  Node: ATANH,  Next: ATOMIC_ADD,  Prev: ATAN2D,  Up: Intrinsic Procedures
8198
81999.27 'ATANH' -- Inverse hyperbolic tangent function
8200===================================================
8201
8202_Description_:
8203     'ATANH(X)' computes the inverse hyperbolic tangent of X.
8204
8205_Standard_:
8206     Fortran 2008 and later
8207
8208_Class_:
8209     Elemental function
8210
8211_Syntax_:
8212     'RESULT = ATANH(X)'
8213
8214_Arguments_:
8215     X           The type shall be 'REAL' or 'COMPLEX'.
8216
8217_Return value_:
8218     The return value has same type and kind as X.  If X is complex, the
8219     imaginary part of the result is in radians and lies between -\pi/2
8220     \leq \Im \atanh(x) \leq \pi/2.
8221
8222_Example_:
8223          PROGRAM test_atanh
8224            REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
8225            WRITE (*,*) ATANH(x)
8226          END PROGRAM
8227
8228_Specific names_:
8229     Name           Argument       Return type    Standard
8230     'DATANH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8231
8232_See also_:
8233     Inverse function: *note TANH::
8234
8235
8236File: gfortran.info,  Node: ATOMIC_ADD,  Next: ATOMIC_AND,  Prev: ATANH,  Up: Intrinsic Procedures
8237
82389.28 'ATOMIC_ADD' -- Atomic ADD operation
8239=========================================
8240
8241_Description_:
8242     'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
8243     variable ATOM.  When STAT is present and the invocation was
8244     successful, it is assigned the value 0.  If it is present and the
8245     invocation has failed, it is assigned a positive value; in
8246     particular, for a coindexed ATOM, if the remote image has stopped,
8247     it is assigned the value of 'ISO_FORTRAN_ENV''s
8248     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8249     'STAT_FAILED_IMAGE'.
8250
8251_Standard_:
8252     TS 18508 or later
8253
8254_Class_:
8255     Atomic subroutine
8256
8257_Syntax_:
8258     'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
8259
8260_Arguments_:
8261     ATOM        Scalar coarray or coindexed variable of integer
8262                 type with 'ATOMIC_INT_KIND' kind.
8263     VALUE       Scalar of the same type as ATOM.  If the kind is
8264                 different, the value is converted to the kind of
8265                 ATOM.
8266     STAT        (optional) Scalar default-kind integer variable.
8267
8268_Example_:
8269          program atomic
8270            use iso_fortran_env
8271            integer(atomic_int_kind) :: atom[*]
8272            call atomic_add (atom[1], this_image())
8273          end program atomic
8274
8275_See also_:
8276     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
8277     ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8278     ATOMIC_XOR::
8279
8280
8281File: gfortran.info,  Node: ATOMIC_AND,  Next: ATOMIC_CAS,  Prev: ATOMIC_ADD,  Up: Intrinsic Procedures
8282
82839.29 'ATOMIC_AND' -- Atomic bitwise AND operation
8284=================================================
8285
8286_Description_:
8287     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
8288     AND between the values of ATOM and VALUE.  When STAT is present and
8289     the invocation was successful, it is assigned the value 0.  If it
8290     is present and the invocation has failed, it is assigned a positive
8291     value; in particular, for a coindexed ATOM, if the remote image has
8292     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8293     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8294     'STAT_FAILED_IMAGE'.
8295
8296_Standard_:
8297     TS 18508 or later
8298
8299_Class_:
8300     Atomic subroutine
8301
8302_Syntax_:
8303     'CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
8304
8305_Arguments_:
8306     ATOM        Scalar coarray or coindexed variable of integer
8307                 type with 'ATOMIC_INT_KIND' kind.
8308     VALUE       Scalar of the same type as ATOM.  If the kind is
8309                 different, the value is converted to the kind of
8310                 ATOM.
8311     STAT        (optional) Scalar default-kind integer variable.
8312
8313_Example_:
8314          program atomic
8315            use iso_fortran_env
8316            integer(atomic_int_kind) :: atom[*]
8317            call atomic_and (atom[1], int(b'10100011101'))
8318          end program atomic
8319
8320_See also_:
8321     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
8322     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8323     ATOMIC_XOR::
8324
8325
8326File: gfortran.info,  Node: ATOMIC_CAS,  Next: ATOMIC_DEFINE,  Prev: ATOMIC_AND,  Up: Intrinsic Procedures
8327
83289.30 'ATOMIC_CAS' -- Atomic compare and swap
8329============================================
8330
8331_Description_:
8332     'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
8333     if the value is the same, ATOM is set to the value of NEW.
8334     Additionally, OLD is set to the value of ATOM that was used for the
8335     comparison.  When STAT is present and the invocation was
8336     successful, it is assigned the value 0.  If it is present and the
8337     invocation has failed, it is assigned a positive value; in
8338     particular, for a coindexed ATOM, if the remote image has stopped,
8339     it is assigned the value of 'ISO_FORTRAN_ENV''s
8340     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8341     'STAT_FAILED_IMAGE'.
8342
8343_Standard_:
8344     TS 18508 or later
8345
8346_Class_:
8347     Atomic subroutine
8348
8349_Syntax_:
8350     'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
8351
8352_Arguments_:
8353     ATOM        Scalar coarray or coindexed variable of either
8354                 integer type with 'ATOMIC_INT_KIND' kind or
8355                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8356     OLD         Scalar of the same type and kind as ATOM.
8357     COMPARE     Scalar variable of the same type and kind as
8358                 ATOM.
8359     NEW         Scalar variable of the same type as ATOM.  If
8360                 kind is different, the value is converted to the
8361                 kind of ATOM.
8362     STAT        (optional) Scalar default-kind integer variable.
8363
8364_Example_:
8365          program atomic
8366            use iso_fortran_env
8367            logical(atomic_logical_kind) :: atom[*], prev
8368            call atomic_cas (atom[1], prev, .false., .true.))
8369          end program atomic
8370
8371_See also_:
8372     *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
8373
8374
8375File: gfortran.info,  Node: ATOMIC_DEFINE,  Next: ATOMIC_FETCH_ADD,  Prev: ATOMIC_CAS,  Up: Intrinsic Procedures
8376
83779.31 'ATOMIC_DEFINE' -- Setting a variable atomically
8378=====================================================
8379
8380_Description_:
8381     'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
8382     value VALUE atomically.  When STAT is present and the invocation
8383     was successful, it is assigned the value 0.  If it is present and
8384     the invocation has failed, it is assigned a positive value; in
8385     particular, for a coindexed ATOM, if the remote image has stopped,
8386     it is assigned the value of 'ISO_FORTRAN_ENV''s
8387     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8388     'STAT_FAILED_IMAGE'.
8389
8390_Standard_:
8391     Fortran 2008 and later; with STAT, TS 18508 or later
8392
8393_Class_:
8394     Atomic subroutine
8395
8396_Syntax_:
8397     'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
8398
8399_Arguments_:
8400     ATOM        Scalar coarray or coindexed variable of either
8401                 integer type with 'ATOMIC_INT_KIND' kind or
8402                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8403
8404     VALUE       Scalar of the same type as ATOM.  If the kind is
8405                 different, the value is converted to the kind of
8406                 ATOM.
8407     STAT        (optional) Scalar default-kind integer variable.
8408
8409_Example_:
8410          program atomic
8411            use iso_fortran_env
8412            integer(atomic_int_kind) :: atom[*]
8413            call atomic_define (atom[1], this_image())
8414          end program atomic
8415
8416_See also_:
8417     *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
8418     *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8419     ATOMIC_XOR::
8420
8421
8422File: gfortran.info,  Node: ATOMIC_FETCH_ADD,  Next: ATOMIC_FETCH_AND,  Prev: ATOMIC_DEFINE,  Up: Intrinsic Procedures
8423
84249.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
8425================================================================
8426
8427_Description_:
8428     'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
8429     ATOM in OLD and adds the value of VAR to the variable ATOM.  When
8430     STAT is present and the invocation was successful, it is assigned
8431     the value 0.  If it is present and the invocation has failed, it is
8432     assigned a positive value; in particular, for a coindexed ATOM, if
8433     the remote image has stopped, it is assigned the value of
8434     'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image
8435     has failed, the value 'STAT_FAILED_IMAGE'.
8436
8437_Standard_:
8438     TS 18508 or later
8439
8440_Class_:
8441     Atomic subroutine
8442
8443_Syntax_:
8444     'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
8445
8446_Arguments_:
8447     ATOM        Scalar coarray or coindexed variable of integer
8448                 type with 'ATOMIC_INT_KIND' kind.
8449                 'ATOMIC_LOGICAL_KIND' kind.
8450
8451     VALUE       Scalar of the same type as ATOM.  If the kind is
8452                 different, the value is converted to the kind of
8453                 ATOM.
8454     OLD         Scalar of the same type and kind as ATOM.
8455     STAT        (optional) Scalar default-kind integer variable.
8456
8457_Example_:
8458          program atomic
8459            use iso_fortran_env
8460            integer(atomic_int_kind) :: atom[*], old
8461            call atomic_add (atom[1], this_image(), old)
8462          end program atomic
8463
8464_See also_:
8465     *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
8466     *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
8467     ATOMIC_FETCH_XOR::
8468
8469
8470File: gfortran.info,  Node: ATOMIC_FETCH_AND,  Next: ATOMIC_FETCH_OR,  Prev: ATOMIC_FETCH_ADD,  Up: Intrinsic Procedures
8471
84729.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
8473========================================================================
8474
8475_Description_:
8476     'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
8477     OLD and defines ATOM with the bitwise AND between the values of
8478     ATOM and VALUE.  When STAT is present and the invocation was
8479     successful, it is assigned the value 0.  If it is present and the
8480     invocation has failed, it is assigned a positive value; in
8481     particular, for a coindexed ATOM, if the remote image has stopped,
8482     it is assigned the value of 'ISO_FORTRAN_ENV''s
8483     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8484     'STAT_FAILED_IMAGE'.
8485
8486_Standard_:
8487     TS 18508 or later
8488
8489_Class_:
8490     Atomic subroutine
8491
8492_Syntax_:
8493     'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
8494
8495_Arguments_:
8496     ATOM        Scalar coarray or coindexed variable of integer
8497                 type with 'ATOMIC_INT_KIND' kind.
8498     VALUE       Scalar of the same type as ATOM.  If the kind is
8499                 different, the value is converted to the kind of
8500                 ATOM.
8501     OLD         Scalar of the same type and kind as ATOM.
8502     STAT        (optional) Scalar default-kind integer variable.
8503
8504_Example_:
8505          program atomic
8506            use iso_fortran_env
8507            integer(atomic_int_kind) :: atom[*], old
8508            call atomic_fetch_and (atom[1], int(b'10100011101'), old)
8509          end program atomic
8510
8511_See also_:
8512     *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
8513     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
8514     ATOMIC_FETCH_XOR::
8515
8516
8517File: gfortran.info,  Node: ATOMIC_FETCH_OR,  Next: ATOMIC_FETCH_XOR,  Prev: ATOMIC_FETCH_AND,  Up: Intrinsic Procedures
8518
85199.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
8520======================================================================
8521
8522_Description_:
8523     'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD
8524     and defines ATOM with the bitwise OR between the values of ATOM and
8525     VALUE.  When STAT is present and the invocation was successful, it
8526     is assigned the value 0.  If it is present and the invocation has
8527     failed, it is assigned a positive value; in particular, for a
8528     coindexed ATOM, if the remote image has stopped, it is assigned the
8529     value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote
8530     image has failed, the value 'STAT_FAILED_IMAGE'.
8531
8532_Standard_:
8533     TS 18508 or later
8534
8535_Class_:
8536     Atomic subroutine
8537
8538_Syntax_:
8539     'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
8540
8541_Arguments_:
8542     ATOM        Scalar coarray or coindexed variable of integer
8543                 type with 'ATOMIC_INT_KIND' kind.
8544     VALUE       Scalar of the same type as ATOM.  If the kind is
8545                 different, the value is converted to the kind of
8546                 ATOM.
8547     OLD         Scalar of the same type and kind as ATOM.
8548     STAT        (optional) Scalar default-kind integer variable.
8549
8550_Example_:
8551          program atomic
8552            use iso_fortran_env
8553            integer(atomic_int_kind) :: atom[*], old
8554            call atomic_fetch_or (atom[1], int(b'10100011101'), old)
8555          end program atomic
8556
8557_See also_:
8558     *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
8559     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8560     ATOMIC_FETCH_XOR::
8561
8562
8563File: gfortran.info,  Node: ATOMIC_FETCH_XOR,  Next: ATOMIC_OR,  Prev: ATOMIC_FETCH_OR,  Up: Intrinsic Procedures
8564
85659.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
8566========================================================================
8567
8568_Description_:
8569     'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
8570     OLD and defines ATOM with the bitwise XOR between the values of
8571     ATOM and VALUE.  When STAT is present and the invocation was
8572     successful, it is assigned the value 0.  If it is present and the
8573     invocation has failed, it is assigned a positive value; in
8574     particular, for a coindexed ATOM, if the remote image has stopped,
8575     it is assigned the value of 'ISO_FORTRAN_ENV''s
8576     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8577     'STAT_FAILED_IMAGE'.
8578
8579_Standard_:
8580     TS 18508 or later
8581
8582_Class_:
8583     Atomic subroutine
8584
8585_Syntax_:
8586     'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
8587
8588_Arguments_:
8589     ATOM        Scalar coarray or coindexed variable of integer
8590                 type with 'ATOMIC_INT_KIND' kind.
8591     VALUE       Scalar of the same type as ATOM.  If the kind is
8592                 different, the value is converted to the kind of
8593                 ATOM.
8594     OLD         Scalar of the same type and kind as ATOM.
8595     STAT        (optional) Scalar default-kind integer variable.
8596
8597_Example_:
8598          program atomic
8599            use iso_fortran_env
8600            integer(atomic_int_kind) :: atom[*], old
8601            call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
8602          end program atomic
8603
8604_See also_:
8605     *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
8606     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8607     ATOMIC_FETCH_OR::
8608
8609
8610File: gfortran.info,  Node: ATOMIC_OR,  Next: ATOMIC_REF,  Prev: ATOMIC_FETCH_XOR,  Up: Intrinsic Procedures
8611
86129.36 'ATOMIC_OR' -- Atomic bitwise OR operation
8613===============================================
8614
8615_Description_:
8616     'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
8617     AND between the values of ATOM and VALUE.  When STAT is present and
8618     the invocation was successful, it is assigned the value 0.  If it
8619     is present and the invocation has failed, it is assigned a positive
8620     value; in particular, for a coindexed ATOM, if the remote image has
8621     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8622     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8623     'STAT_FAILED_IMAGE'.
8624
8625_Standard_:
8626     TS 18508 or later
8627
8628_Class_:
8629     Atomic subroutine
8630
8631_Syntax_:
8632     'CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
8633
8634_Arguments_:
8635     ATOM        Scalar coarray or coindexed variable of integer
8636                 type with 'ATOMIC_INT_KIND' kind.
8637     VALUE       Scalar of the same type as ATOM.  If the kind is
8638                 different, the value is converted to the kind of
8639                 ATOM.
8640     STAT        (optional) Scalar default-kind integer variable.
8641
8642_Example_:
8643          program atomic
8644            use iso_fortran_env
8645            integer(atomic_int_kind) :: atom[*]
8646            call atomic_or (atom[1], int(b'10100011101'))
8647          end program atomic
8648
8649_See also_:
8650     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
8651     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8652     ATOMIC_XOR::
8653
8654
8655File: gfortran.info,  Node: ATOMIC_REF,  Next: ATOMIC_XOR,  Prev: ATOMIC_OR,  Up: Intrinsic Procedures
8656
86579.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically
8658=================================================================
8659
8660_Description_:
8661     'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
8662     variable ATOM to VALUE.  When STAT is present and the invocation
8663     was successful, it is assigned the value 0.  If it is present and
8664     the invocation has failed, it is assigned a positive value; in
8665     particular, for a coindexed ATOM, if the remote image has stopped,
8666     it is assigned the value of 'ISO_FORTRAN_ENV''s
8667     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8668     'STAT_FAILED_IMAGE'.
8669
8670_Standard_:
8671     Fortran 2008 and later; with STAT, TS 18508 or later
8672
8673_Class_:
8674     Atomic subroutine
8675
8676_Syntax_:
8677     'CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
8678
8679_Arguments_:
8680     VALUE       Scalar of the same type as ATOM.  If the kind is
8681                 different, the value is converted to the kind of
8682                 ATOM.
8683     ATOM        Scalar coarray or coindexed variable of either
8684                 integer type with 'ATOMIC_INT_KIND' kind or
8685                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8686     STAT        (optional) Scalar default-kind integer variable.
8687
8688_Example_:
8689          program atomic
8690            use iso_fortran_env
8691            logical(atomic_logical_kind) :: atom[*]
8692            logical :: val
8693            call atomic_ref (atom, .false.)
8694            ! ...
8695            call atomic_ref (atom, val)
8696            if (val) then
8697              print *, "Obtained"
8698            end if
8699          end program atomic
8700
8701_See also_:
8702     *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
8703     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8704     ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
8705
8706
8707File: gfortran.info,  Node: ATOMIC_XOR,  Next: BACKTRACE,  Prev: ATOMIC_REF,  Up: Intrinsic Procedures
8708
87099.38 'ATOMIC_XOR' -- Atomic bitwise OR operation
8710================================================
8711
8712_Description_:
8713     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
8714     XOR between the values of ATOM and VALUE.  When STAT is present and
8715     the invocation was successful, it is assigned the value 0.  If it
8716     is present and the invocation has failed, it is assigned a positive
8717     value; in particular, for a coindexed ATOM, if the remote image has
8718     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8719     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8720     'STAT_FAILED_IMAGE'.
8721
8722_Standard_:
8723     TS 18508 or later
8724
8725_Class_:
8726     Atomic subroutine
8727
8728_Syntax_:
8729     'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
8730
8731_Arguments_:
8732     ATOM        Scalar coarray or coindexed variable of integer
8733                 type with 'ATOMIC_INT_KIND' kind.
8734     VALUE       Scalar of the same type as ATOM.  If the kind is
8735                 different, the value is converted to the kind of
8736                 ATOM.
8737     STAT        (optional) Scalar default-kind integer variable.
8738
8739_Example_:
8740          program atomic
8741            use iso_fortran_env
8742            integer(atomic_int_kind) :: atom[*]
8743            call atomic_xor (atom[1], int(b'10100011101'))
8744          end program atomic
8745
8746_See also_:
8747     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
8748     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8749     ATOMIC_XOR::
8750
8751
8752File: gfortran.info,  Node: BACKTRACE,  Next: BESSEL_J0,  Prev: ATOMIC_XOR,  Up: Intrinsic Procedures
8753
87549.39 'BACKTRACE' -- Show a backtrace
8755====================================
8756
8757_Description_:
8758     'BACKTRACE' shows a backtrace at an arbitrary place in user code.
8759     Program execution continues normally afterwards.  The backtrace
8760     information is printed to the unit corresponding to 'ERROR_UNIT' in
8761     'ISO_FORTRAN_ENV'.
8762
8763_Standard_:
8764     GNU Extension
8765
8766_Class_:
8767     Subroutine
8768
8769_Syntax_:
8770     'CALL BACKTRACE'
8771
8772_Arguments_:
8773     None
8774
8775_See also_:
8776     *note ABORT::
8777
8778
8779File: gfortran.info,  Node: BESSEL_J0,  Next: BESSEL_J1,  Prev: BACKTRACE,  Up: Intrinsic Procedures
8780
87819.40 'BESSEL_J0' -- Bessel function of the first kind of order 0
8782================================================================
8783
8784_Description_:
8785     'BESSEL_J0(X)' computes the Bessel function of the first kind of
8786     order 0 of X.  This function is available under the name 'BESJ0' as
8787     a GNU extension.
8788
8789_Standard_:
8790     Fortran 2008 and later
8791
8792_Class_:
8793     Elemental function
8794
8795_Syntax_:
8796     'RESULT = BESSEL_J0(X)'
8797
8798_Arguments_:
8799     X           The type shall be 'REAL'.
8800
8801_Return value_:
8802     The return value is of type 'REAL' and lies in the range -
8803     0.4027... \leq Bessel (0,x) \leq 1.  It has the same kind as X.
8804
8805_Example_:
8806          program test_besj0
8807            real(8) :: x = 0.0_8
8808            x = bessel_j0(x)
8809          end program test_besj0
8810
8811_Specific names_:
8812     Name           Argument       Return type    Standard
8813     'DBESJ0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8814
8815
8816File: gfortran.info,  Node: BESSEL_J1,  Next: BESSEL_JN,  Prev: BESSEL_J0,  Up: Intrinsic Procedures
8817
88189.41 'BESSEL_J1' -- Bessel function of the first kind of order 1
8819================================================================
8820
8821_Description_:
8822     'BESSEL_J1(X)' computes the Bessel function of the first kind of
8823     order 1 of X.  This function is available under the name 'BESJ1' as
8824     a GNU extension.
8825
8826_Standard_:
8827     Fortran 2008
8828
8829_Class_:
8830     Elemental function
8831
8832_Syntax_:
8833     'RESULT = BESSEL_J1(X)'
8834
8835_Arguments_:
8836     X           The type shall be 'REAL'.
8837
8838_Return value_:
8839     The return value is of type 'REAL' and lies in the range -
8840     0.5818... \leq Bessel (0,x) \leq 0.5818 .  It has the same kind as
8841     X.
8842
8843_Example_:
8844          program test_besj1
8845            real(8) :: x = 1.0_8
8846            x = bessel_j1(x)
8847          end program test_besj1
8848
8849_Specific names_:
8850     Name           Argument       Return type    Standard
8851     'DBESJ1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8852
8853
8854File: gfortran.info,  Node: BESSEL_JN,  Next: BESSEL_Y0,  Prev: BESSEL_J1,  Up: Intrinsic Procedures
8855
88569.42 'BESSEL_JN' -- Bessel function of the first kind
8857=====================================================
8858
8859_Description_:
8860     'BESSEL_JN(N, X)' computes the Bessel function of the first kind of
8861     order N of X.  This function is available under the name 'BESJN' as
8862     a GNU extension.  If N and X are arrays, their ranks and shapes
8863     shall conform.
8864
8865     'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
8866     of the first kind of the orders N1 to N2.
8867
8868_Standard_:
8869     Fortran 2008 and later, negative N is allowed as GNU extension
8870
8871_Class_:
8872     Elemental function, except for the transformational function
8873     'BESSEL_JN(N1, N2, X)'
8874
8875_Syntax_:
8876     'RESULT = BESSEL_JN(N, X)'
8877     'RESULT = BESSEL_JN(N1, N2, X)'
8878
8879_Arguments_:
8880     N           Shall be a scalar or an array of type 'INTEGER'.
8881     N1          Shall be a non-negative scalar of type
8882                 'INTEGER'.
8883     N2          Shall be a non-negative scalar of type
8884                 'INTEGER'.
8885     X           Shall be a scalar or an array of type 'REAL';
8886                 for 'BESSEL_JN(N1, N2, X)' it shall be scalar.
8887
8888_Return value_:
8889     The return value is a scalar of type 'REAL'.  It has the same kind
8890     as X.
8891
8892_Note_:
8893     The transformational function uses a recurrence algorithm which
8894     might, for some values of X, lead to different results than calls
8895     to the elemental function.
8896
8897_Example_:
8898          program test_besjn
8899            real(8) :: x = 1.0_8
8900            x = bessel_jn(5,x)
8901          end program test_besjn
8902
8903_Specific names_:
8904     Name           Argument       Return type    Standard
8905     'DBESJN(N,     'INTEGER N'    'REAL(8)'      GNU extension
8906     X)'
8907                    'REAL(8) X'
8908
8909
8910File: gfortran.info,  Node: BESSEL_Y0,  Next: BESSEL_Y1,  Prev: BESSEL_JN,  Up: Intrinsic Procedures
8911
89129.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0
8913=================================================================
8914
8915_Description_:
8916     'BESSEL_Y0(X)' computes the Bessel function of the second kind of
8917     order 0 of X.  This function is available under the name 'BESY0' as
8918     a GNU extension.
8919
8920_Standard_:
8921     Fortran 2008 and later
8922
8923_Class_:
8924     Elemental function
8925
8926_Syntax_:
8927     'RESULT = BESSEL_Y0(X)'
8928
8929_Arguments_:
8930     X           The type shall be 'REAL'.
8931
8932_Return value_:
8933     The return value is of type 'REAL'.  It has the same kind as X.
8934
8935_Example_:
8936          program test_besy0
8937            real(8) :: x = 0.0_8
8938            x = bessel_y0(x)
8939          end program test_besy0
8940
8941_Specific names_:
8942     Name           Argument       Return type    Standard
8943     'DBESY0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8944
8945
8946File: gfortran.info,  Node: BESSEL_Y1,  Next: BESSEL_YN,  Prev: BESSEL_Y0,  Up: Intrinsic Procedures
8947
89489.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1
8949=================================================================
8950
8951_Description_:
8952     'BESSEL_Y1(X)' computes the Bessel function of the second kind of
8953     order 1 of X.  This function is available under the name 'BESY1' as
8954     a GNU extension.
8955
8956_Standard_:
8957     Fortran 2008 and later
8958
8959_Class_:
8960     Elemental function
8961
8962_Syntax_:
8963     'RESULT = BESSEL_Y1(X)'
8964
8965_Arguments_:
8966     X           The type shall be 'REAL'.
8967
8968_Return value_:
8969     The return value is of type 'REAL'.  It has the same kind as X.
8970
8971_Example_:
8972          program test_besy1
8973            real(8) :: x = 1.0_8
8974            x = bessel_y1(x)
8975          end program test_besy1
8976
8977_Specific names_:
8978     Name           Argument       Return type    Standard
8979     'DBESY1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8980
8981
8982File: gfortran.info,  Node: BESSEL_YN,  Next: BGE,  Prev: BESSEL_Y1,  Up: Intrinsic Procedures
8983
89849.45 'BESSEL_YN' -- Bessel function of the second kind
8985======================================================
8986
8987_Description_:
8988     'BESSEL_YN(N, X)' computes the Bessel function of the second kind
8989     of order N of X.  This function is available under the name 'BESYN'
8990     as a GNU extension.  If N and X are arrays, their ranks and shapes
8991     shall conform.
8992
8993     'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
8994     of the first kind of the orders N1 to N2.
8995
8996_Standard_:
8997     Fortran 2008 and later, negative N is allowed as GNU extension
8998
8999_Class_:
9000     Elemental function, except for the transformational function
9001     'BESSEL_YN(N1, N2, X)'
9002
9003_Syntax_:
9004     'RESULT = BESSEL_YN(N, X)'
9005     'RESULT = BESSEL_YN(N1, N2, X)'
9006
9007_Arguments_:
9008     N           Shall be a scalar or an array of type 'INTEGER'
9009                 .
9010     N1          Shall be a non-negative scalar of type
9011                 'INTEGER'.
9012     N2          Shall be a non-negative scalar of type
9013                 'INTEGER'.
9014     X           Shall be a scalar or an array of type 'REAL';
9015                 for 'BESSEL_YN(N1, N2, X)' it shall be scalar.
9016
9017_Return value_:
9018     The return value is a scalar of type 'REAL'.  It has the same kind
9019     as X.
9020
9021_Note_:
9022     The transformational function uses a recurrence algorithm which
9023     might, for some values of X, lead to different results than calls
9024     to the elemental function.
9025
9026_Example_:
9027          program test_besyn
9028            real(8) :: x = 1.0_8
9029            x = bessel_yn(5,x)
9030          end program test_besyn
9031
9032_Specific names_:
9033     Name           Argument       Return type    Standard
9034     'DBESYN(N,X)'  'INTEGER N'    'REAL(8)'      GNU extension
9035                    'REAL(8) X'
9036
9037
9038File: gfortran.info,  Node: BGE,  Next: BGT,  Prev: BESSEL_YN,  Up: Intrinsic Procedures
9039
90409.46 'BGE' -- Bitwise greater than or equal to
9041==============================================
9042
9043_Description_:
9044     Determines whether an integral is a bitwise greater than or equal
9045     to another.
9046
9047_Standard_:
9048     Fortran 2008 and later
9049
9050_Class_:
9051     Elemental function
9052
9053_Syntax_:
9054     'RESULT = BGE(I, J)'
9055
9056_Arguments_:
9057     I           Shall be of 'INTEGER' type.
9058     J           Shall be of 'INTEGER' type, and of the same kind
9059                 as I.
9060
9061_Return value_:
9062     The return value is of type 'LOGICAL' and of the default kind.
9063
9064_See also_:
9065     *note BGT::, *note BLE::, *note BLT::
9066
9067
9068File: gfortran.info,  Node: BGT,  Next: BIT_SIZE,  Prev: BGE,  Up: Intrinsic Procedures
9069
90709.47 'BGT' -- Bitwise greater than
9071==================================
9072
9073_Description_:
9074     Determines whether an integral is a bitwise greater than another.
9075
9076_Standard_:
9077     Fortran 2008 and later
9078
9079_Class_:
9080     Elemental function
9081
9082_Syntax_:
9083     'RESULT = BGT(I, J)'
9084
9085_Arguments_:
9086     I           Shall be of 'INTEGER' type.
9087     J           Shall be of 'INTEGER' type, and of the same kind
9088                 as I.
9089
9090_Return value_:
9091     The return value is of type 'LOGICAL' and of the default kind.
9092
9093_See also_:
9094     *note BGE::, *note BLE::, *note BLT::
9095
9096
9097File: gfortran.info,  Node: BIT_SIZE,  Next: BLE,  Prev: BGT,  Up: Intrinsic Procedures
9098
90999.48 'BIT_SIZE' -- Bit size inquiry function
9100============================================
9101
9102_Description_:
9103     'BIT_SIZE(I)' returns the number of bits (integer precision plus
9104     sign bit) represented by the type of I.  The result of
9105     'BIT_SIZE(I)' is independent of the actual value of I.
9106
9107_Standard_:
9108     Fortran 95 and later
9109
9110_Class_:
9111     Inquiry function
9112
9113_Syntax_:
9114     'RESULT = BIT_SIZE(I)'
9115
9116_Arguments_:
9117     I           The type shall be 'INTEGER'.
9118
9119_Return value_:
9120     The return value is of type 'INTEGER'
9121
9122_Example_:
9123          program test_bit_size
9124              integer :: i = 123
9125              integer :: size
9126              size = bit_size(i)
9127              print *, size
9128          end program test_bit_size
9129
9130
9131File: gfortran.info,  Node: BLE,  Next: BLT,  Prev: BIT_SIZE,  Up: Intrinsic Procedures
9132
91339.49 'BLE' -- Bitwise less than or equal to
9134===========================================
9135
9136_Description_:
9137     Determines whether an integral is a bitwise less than or equal to
9138     another.
9139
9140_Standard_:
9141     Fortran 2008 and later
9142
9143_Class_:
9144     Elemental function
9145
9146_Syntax_:
9147     'RESULT = BLE(I, J)'
9148
9149_Arguments_:
9150     I           Shall be of 'INTEGER' type.
9151     J           Shall be of 'INTEGER' type, and of the same kind
9152                 as I.
9153
9154_Return value_:
9155     The return value is of type 'LOGICAL' and of the default kind.
9156
9157_See also_:
9158     *note BGT::, *note BGE::, *note BLT::
9159
9160
9161File: gfortran.info,  Node: BLT,  Next: BTEST,  Prev: BLE,  Up: Intrinsic Procedures
9162
91639.50 'BLT' -- Bitwise less than
9164===============================
9165
9166_Description_:
9167     Determines whether an integral is a bitwise less than another.
9168
9169_Standard_:
9170     Fortran 2008 and later
9171
9172_Class_:
9173     Elemental function
9174
9175_Syntax_:
9176     'RESULT = BLT(I, J)'
9177
9178_Arguments_:
9179     I           Shall be of 'INTEGER' type.
9180     J           Shall be of 'INTEGER' type, and of the same kind
9181                 as I.
9182
9183_Return value_:
9184     The return value is of type 'LOGICAL' and of the default kind.
9185
9186_See also_:
9187     *note BGE::, *note BGT::, *note BLE::
9188
9189
9190File: gfortran.info,  Node: BTEST,  Next: C_ASSOCIATED,  Prev: BLT,  Up: Intrinsic Procedures
9191
91929.51 'BTEST' -- Bit test function
9193=================================
9194
9195_Description_:
9196     'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is
9197     set.  The counting of the bits starts at 0.
9198
9199_Standard_:
9200     Fortran 95 and later, has overloads that are GNU extensions
9201
9202_Class_:
9203     Elemental function
9204
9205_Syntax_:
9206     'RESULT = BTEST(I, POS)'
9207
9208_Arguments_:
9209     I           The type shall be 'INTEGER'.
9210     POS         The type shall be 'INTEGER'.
9211
9212_Return value_:
9213     The return value is of type 'LOGICAL'
9214
9215_Example_:
9216          program test_btest
9217              integer :: i = 32768 + 1024 + 64
9218              integer :: pos
9219              logical :: bool
9220              do pos=0,16
9221                  bool = btest(i, pos)
9222                  print *, pos, bool
9223              end do
9224          end program test_btest
9225
9226_Specific names_:
9227     Name           Argument       Return type    Standard
9228     'BTEST(I,POS)' 'INTEGER       'LOGICAL'      F95 and later
9229                    I,POS'
9230     'BBTEST(I,POS)''INTEGER(1)    'LOGICAL(1)'   GNU extension
9231                    I,POS'
9232     'BITEST(I,POS)''INTEGER(2)    'LOGICAL(2)'   GNU extension
9233                    I,POS'
9234     'BJTEST(I,POS)''INTEGER(4)    'LOGICAL(4)'   GNU extension
9235                    I,POS'
9236     'BKTEST(I,POS)''INTEGER(8)    'LOGICAL(8)'   GNU extension
9237                    I,POS'
9238
9239
9240File: gfortran.info,  Node: C_ASSOCIATED,  Next: C_F_POINTER,  Prev: BTEST,  Up: Intrinsic Procedures
9241
92429.52 'C_ASSOCIATED' -- Status of a C pointer
9243============================================
9244
9245_Description_:
9246     'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
9247     pointer C_PTR_1 or if C_PTR_1 is associated with the target
9248     C_PTR_2.
9249
9250_Standard_:
9251     Fortran 2003 and later
9252
9253_Class_:
9254     Inquiry function
9255
9256_Syntax_:
9257     'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
9258
9259_Arguments_:
9260     C_PTR_1     Scalar of the type 'C_PTR' or 'C_FUNPTR'.
9261     C_PTR_2     (Optional) Scalar of the same type as C_PTR_1.
9262
9263_Return value_:
9264     The return value is of type 'LOGICAL'; it is '.false.' if either
9265     C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
9266     different addresses.
9267
9268_Example_:
9269          subroutine association_test(a,b)
9270            use iso_c_binding, only: c_associated, c_loc, c_ptr
9271            implicit none
9272            real, pointer :: a
9273            type(c_ptr) :: b
9274            if(c_associated(b, c_loc(a))) &
9275               stop 'b and a do not point to same target'
9276          end subroutine association_test
9277
9278_See also_:
9279     *note C_LOC::, *note C_FUNLOC::
9280
9281
9282File: gfortran.info,  Node: C_F_POINTER,  Next: C_F_PROCPOINTER,  Prev: C_ASSOCIATED,  Up: Intrinsic Procedures
9283
92849.53 'C_F_POINTER' -- Convert C into Fortran pointer
9285====================================================
9286
9287_Description_:
9288     'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
9289     pointer CPTR to the Fortran pointer FPTR and specifies its shape.
9290
9291_Standard_:
9292     Fortran 2003 and later
9293
9294_Class_:
9295     Subroutine
9296
9297_Syntax_:
9298     'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
9299
9300_Arguments_:
9301     CPTR        scalar of the type 'C_PTR'.  It is 'INTENT(IN)'.
9302     FPTR        pointer interoperable with CPTR.  It is
9303                 'INTENT(OUT)'.
9304     SHAPE       (Optional) Rank-one array of type 'INTEGER' with
9305                 'INTENT(IN)'.  It shall be present if and only
9306                 if FPTR is an array.  The size must be equal to
9307                 the rank of FPTR.
9308
9309_Example_:
9310          program main
9311            use iso_c_binding
9312            implicit none
9313            interface
9314              subroutine my_routine(p) bind(c,name='myC_func')
9315                import :: c_ptr
9316                type(c_ptr), intent(out) :: p
9317              end subroutine
9318            end interface
9319            type(c_ptr) :: cptr
9320            real,pointer :: a(:)
9321            call my_routine(cptr)
9322            call c_f_pointer(cptr, a, [12])
9323          end program main
9324
9325_See also_:
9326     *note C_LOC::, *note C_F_PROCPOINTER::
9327
9328
9329File: gfortran.info,  Node: C_F_PROCPOINTER,  Next: C_FUNLOC,  Prev: C_F_POINTER,  Up: Intrinsic Procedures
9330
93319.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
9332==================================================================
9333
9334_Description_:
9335     'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
9336     pointer CPTR to the Fortran procedure pointer FPTR.
9337
9338_Standard_:
9339     Fortran 2003 and later
9340
9341_Class_:
9342     Subroutine
9343
9344_Syntax_:
9345     'CALL C_F_PROCPOINTER(cptr, fptr)'
9346
9347_Arguments_:
9348     CPTR        scalar of the type 'C_FUNPTR'.  It is
9349                 'INTENT(IN)'.
9350     FPTR        procedure pointer interoperable with CPTR.  It
9351                 is 'INTENT(OUT)'.
9352
9353_Example_:
9354          program main
9355            use iso_c_binding
9356            implicit none
9357            abstract interface
9358              function func(a)
9359                import :: c_float
9360                real(c_float), intent(in) :: a
9361                real(c_float) :: func
9362              end function
9363            end interface
9364            interface
9365               function getIterFunc() bind(c,name="getIterFunc")
9366                 import :: c_funptr
9367                 type(c_funptr) :: getIterFunc
9368               end function
9369            end interface
9370            type(c_funptr) :: cfunptr
9371            procedure(func), pointer :: myFunc
9372            cfunptr = getIterFunc()
9373            call c_f_procpointer(cfunptr, myFunc)
9374          end program main
9375
9376_See also_:
9377     *note C_LOC::, *note C_F_POINTER::
9378
9379
9380File: gfortran.info,  Node: C_FUNLOC,  Next: C_LOC,  Prev: C_F_PROCPOINTER,  Up: Intrinsic Procedures
9381
93829.55 'C_FUNLOC' -- Obtain the C address of a procedure
9383======================================================
9384
9385_Description_:
9386     'C_FUNLOC(x)' determines the C address of the argument.
9387
9388_Standard_:
9389     Fortran 2003 and later
9390
9391_Class_:
9392     Inquiry function
9393
9394_Syntax_:
9395     'RESULT = C_FUNLOC(x)'
9396
9397_Arguments_:
9398     X           Interoperable function or pointer to such
9399                 function.
9400
9401_Return value_:
9402     The return value is of type 'C_FUNPTR' and contains the C address
9403     of the argument.
9404
9405_Example_:
9406          module x
9407            use iso_c_binding
9408            implicit none
9409          contains
9410            subroutine sub(a) bind(c)
9411              real(c_float) :: a
9412              a = sqrt(a)+5.0
9413            end subroutine sub
9414          end module x
9415          program main
9416            use iso_c_binding
9417            use x
9418            implicit none
9419            interface
9420              subroutine my_routine(p) bind(c,name='myC_func')
9421                import :: c_funptr
9422                type(c_funptr), intent(in) :: p
9423              end subroutine
9424            end interface
9425            call my_routine(c_funloc(sub))
9426          end program main
9427
9428_See also_:
9429     *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
9430     C_F_PROCPOINTER::
9431
9432
9433File: gfortran.info,  Node: C_LOC,  Next: C_SIZEOF,  Prev: C_FUNLOC,  Up: Intrinsic Procedures
9434
94359.56 'C_LOC' -- Obtain the C address of an object
9436=================================================
9437
9438_Description_:
9439     'C_LOC(X)' determines the C address of the argument.
9440
9441_Standard_:
9442     Fortran 2003 and later
9443
9444_Class_:
9445     Inquiry function
9446
9447_Syntax_:
9448     'RESULT = C_LOC(X)'
9449
9450_Arguments_:
9451     X       Shall have either the POINTER or TARGET attribute.
9452             It shall not be a coindexed object.  It shall either
9453             be a variable with interoperable type and kind type
9454             parameters, or be a scalar, nonpolymorphic variable
9455             with no length type parameters.
9456
9457
9458_Return value_:
9459     The return value is of type 'C_PTR' and contains the C address of
9460     the argument.
9461
9462_Example_:
9463          subroutine association_test(a,b)
9464            use iso_c_binding, only: c_associated, c_loc, c_ptr
9465            implicit none
9466            real, pointer :: a
9467            type(c_ptr) :: b
9468            if(c_associated(b, c_loc(a))) &
9469               stop 'b and a do not point to same target'
9470          end subroutine association_test
9471
9472_See also_:
9473     *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
9474     C_F_PROCPOINTER::
9475
9476
9477File: gfortran.info,  Node: C_SIZEOF,  Next: CEILING,  Prev: C_LOC,  Up: Intrinsic Procedures
9478
94799.57 'C_SIZEOF' -- Size in bytes of an expression
9480=================================================
9481
9482_Description_:
9483     'C_SIZEOF(X)' calculates the number of bytes of storage the
9484     expression 'X' occupies.
9485
9486_Standard_:
9487     Fortran 2008
9488
9489_Class_:
9490     Inquiry function of the module 'ISO_C_BINDING'
9491
9492_Syntax_:
9493     'N = C_SIZEOF(X)'
9494
9495_Arguments_:
9496     X           The argument shall be an interoperable data
9497                 entity.
9498
9499_Return value_:
9500     The return value is of type integer and of the system-dependent
9501     kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module).  Its value is
9502     the number of bytes occupied by the argument.  If the argument has
9503     the 'POINTER' attribute, the number of bytes of the storage area
9504     pointed to is returned.  If the argument is of a derived type with
9505     'POINTER' or 'ALLOCATABLE' components, the return value does not
9506     account for the sizes of the data pointed to by these components.
9507
9508_Example_:
9509             use iso_c_binding
9510             integer(c_int) :: i
9511             real(c_float) :: r, s(5)
9512             print *, (c_sizeof(s)/c_sizeof(r) == 5)
9513             end
9514     The example will print '.TRUE.' unless you are using a platform
9515     where default 'REAL' variables are unusually padded.
9516
9517_See also_:
9518     *note SIZEOF::, *note STORAGE_SIZE::
9519
9520
9521File: gfortran.info,  Node: CEILING,  Next: CHAR,  Prev: C_SIZEOF,  Up: Intrinsic Procedures
9522
95239.58 'CEILING' -- Integer ceiling function
9524==========================================
9525
9526_Description_:
9527     'CEILING(A)' returns the least integer greater than or equal to A.
9528
9529_Standard_:
9530     Fortran 95 and later
9531
9532_Class_:
9533     Elemental function
9534
9535_Syntax_:
9536     'RESULT = CEILING(A [, KIND])'
9537
9538_Arguments_:
9539     A           The type shall be 'REAL'.
9540     KIND        (Optional) An 'INTEGER' initialization
9541                 expression indicating the kind parameter of the
9542                 result.
9543
9544_Return value_:
9545     The return value is of type 'INTEGER(KIND)' if KIND is present and
9546     a default-kind 'INTEGER' otherwise.
9547
9548_Example_:
9549          program test_ceiling
9550              real :: x = 63.29
9551              real :: y = -63.59
9552              print *, ceiling(x) ! returns 64
9553              print *, ceiling(y) ! returns -63
9554          end program test_ceiling
9555
9556_See also_:
9557     *note FLOOR::, *note NINT::
9558
9559
9560File: gfortran.info,  Node: CHAR,  Next: CHDIR,  Prev: CEILING,  Up: Intrinsic Procedures
9561
95629.59 'CHAR' -- Character conversion function
9563============================================
9564
9565_Description_:
9566     'CHAR(I [, KIND])' returns the character represented by the integer
9567     I.
9568
9569_Standard_:
9570     Fortran 77 and later
9571
9572_Class_:
9573     Elemental function
9574
9575_Syntax_:
9576     'RESULT = CHAR(I [, KIND])'
9577
9578_Arguments_:
9579     I           The type shall be 'INTEGER'.
9580     KIND        (Optional) An 'INTEGER' initialization
9581                 expression indicating the kind parameter of the
9582                 result.
9583
9584_Return value_:
9585     The return value is of type 'CHARACTER(1)'
9586
9587_Example_:
9588          program test_char
9589              integer :: i = 74
9590              character(1) :: c
9591              c = char(i)
9592              print *, i, c ! returns 'J'
9593          end program test_char
9594
9595_Specific names_:
9596     Name           Argument       Return type    Standard
9597     'CHAR(I)'      'INTEGER I'    'CHARACTER(LEN=1)'F77 and later
9598
9599_Note_:
9600     See *note ICHAR:: for a discussion of converting between numerical
9601     values and formatted string representations.
9602
9603_See also_:
9604     *note ACHAR::, *note IACHAR::, *note ICHAR::
9605
9606
9607File: gfortran.info,  Node: CHDIR,  Next: CHMOD,  Prev: CHAR,  Up: Intrinsic Procedures
9608
96099.60 'CHDIR' -- Change working directory
9610========================================
9611
9612_Description_:
9613     Change current working directory to a specified path.
9614
9615     This intrinsic is provided in both subroutine and function forms;
9616     however, only one form can be used in any given program unit.
9617
9618_Standard_:
9619     GNU extension
9620
9621_Class_:
9622     Subroutine, function
9623
9624_Syntax_:
9625     'CALL CHDIR(NAME [, STATUS])'
9626     'STATUS = CHDIR(NAME)'
9627
9628_Arguments_:
9629     NAME        The type shall be 'CHARACTER' of default kind
9630                 and shall specify a valid path within the file
9631                 system.
9632     STATUS      (Optional) 'INTEGER' status flag of the default
9633                 kind.  Returns 0 on success, and a system
9634                 specific and nonzero error code otherwise.
9635
9636_Example_:
9637          PROGRAM test_chdir
9638            CHARACTER(len=255) :: path
9639            CALL getcwd(path)
9640            WRITE(*,*) TRIM(path)
9641            CALL chdir("/tmp")
9642            CALL getcwd(path)
9643            WRITE(*,*) TRIM(path)
9644          END PROGRAM
9645
9646_See also_:
9647     *note GETCWD::
9648
9649
9650File: gfortran.info,  Node: CHMOD,  Next: CMPLX,  Prev: CHDIR,  Up: Intrinsic Procedures
9651
96529.61 'CHMOD' -- Change access permissions of files
9653==================================================
9654
9655_Description_:
9656     'CHMOD' changes the permissions of a file.
9657
9658     This intrinsic is provided in both subroutine and function forms;
9659     however, only one form can be used in any given program unit.
9660
9661_Standard_:
9662     GNU extension
9663
9664_Class_:
9665     Subroutine, function
9666
9667_Syntax_:
9668     'CALL CHMOD(NAME, MODE[, STATUS])'
9669     'STATUS = CHMOD(NAME, MODE)'
9670
9671_Arguments_:
9672
9673     NAME        Scalar 'CHARACTER' of default kind with the file
9674                 name.  Trailing blanks are ignored unless the
9675                 character 'achar(0)' is present, then all
9676                 characters up to and excluding 'achar(0)' are
9677                 used as the file name.
9678
9679     MODE        Scalar 'CHARACTER' of default kind giving the
9680                 file permission.  MODE uses the same syntax as
9681                 the 'chmod' utility as defined by the POSIX
9682                 standard.  The argument shall either be a string
9683                 of a nonnegative octal number or a symbolic
9684                 mode.
9685
9686     STATUS      (optional) scalar 'INTEGER', which is '0' on
9687                 success and nonzero otherwise.
9688
9689_Return value_:
9690     In either syntax, STATUS is set to '0' on success and nonzero
9691     otherwise.
9692
9693_Example_:
9694     'CHMOD' as subroutine
9695          program chmod_test
9696            implicit none
9697            integer :: status
9698            call chmod('test.dat','u+x',status)
9699            print *, 'Status: ', status
9700          end program chmod_test
9701     'CHMOD' as function:
9702          program chmod_test
9703            implicit none
9704            integer :: status
9705            status = chmod('test.dat','u+x')
9706            print *, 'Status: ', status
9707          end program chmod_test
9708
9709
9710File: gfortran.info,  Node: CMPLX,  Next: CO_BROADCAST,  Prev: CHMOD,  Up: Intrinsic Procedures
9711
97129.62 'CMPLX' -- Complex conversion function
9713===========================================
9714
9715_Description_:
9716     'CMPLX(X [, Y [, KIND]])' returns a complex number where X is
9717     converted to the real component.  If Y is present it is converted
9718     to the imaginary component.  If Y is not present then the imaginary
9719     component is set to 0.0.  If X is complex then Y must not be
9720     present.
9721
9722_Standard_:
9723     Fortran 77 and later
9724
9725_Class_:
9726     Elemental function
9727
9728_Syntax_:
9729     'RESULT = CMPLX(X [, Y [, KIND]])'
9730
9731_Arguments_:
9732     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
9733     Y           (Optional; only allowed if X is not 'COMPLEX'.)
9734                 May be 'INTEGER' or 'REAL'.
9735     KIND        (Optional) An 'INTEGER' initialization
9736                 expression indicating the kind parameter of the
9737                 result.
9738
9739_Return value_:
9740     The return value is of 'COMPLEX' type, with a kind equal to KIND if
9741     it is specified.  If KIND is not specified, the result is of the
9742     default 'COMPLEX' kind, regardless of the kinds of X and Y.
9743
9744_Example_:
9745          program test_cmplx
9746              integer :: i = 42
9747              real :: x = 3.14
9748              complex :: z
9749              z = cmplx(i, x)
9750              print *, z, cmplx(x)
9751          end program test_cmplx
9752
9753_See also_:
9754     *note COMPLEX::
9755
9756
9757File: gfortran.info,  Node: CO_BROADCAST,  Next: CO_MAX,  Prev: CMPLX,  Up: Intrinsic Procedures
9758
97599.63 'CO_BROADCAST' -- Copy a value to all images the current set of images
9760===========================================================================
9761
9762_Description_:
9763     'CO_BROADCAST' copies the value of argument A on the image with
9764     image index 'SOURCE_IMAGE' to all images in the current team.  A
9765     becomes defined as if by intrinsic assignment.  If the execution
9766     was successful and STAT is present, it is assigned the value zero.
9767     If the execution failed, STAT gets assigned a nonzero value and, if
9768     present, ERRMSG gets assigned a value describing the occurred
9769     error.
9770
9771_Standard_:
9772     Technical Specification (TS) 18508 or later
9773
9774_Class_:
9775     Collective subroutine
9776
9777_Syntax_:
9778     'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
9779
9780_Arguments_:
9781     A           INTENT(INOUT) argument; shall have the same
9782                 dynamic type and type paramters on all images of
9783                 the current team.  If it is an array, it shall
9784                 have the same shape on all images.
9785     SOURCE_IMAGEa scalar integer expression.  It shall have the
9786                 same the same value on all images and refer to
9787                 an image of the current team.
9788     STAT        (optional) a scalar integer variable
9789     ERRMSG      (optional) a scalar character variable
9790
9791_Example_:
9792          program test
9793            integer :: val(3)
9794            if (this_image() == 1) then
9795              val = [1, 5, 3]
9796            end if
9797            call co_broadcast (val, source_image=1)
9798            print *, this_image, ":", val
9799          end program test
9800
9801_See also_:
9802     *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
9803
9804
9805File: gfortran.info,  Node: CO_MAX,  Next: CO_MIN,  Prev: CO_BROADCAST,  Up: Intrinsic Procedures
9806
98079.64 'CO_MAX' -- Maximal value on the current set of images
9808===========================================================
9809
9810_Description_:
9811     'CO_MAX' determines element-wise the maximal value of A on all
9812     images of the current team.  If RESULT_IMAGE is present, the
9813     maximum values are returned in A on the specified image only and
9814     the value of A on the other images become undefined.  If
9815     RESULT_IMAGE is not present, the value is returned on all images.
9816     If the execution was successful and STAT is present, it is assigned
9817     the value zero.  If the execution failed, STAT gets assigned a
9818     nonzero value and, if present, ERRMSG gets assigned a value
9819     describing the occurred error.
9820
9821_Standard_:
9822     Technical Specification (TS) 18508 or later
9823
9824_Class_:
9825     Collective subroutine
9826
9827_Syntax_:
9828     'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
9829
9830_Arguments_:
9831     A           shall be an integer, real or character variable,
9832                 which has the same type and type parameters on
9833                 all images of the team.
9834     RESULT_IMAGE(optional) a scalar integer expression; if
9835                 present, it shall have the same the same value
9836                 on all images and refer to an image of the
9837                 current team.
9838     STAT        (optional) a scalar integer variable
9839     ERRMSG      (optional) a scalar character variable
9840
9841_Example_:
9842          program test
9843            integer :: val
9844            val = this_image ()
9845            call co_max (val, result_image=1)
9846            if (this_image() == 1) then
9847              write(*,*) "Maximal value", val  ! prints num_images()
9848            end if
9849          end program test
9850
9851_See also_:
9852     *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
9853     CO_BROADCAST::
9854
9855
9856File: gfortran.info,  Node: CO_MIN,  Next: CO_REDUCE,  Prev: CO_MAX,  Up: Intrinsic Procedures
9857
98589.65 'CO_MIN' -- Minimal value on the current set of images
9859===========================================================
9860
9861_Description_:
9862     'CO_MIN' determines element-wise the minimal value of A on all
9863     images of the current team.  If RESULT_IMAGE is present, the
9864     minimal values are returned in A on the specified image only and
9865     the value of A on the other images become undefined.  If
9866     RESULT_IMAGE is not present, the value is returned on all images.
9867     If the execution was successful and STAT is present, it is assigned
9868     the value zero.  If the execution failed, STAT gets assigned a
9869     nonzero value and, if present, ERRMSG gets assigned a value
9870     describing the occurred error.
9871
9872_Standard_:
9873     Technical Specification (TS) 18508 or later
9874
9875_Class_:
9876     Collective subroutine
9877
9878_Syntax_:
9879     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
9880
9881_Arguments_:
9882     A           shall be an integer, real or character variable,
9883                 which has the same type and type parameters on
9884                 all images of the team.
9885     RESULT_IMAGE(optional) a scalar integer expression; if
9886                 present, it shall have the same the same value
9887                 on all images and refer to an image of the
9888                 current team.
9889     STAT        (optional) a scalar integer variable
9890     ERRMSG      (optional) a scalar character variable
9891
9892_Example_:
9893          program test
9894            integer :: val
9895            val = this_image ()
9896            call co_min (val, result_image=1)
9897            if (this_image() == 1) then
9898              write(*,*) "Minimal value", val  ! prints 1
9899            end if
9900          end program test
9901
9902_See also_:
9903     *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
9904     CO_BROADCAST::
9905
9906
9907File: gfortran.info,  Node: CO_REDUCE,  Next: CO_SUM,  Prev: CO_MIN,  Up: Intrinsic Procedures
9908
99099.66 'CO_REDUCE' -- Reduction of values on the current set of images
9910====================================================================
9911
9912_Description_:
9913     'CO_REDUCE' determines element-wise the reduction of the value of A
9914     on all images of the current team.  The pure function passed as
9915     OPERATOR is used to pairwise reduce the values of A by passing
9916     either the value of A of different images or the result values of
9917     such a reduction as argument.  If A is an array, the deduction is
9918     done element wise.  If RESULT_IMAGE is present, the result values
9919     are returned in A on the specified image only and the value of A on
9920     the other images become undefined.  If RESULT_IMAGE is not present,
9921     the value is returned on all images.  If the execution was
9922     successful and STAT is present, it is assigned the value zero.  If
9923     the execution failed, STAT gets assigned a nonzero value and, if
9924     present, ERRMSG gets assigned a value describing the occurred
9925     error.
9926
9927_Standard_:
9928     Technical Specification (TS) 18508 or later
9929
9930_Class_:
9931     Collective subroutine
9932
9933_Syntax_:
9934     'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
9935
9936_Arguments_:
9937     A           is an 'INTENT(INOUT)' argument and shall be
9938                 nonpolymorphic.  If it is allocatable, it shall
9939                 be allocated; if it is a pointer, it shall be
9940                 associated.  A shall have the same type and type
9941                 parameters on all images of the team; if it is
9942                 an array, it shall have the same shape on all
9943                 images.
9944     OPERATOR    pure function with two scalar nonallocatable
9945                 arguments, which shall be nonpolymorphic and
9946                 have the same type and type parameters as A.
9947                 The function shall return a nonallocatable
9948                 scalar of the same type and type parameters as
9949                 A.  The function shall be the same on all images
9950                 and with regards to the arguments mathematically
9951                 commutative and associative.  Note that OPERATOR
9952                 may not be an elemental function, unless it is
9953                 an intrisic function.
9954     RESULT_IMAGE(optional) a scalar integer expression; if
9955                 present, it shall have the same the same value
9956                 on all images and refer to an image of the
9957                 current team.
9958     STAT        (optional) a scalar integer variable
9959     ERRMSG      (optional) a scalar character variable
9960
9961_Example_:
9962          program test
9963            integer :: val
9964            val = this_image ()
9965            call co_reduce (val, result_image=1, operator=myprod)
9966            if (this_image() == 1) then
9967              write(*,*) "Product value", val  ! prints num_images() factorial
9968            end if
9969          contains
9970            pure function myprod(a, b)
9971              integer, value :: a, b
9972              integer :: myprod
9973              myprod = a * b
9974            end function myprod
9975          end program test
9976
9977_Note_:
9978     While the rules permit in principle an intrinsic function, none of
9979     the intrinsics in the standard fulfill the criteria of having a
9980     specific function, which takes two arguments of the same type and
9981     returning that type as result.
9982
9983_See also_:
9984     *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
9985     CO_BROADCAST::
9986
9987
9988File: gfortran.info,  Node: CO_SUM,  Next: COMMAND_ARGUMENT_COUNT,  Prev: CO_REDUCE,  Up: Intrinsic Procedures
9989
99909.67 'CO_SUM' -- Sum of values on the current set of images
9991===========================================================
9992
9993_Description_:
9994     'CO_SUM' sums up the values of each element of A on all images of
9995     the current team.  If RESULT_IMAGE is present, the summed-up values
9996     are returned in A on the specified image only and the value of A on
9997     the other images become undefined.  If RESULT_IMAGE is not present,
9998     the value is returned on all images.  If the execution was
9999     successful and STAT is present, it is assigned the value zero.  If
10000     the execution failed, STAT gets assigned a nonzero value and, if
10001     present, ERRMSG gets assigned a value describing the occurred
10002     error.
10003
10004_Standard_:
10005     Technical Specification (TS) 18508 or later
10006
10007_Class_:
10008     Collective subroutine
10009
10010_Syntax_:
10011     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
10012
10013_Arguments_:
10014     A           shall be an integer, real or complex variable,
10015                 which has the same type and type parameters on
10016                 all images of the team.
10017     RESULT_IMAGE(optional) a scalar integer expression; if
10018                 present, it shall have the same the same value
10019                 on all images and refer to an image of the
10020                 current team.
10021     STAT        (optional) a scalar integer variable
10022     ERRMSG      (optional) a scalar character variable
10023
10024_Example_:
10025          program test
10026            integer :: val
10027            val = this_image ()
10028            call co_sum (val, result_image=1)
10029            if (this_image() == 1) then
10030              write(*,*) "The sum is ", val ! prints (n**2 + n)/2, with n = num_images()
10031            end if
10032          end program test
10033
10034_See also_:
10035     *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
10036     CO_BROADCAST::
10037
10038
10039File: gfortran.info,  Node: COMMAND_ARGUMENT_COUNT,  Next: COMPILER_OPTIONS,  Prev: CO_SUM,  Up: Intrinsic Procedures
10040
100419.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
10042=====================================================================
10043
10044_Description_:
10045     'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
10046     the command line when the containing program was invoked.
10047
10048_Standard_:
10049     Fortran 2003 and later
10050
10051_Class_:
10052     Inquiry function
10053
10054_Syntax_:
10055     'RESULT = COMMAND_ARGUMENT_COUNT()'
10056
10057_Arguments_:
10058     None
10059
10060_Return value_:
10061     The return value is an 'INTEGER' of default kind.
10062
10063_Example_:
10064          program test_command_argument_count
10065              integer :: count
10066              count = command_argument_count()
10067              print *, count
10068          end program test_command_argument_count
10069
10070_See also_:
10071     *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
10072
10073
10074File: gfortran.info,  Node: COMPILER_OPTIONS,  Next: COMPILER_VERSION,  Prev: COMMAND_ARGUMENT_COUNT,  Up: Intrinsic Procedures
10075
100769.69 'COMPILER_OPTIONS' -- Options passed to the compiler
10077=========================================================
10078
10079_Description_:
10080     'COMPILER_OPTIONS' returns a string with the options used for
10081     compiling.
10082
10083_Standard_:
10084     Fortran 2008
10085
10086_Class_:
10087     Inquiry function of the module 'ISO_FORTRAN_ENV'
10088
10089_Syntax_:
10090     'STR = COMPILER_OPTIONS()'
10091
10092_Arguments_:
10093     None.
10094
10095_Return value_:
10096     The return value is a default-kind string with system-dependent
10097     length.  It contains the compiler flags used to compile the file,
10098     which called the 'COMPILER_OPTIONS' intrinsic.
10099
10100_Example_:
10101             use iso_fortran_env
10102             print '(4a)', 'This file was compiled by ', &
10103                           compiler_version(), ' using the options ', &
10104                           compiler_options()
10105             end
10106
10107_See also_:
10108     *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
10109
10110
10111File: gfortran.info,  Node: COMPILER_VERSION,  Next: COMPLEX,  Prev: COMPILER_OPTIONS,  Up: Intrinsic Procedures
10112
101139.70 'COMPILER_VERSION' -- Compiler version string
10114==================================================
10115
10116_Description_:
10117     'COMPILER_VERSION' returns a string with the name and the version
10118     of the compiler.
10119
10120_Standard_:
10121     Fortran 2008
10122
10123_Class_:
10124     Inquiry function of the module 'ISO_FORTRAN_ENV'
10125
10126_Syntax_:
10127     'STR = COMPILER_VERSION()'
10128
10129_Arguments_:
10130     None.
10131
10132_Return value_:
10133     The return value is a default-kind string with system-dependent
10134     length.  It contains the name of the compiler and its version
10135     number.
10136
10137_Example_:
10138             use iso_fortran_env
10139             print '(4a)', 'This file was compiled by ', &
10140                           compiler_version(), ' using the options ', &
10141                           compiler_options()
10142             end
10143
10144_See also_:
10145     *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
10146
10147
10148File: gfortran.info,  Node: COMPLEX,  Next: CONJG,  Prev: COMPILER_VERSION,  Up: Intrinsic Procedures
10149
101509.71 'COMPLEX' -- Complex conversion function
10151=============================================
10152
10153_Description_:
10154     'COMPLEX(X, Y)' returns a complex number where X is converted to
10155     the real component and Y is converted to the imaginary component.
10156
10157_Standard_:
10158     GNU extension
10159
10160_Class_:
10161     Elemental function
10162
10163_Syntax_:
10164     'RESULT = COMPLEX(X, Y)'
10165
10166_Arguments_:
10167     X           The type may be 'INTEGER' or 'REAL'.
10168     Y           The type may be 'INTEGER' or 'REAL'.
10169
10170_Return value_:
10171     If X and Y are both of 'INTEGER' type, then the return value is of
10172     default 'COMPLEX' type.
10173
10174     If X and Y are of 'REAL' type, or one is of 'REAL' type and one is
10175     of 'INTEGER' type, then the return value is of 'COMPLEX' type with
10176     a kind equal to that of the 'REAL' argument with the highest
10177     precision.
10178
10179_Example_:
10180          program test_complex
10181              integer :: i = 42
10182              real :: x = 3.14
10183              print *, complex(i, x)
10184          end program test_complex
10185
10186_See also_:
10187     *note CMPLX::
10188
10189
10190File: gfortran.info,  Node: CONJG,  Next: COS,  Prev: COMPLEX,  Up: Intrinsic Procedures
10191
101929.72 'CONJG' -- Complex conjugate function
10193==========================================
10194
10195_Description_:
10196     'CONJG(Z)' returns the conjugate of Z.  If Z is '(x, y)' then the
10197     result is '(x, -y)'
10198
10199_Standard_:
10200     Fortran 77 and later, has overloads that are GNU extensions
10201
10202_Class_:
10203     Elemental function
10204
10205_Syntax_:
10206     'Z = CONJG(Z)'
10207
10208_Arguments_:
10209     Z           The type shall be 'COMPLEX'.
10210
10211_Return value_:
10212     The return value is of type 'COMPLEX'.
10213
10214_Example_:
10215          program test_conjg
10216              complex :: z = (2.0, 3.0)
10217              complex(8) :: dz = (2.71_8, -3.14_8)
10218              z= conjg(z)
10219              print *, z
10220              dz = dconjg(dz)
10221              print *, dz
10222          end program test_conjg
10223
10224_Specific names_:
10225     Name           Argument       Return type    Standard
10226     'CONJG(Z)'     'COMPLEX Z'    'COMPLEX'      GNU extension
10227     'DCONJG(Z)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10228                    Z'
10229
10230
10231File: gfortran.info,  Node: COS,  Next: COSD,  Prev: CONJG,  Up: Intrinsic Procedures
10232
102339.73 'COS' -- Cosine function
10234=============================
10235
10236_Description_:
10237     'COS(X)' computes the cosine of X.
10238
10239_Standard_:
10240     Fortran 77 and later, has overloads that are GNU extensions
10241
10242_Class_:
10243     Elemental function
10244
10245_Syntax_:
10246     'RESULT = COS(X)'
10247
10248_Arguments_:
10249     X           The type shall be 'REAL' or 'COMPLEX'.
10250
10251_Return value_:
10252     The return value is of the same type and kind as X.  The real part
10253     of the result is in radians.  If X is of the type 'REAL', the
10254     return value lies in the range -1 \leq \cos (x) \leq 1.
10255
10256_Example_:
10257          program test_cos
10258            real :: x = 0.0
10259            x = cos(x)
10260          end program test_cos
10261
10262_Specific names_:
10263     Name           Argument       Return type    Standard
10264     'COS(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
10265                                                  later
10266     'DCOS(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
10267                                                  later
10268     'CCOS(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
10269                    X'                            later
10270     'ZCOS(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10271                    X'
10272     'CDCOS(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10273                    X'
10274
10275_See also_:
10276     Inverse function: *note ACOS:: Degrees function: *note COSD::
10277
10278
10279File: gfortran.info,  Node: COSD,  Next: COSH,  Prev: COS,  Up: Intrinsic Procedures
10280
102819.74 'COSD' -- Cosine function, degrees
10282=======================================
10283
10284_Description_:
10285     'COSD(X)' computes the cosine of X in degrees.
10286
10287     This function is for compatibility only and should be avoided in
10288     favor of standard constructs wherever possible.
10289
10290_Standard_:
10291     GNU Extension, enabled with '-fdec-math'.
10292
10293_Class_:
10294     Elemental function
10295
10296_Syntax_:
10297     'RESULT = COSD(X)'
10298
10299_Arguments_:
10300     X           The type shall be 'REAL' or 'COMPLEX'.
10301
10302_Return value_:
10303     The return value is of the same type and kind as X.  The real part
10304     of the result is in degrees.  If X is of the type 'REAL', the
10305     return value lies in the range -1 \leq \cosd (x) \leq 1.
10306
10307_Example_:
10308          program test_cosd
10309            real :: x = 0.0
10310            x = cosd(x)
10311          end program test_cosd
10312
10313_Specific names_:
10314     Name           Argument       Return type    Standard
10315     'COSD(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
10316     'DCOSD(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
10317     'CCOSD(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU Extension
10318                    X'
10319     'ZCOSD(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10320                    X'
10321     'CDCOSD(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10322                    X'
10323
10324_See also_:
10325     Inverse function: *note ACOSD:: Radians function: *note COS::
10326
10327
10328File: gfortran.info,  Node: COSH,  Next: COTAN,  Prev: COSD,  Up: Intrinsic Procedures
10329
103309.75 'COSH' -- Hyperbolic cosine function
10331=========================================
10332
10333_Description_:
10334     'COSH(X)' computes the hyperbolic cosine of X.
10335
10336_Standard_:
10337     Fortran 77 and later, for a complex argument Fortran 2008 or later
10338
10339_Class_:
10340     Elemental function
10341
10342_Syntax_:
10343     'X = COSH(X)'
10344
10345_Arguments_:
10346     X           The type shall be 'REAL' or 'COMPLEX'.
10347
10348_Return value_:
10349     The return value has same type and kind as X.  If X is complex, the
10350     imaginary part of the result is in radians.  If X is 'REAL', the
10351     return value has a lower bound of one, \cosh (x) \geq 1.
10352
10353_Example_:
10354          program test_cosh
10355            real(8) :: x = 1.0_8
10356            x = cosh(x)
10357          end program test_cosh
10358
10359_Specific names_:
10360     Name           Argument       Return type    Standard
10361     'COSH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
10362                                                  later
10363     'DCOSH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
10364                                                  later
10365
10366_See also_:
10367     Inverse function: *note ACOSH::
10368
10369
10370File: gfortran.info,  Node: COTAN,  Next: COTAND,  Prev: COSH,  Up: Intrinsic Procedures
10371
103729.76 'COTAN' -- Cotangent function
10373==================================
10374
10375_Description_:
10376     'COTAN(X)' computes the cotangent of X.  Equivalent to 'COS(x)'
10377     divided by 'SIN(x)', or '1 / TAN(x)'.
10378
10379     This function is for compatibility only and should be avoided in
10380     favor of standard constructs wherever possible.
10381
10382_Standard_:
10383     GNU Extension, enabled with '-fdec-math'.
10384
10385_Class_:
10386     Elemental function
10387
10388_Syntax_:
10389     'RESULT = COTAN(X)'
10390
10391_Arguments_:
10392     X           The type shall be 'REAL' or 'COMPLEX'.
10393
10394_Return value_:
10395     The return value has same type and kind as X, and its value is in
10396     radians.
10397
10398_Example_:
10399          program test_cotan
10400            real(8) :: x = 0.165_8
10401            x = cotan(x)
10402          end program test_cotan
10403
10404_Specific names_:
10405     Name           Argument       Return type    Standard
10406     'COTAN(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
10407     'DCOTAN(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
10408
10409_See also_:
10410     Converse function: *note TAN:: Degrees function: *note COTAND::
10411
10412
10413File: gfortran.info,  Node: COTAND,  Next: COUNT,  Prev: COTAN,  Up: Intrinsic Procedures
10414
104159.77 'COTAND' -- Cotangent function, degrees
10416============================================
10417
10418_Description_:
10419     'COTAND(X)' computes the cotangent of X in degrees.  Equivalent to
10420     'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'.
10421
10422_Standard_:
10423     GNU Extension, enabled with '-fdec-math'.
10424
10425     This function is for compatibility only and should be avoided in
10426     favor of standard constructs wherever possible.
10427
10428_Class_:
10429     Elemental function
10430
10431_Syntax_:
10432     'RESULT = COTAND(X)'
10433
10434_Arguments_:
10435     X           The type shall be 'REAL' or 'COMPLEX'.
10436
10437_Return value_:
10438     The return value has same type and kind as X, and its value is in
10439     degrees.
10440
10441_Example_:
10442          program test_cotand
10443            real(8) :: x = 0.165_8
10444            x = cotand(x)
10445          end program test_cotand
10446
10447_Specific names_:
10448     Name           Argument       Return type    Standard
10449     'COTAND(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
10450     'DCOTAND(X)'   'REAL(8) X'    'REAL(8)'      GNU Extension
10451
10452_See also_:
10453     Converse function: *note TAND:: Radians function: *note COTAN::
10454
10455
10456File: gfortran.info,  Node: COUNT,  Next: CPU_TIME,  Prev: COTAND,  Up: Intrinsic Procedures
10457
104589.78 'COUNT' -- Count function
10459==============================
10460
10461_Description_:
10462
10463     Counts the number of '.TRUE.' elements in a logical MASK, or, if
10464     the DIM argument is supplied, counts the number of elements along
10465     each row of the array in the DIM direction.  If the array has zero
10466     size, or all of the elements of MASK are '.FALSE.', then the result
10467     is '0'.
10468
10469_Standard_:
10470     Fortran 95 and later, with KIND argument Fortran 2003 and later
10471
10472_Class_:
10473     Transformational function
10474
10475_Syntax_:
10476     'RESULT = COUNT(MASK [, DIM, KIND])'
10477
10478_Arguments_:
10479     MASK        The type shall be 'LOGICAL'.
10480     DIM         (Optional) The type shall be 'INTEGER'.
10481     KIND        (Optional) An 'INTEGER' initialization
10482                 expression indicating the kind parameter of the
10483                 result.
10484
10485_Return value_:
10486     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
10487     absent, the return value is of default integer kind.  If DIM is
10488     present, the result is an array with a rank one less than the rank
10489     of ARRAY, and a size corresponding to the shape of ARRAY with the
10490     DIM dimension removed.
10491
10492_Example_:
10493          program test_count
10494              integer, dimension(2,3) :: a, b
10495              logical, dimension(2,3) :: mask
10496              a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
10497              b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
10498              print '(3i3)', a(1,:)
10499              print '(3i3)', a(2,:)
10500              print *
10501              print '(3i3)', b(1,:)
10502              print '(3i3)', b(2,:)
10503              print *
10504              mask = a.ne.b
10505              print '(3l3)', mask(1,:)
10506              print '(3l3)', mask(2,:)
10507              print *
10508              print '(3i3)', count(mask)
10509              print *
10510              print '(3i3)', count(mask, 1)
10511              print *
10512              print '(3i3)', count(mask, 2)
10513          end program test_count
10514
10515
10516File: gfortran.info,  Node: CPU_TIME,  Next: CSHIFT,  Prev: COUNT,  Up: Intrinsic Procedures
10517
105189.79 'CPU_TIME' -- CPU elapsed time in seconds
10519==============================================
10520
10521_Description_:
10522     Returns a 'REAL' value representing the elapsed CPU time in
10523     seconds.  This is useful for testing segments of code to determine
10524     execution time.
10525
10526     If a time source is available, time will be reported with
10527     microsecond resolution.  If no time source is available, TIME is
10528     set to '-1.0'.
10529
10530     Note that TIME may contain a, system dependent, arbitrary offset
10531     and may not start with '0.0'.  For 'CPU_TIME', the absolute value
10532     is meaningless, only differences between subsequent calls to this
10533     subroutine, as shown in the example below, should be used.
10534
10535_Standard_:
10536     Fortran 95 and later
10537
10538_Class_:
10539     Subroutine
10540
10541_Syntax_:
10542     'CALL CPU_TIME(TIME)'
10543
10544_Arguments_:
10545     TIME        The type shall be 'REAL' with 'INTENT(OUT)'.
10546
10547_Return value_:
10548     None
10549
10550_Example_:
10551          program test_cpu_time
10552              real :: start, finish
10553              call cpu_time(start)
10554                  ! put code to test here
10555              call cpu_time(finish)
10556              print '("Time = ",f6.3," seconds.")',finish-start
10557          end program test_cpu_time
10558
10559_See also_:
10560     *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
10561
10562
10563File: gfortran.info,  Node: CSHIFT,  Next: CTIME,  Prev: CPU_TIME,  Up: Intrinsic Procedures
10564
105659.80 'CSHIFT' -- Circular shift elements of an array
10566====================================================
10567
10568_Description_:
10569     'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
10570     elements of ARRAY along the dimension of DIM.  If DIM is omitted it
10571     is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the range
10572     of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the rank of
10573     ARRAY is one, then all elements of ARRAY are shifted by SHIFT
10574     places.  If rank is greater than one, then all complete rank one
10575     sections of ARRAY along the given dimension are shifted.  Elements
10576     shifted out one end of each rank one section are shifted back in
10577     the other end.
10578
10579_Standard_:
10580     Fortran 95 and later
10581
10582_Class_:
10583     Transformational function
10584
10585_Syntax_:
10586     'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
10587
10588_Arguments_:
10589     ARRAY       Shall be an array of any type.
10590     SHIFT       The type shall be 'INTEGER'.
10591     DIM         The type shall be 'INTEGER'.
10592
10593_Return value_:
10594     Returns an array of same type and rank as the ARRAY argument.
10595
10596_Example_:
10597          program test_cshift
10598              integer, dimension(3,3) :: a
10599              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
10600              print '(3i3)', a(1,:)
10601              print '(3i3)', a(2,:)
10602              print '(3i3)', a(3,:)
10603              a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
10604              print *
10605              print '(3i3)', a(1,:)
10606              print '(3i3)', a(2,:)
10607              print '(3i3)', a(3,:)
10608          end program test_cshift
10609
10610
10611File: gfortran.info,  Node: CTIME,  Next: DATE_AND_TIME,  Prev: CSHIFT,  Up: Intrinsic Procedures
10612
106139.81 'CTIME' -- Convert a time into a string
10614============================================
10615
10616_Description_:
10617     'CTIME' converts a system time value, such as returned by *note
10618     TIME8::, to a string.  The output will be of the form 'Sat Aug 19
10619     18:13:14 1995'.
10620
10621     This intrinsic is provided in both subroutine and function forms;
10622     however, only one form can be used in any given program unit.
10623
10624_Standard_:
10625     GNU extension
10626
10627_Class_:
10628     Subroutine, function
10629
10630_Syntax_:
10631     'CALL CTIME(TIME, RESULT)'.
10632     'RESULT = CTIME(TIME)'.
10633
10634_Arguments_:
10635     TIME        The type shall be of type 'INTEGER'.
10636     RESULT      The type shall be of type 'CHARACTER' and of
10637                 default kind.  It is an 'INTENT(OUT)' argument.
10638                 If the length of this variable is too short for
10639                 the time and date string to fit completely, it
10640                 will be blank on procedure return.
10641
10642_Return value_:
10643     The converted date and time as a string.
10644
10645_Example_:
10646          program test_ctime
10647              integer(8) :: i
10648              character(len=30) :: date
10649              i = time8()
10650
10651              ! Do something, main part of the program
10652
10653              call ctime(i,date)
10654              print *, 'Program was started on ', date
10655          end program test_ctime
10656
10657_See Also_:
10658     *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::,
10659     *note TIME8::
10660
10661
10662File: gfortran.info,  Node: DATE_AND_TIME,  Next: DBLE,  Prev: CTIME,  Up: Intrinsic Procedures
10663
106649.82 'DATE_AND_TIME' -- Date and time subroutine
10665================================================
10666
10667_Description_:
10668     'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
10669     date and time information from the real-time system clock.  DATE is
10670     'INTENT(OUT)' and has form ccyymmdd.  TIME is 'INTENT(OUT)' and has
10671     form hhmmss.sss.  ZONE is 'INTENT(OUT)' and has form (+-)hhmm,
10672     representing the difference with respect to Coordinated Universal
10673     Time (UTC). Unavailable time and date parameters return blanks.
10674
10675     VALUES is 'INTENT(OUT)' and provides the following:
10676
10677                 'VALUE(1)':            The year
10678                 'VALUE(2)':            The month
10679                 'VALUE(3)':            The day of the month
10680                 'VALUE(4)':            Time difference with UTC in
10681                                        minutes
10682                 'VALUE(5)':            The hour of the day
10683                 'VALUE(6)':            The minutes of the hour
10684                 'VALUE(7)':            The seconds of the minute
10685                 'VALUE(8)':            The milliseconds of the
10686                                        second
10687
10688_Standard_:
10689     Fortran 95 and later
10690
10691_Class_:
10692     Subroutine
10693
10694_Syntax_:
10695     'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
10696
10697_Arguments_:
10698     DATE        (Optional) The type shall be 'CHARACTER(LEN=8)'
10699                 or larger, and of default kind.
10700     TIME        (Optional) The type shall be 'CHARACTER(LEN=10)'
10701                 or larger, and of default kind.
10702     ZONE        (Optional) The type shall be 'CHARACTER(LEN=5)'
10703                 or larger, and of default kind.
10704     VALUES      (Optional) The type shall be 'INTEGER(8)'.
10705
10706_Return value_:
10707     None
10708
10709_Example_:
10710          program test_time_and_date
10711              character(8)  :: date
10712              character(10) :: time
10713              character(5)  :: zone
10714              integer,dimension(8) :: values
10715              ! using keyword arguments
10716              call date_and_time(date,time,zone,values)
10717              call date_and_time(DATE=date,ZONE=zone)
10718              call date_and_time(TIME=time)
10719              call date_and_time(VALUES=values)
10720              print '(a,2x,a,2x,a)', date, time, zone
10721              print '(8i5)', values
10722          end program test_time_and_date
10723
10724_See also_:
10725     *note CPU_TIME::, *note SYSTEM_CLOCK::
10726
10727
10728File: gfortran.info,  Node: DBLE,  Next: DCMPLX,  Prev: DATE_AND_TIME,  Up: Intrinsic Procedures
10729
107309.83 'DBLE' -- Double conversion function
10731=========================================
10732
10733_Description_:
10734     'DBLE(A)' Converts A to double precision real type.
10735
10736_Standard_:
10737     Fortran 77 and later
10738
10739_Class_:
10740     Elemental function
10741
10742_Syntax_:
10743     'RESULT = DBLE(A)'
10744
10745_Arguments_:
10746     A           The type shall be 'INTEGER', 'REAL', or
10747                 'COMPLEX'.
10748
10749_Return value_:
10750     The return value is of type double precision real.
10751
10752_Example_:
10753          program test_dble
10754              real    :: x = 2.18
10755              integer :: i = 5
10756              complex :: z = (2.3,1.14)
10757              print *, dble(x), dble(i), dble(z)
10758          end program test_dble
10759
10760_See also_:
10761     *note REAL::
10762
10763
10764File: gfortran.info,  Node: DCMPLX,  Next: DIGITS,  Prev: DBLE,  Up: Intrinsic Procedures
10765
107669.84 'DCMPLX' -- Double complex conversion function
10767===================================================
10768
10769_Description_:
10770     'DCMPLX(X [,Y])' returns a double complex number where X is
10771     converted to the real component.  If Y is present it is converted
10772     to the imaginary component.  If Y is not present then the imaginary
10773     component is set to 0.0.  If X is complex then Y must not be
10774     present.
10775
10776_Standard_:
10777     GNU extension
10778
10779_Class_:
10780     Elemental function
10781
10782_Syntax_:
10783     'RESULT = DCMPLX(X [, Y])'
10784
10785_Arguments_:
10786     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
10787     Y           (Optional if X is not 'COMPLEX'.)  May be
10788                 'INTEGER' or 'REAL'.
10789
10790_Return value_:
10791     The return value is of type 'COMPLEX(8)'
10792
10793_Example_:
10794          program test_dcmplx
10795              integer :: i = 42
10796              real :: x = 3.14
10797              complex :: z
10798              z = cmplx(i, x)
10799              print *, dcmplx(i)
10800              print *, dcmplx(x)
10801              print *, dcmplx(z)
10802              print *, dcmplx(x,i)
10803          end program test_dcmplx
10804
10805
10806File: gfortran.info,  Node: DIGITS,  Next: DIM,  Prev: DCMPLX,  Up: Intrinsic Procedures
10807
108089.85 'DIGITS' -- Significant binary digits function
10809===================================================
10810
10811_Description_:
10812     'DIGITS(X)' returns the number of significant binary digits of the
10813     internal model representation of X.  For example, on a system using
10814     a 32-bit floating point representation, a default real number would
10815     likely return 24.
10816
10817_Standard_:
10818     Fortran 95 and later
10819
10820_Class_:
10821     Inquiry function
10822
10823_Syntax_:
10824     'RESULT = DIGITS(X)'
10825
10826_Arguments_:
10827     X           The type may be 'INTEGER' or 'REAL'.
10828
10829_Return value_:
10830     The return value is of type 'INTEGER'.
10831
10832_Example_:
10833          program test_digits
10834              integer :: i = 12345
10835              real :: x = 3.143
10836              real(8) :: y = 2.33
10837              print *, digits(i)
10838              print *, digits(x)
10839              print *, digits(y)
10840          end program test_digits
10841
10842
10843File: gfortran.info,  Node: DIM,  Next: DOT_PRODUCT,  Prev: DIGITS,  Up: Intrinsic Procedures
10844
108459.86 'DIM' -- Positive difference
10846=================================
10847
10848_Description_:
10849     'DIM(X,Y)' returns the difference 'X-Y' if the result is positive;
10850     otherwise returns zero.
10851
10852_Standard_:
10853     Fortran 77 and later
10854
10855_Class_:
10856     Elemental function
10857
10858_Syntax_:
10859     'RESULT = DIM(X, Y)'
10860
10861_Arguments_:
10862     X           The type shall be 'INTEGER' or 'REAL'
10863     Y           The type shall be the same type and kind as X.
10864
10865_Return value_:
10866     The return value is of type 'INTEGER' or 'REAL'.
10867
10868_Example_:
10869          program test_dim
10870              integer :: i
10871              real(8) :: x
10872              i = dim(4, 15)
10873              x = dim(4.345_8, 2.111_8)
10874              print *, i
10875              print *, x
10876          end program test_dim
10877
10878_Specific names_:
10879     Name           Argument       Return type    Standard
10880     'DIM(X,Y)'     'REAL(4) X,    'REAL(4)'      Fortran 77 and
10881                    Y'                            later
10882     'IDIM(X,Y)'    'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
10883                    X, Y'                         later
10884     'DDIM(X,Y)'    'REAL(8) X,    'REAL(8)'      Fortran 77 and
10885                    Y'                            later
10886
10887
10888File: gfortran.info,  Node: DOT_PRODUCT,  Next: DPROD,  Prev: DIM,  Up: Intrinsic Procedures
10889
108909.87 'DOT_PRODUCT' -- Dot product function
10891==========================================
10892
10893_Description_:
10894     'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
10895     multiplication of two vectors VECTOR_A and VECTOR_B.  The two
10896     vectors may be either numeric or logical and must be arrays of rank
10897     one and of equal size.  If the vectors are 'INTEGER' or 'REAL', the
10898     result is 'SUM(VECTOR_A*VECTOR_B)'.  If the vectors are 'COMPLEX',
10899     the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'.  If the vectors are
10900     'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'.
10901
10902_Standard_:
10903     Fortran 95 and later
10904
10905_Class_:
10906     Transformational function
10907
10908_Syntax_:
10909     'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
10910
10911_Arguments_:
10912     VECTOR_A    The type shall be numeric or 'LOGICAL', rank 1.
10913     VECTOR_B    The type shall be numeric if VECTOR_A is of
10914                 numeric type or 'LOGICAL' if VECTOR_A is of type
10915                 'LOGICAL'.  VECTOR_B shall be a rank-one array.
10916
10917_Return value_:
10918     If the arguments are numeric, the return value is a scalar of
10919     numeric type, 'INTEGER', 'REAL', or 'COMPLEX'.  If the arguments
10920     are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'.
10921
10922_Example_:
10923          program test_dot_prod
10924              integer, dimension(3) :: a, b
10925              a = (/ 1, 2, 3 /)
10926              b = (/ 4, 5, 6 /)
10927              print '(3i3)', a
10928              print *
10929              print '(3i3)', b
10930              print *
10931              print *, dot_product(a,b)
10932          end program test_dot_prod
10933
10934
10935File: gfortran.info,  Node: DPROD,  Next: DREAL,  Prev: DOT_PRODUCT,  Up: Intrinsic Procedures
10936
109379.88 'DPROD' -- Double product function
10938=======================================
10939
10940_Description_:
10941     'DPROD(X,Y)' returns the product 'X*Y'.
10942
10943_Standard_:
10944     Fortran 77 and later
10945
10946_Class_:
10947     Elemental function
10948
10949_Syntax_:
10950     'RESULT = DPROD(X, Y)'
10951
10952_Arguments_:
10953     X           The type shall be 'REAL'.
10954     Y           The type shall be 'REAL'.
10955
10956_Return value_:
10957     The return value is of type 'REAL(8)'.
10958
10959_Example_:
10960          program test_dprod
10961              real :: x = 5.2
10962              real :: y = 2.3
10963              real(8) :: d
10964              d = dprod(x,y)
10965              print *, d
10966          end program test_dprod
10967
10968_Specific names_:
10969     Name           Argument       Return type    Standard
10970     'DPROD(X,Y)'   'REAL(4) X,    'REAL(8)'      Fortran 77 and
10971                    Y'                            later
10972
10973
10974File: gfortran.info,  Node: DREAL,  Next: DSHIFTL,  Prev: DPROD,  Up: Intrinsic Procedures
10975
109769.89 'DREAL' -- Double real part function
10977=========================================
10978
10979_Description_:
10980     'DREAL(Z)' returns the real part of complex variable Z.
10981
10982_Standard_:
10983     GNU extension
10984
10985_Class_:
10986     Elemental function
10987
10988_Syntax_:
10989     'RESULT = DREAL(A)'
10990
10991_Arguments_:
10992     A           The type shall be 'COMPLEX(8)'.
10993
10994_Return value_:
10995     The return value is of type 'REAL(8)'.
10996
10997_Example_:
10998          program test_dreal
10999              complex(8) :: z = (1.3_8,7.2_8)
11000              print *, dreal(z)
11001          end program test_dreal
11002
11003_See also_:
11004     *note AIMAG::
11005
11006
11007File: gfortran.info,  Node: DSHIFTL,  Next: DSHIFTR,  Prev: DREAL,  Up: Intrinsic Procedures
11008
110099.90 'DSHIFTL' -- Combined left shift
11010=====================================
11011
11012_Description_:
11013     'DSHIFTL(I, J, SHIFT)' combines bits of I and J.  The rightmost
11014     SHIFT bits of the result are the leftmost SHIFT bits of J, and the
11015     remaining bits are the rightmost bits of I.
11016
11017_Standard_:
11018     Fortran 2008 and later
11019
11020_Class_:
11021     Elemental function
11022
11023_Syntax_:
11024     'RESULT = DSHIFTL(I, J, SHIFT)'
11025
11026_Arguments_:
11027     I           Shall be of type 'INTEGER' or a BOZ constant.
11028     J           Shall be of type 'INTEGER' or a BOZ constant.
11029                 If both I and J have integer type, then they
11030                 shall have the same kind type parameter.  I and
11031                 J shall not both be BOZ constants.
11032     SHIFT       Shall be of type 'INTEGER'.  It shall be
11033                 nonnegative.  If I is not a BOZ constant, then
11034                 SHIFT shall be less than or equal to
11035                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11036                 than or equal to 'BIT_SIZE(J)'.
11037
11038_Return value_:
11039     If either I or J is a BOZ constant, it is first converted as if by
11040     the intrinsic function 'INT' to an integer type with the kind type
11041     parameter of the other.
11042
11043_See also_:
11044     *note DSHIFTR::
11045
11046
11047File: gfortran.info,  Node: DSHIFTR,  Next: DTIME,  Prev: DSHIFTL,  Up: Intrinsic Procedures
11048
110499.91 'DSHIFTR' -- Combined right shift
11050======================================
11051
11052_Description_:
11053     'DSHIFTR(I, J, SHIFT)' combines bits of I and J.  The leftmost
11054     SHIFT bits of the result are the rightmost SHIFT bits of I, and the
11055     remaining bits are the leftmost bits of J.
11056
11057_Standard_:
11058     Fortran 2008 and later
11059
11060_Class_:
11061     Elemental function
11062
11063_Syntax_:
11064     'RESULT = DSHIFTR(I, J, SHIFT)'
11065
11066_Arguments_:
11067     I           Shall be of type 'INTEGER' or a BOZ constant.
11068     J           Shall be of type 'INTEGER' or a BOZ constant.
11069                 If both I and J have integer type, then they
11070                 shall have the same kind type parameter.  I and
11071                 J shall not both be BOZ constants.
11072     SHIFT       Shall be of type 'INTEGER'.  It shall be
11073                 nonnegative.  If I is not a BOZ constant, then
11074                 SHIFT shall be less than or equal to
11075                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11076                 than or equal to 'BIT_SIZE(J)'.
11077
11078_Return value_:
11079     If either I or J is a BOZ constant, it is first converted as if by
11080     the intrinsic function 'INT' to an integer type with the kind type
11081     parameter of the other.
11082
11083_See also_:
11084     *note DSHIFTL::
11085
11086
11087File: gfortran.info,  Node: DTIME,  Next: EOSHIFT,  Prev: DSHIFTR,  Up: Intrinsic Procedures
11088
110899.92 'DTIME' -- Execution time subroutine (or function)
11090=======================================================
11091
11092_Description_:
11093     'DTIME(VALUES, TIME)' initially returns the number of seconds of
11094     runtime since the start of the process's execution in TIME.  VALUES
11095     returns the user and system components of this time in 'VALUES(1)'
11096     and 'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11097     VALUES(2)'.
11098
11099     Subsequent invocations of 'DTIME' return values accumulated since
11100     the previous invocation.
11101
11102     On some systems, the underlying timings are represented using types
11103     with sufficiently small limits that overflows (wrap around) are
11104     possible, such as 32-bit types.  Therefore, the values returned by
11105     this intrinsic might be, or become, negative, or numerically less
11106     than previous values, during a single run of the compiled program.
11107
11108     Please note, that this implementation is thread safe if used within
11109     OpenMP directives, i.e., its state will be consistent while called
11110     from multiple threads.  However, if 'DTIME' is called from multiple
11111     threads, the result is still the time since the last invocation.
11112     This may not give the intended results.  If possible, use
11113     'CPU_TIME' instead.
11114
11115     This intrinsic is provided in both subroutine and function forms;
11116     however, only one form can be used in any given program unit.
11117
11118     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11119
11120                 'VALUES(1)':           User time in seconds.
11121                 'VALUES(2)':           System time in seconds.
11122                 'TIME':                Run time since start in
11123                                        seconds.
11124
11125_Standard_:
11126     GNU extension
11127
11128_Class_:
11129     Subroutine, function
11130
11131_Syntax_:
11132     'CALL DTIME(VALUES, TIME)'.
11133     'TIME = DTIME(VALUES)', (not recommended).
11134
11135_Arguments_:
11136     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11137     TIME        The type shall be 'REAL(4)'.
11138
11139_Return value_:
11140     Elapsed time in seconds since the last invocation or since the
11141     start of program execution if not called before.
11142
11143_Example_:
11144          program test_dtime
11145              integer(8) :: i, j
11146              real, dimension(2) :: tarray
11147              real :: result
11148              call dtime(tarray, result)
11149              print *, result
11150              print *, tarray(1)
11151              print *, tarray(2)
11152              do i=1,100000000    ! Just a delay
11153                  j = i * i - i
11154              end do
11155              call dtime(tarray, result)
11156              print *, result
11157              print *, tarray(1)
11158              print *, tarray(2)
11159          end program test_dtime
11160
11161_See also_:
11162     *note CPU_TIME::
11163
11164
11165File: gfortran.info,  Node: EOSHIFT,  Next: EPSILON,  Prev: DTIME,  Up: Intrinsic Procedures
11166
111679.93 'EOSHIFT' -- End-off shift elements of an array
11168====================================================
11169
11170_Description_:
11171     'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
11172     on elements of ARRAY along the dimension of DIM.  If DIM is omitted
11173     it is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the
11174     range of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the
11175     rank of ARRAY is one, then all elements of ARRAY are shifted by
11176     SHIFT places.  If rank is greater than one, then all complete rank
11177     one sections of ARRAY along the given dimension are shifted.
11178     Elements shifted out one end of each rank one section are dropped.
11179     If BOUNDARY is present then the corresponding value of from
11180     BOUNDARY is copied back in the other end.  If BOUNDARY is not
11181     present then the following are copied in depending on the type of
11182     ARRAY.
11183
11184     _Array      _Boundary Value_
11185     Type_
11186     Numeric     0 of the type and kind of ARRAY.
11187     Logical     '.FALSE.'.
11188     Character(LEN)LEN blanks.
11189
11190_Standard_:
11191     Fortran 95 and later
11192
11193_Class_:
11194     Transformational function
11195
11196_Syntax_:
11197     'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
11198
11199_Arguments_:
11200     ARRAY       May be any type, not scalar.
11201     SHIFT       The type shall be 'INTEGER'.
11202     BOUNDARY    Same type as ARRAY.
11203     DIM         The type shall be 'INTEGER'.
11204
11205_Return value_:
11206     Returns an array of same type and rank as the ARRAY argument.
11207
11208_Example_:
11209          program test_eoshift
11210              integer, dimension(3,3) :: a
11211              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
11212              print '(3i3)', a(1,:)
11213              print '(3i3)', a(2,:)
11214              print '(3i3)', a(3,:)
11215              a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
11216              print *
11217              print '(3i3)', a(1,:)
11218              print '(3i3)', a(2,:)
11219              print '(3i3)', a(3,:)
11220          end program test_eoshift
11221
11222
11223File: gfortran.info,  Node: EPSILON,  Next: ERF,  Prev: EOSHIFT,  Up: Intrinsic Procedures
11224
112259.94 'EPSILON' -- Epsilon function
11226==================================
11227
11228_Description_:
11229     'EPSILON(X)' returns the smallest number E of the same kind as X
11230     such that 1 + E > 1.
11231
11232_Standard_:
11233     Fortran 95 and later
11234
11235_Class_:
11236     Inquiry function
11237
11238_Syntax_:
11239     'RESULT = EPSILON(X)'
11240
11241_Arguments_:
11242     X           The type shall be 'REAL'.
11243
11244_Return value_:
11245     The return value is of same type as the argument.
11246
11247_Example_:
11248          program test_epsilon
11249              real :: x = 3.143
11250              real(8) :: y = 2.33
11251              print *, EPSILON(x)
11252              print *, EPSILON(y)
11253          end program test_epsilon
11254
11255
11256File: gfortran.info,  Node: ERF,  Next: ERFC,  Prev: EPSILON,  Up: Intrinsic Procedures
11257
112589.95 'ERF' -- Error function
11259============================
11260
11261_Description_:
11262     'ERF(X)' computes the error function of X.
11263
11264_Standard_:
11265     Fortran 2008 and later
11266
11267_Class_:
11268     Elemental function
11269
11270_Syntax_:
11271     'RESULT = ERF(X)'
11272
11273_Arguments_:
11274     X           The type shall be 'REAL'.
11275
11276_Return value_:
11277     The return value is of type 'REAL', of the same kind as X and lies
11278     in the range -1 \leq erf (x) \leq 1 .
11279
11280_Example_:
11281          program test_erf
11282            real(8) :: x = 0.17_8
11283            x = erf(x)
11284          end program test_erf
11285
11286_Specific names_:
11287     Name           Argument       Return type    Standard
11288     'DERF(X)'      'REAL(8) X'    'REAL(8)'      GNU extension
11289
11290
11291File: gfortran.info,  Node: ERFC,  Next: ERFC_SCALED,  Prev: ERF,  Up: Intrinsic Procedures
11292
112939.96 'ERFC' -- Error function
11294=============================
11295
11296_Description_:
11297     'ERFC(X)' computes the complementary error function of X.
11298
11299_Standard_:
11300     Fortran 2008 and later
11301
11302_Class_:
11303     Elemental function
11304
11305_Syntax_:
11306     'RESULT = ERFC(X)'
11307
11308_Arguments_:
11309     X           The type shall be 'REAL'.
11310
11311_Return value_:
11312     The return value is of type 'REAL' and of the same kind as X.  It
11313     lies in the range 0 \leq erfc (x) \leq 2 .
11314
11315_Example_:
11316          program test_erfc
11317            real(8) :: x = 0.17_8
11318            x = erfc(x)
11319          end program test_erfc
11320
11321_Specific names_:
11322     Name           Argument       Return type    Standard
11323     'DERFC(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
11324
11325
11326File: gfortran.info,  Node: ERFC_SCALED,  Next: ETIME,  Prev: ERFC,  Up: Intrinsic Procedures
11327
113289.97 'ERFC_SCALED' -- Error function
11329====================================
11330
11331_Description_:
11332     'ERFC_SCALED(X)' computes the exponentially-scaled complementary
11333     error function of X.
11334
11335_Standard_:
11336     Fortran 2008 and later
11337
11338_Class_:
11339     Elemental function
11340
11341_Syntax_:
11342     'RESULT = ERFC_SCALED(X)'
11343
11344_Arguments_:
11345     X           The type shall be 'REAL'.
11346
11347_Return value_:
11348     The return value is of type 'REAL' and of the same kind as X.
11349
11350_Example_:
11351          program test_erfc_scaled
11352            real(8) :: x = 0.17_8
11353            x = erfc_scaled(x)
11354          end program test_erfc_scaled
11355
11356
11357File: gfortran.info,  Node: ETIME,  Next: EVENT_QUERY,  Prev: ERFC_SCALED,  Up: Intrinsic Procedures
11358
113599.98 'ETIME' -- Execution time subroutine (or function)
11360=======================================================
11361
11362_Description_:
11363     'ETIME(VALUES, TIME)' returns the number of seconds of runtime
11364     since the start of the process's execution in TIME.  VALUES returns
11365     the user and system components of this time in 'VALUES(1)' and
11366     'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11367     VALUES(2)'.
11368
11369     On some systems, the underlying timings are represented using types
11370     with sufficiently small limits that overflows (wrap around) are
11371     possible, such as 32-bit types.  Therefore, the values returned by
11372     this intrinsic might be, or become, negative, or numerically less
11373     than previous values, during a single run of the compiled program.
11374
11375     This intrinsic is provided in both subroutine and function forms;
11376     however, only one form can be used in any given program unit.
11377
11378     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11379
11380                 'VALUES(1)':           User time in seconds.
11381                 'VALUES(2)':           System time in seconds.
11382                 'TIME':                Run time since start in seconds.
11383
11384_Standard_:
11385     GNU extension
11386
11387_Class_:
11388     Subroutine, function
11389
11390_Syntax_:
11391     'CALL ETIME(VALUES, TIME)'.
11392     'TIME = ETIME(VALUES)', (not recommended).
11393
11394_Arguments_:
11395     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11396     TIME        The type shall be 'REAL(4)'.
11397
11398_Return value_:
11399     Elapsed time in seconds since the start of program execution.
11400
11401_Example_:
11402          program test_etime
11403              integer(8) :: i, j
11404              real, dimension(2) :: tarray
11405              real :: result
11406              call ETIME(tarray, result)
11407              print *, result
11408              print *, tarray(1)
11409              print *, tarray(2)
11410              do i=1,100000000    ! Just a delay
11411                  j = i * i - i
11412              end do
11413              call ETIME(tarray, result)
11414              print *, result
11415              print *, tarray(1)
11416              print *, tarray(2)
11417          end program test_etime
11418
11419_See also_:
11420     *note CPU_TIME::
11421
11422
11423File: gfortran.info,  Node: EVENT_QUERY,  Next: EXECUTE_COMMAND_LINE,  Prev: ETIME,  Up: Intrinsic Procedures
11424
114259.99 'EVENT_QUERY' -- Query whether a coarray event has occurred
11426================================================================
11427
11428_Description_:
11429     'EVENT_QUERY' assignes the number of events to COUNT which have
11430     been posted to the EVENT variable and not yet been removed by
11431     calling 'EVENT WAIT'.  When STAT is present and the invocation was
11432     successful, it is assigned the value 0.  If it is present and the
11433     invocation has failed, it is assigned a positive value and COUNT is
11434     assigned the value -1.
11435
11436_Standard_:
11437     TS 18508 or later
11438
11439_Class_:
11440     subroutine
11441
11442_Syntax_:
11443     'CALL EVENT_QUERY (EVENT, COUNT [, STAT])'
11444
11445_Arguments_:
11446     EVENT       (intent(IN)) Scalar of type 'EVENT_TYPE',
11447                 defined in 'ISO_FORTRAN_ENV'; shall not be
11448                 coindexed.
11449     COUNT       (intent(out))Scalar integer with at least the
11450                 precision of default integer.
11451     STAT        (optional) Scalar default-kind integer variable.
11452
11453_Example_:
11454          program atomic
11455            use iso_fortran_env
11456            implicit none
11457            type(event_type) :: event_value_has_been_set[*]
11458            integer :: cnt
11459            if (this_image() == 1) then
11460              call event_query (event_value_has_been_set, cnt)
11461              if (cnt > 0) write(*,*) "Value has been set"
11462            elseif (this_image() == 2) then
11463              event post (event_value_has_been_set[1])
11464            end if
11465          end program atomic
11466
11467
11468File: gfortran.info,  Node: EXECUTE_COMMAND_LINE,  Next: EXIT,  Prev: EVENT_QUERY,  Up: Intrinsic Procedures
11469
114709.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command
11471=======================================================
11472
11473_Description_:
11474     'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
11475     asynchronously.
11476
11477     The 'COMMAND' argument is passed to the shell and executed, using
11478     the C library's 'system' call.  (The shell is 'sh' on Unix systems,
11479     and 'cmd.exe' on Windows.)  If 'WAIT' is present and has the value
11480     false, the execution of the command is asynchronous if the system
11481     supports it; otherwise, the command is executed synchronously.
11482
11483     The three last arguments allow the user to get status information.
11484     After synchronous execution, 'EXITSTAT' contains the integer exit
11485     code of the command, as returned by 'system'.  'CMDSTAT' is set to
11486     zero if the command line was executed (whatever its exit status
11487     was).  'CMDMSG' is assigned an error message if an error has
11488     occurred.
11489
11490     Note that the 'system' function need not be thread-safe.  It is the
11491     responsibility of the user to ensure that 'system' is not called
11492     concurrently.
11493
11494_Standard_:
11495     Fortran 2008 and later
11496
11497_Class_:
11498     Subroutine
11499
11500_Syntax_:
11501     'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
11502     CMDMSG ])'
11503
11504_Arguments_:
11505     COMMAND     Shall be a default 'CHARACTER' scalar.
11506     WAIT        (Optional) Shall be a default 'LOGICAL' scalar.
11507     EXITSTAT    (Optional) Shall be an 'INTEGER' of the default
11508                 kind.
11509     CMDSTAT     (Optional) Shall be an 'INTEGER' of the default
11510                 kind.
11511     CMDMSG      (Optional) Shall be an 'CHARACTER' scalar of the
11512                 default kind.
11513
11514_Example_:
11515          program test_exec
11516            integer :: i
11517
11518            call execute_command_line ("external_prog.exe", exitstat=i)
11519            print *, "Exit status of external_prog.exe was ", i
11520
11521            call execute_command_line ("reindex_files.exe", wait=.false.)
11522            print *, "Now reindexing files in the background"
11523
11524          end program test_exec
11525
11526_Note_:
11527
11528     Because this intrinsic is implemented in terms of the 'system'
11529     function call, its behavior with respect to signaling is processor
11530     dependent.  In particular, on POSIX-compliant systems, the SIGINT
11531     and SIGQUIT signals will be ignored, and the SIGCHLD will be
11532     blocked.  As such, if the parent process is terminated, the child
11533     process might not be terminated alongside.
11534
11535_See also_:
11536     *note SYSTEM::
11537
11538
11539File: gfortran.info,  Node: EXIT,  Next: EXP,  Prev: EXECUTE_COMMAND_LINE,  Up: Intrinsic Procedures
11540
115419.101 'EXIT' -- Exit the program with status.
11542=============================================
11543
11544_Description_:
11545     'EXIT' causes immediate termination of the program with status.  If
11546     status is omitted it returns the canonical _success_ for the
11547     system.  All Fortran I/O units are closed.
11548
11549_Standard_:
11550     GNU extension
11551
11552_Class_:
11553     Subroutine
11554
11555_Syntax_:
11556     'CALL EXIT([STATUS])'
11557
11558_Arguments_:
11559     STATUS      Shall be an 'INTEGER' of the default kind.
11560
11561_Return value_:
11562     'STATUS' is passed to the parent process on exit.
11563
11564_Example_:
11565          program test_exit
11566            integer :: STATUS = 0
11567            print *, 'This program is going to exit.'
11568            call EXIT(STATUS)
11569          end program test_exit
11570
11571_See also_:
11572     *note ABORT::, *note KILL::
11573
11574
11575File: gfortran.info,  Node: EXP,  Next: EXPONENT,  Prev: EXIT,  Up: Intrinsic Procedures
11576
115779.102 'EXP' -- Exponential function
11578===================================
11579
11580_Description_:
11581     'EXP(X)' computes the base e exponential of X.
11582
11583_Standard_:
11584     Fortran 77 and later, has overloads that are GNU extensions
11585
11586_Class_:
11587     Elemental function
11588
11589_Syntax_:
11590     'RESULT = EXP(X)'
11591
11592_Arguments_:
11593     X           The type shall be 'REAL' or 'COMPLEX'.
11594
11595_Return value_:
11596     The return value has same type and kind as X.
11597
11598_Example_:
11599          program test_exp
11600            real :: x = 1.0
11601            x = exp(x)
11602          end program test_exp
11603
11604_Specific names_:
11605     Name           Argument       Return type    Standard
11606     'EXP(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
11607                                                  later
11608     'DEXP(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
11609                                                  later
11610     'CEXP(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
11611                    X'                            later
11612     'ZEXP(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11613                    X'
11614     'CDEXP(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11615                    X'
11616
11617
11618File: gfortran.info,  Node: EXPONENT,  Next: EXTENDS_TYPE_OF,  Prev: EXP,  Up: Intrinsic Procedures
11619
116209.103 'EXPONENT' -- Exponent function
11621=====================================
11622
11623_Description_:
11624     'EXPONENT(X)' returns the value of the exponent part of X.  If X is
11625     zero the value returned is zero.
11626
11627_Standard_:
11628     Fortran 95 and later
11629
11630_Class_:
11631     Elemental function
11632
11633_Syntax_:
11634     'RESULT = EXPONENT(X)'
11635
11636_Arguments_:
11637     X           The type shall be 'REAL'.
11638
11639_Return value_:
11640     The return value is of type default 'INTEGER'.
11641
11642_Example_:
11643          program test_exponent
11644            real :: x = 1.0
11645            integer :: i
11646            i = exponent(x)
11647            print *, i
11648            print *, exponent(0.0)
11649          end program test_exponent
11650
11651
11652File: gfortran.info,  Node: EXTENDS_TYPE_OF,  Next: FDATE,  Prev: EXPONENT,  Up: Intrinsic Procedures
11653
116549.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension
11655===========================================================
11656
11657_Description_:
11658     Query dynamic type for extension.
11659
11660_Standard_:
11661     Fortran 2003 and later
11662
11663_Class_:
11664     Inquiry function
11665
11666_Syntax_:
11667     'RESULT = EXTENDS_TYPE_OF(A, MOLD)'
11668
11669_Arguments_:
11670     A           Shall be an object of extensible declared type
11671                 or unlimited polymorphic.
11672     MOLD        Shall be an object of extensible declared type
11673                 or unlimited polymorphic.
11674
11675_Return value_:
11676     The return value is a scalar of type default logical.  It is true
11677     if and only if the dynamic type of A is an extension type of the
11678     dynamic type of MOLD.
11679
11680_See also_:
11681     *note SAME_TYPE_AS::
11682
11683
11684File: gfortran.info,  Node: FDATE,  Next: FGET,  Prev: EXTENDS_TYPE_OF,  Up: Intrinsic Procedures
11685
116869.105 'FDATE' -- Get the current time as a string
11687=================================================
11688
11689_Description_:
11690     'FDATE(DATE)' returns the current date (using the same format as
11691     *note CTIME::) in DATE.  It is equivalent to 'CALL CTIME(DATE,
11692     TIME())'.
11693
11694     This intrinsic is provided in both subroutine and function forms;
11695     however, only one form can be used in any given program unit.
11696
11697_Standard_:
11698     GNU extension
11699
11700_Class_:
11701     Subroutine, function
11702
11703_Syntax_:
11704     'CALL FDATE(DATE)'.
11705     'DATE = FDATE()'.
11706
11707_Arguments_:
11708     DATE        The type shall be of type 'CHARACTER' of the
11709                 default kind.  It is an 'INTENT(OUT)' argument.
11710                 If the length of this variable is too short for
11711                 the date and time string to fit completely, it
11712                 will be blank on procedure return.
11713
11714_Return value_:
11715     The current date and time as a string.
11716
11717_Example_:
11718          program test_fdate
11719              integer(8) :: i, j
11720              character(len=30) :: date
11721              call fdate(date)
11722              print *, 'Program started on ', date
11723              do i = 1, 100000000 ! Just a delay
11724                  j = i * i - i
11725              end do
11726              call fdate(date)
11727              print *, 'Program ended on ', date
11728          end program test_fdate
11729
11730_See also_:
11731     *note DATE_AND_TIME::, *note CTIME::
11732
11733
11734File: gfortran.info,  Node: FGET,  Next: FGETC,  Prev: FDATE,  Up: Intrinsic Procedures
11735
117369.106 'FGET' -- Read a single character in stream mode from stdin
11737=================================================================
11738
11739_Description_:
11740     Read a single character in stream mode from stdin by bypassing
11741     normal formatted output.  Stream I/O should not be mixed with
11742     normal record-oriented (formatted or unformatted) I/O on the same
11743     unit; the results are unpredictable.
11744
11745     This intrinsic is provided in both subroutine and function forms;
11746     however, only one form can be used in any given program unit.
11747
11748     Note that the 'FGET' intrinsic is provided for backwards
11749     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
11750     Stream facility.  Programmers should consider the use of new stream
11751     IO feature in new code for future portability.  See also *note
11752     Fortran 2003 status::.
11753
11754_Standard_:
11755     GNU extension
11756
11757_Class_:
11758     Subroutine, function
11759
11760_Syntax_:
11761     'CALL FGET(C [, STATUS])'
11762     'STATUS = FGET(C)'
11763
11764_Arguments_:
11765     C           The type shall be 'CHARACTER' and of default
11766                 kind.
11767     STATUS      (Optional) status flag of type 'INTEGER'.
11768                 Returns 0 on success, -1 on end-of-file, and a
11769                 system specific positive error code otherwise.
11770
11771_Example_:
11772          PROGRAM test_fget
11773            INTEGER, PARAMETER :: strlen = 100
11774            INTEGER :: status, i = 1
11775            CHARACTER(len=strlen) :: str = ""
11776
11777            WRITE (*,*) 'Enter text:'
11778            DO
11779              CALL fget(str(i:i), status)
11780              if (status /= 0 .OR. i > strlen) exit
11781              i = i + 1
11782            END DO
11783            WRITE (*,*) TRIM(str)
11784          END PROGRAM
11785
11786_See also_:
11787     *note FGETC::, *note FPUT::, *note FPUTC::
11788
11789
11790File: gfortran.info,  Node: FGETC,  Next: FLOOR,  Prev: FGET,  Up: Intrinsic Procedures
11791
117929.107 'FGETC' -- Read a single character in stream mode
11793=======================================================
11794
11795_Description_:
11796     Read a single character in stream mode by bypassing normal
11797     formatted output.  Stream I/O should not be mixed with normal
11798     record-oriented (formatted or unformatted) I/O on the same unit;
11799     the results are unpredictable.
11800
11801     This intrinsic is provided in both subroutine and function forms;
11802     however, only one form can be used in any given program unit.
11803
11804     Note that the 'FGET' intrinsic is provided for backwards
11805     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
11806     Stream facility.  Programmers should consider the use of new stream
11807     IO feature in new code for future portability.  See also *note
11808     Fortran 2003 status::.
11809
11810_Standard_:
11811     GNU extension
11812
11813_Class_:
11814     Subroutine, function
11815
11816_Syntax_:
11817     'CALL FGETC(UNIT, C [, STATUS])'
11818     'STATUS = FGETC(UNIT, C)'
11819
11820_Arguments_:
11821     UNIT        The type shall be 'INTEGER'.
11822     C           The type shall be 'CHARACTER' and of default
11823                 kind.
11824     STATUS      (Optional) status flag of type 'INTEGER'.
11825                 Returns 0 on success, -1 on end-of-file and a
11826                 system specific positive error code otherwise.
11827
11828_Example_:
11829          PROGRAM test_fgetc
11830            INTEGER :: fd = 42, status
11831            CHARACTER :: c
11832
11833            OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
11834            DO
11835              CALL fgetc(fd, c, status)
11836              IF (status /= 0) EXIT
11837              call fput(c)
11838            END DO
11839            CLOSE(UNIT=fd)
11840          END PROGRAM
11841
11842_See also_:
11843     *note FGET::, *note FPUT::, *note FPUTC::
11844
11845
11846File: gfortran.info,  Node: FLOOR,  Next: FLUSH,  Prev: FGETC,  Up: Intrinsic Procedures
11847
118489.108 'FLOOR' -- Integer floor function
11849=======================================
11850
11851_Description_:
11852     'FLOOR(A)' returns the greatest integer less than or equal to X.
11853
11854_Standard_:
11855     Fortran 95 and later
11856
11857_Class_:
11858     Elemental function
11859
11860_Syntax_:
11861     'RESULT = FLOOR(A [, KIND])'
11862
11863_Arguments_:
11864     A           The type shall be 'REAL'.
11865     KIND        (Optional) An 'INTEGER' initialization
11866                 expression indicating the kind parameter of the
11867                 result.
11868
11869_Return value_:
11870     The return value is of type 'INTEGER(KIND)' if KIND is present and
11871     of default-kind 'INTEGER' otherwise.
11872
11873_Example_:
11874          program test_floor
11875              real :: x = 63.29
11876              real :: y = -63.59
11877              print *, floor(x) ! returns 63
11878              print *, floor(y) ! returns -64
11879          end program test_floor
11880
11881_See also_:
11882     *note CEILING::, *note NINT::
11883
11884
11885File: gfortran.info,  Node: FLUSH,  Next: FNUM,  Prev: FLOOR,  Up: Intrinsic Procedures
11886
118879.109 'FLUSH' -- Flush I/O unit(s)
11888==================================
11889
11890_Description_:
11891     Flushes Fortran unit(s) currently open for output.  Without the
11892     optional argument, all units are flushed, otherwise just the unit
11893     specified.
11894
11895_Standard_:
11896     GNU extension
11897
11898_Class_:
11899     Subroutine
11900
11901_Syntax_:
11902     'CALL FLUSH(UNIT)'
11903
11904_Arguments_:
11905     UNIT        (Optional) The type shall be 'INTEGER'.
11906
11907_Note_:
11908     Beginning with the Fortran 2003 standard, there is a 'FLUSH'
11909     statement that should be preferred over the 'FLUSH' intrinsic.
11910
11911     The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have
11912     identical effect: they flush the runtime library's I/O buffer so
11913     that the data becomes visible to other processes.  This does not
11914     guarantee that the data is committed to disk.
11915
11916     On POSIX systems, you can request that all data is transferred to
11917     the storage device by calling the 'fsync' function, with the POSIX
11918     file descriptor of the I/O unit as argument (retrieved with GNU
11919     intrinsic 'FNUM').  The following example shows how:
11920
11921            ! Declare the interface for POSIX fsync function
11922            interface
11923              function fsync (fd) bind(c,name="fsync")
11924              use iso_c_binding, only: c_int
11925                integer(c_int), value :: fd
11926                integer(c_int) :: fsync
11927              end function fsync
11928            end interface
11929
11930            ! Variable declaration
11931            integer :: ret
11932
11933            ! Opening unit 10
11934            open (10,file="foo")
11935
11936            ! ...
11937            ! Perform I/O on unit 10
11938            ! ...
11939
11940            ! Flush and sync
11941            flush(10)
11942            ret = fsync(fnum(10))
11943
11944            ! Handle possible error
11945            if (ret /= 0) stop "Error calling FSYNC"
11946
11947
11948File: gfortran.info,  Node: FNUM,  Next: FPUT,  Prev: FLUSH,  Up: Intrinsic Procedures
11949
119509.110 'FNUM' -- File number function
11951====================================
11952
11953_Description_:
11954     'FNUM(UNIT)' returns the POSIX file descriptor number corresponding
11955     to the open Fortran I/O unit 'UNIT'.
11956
11957_Standard_:
11958     GNU extension
11959
11960_Class_:
11961     Function
11962
11963_Syntax_:
11964     'RESULT = FNUM(UNIT)'
11965
11966_Arguments_:
11967     UNIT        The type shall be 'INTEGER'.
11968
11969_Return value_:
11970     The return value is of type 'INTEGER'
11971
11972_Example_:
11973          program test_fnum
11974            integer :: i
11975            open (unit=10, status = "scratch")
11976            i = fnum(10)
11977            print *, i
11978            close (10)
11979          end program test_fnum
11980
11981
11982File: gfortran.info,  Node: FPUT,  Next: FPUTC,  Prev: FNUM,  Up: Intrinsic Procedures
11983
119849.111 'FPUT' -- Write a single character in stream mode to stdout
11985=================================================================
11986
11987_Description_:
11988     Write a single character in stream mode to stdout by bypassing
11989     normal formatted output.  Stream I/O should not be mixed with
11990     normal record-oriented (formatted or unformatted) I/O on the same
11991     unit; the results are unpredictable.
11992
11993     This intrinsic is provided in both subroutine and function forms;
11994     however, only one form can be used in any given program unit.
11995
11996     Note that the 'FGET' intrinsic is provided for backwards
11997     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
11998     Stream facility.  Programmers should consider the use of new stream
11999     IO feature in new code for future portability.  See also *note
12000     Fortran 2003 status::.
12001
12002_Standard_:
12003     GNU extension
12004
12005_Class_:
12006     Subroutine, function
12007
12008_Syntax_:
12009     'CALL FPUT(C [, STATUS])'
12010     'STATUS = FPUT(C)'
12011
12012_Arguments_:
12013     C           The type shall be 'CHARACTER' and of default
12014                 kind.
12015     STATUS      (Optional) status flag of type 'INTEGER'.
12016                 Returns 0 on success, -1 on end-of-file and a
12017                 system specific positive error code otherwise.
12018
12019_Example_:
12020          PROGRAM test_fput
12021            CHARACTER(len=10) :: str = "gfortran"
12022            INTEGER :: i
12023            DO i = 1, len_trim(str)
12024              CALL fput(str(i:i))
12025            END DO
12026          END PROGRAM
12027
12028_See also_:
12029     *note FPUTC::, *note FGET::, *note FGETC::
12030
12031
12032File: gfortran.info,  Node: FPUTC,  Next: FRACTION,  Prev: FPUT,  Up: Intrinsic Procedures
12033
120349.112 'FPUTC' -- Write a single character in stream mode
12035========================================================
12036
12037_Description_:
12038     Write a single character in stream mode by bypassing normal
12039     formatted output.  Stream I/O should not be mixed with normal
12040     record-oriented (formatted or unformatted) I/O on the same unit;
12041     the results are unpredictable.
12042
12043     This intrinsic is provided in both subroutine and function forms;
12044     however, only one form can be used in any given program unit.
12045
12046     Note that the 'FGET' intrinsic is provided for backwards
12047     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12048     Stream facility.  Programmers should consider the use of new stream
12049     IO feature in new code for future portability.  See also *note
12050     Fortran 2003 status::.
12051
12052_Standard_:
12053     GNU extension
12054
12055_Class_:
12056     Subroutine, function
12057
12058_Syntax_:
12059     'CALL FPUTC(UNIT, C [, STATUS])'
12060     'STATUS = FPUTC(UNIT, C)'
12061
12062_Arguments_:
12063     UNIT        The type shall be 'INTEGER'.
12064     C           The type shall be 'CHARACTER' and of default
12065                 kind.
12066     STATUS      (Optional) status flag of type 'INTEGER'.
12067                 Returns 0 on success, -1 on end-of-file and a
12068                 system specific positive error code otherwise.
12069
12070_Example_:
12071          PROGRAM test_fputc
12072            CHARACTER(len=10) :: str = "gfortran"
12073            INTEGER :: fd = 42, i
12074
12075            OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
12076            DO i = 1, len_trim(str)
12077              CALL fputc(fd, str(i:i))
12078            END DO
12079            CLOSE(fd)
12080          END PROGRAM
12081
12082_See also_:
12083     *note FPUT::, *note FGET::, *note FGETC::
12084
12085
12086File: gfortran.info,  Node: FRACTION,  Next: FREE,  Prev: FPUTC,  Up: Intrinsic Procedures
12087
120889.113 'FRACTION' -- Fractional part of the model representation
12089===============================================================
12090
12091_Description_:
12092     'FRACTION(X)' returns the fractional part of the model
12093     representation of 'X'.
12094
12095_Standard_:
12096     Fortran 95 and later
12097
12098_Class_:
12099     Elemental function
12100
12101_Syntax_:
12102     'Y = FRACTION(X)'
12103
12104_Arguments_:
12105     X           The type of the argument shall be a 'REAL'.
12106
12107_Return value_:
12108     The return value is of the same type and kind as the argument.  The
12109     fractional part of the model representation of 'X' is returned; it
12110     is 'X * RADIX(X)**(-EXPONENT(X))'.
12111
12112_Example_:
12113          program test_fraction
12114            real :: x
12115            x = 178.1387e-4
12116            print *, fraction(x), x * radix(x)**(-exponent(x))
12117          end program test_fraction
12118
12119
12120File: gfortran.info,  Node: FREE,  Next: FSEEK,  Prev: FRACTION,  Up: Intrinsic Procedures
12121
121229.114 'FREE' -- Frees memory
12123============================
12124
12125_Description_:
12126     Frees memory previously allocated by 'MALLOC'.  The 'FREE'
12127     intrinsic is an extension intended to be used with Cray pointers,
12128     and is provided in GNU Fortran to allow user to compile legacy
12129     code.  For new code using Fortran 95 pointers, the memory
12130     de-allocation intrinsic is 'DEALLOCATE'.
12131
12132_Standard_:
12133     GNU extension
12134
12135_Class_:
12136     Subroutine
12137
12138_Syntax_:
12139     'CALL FREE(PTR)'
12140
12141_Arguments_:
12142     PTR         The type shall be 'INTEGER'.  It represents the
12143                 location of the memory that should be
12144                 de-allocated.
12145
12146_Return value_:
12147     None
12148
12149_Example_:
12150     See 'MALLOC' for an example.
12151
12152_See also_:
12153     *note MALLOC::
12154
12155
12156File: gfortran.info,  Node: FSEEK,  Next: FSTAT,  Prev: FREE,  Up: Intrinsic Procedures
12157
121589.115 'FSEEK' -- Low level file positioning subroutine
12159======================================================
12160
12161_Description_:
12162     Moves UNIT to the specified OFFSET.  If WHENCE is set to 0, the
12163     OFFSET is taken as an absolute value 'SEEK_SET', if set to 1,
12164     OFFSET is taken to be relative to the current position 'SEEK_CUR',
12165     and if set to 2 relative to the end of the file 'SEEK_END'.  On
12166     error, STATUS is set to a nonzero value.  If STATUS the seek fails
12167     silently.
12168
12169     This intrinsic routine is not fully backwards compatible with
12170     'g77'.  In 'g77', the 'FSEEK' takes a statement label instead of a
12171     STATUS variable.  If FSEEK is used in old code, change
12172            CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
12173     to
12174            INTEGER :: status
12175            CALL FSEEK(UNIT, OFFSET, WHENCE, status)
12176            IF (status /= 0) GOTO label
12177
12178     Please note that GNU Fortran provides the Fortran 2003 Stream
12179     facility.  Programmers should consider the use of new stream IO
12180     feature in new code for future portability.  See also *note Fortran
12181     2003 status::.
12182
12183_Standard_:
12184     GNU extension
12185
12186_Class_:
12187     Subroutine
12188
12189_Syntax_:
12190     'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
12191
12192_Arguments_:
12193     UNIT        Shall be a scalar of type 'INTEGER'.
12194     OFFSET      Shall be a scalar of type 'INTEGER'.
12195     WHENCE      Shall be a scalar of type 'INTEGER'.  Its value
12196                 shall be either 0, 1 or 2.
12197     STATUS      (Optional) shall be a scalar of type
12198                 'INTEGER(4)'.
12199
12200_Example_:
12201          PROGRAM test_fseek
12202            INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
12203            INTEGER :: fd, offset, ierr
12204
12205            ierr   = 0
12206            offset = 5
12207            fd     = 10
12208
12209            OPEN(UNIT=fd, FILE="fseek.test")
12210            CALL FSEEK(fd, offset, SEEK_SET, ierr)  ! move to OFFSET
12211            print *, FTELL(fd), ierr
12212
12213            CALL FSEEK(fd, 0, SEEK_END, ierr)       ! move to end
12214            print *, FTELL(fd), ierr
12215
12216            CALL FSEEK(fd, 0, SEEK_SET, ierr)       ! move to beginning
12217            print *, FTELL(fd), ierr
12218
12219            CLOSE(UNIT=fd)
12220          END PROGRAM
12221
12222_See also_:
12223     *note FTELL::
12224
12225
12226File: gfortran.info,  Node: FSTAT,  Next: FTELL,  Prev: FSEEK,  Up: Intrinsic Procedures
12227
122289.116 'FSTAT' -- Get file status
12229================================
12230
12231_Description_:
12232     'FSTAT' is identical to *note STAT::, except that information about
12233     an already opened file is obtained.
12234
12235     The elements in 'VALUES' are the same as described by *note STAT::.
12236
12237     This intrinsic is provided in both subroutine and function forms;
12238     however, only one form can be used in any given program unit.
12239
12240_Standard_:
12241     GNU extension
12242
12243_Class_:
12244     Subroutine, function
12245
12246_Syntax_:
12247     'CALL FSTAT(UNIT, VALUES [, STATUS])'
12248     'STATUS = FSTAT(UNIT, VALUES)'
12249
12250_Arguments_:
12251     UNIT        An open I/O unit number of type 'INTEGER'.
12252     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
12253     STATUS      (Optional) status flag of type 'INTEGER(4)'.
12254                 Returns 0 on success and a system specific error
12255                 code otherwise.
12256
12257_Example_:
12258     See *note STAT:: for an example.
12259
12260_See also_:
12261     To stat a link: *note LSTAT::, to stat a file: *note STAT::
12262
12263
12264File: gfortran.info,  Node: FTELL,  Next: GAMMA,  Prev: FSTAT,  Up: Intrinsic Procedures
12265
122669.117 'FTELL' -- Current stream position
12267========================================
12268
12269_Description_:
12270     Retrieves the current position within an open file.
12271
12272     This intrinsic is provided in both subroutine and function forms;
12273     however, only one form can be used in any given program unit.
12274
12275_Standard_:
12276     GNU extension
12277
12278_Class_:
12279     Subroutine, function
12280
12281_Syntax_:
12282     'CALL FTELL(UNIT, OFFSET)'
12283     'OFFSET = FTELL(UNIT)'
12284
12285_Arguments_:
12286     OFFSET      Shall of type 'INTEGER'.
12287     UNIT        Shall of type 'INTEGER'.
12288
12289_Return value_:
12290     In either syntax, OFFSET is set to the current offset of unit
12291     number UNIT, or to -1 if the unit is not currently open.
12292
12293_Example_:
12294          PROGRAM test_ftell
12295            INTEGER :: i
12296            OPEN(10, FILE="temp.dat")
12297            CALL ftell(10,i)
12298            WRITE(*,*) i
12299          END PROGRAM
12300
12301_See also_:
12302     *note FSEEK::
12303
12304
12305File: gfortran.info,  Node: GAMMA,  Next: GERROR,  Prev: FTELL,  Up: Intrinsic Procedures
12306
123079.118 'GAMMA' -- Gamma function
12308===============================
12309
12310_Description_:
12311     'GAMMA(X)' computes Gamma (\Gamma) of X.  For positive, integer
12312     values of X the Gamma function simplifies to the factorial function
12313     \Gamma(x)=(x-1)!.
12314
12315_Standard_:
12316     Fortran 2008 and later
12317
12318_Class_:
12319     Elemental function
12320
12321_Syntax_:
12322     'X = GAMMA(X)'
12323
12324_Arguments_:
12325     X           Shall be of type 'REAL' and neither zero nor a
12326                 negative integer.
12327
12328_Return value_:
12329     The return value is of type 'REAL' of the same kind as X.
12330
12331_Example_:
12332          program test_gamma
12333            real :: x = 1.0
12334            x = gamma(x) ! returns 1.0
12335          end program test_gamma
12336
12337_Specific names_:
12338     Name           Argument       Return type    Standard
12339     'GAMMA(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
12340     'DGAMMA(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
12341
12342_See also_:
12343     Logarithm of the Gamma function: *note LOG_GAMMA::
12344
12345
12346File: gfortran.info,  Node: GERROR,  Next: GETARG,  Prev: GAMMA,  Up: Intrinsic Procedures
12347
123489.119 'GERROR' -- Get last system error message
12349===============================================
12350
12351_Description_:
12352     Returns the system error message corresponding to the last system
12353     error.  This resembles the functionality of 'strerror(3)' in C.
12354
12355_Standard_:
12356     GNU extension
12357
12358_Class_:
12359     Subroutine
12360
12361_Syntax_:
12362     'CALL GERROR(RESULT)'
12363
12364_Arguments_:
12365     RESULT      Shall of type 'CHARACTER' and of default
12366
12367_Example_:
12368          PROGRAM test_gerror
12369            CHARACTER(len=100) :: msg
12370            CALL gerror(msg)
12371            WRITE(*,*) msg
12372          END PROGRAM
12373
12374_See also_:
12375     *note IERRNO::, *note PERROR::
12376
12377
12378File: gfortran.info,  Node: GETARG,  Next: GET_COMMAND,  Prev: GERROR,  Up: Intrinsic Procedures
12379
123809.120 'GETARG' -- Get command line arguments
12381============================================
12382
12383_Description_:
12384     Retrieve the POS-th argument that was passed on the command line
12385     when the containing program was invoked.
12386
12387     This intrinsic routine is provided for backwards compatibility with
12388     GNU Fortran 77.  In new code, programmers should consider the use
12389     of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
12390     Fortran 2003 standard.
12391
12392_Standard_:
12393     GNU extension
12394
12395_Class_:
12396     Subroutine
12397
12398_Syntax_:
12399     'CALL GETARG(POS, VALUE)'
12400
12401_Arguments_:
12402     POS         Shall be of type 'INTEGER' and not wider than
12403                 the default integer kind; POS \geq 0
12404     VALUE       Shall be of type 'CHARACTER' and of default
12405                 kind.
12406     VALUE       Shall be of type 'CHARACTER'.
12407
12408_Return value_:
12409     After 'GETARG' returns, the VALUE argument holds the POSth command
12410     line argument.  If VALUE can not hold the argument, it is truncated
12411     to fit the length of VALUE.  If there are less than POS arguments
12412     specified at the command line, VALUE will be filled with blanks.
12413     If POS = 0, VALUE is set to the name of the program (on systems
12414     that support this feature).
12415
12416_Example_:
12417          PROGRAM test_getarg
12418            INTEGER :: i
12419            CHARACTER(len=32) :: arg
12420
12421            DO i = 1, iargc()
12422              CALL getarg(i, arg)
12423              WRITE (*,*) arg
12424            END DO
12425          END PROGRAM
12426
12427_See also_:
12428     GNU Fortran 77 compatibility function: *note IARGC::
12429
12430     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
12431     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12432
12433
12434File: gfortran.info,  Node: GET_COMMAND,  Next: GET_COMMAND_ARGUMENT,  Prev: GETARG,  Up: Intrinsic Procedures
12435
124369.121 'GET_COMMAND' -- Get the entire command line
12437==================================================
12438
12439_Description_:
12440     Retrieve the entire command line that was used to invoke the
12441     program.
12442
12443_Standard_:
12444     Fortran 2003 and later
12445
12446_Class_:
12447     Subroutine
12448
12449_Syntax_:
12450     'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
12451
12452_Arguments_:
12453     COMMAND     (Optional) shall be of type 'CHARACTER' and of
12454                 default kind.
12455     LENGTH      (Optional) Shall be of type 'INTEGER' and of
12456                 default kind.
12457     STATUS      (Optional) Shall be of type 'INTEGER' and of
12458                 default kind.
12459
12460_Return value_:
12461     If COMMAND is present, stores the entire command line that was used
12462     to invoke the program in COMMAND.  If LENGTH is present, it is
12463     assigned the length of the command line.  If STATUS is present, it
12464     is assigned 0 upon success of the command, -1 if COMMAND is too
12465     short to store the command line, or a positive value in case of an
12466     error.
12467
12468_Example_:
12469          PROGRAM test_get_command
12470            CHARACTER(len=255) :: cmd
12471            CALL get_command(cmd)
12472            WRITE (*,*) TRIM(cmd)
12473          END PROGRAM
12474
12475_See also_:
12476     *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12477
12478
12479File: gfortran.info,  Node: GET_COMMAND_ARGUMENT,  Next: GETCWD,  Prev: GET_COMMAND,  Up: Intrinsic Procedures
12480
124819.122 'GET_COMMAND_ARGUMENT' -- Get command line arguments
12482==========================================================
12483
12484_Description_:
12485     Retrieve the NUMBER-th argument that was passed on the command line
12486     when the containing program was invoked.
12487
12488_Standard_:
12489     Fortran 2003 and later
12490
12491_Class_:
12492     Subroutine
12493
12494_Syntax_:
12495     'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
12496
12497_Arguments_:
12498     NUMBER      Shall be a scalar of type 'INTEGER' and of
12499                 default kind, NUMBER \geq 0
12500     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
12501                 and of default kind.
12502     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
12503                 and of default kind.
12504     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
12505                 and of default kind.
12506
12507_Return value_:
12508     After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
12509     NUMBER-th command line argument.  If VALUE can not hold the
12510     argument, it is truncated to fit the length of VALUE.  If there are
12511     less than NUMBER arguments specified at the command line, VALUE
12512     will be filled with blanks.  If NUMBER = 0, VALUE is set to the
12513     name of the program (on systems that support this feature).  The
12514     LENGTH argument contains the length of the NUMBER-th command line
12515     argument.  If the argument retrieval fails, STATUS is a positive
12516     number; if VALUE contains a truncated command line argument, STATUS
12517     is -1; and otherwise the STATUS is zero.
12518
12519_Example_:
12520          PROGRAM test_get_command_argument
12521            INTEGER :: i
12522            CHARACTER(len=32) :: arg
12523
12524            i = 0
12525            DO
12526              CALL get_command_argument(i, arg)
12527              IF (LEN_TRIM(arg) == 0) EXIT
12528
12529              WRITE (*,*) TRIM(arg)
12530              i = i+1
12531            END DO
12532          END PROGRAM
12533
12534_See also_:
12535     *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
12536
12537
12538File: gfortran.info,  Node: GETCWD,  Next: GETENV,  Prev: GET_COMMAND_ARGUMENT,  Up: Intrinsic Procedures
12539
125409.123 'GETCWD' -- Get current working directory
12541===============================================
12542
12543_Description_:
12544     Get current working directory.
12545
12546     This intrinsic is provided in both subroutine and function forms;
12547     however, only one form can be used in any given program unit.
12548
12549_Standard_:
12550     GNU extension
12551
12552_Class_:
12553     Subroutine, function
12554
12555_Syntax_:
12556     'CALL GETCWD(C [, STATUS])'
12557     'STATUS = GETCWD(C)'
12558
12559_Arguments_:
12560     C           The type shall be 'CHARACTER' and of default
12561                 kind.
12562     STATUS      (Optional) status flag.  Returns 0 on success, a
12563                 system specific and nonzero error code
12564                 otherwise.
12565
12566_Example_:
12567          PROGRAM test_getcwd
12568            CHARACTER(len=255) :: cwd
12569            CALL getcwd(cwd)
12570            WRITE(*,*) TRIM(cwd)
12571          END PROGRAM
12572
12573_See also_:
12574     *note CHDIR::
12575
12576
12577File: gfortran.info,  Node: GETENV,  Next: GET_ENVIRONMENT_VARIABLE,  Prev: GETCWD,  Up: Intrinsic Procedures
12578
125799.124 'GETENV' -- Get an environmental variable
12580===============================================
12581
12582_Description_:
12583     Get the VALUE of the environmental variable NAME.
12584
12585     This intrinsic routine is provided for backwards compatibility with
12586     GNU Fortran 77.  In new code, programmers should consider the use
12587     of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
12588     Fortran 2003 standard.
12589
12590     Note that 'GETENV' need not be thread-safe.  It is the
12591     responsibility of the user to ensure that the environment is not
12592     being updated concurrently with a call to the 'GETENV' intrinsic.
12593
12594_Standard_:
12595     GNU extension
12596
12597_Class_:
12598     Subroutine
12599
12600_Syntax_:
12601     'CALL GETENV(NAME, VALUE)'
12602
12603_Arguments_:
12604     NAME        Shall be of type 'CHARACTER' and of default
12605                 kind.
12606     VALUE       Shall be of type 'CHARACTER' and of default
12607                 kind.
12608
12609_Return value_:
12610     Stores the value of NAME in VALUE.  If VALUE is not large enough to
12611     hold the data, it is truncated.  If NAME is not set, VALUE will be
12612     filled with blanks.
12613
12614_Example_:
12615          PROGRAM test_getenv
12616            CHARACTER(len=255) :: homedir
12617            CALL getenv("HOME", homedir)
12618            WRITE (*,*) TRIM(homedir)
12619          END PROGRAM
12620
12621_See also_:
12622     *note GET_ENVIRONMENT_VARIABLE::
12623
12624
12625File: gfortran.info,  Node: GET_ENVIRONMENT_VARIABLE,  Next: GETGID,  Prev: GETENV,  Up: Intrinsic Procedures
12626
126279.125 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
12628=================================================================
12629
12630_Description_:
12631     Get the VALUE of the environmental variable NAME.
12632
12633     Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe.  It
12634     is the responsibility of the user to ensure that the environment is
12635     not being updated concurrently with a call to the
12636     'GET_ENVIRONMENT_VARIABLE' intrinsic.
12637
12638_Standard_:
12639     Fortran 2003 and later
12640
12641_Class_:
12642     Subroutine
12643
12644_Syntax_:
12645     'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
12646     TRIM_NAME)'
12647
12648_Arguments_:
12649     NAME        Shall be a scalar of type 'CHARACTER' and of
12650                 default kind.
12651     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
12652                 and of default kind.
12653     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
12654                 and of default kind.
12655     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
12656                 and of default kind.
12657     TRIM_NAME   (Optional) Shall be a scalar of type 'LOGICAL'
12658                 and of default kind.
12659
12660_Return value_:
12661     Stores the value of NAME in VALUE.  If VALUE is not large enough to
12662     hold the data, it is truncated.  If NAME is not set, VALUE will be
12663     filled with blanks.  Argument LENGTH contains the length needed for
12664     storing the environment variable NAME or zero if it is not present.
12665     STATUS is -1 if VALUE is present but too short for the environment
12666     variable; it is 1 if the environment variable does not exist and 2
12667     if the processor does not support environment variables; in all
12668     other cases STATUS is zero.  If TRIM_NAME is present with the value
12669     '.FALSE.', the trailing blanks in NAME are significant; otherwise
12670     they are not part of the environment variable name.
12671
12672_Example_:
12673          PROGRAM test_getenv
12674            CHARACTER(len=255) :: homedir
12675            CALL get_environment_variable("HOME", homedir)
12676            WRITE (*,*) TRIM(homedir)
12677          END PROGRAM
12678
12679
12680File: gfortran.info,  Node: GETGID,  Next: GETLOG,  Prev: GET_ENVIRONMENT_VARIABLE,  Up: Intrinsic Procedures
12681
126829.126 'GETGID' -- Group ID function
12683===================================
12684
12685_Description_:
12686     Returns the numerical group ID of the current process.
12687
12688_Standard_:
12689     GNU extension
12690
12691_Class_:
12692     Function
12693
12694_Syntax_:
12695     'RESULT = GETGID()'
12696
12697_Return value_:
12698     The return value of 'GETGID' is an 'INTEGER' of the default kind.
12699
12700_Example_:
12701     See 'GETPID' for an example.
12702
12703_See also_:
12704     *note GETPID::, *note GETUID::
12705
12706
12707File: gfortran.info,  Node: GETLOG,  Next: GETPID,  Prev: GETGID,  Up: Intrinsic Procedures
12708
127099.127 'GETLOG' -- Get login name
12710================================
12711
12712_Description_:
12713     Gets the username under which the program is running.
12714
12715_Standard_:
12716     GNU extension
12717
12718_Class_:
12719     Subroutine
12720
12721_Syntax_:
12722     'CALL GETLOG(C)'
12723
12724_Arguments_:
12725     C           Shall be of type 'CHARACTER' and of default
12726                 kind.
12727
12728_Return value_:
12729     Stores the current user name in LOGIN.  (On systems where POSIX
12730     functions 'geteuid' and 'getpwuid' are not available, and the
12731     'getlogin' function is not implemented either, this will return a
12732     blank string.)
12733
12734_Example_:
12735          PROGRAM TEST_GETLOG
12736            CHARACTER(32) :: login
12737            CALL GETLOG(login)
12738            WRITE(*,*) login
12739          END PROGRAM
12740
12741_See also_:
12742     *note GETUID::
12743
12744
12745File: gfortran.info,  Node: GETPID,  Next: GETUID,  Prev: GETLOG,  Up: Intrinsic Procedures
12746
127479.128 'GETPID' -- Process ID function
12748=====================================
12749
12750_Description_:
12751     Returns the numerical process identifier of the current process.
12752
12753_Standard_:
12754     GNU extension
12755
12756_Class_:
12757     Function
12758
12759_Syntax_:
12760     'RESULT = GETPID()'
12761
12762_Return value_:
12763     The return value of 'GETPID' is an 'INTEGER' of the default kind.
12764
12765_Example_:
12766          program info
12767            print *, "The current process ID is ", getpid()
12768            print *, "Your numerical user ID is ", getuid()
12769            print *, "Your numerical group ID is ", getgid()
12770          end program info
12771
12772_See also_:
12773     *note GETGID::, *note GETUID::
12774
12775
12776File: gfortran.info,  Node: GETUID,  Next: GMTIME,  Prev: GETPID,  Up: Intrinsic Procedures
12777
127789.129 'GETUID' -- User ID function
12779==================================
12780
12781_Description_:
12782     Returns the numerical user ID of the current process.
12783
12784_Standard_:
12785     GNU extension
12786
12787_Class_:
12788     Function
12789
12790_Syntax_:
12791     'RESULT = GETUID()'
12792
12793_Return value_:
12794     The return value of 'GETUID' is an 'INTEGER' of the default kind.
12795
12796_Example_:
12797     See 'GETPID' for an example.
12798
12799_See also_:
12800     *note GETPID::, *note GETLOG::
12801
12802
12803File: gfortran.info,  Node: GMTIME,  Next: HOSTNM,  Prev: GETUID,  Up: Intrinsic Procedures
12804
128059.130 'GMTIME' -- Convert time to GMT info
12806==========================================
12807
12808_Description_:
12809     Given a system time value TIME (as provided by the *note TIME::
12810     intrinsic), fills VALUES with values extracted from it appropriate
12811     to the UTC time zone (Universal Coordinated Time, also known in
12812     some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'.
12813
12814     This intrinsic routine is provided for backwards compatibility with
12815     GNU Fortran 77.  In new code, programmers should consider the use
12816     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
12817     standard.
12818
12819_Standard_:
12820     GNU extension
12821
12822_Class_:
12823     Subroutine
12824
12825_Syntax_:
12826     'CALL GMTIME(TIME, VALUES)'
12827
12828_Arguments_:
12829     TIME        An 'INTEGER' scalar expression corresponding to
12830                 a system time, with 'INTENT(IN)'.
12831     VALUES      A default 'INTEGER' array with 9 elements, with
12832                 'INTENT(OUT)'.
12833
12834_Return value_:
12835     The elements of VALUES are assigned as follows:
12836       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
12837          seconds
12838       2. Minutes after the hour, range 0-59
12839       3. Hours past midnight, range 0-23
12840       4. Day of month, range 1-31
12841       5. Number of months since January, range 0-11
12842       6. Years since 1900
12843       7. Number of days since Sunday, range 0-6
12844       8. Days since January 1, range 0-365
12845       9. Daylight savings indicator: positive if daylight savings is in
12846          effect, zero if not, and negative if the information is not
12847          available.
12848
12849_See also_:
12850     *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::,
12851     *note TIME8::
12852
12853
12854File: gfortran.info,  Node: HOSTNM,  Next: HUGE,  Prev: GMTIME,  Up: Intrinsic Procedures
12855
128569.131 'HOSTNM' -- Get system host name
12857======================================
12858
12859_Description_:
12860     Retrieves the host name of the system on which the program is
12861     running.
12862
12863     This intrinsic is provided in both subroutine and function forms;
12864     however, only one form can be used in any given program unit.
12865
12866_Standard_:
12867     GNU extension
12868
12869_Class_:
12870     Subroutine, function
12871
12872_Syntax_:
12873     'CALL HOSTNM(C [, STATUS])'
12874     'STATUS = HOSTNM(NAME)'
12875
12876_Arguments_:
12877     C           Shall of type 'CHARACTER' and of default kind.
12878     STATUS      (Optional) status flag of type 'INTEGER'.
12879                 Returns 0 on success, or a system specific error
12880                 code otherwise.
12881
12882_Return value_:
12883     In either syntax, NAME is set to the current hostname if it can be
12884     obtained, or to a blank string otherwise.
12885
12886
12887File: gfortran.info,  Node: HUGE,  Next: HYPOT,  Prev: HOSTNM,  Up: Intrinsic Procedures
12888
128899.132 'HUGE' -- Largest number of a kind
12890========================================
12891
12892_Description_:
12893     'HUGE(X)' returns the largest number that is not an infinity in the
12894     model of the type of 'X'.
12895
12896_Standard_:
12897     Fortran 95 and later
12898
12899_Class_:
12900     Inquiry function
12901
12902_Syntax_:
12903     'RESULT = HUGE(X)'
12904
12905_Arguments_:
12906     X           Shall be of type 'REAL' or 'INTEGER'.
12907
12908_Return value_:
12909     The return value is of the same type and kind as X
12910
12911_Example_:
12912          program test_huge_tiny
12913            print *, huge(0), huge(0.0), huge(0.0d0)
12914            print *, tiny(0.0), tiny(0.0d0)
12915          end program test_huge_tiny
12916
12917
12918File: gfortran.info,  Node: HYPOT,  Next: IACHAR,  Prev: HUGE,  Up: Intrinsic Procedures
12919
129209.133 'HYPOT' -- Euclidean distance function
12921============================================
12922
12923_Description_:
12924     'HYPOT(X,Y)' is the Euclidean distance function.  It is equal to
12925     \sqrt{X^2 + Y^2}, without undue underflow or overflow.
12926
12927_Standard_:
12928     Fortran 2008 and later
12929
12930_Class_:
12931     Elemental function
12932
12933_Syntax_:
12934     'RESULT = HYPOT(X, Y)'
12935
12936_Arguments_:
12937     X           The type shall be 'REAL'.
12938     Y           The type and kind type parameter shall be the
12939                 same as X.
12940
12941_Return value_:
12942     The return value has the same type and kind type parameter as X.
12943
12944_Example_:
12945          program test_hypot
12946            real(4) :: x = 1.e0_4, y = 0.5e0_4
12947            x = hypot(x,y)
12948          end program test_hypot
12949
12950
12951File: gfortran.info,  Node: IACHAR,  Next: IALL,  Prev: HYPOT,  Up: Intrinsic Procedures
12952
129539.134 'IACHAR' -- Code in ASCII collating sequence
12954==================================================
12955
12956_Description_:
12957     'IACHAR(C)' returns the code for the ASCII character in the first
12958     character position of 'C'.
12959
12960_Standard_:
12961     Fortran 95 and later, with KIND argument Fortran 2003 and later
12962
12963_Class_:
12964     Elemental function
12965
12966_Syntax_:
12967     'RESULT = IACHAR(C [, KIND])'
12968
12969_Arguments_:
12970     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
12971     KIND        (Optional) An 'INTEGER' initialization
12972                 expression indicating the kind parameter of the
12973                 result.
12974
12975_Return value_:
12976     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
12977     absent, the return value is of default integer kind.
12978
12979_Example_:
12980          program test_iachar
12981            integer i
12982            i = iachar(' ')
12983          end program test_iachar
12984
12985_Note_:
12986     See *note ICHAR:: for a discussion of converting between numerical
12987     values and formatted string representations.
12988
12989_See also_:
12990     *note ACHAR::, *note CHAR::, *note ICHAR::
12991
12992
12993File: gfortran.info,  Node: IALL,  Next: IAND,  Prev: IACHAR,  Up: Intrinsic Procedures
12994
129959.135 'IALL' -- Bitwise AND of array elements
12996=============================================
12997
12998_Description_:
12999     Reduces with bitwise AND the elements of ARRAY along dimension DIM
13000     if the corresponding element in MASK is 'TRUE'.
13001
13002_Standard_:
13003     Fortran 2008 and later
13004
13005_Class_:
13006     Transformational function
13007
13008_Syntax_:
13009     'RESULT = IALL(ARRAY[, MASK])'
13010     'RESULT = IALL(ARRAY, DIM[, MASK])'
13011
13012_Arguments_:
13013     ARRAY       Shall be an array of type 'INTEGER'
13014     DIM         (Optional) shall be a scalar of type 'INTEGER'
13015                 with a value in the range from 1 to n, where n
13016                 equals the rank of ARRAY.
13017     MASK        (Optional) shall be of type 'LOGICAL' and either
13018                 be a scalar or an array of the same shape as
13019                 ARRAY.
13020
13021_Return value_:
13022     The result is of the same type as ARRAY.
13023
13024     If DIM is absent, a scalar with the bitwise ALL of all elements in
13025     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13026     the rank of ARRAY, and a shape similar to that of ARRAY with
13027     dimension DIM dropped is returned.
13028
13029_Example_:
13030          PROGRAM test_iall
13031            INTEGER(1) :: a(2)
13032
13033            a(1) = b'00100100'
13034            a(2) = b'01101010'
13035
13036            ! prints 00100000
13037            PRINT '(b8.8)', IALL(a)
13038          END PROGRAM
13039
13040_See also_:
13041     *note IANY::, *note IPARITY::, *note IAND::
13042
13043
13044File: gfortran.info,  Node: IAND,  Next: IANY,  Prev: IALL,  Up: Intrinsic Procedures
13045
130469.136 'IAND' -- Bitwise logical and
13047===================================
13048
13049_Description_:
13050     Bitwise logical 'AND'.
13051
13052_Standard_:
13053     Fortran 95 and later, has overloads that are GNU extensions
13054
13055_Class_:
13056     Elemental function
13057
13058_Syntax_:
13059     'RESULT = IAND(I, J)'
13060
13061_Arguments_:
13062     I           The type shall be 'INTEGER'.
13063     J           The type shall be 'INTEGER', of the same kind as
13064                 I.  (As a GNU extension, different kinds are
13065                 also permitted.)
13066
13067_Return value_:
13068     The return type is 'INTEGER', of the same kind as the arguments.
13069     (If the argument kinds differ, it is of the same kind as the larger
13070     argument.)
13071
13072_Example_:
13073          PROGRAM test_iand
13074            INTEGER :: a, b
13075            DATA a / Z'F' /, b / Z'3' /
13076            WRITE (*,*) IAND(a, b)
13077          END PROGRAM
13078
13079_Specific names_:
13080     Name           Argument       Return type    Standard
13081     'IAND(A)'      'INTEGER A'    'INTEGER'      Fortran 95 and
13082                                                  later
13083     'BIAND(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13084                    A'
13085     'IIAND(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13086                    A'
13087     'JIAND(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13088                    A'
13089     'KIAND(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13090                    A'
13091
13092_See also_:
13093     *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
13094     IBCLR::, *note NOT::
13095
13096
13097File: gfortran.info,  Node: IANY,  Next: IARGC,  Prev: IAND,  Up: Intrinsic Procedures
13098
130999.137 'IANY' -- Bitwise OR of array elements
13100============================================
13101
13102_Description_:
13103     Reduces with bitwise OR (inclusive or) the elements of ARRAY along
13104     dimension DIM if the corresponding element in MASK is 'TRUE'.
13105
13106_Standard_:
13107     Fortran 2008 and later
13108
13109_Class_:
13110     Transformational function
13111
13112_Syntax_:
13113     'RESULT = IANY(ARRAY[, MASK])'
13114     'RESULT = IANY(ARRAY, DIM[, MASK])'
13115
13116_Arguments_:
13117     ARRAY       Shall be an array of type 'INTEGER'
13118     DIM         (Optional) shall be a scalar of type 'INTEGER'
13119                 with a value in the range from 1 to n, where n
13120                 equals the rank of ARRAY.
13121     MASK        (Optional) shall be of type 'LOGICAL' and either
13122                 be a scalar or an array of the same shape as
13123                 ARRAY.
13124
13125_Return value_:
13126     The result is of the same type as ARRAY.
13127
13128     If DIM is absent, a scalar with the bitwise OR of all elements in
13129     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13130     the rank of ARRAY, and a shape similar to that of ARRAY with
13131     dimension DIM dropped is returned.
13132
13133_Example_:
13134          PROGRAM test_iany
13135            INTEGER(1) :: a(2)
13136
13137            a(1) = b'00100100'
13138            a(2) = b'01101010'
13139
13140            ! prints 01101110
13141            PRINT '(b8.8)', IANY(a)
13142          END PROGRAM
13143
13144_See also_:
13145     *note IPARITY::, *note IALL::, *note IOR::
13146
13147
13148File: gfortran.info,  Node: IARGC,  Next: IBCLR,  Prev: IANY,  Up: Intrinsic Procedures
13149
131509.138 'IARGC' -- Get the number of command line arguments
13151=========================================================
13152
13153_Description_:
13154     'IARGC' returns the number of arguments passed on the command line
13155     when the containing program was invoked.
13156
13157     This intrinsic routine is provided for backwards compatibility with
13158     GNU Fortran 77.  In new code, programmers should consider the use
13159     of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
13160     Fortran 2003 standard.
13161
13162_Standard_:
13163     GNU extension
13164
13165_Class_:
13166     Function
13167
13168_Syntax_:
13169     'RESULT = IARGC()'
13170
13171_Arguments_:
13172     None.
13173
13174_Return value_:
13175     The number of command line arguments, type 'INTEGER(4)'.
13176
13177_Example_:
13178     See *note GETARG::
13179
13180_See also_:
13181     GNU Fortran 77 compatibility subroutine: *note GETARG::
13182
13183     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
13184     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
13185
13186
13187File: gfortran.info,  Node: IBCLR,  Next: IBITS,  Prev: IARGC,  Up: Intrinsic Procedures
13188
131899.139 'IBCLR' -- Clear bit
13190==========================
13191
13192_Description_:
13193     'IBCLR' returns the value of I with the bit at position POS set to
13194     zero.
13195
13196_Standard_:
13197     Fortran 95 and later, has overloads that are GNU extensions
13198
13199_Class_:
13200     Elemental function
13201
13202_Syntax_:
13203     'RESULT = IBCLR(I, POS)'
13204
13205_Arguments_:
13206     I           The type shall be 'INTEGER'.
13207     POS         The type shall be 'INTEGER'.
13208
13209_Return value_:
13210     The return value is of type 'INTEGER' and of the same kind as I.
13211
13212_Specific names_:
13213     Name           Argument       Return type    Standard
13214     'IBCLR(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13215                                                  later
13216     'BBCLR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13217                    A'
13218     'IIBCLR(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13219                    A'
13220     'JIBCLR(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13221                    A'
13222     'KIBCLR(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13223                    A'
13224
13225_See also_:
13226     *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
13227     IEOR::, *note MVBITS::
13228
13229
13230File: gfortran.info,  Node: IBITS,  Next: IBSET,  Prev: IBCLR,  Up: Intrinsic Procedures
13231
132329.140 'IBITS' -- Bit extraction
13233===============================
13234
13235_Description_:
13236     'IBITS' extracts a field of length LEN from I, starting from bit
13237     position POS and extending left for LEN bits.  The result is
13238     right-justified and the remaining bits are zeroed.  The value of
13239     'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'.
13240
13241_Standard_:
13242     Fortran 95 and later, has overloads that are GNU extensions
13243
13244_Class_:
13245     Elemental function
13246
13247_Syntax_:
13248     'RESULT = IBITS(I, POS, LEN)'
13249
13250_Arguments_:
13251     I           The type shall be 'INTEGER'.
13252     POS         The type shall be 'INTEGER'.
13253     LEN         The type shall be 'INTEGER'.
13254
13255_Return value_:
13256     The return value is of type 'INTEGER' and of the same kind as I.
13257
13258_Specific names_:
13259     Name           Argument       Return type    Standard
13260     'IBITS(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13261                                                  later
13262     'BBITS(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13263                    A'
13264     'IIBITS(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13265                    A'
13266     'JIBITS(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13267                    A'
13268     'KIBITS(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13269                    A'
13270
13271_See also_:
13272     *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note
13273     IOR::, *note IEOR::
13274
13275
13276File: gfortran.info,  Node: IBSET,  Next: ICHAR,  Prev: IBITS,  Up: Intrinsic Procedures
13277
132789.141 'IBSET' -- Set bit
13279========================
13280
13281_Description_:
13282     'IBSET' returns the value of I with the bit at position POS set to
13283     one.
13284
13285_Standard_:
13286     Fortran 95 and later, has overloads that are GNU extensions
13287
13288_Class_:
13289     Elemental function
13290
13291_Syntax_:
13292     'RESULT = IBSET(I, POS)'
13293
13294_Arguments_:
13295     I           The type shall be 'INTEGER'.
13296     POS         The type shall be 'INTEGER'.
13297
13298_Return value_:
13299     The return value is of type 'INTEGER' and of the same kind as I.
13300
13301_Specific names_:
13302     Name           Argument       Return type    Standard
13303     'IBSET(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13304                                                  later
13305     'BBSET(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13306                    A'
13307     'IIBSET(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13308                    A'
13309     'JIBSET(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13310                    A'
13311     'KIBSET(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13312                    A'
13313
13314_See also_:
13315     *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
13316     IEOR::, *note MVBITS::
13317
13318
13319File: gfortran.info,  Node: ICHAR,  Next: IDATE,  Prev: IBSET,  Up: Intrinsic Procedures
13320
133219.142 'ICHAR' -- Character-to-integer conversion function
13322=========================================================
13323
13324_Description_:
13325     'ICHAR(C)' returns the code for the character in the first
13326     character position of 'C' in the system's native character set.
13327     The correspondence between characters and their codes is not
13328     necessarily the same across different GNU Fortran implementations.
13329
13330_Standard_:
13331     Fortran 95 and later, with KIND argument Fortran 2003 and later
13332
13333_Class_:
13334     Elemental function
13335
13336_Syntax_:
13337     'RESULT = ICHAR(C [, KIND])'
13338
13339_Arguments_:
13340     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13341     KIND        (Optional) An 'INTEGER' initialization
13342                 expression indicating the kind parameter of the
13343                 result.
13344
13345_Return value_:
13346     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13347     absent, the return value is of default integer kind.
13348
13349_Example_:
13350          program test_ichar
13351            integer i
13352            i = ichar(' ')
13353          end program test_ichar
13354
13355_Specific names_:
13356     Name           Argument       Return type    Standard
13357     'ICHAR(C)'     'CHARACTER     'INTEGER(4)'   Fortran 77 and
13358                    C'                            later
13359
13360_Note_:
13361     No intrinsic exists to convert between a numeric value and a
13362     formatted character string representation - for instance, given the
13363     'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value
13364     with the value 154, or vice versa.  Instead, this functionality is
13365     provided by internal-file I/O, as in the following example:
13366          program read_val
13367            integer value
13368            character(len=10) string, string2
13369            string = '154'
13370
13371            ! Convert a string to a numeric value
13372            read (string,'(I10)') value
13373            print *, value
13374
13375            ! Convert a value to a formatted string
13376            write (string2,'(I10)') value
13377            print *, string2
13378          end program read_val
13379
13380_See also_:
13381     *note ACHAR::, *note CHAR::, *note IACHAR::
13382
13383
13384File: gfortran.info,  Node: IDATE,  Next: IEOR,  Prev: ICHAR,  Up: Intrinsic Procedures
13385
133869.143 'IDATE' -- Get current local time subroutine (day/month/year)
13387===================================================================
13388
13389_Description_:
13390     'IDATE(VALUES)' Fills VALUES with the numerical values at the
13391     current local time.  The day (in the range 1-31), month (in the
13392     range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
13393     respectively.  The year has four significant digits.
13394
13395     This intrinsic routine is provided for backwards compatibility with
13396     GNU Fortran 77.  In new code, programmers should consider the use
13397     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
13398     standard.
13399
13400_Standard_:
13401     GNU extension
13402
13403_Class_:
13404     Subroutine
13405
13406_Syntax_:
13407     'CALL IDATE(VALUES)'
13408
13409_Arguments_:
13410     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
13411                 the kind shall be the default integer kind.
13412
13413_Return value_:
13414     Does not return anything.
13415
13416_Example_:
13417          program test_idate
13418            integer, dimension(3) :: tarray
13419            call idate(tarray)
13420            print *, tarray(1)
13421            print *, tarray(2)
13422            print *, tarray(3)
13423          end program test_idate
13424
13425_See also_:
13426     *note DATE_AND_TIME::
13427
13428
13429File: gfortran.info,  Node: IEOR,  Next: IERRNO,  Prev: IDATE,  Up: Intrinsic Procedures
13430
134319.144 'IEOR' -- Bitwise logical exclusive or
13432============================================
13433
13434_Description_:
13435     'IEOR' returns the bitwise Boolean exclusive-OR of I and J.
13436
13437_Standard_:
13438     Fortran 95 and later, has overloads that are GNU extensions
13439
13440_Class_:
13441     Elemental function
13442
13443_Syntax_:
13444     'RESULT = IEOR(I, J)'
13445
13446_Arguments_:
13447     I           The type shall be 'INTEGER'.
13448     J           The type shall be 'INTEGER', of the same kind as
13449                 I.  (As a GNU extension, different kinds are
13450                 also permitted.)
13451
13452_Return value_:
13453     The return type is 'INTEGER', of the same kind as the arguments.
13454     (If the argument kinds differ, it is of the same kind as the larger
13455     argument.)
13456
13457_Specific names_:
13458     Name           Argument       Return type    Standard
13459     'IEOR(A)'      'INTEGER A'    'INTEGER'      Fortran 95 and
13460                                                  later
13461     'BIEOR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13462                    A'
13463     'IIEOR(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13464                    A'
13465     'JIEOR(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13466                    A'
13467     'KIEOR(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13468                    A'
13469
13470_See also_:
13471     *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
13472     IBCLR::, *note NOT::
13473
13474
13475File: gfortran.info,  Node: IERRNO,  Next: IMAGE_INDEX,  Prev: IEOR,  Up: Intrinsic Procedures
13476
134779.145 'IERRNO' -- Get the last system error number
13478==================================================
13479
13480_Description_:
13481     Returns the last system error number, as given by the C 'errno'
13482     variable.
13483
13484_Standard_:
13485     GNU extension
13486
13487_Class_:
13488     Function
13489
13490_Syntax_:
13491     'RESULT = IERRNO()'
13492
13493_Arguments_:
13494     None.
13495
13496_Return value_:
13497     The return value is of type 'INTEGER' and of the default integer
13498     kind.
13499
13500_See also_:
13501     *note PERROR::
13502
13503
13504File: gfortran.info,  Node: IMAGE_INDEX,  Next: INDEX intrinsic,  Prev: IERRNO,  Up: Intrinsic Procedures
13505
135069.146 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index
13507=============================================================================
13508
13509_Description_:
13510     Returns the image index belonging to a cosubscript.
13511
13512_Standard_:
13513     Fortran 2008 and later
13514
13515_Class_:
13516     Inquiry function.
13517
13518_Syntax_:
13519     'RESULT = IMAGE_INDEX(COARRAY, SUB)'
13520
13521_Arguments_: None.
13522     COARRAY     Coarray of any type.
13523     SUB         default integer rank-1 array of a size equal to
13524                 the corank of COARRAY.
13525
13526_Return value_:
13527     Scalar default integer with the value of the image index which
13528     corresponds to the cosubscripts.  For invalid cosubscripts the
13529     result is zero.
13530
13531_Example_:
13532          INTEGER :: array[2,-1:4,8,*]
13533          ! Writes  28 (or 0 if there are fewer than 28 images)
13534          WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
13535
13536_See also_:
13537     *note THIS_IMAGE::, *note NUM_IMAGES::
13538
13539
13540File: gfortran.info,  Node: INDEX intrinsic,  Next: INT,  Prev: IMAGE_INDEX,  Up: Intrinsic Procedures
13541
135429.147 'INDEX' -- Position of a substring within a string
13543========================================================
13544
13545_Description_:
13546     Returns the position of the start of the first occurrence of string
13547     SUBSTRING as a substring in STRING, counting from one.  If
13548     SUBSTRING is not present in STRING, zero is returned.  If the BACK
13549     argument is present and true, the return value is the start of the
13550     last occurrence rather than the first.
13551
13552_Standard_:
13553     Fortran 77 and later, with KIND argument Fortran 2003 and later
13554
13555_Class_:
13556     Elemental function
13557
13558_Syntax_:
13559     'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
13560
13561_Arguments_:
13562     STRING      Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13563     SUBSTRING   Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13564     BACK        (Optional) Shall be a scalar 'LOGICAL', with
13565                 'INTENT(IN)'
13566     KIND        (Optional) An 'INTEGER' initialization
13567                 expression indicating the kind parameter of the
13568                 result.
13569
13570_Return value_:
13571     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13572     absent, the return value is of default integer kind.
13573
13574_Specific names_:
13575     Name           Argument       Return type    Standard
13576     'INDEX(STRING, 'CHARACTER'    'INTEGER(4)'   Fortran 77 and
13577     SUBSTRING)'                                  later
13578
13579_See also_:
13580     *note SCAN::, *note VERIFY::
13581
13582
13583File: gfortran.info,  Node: INT,  Next: INT2,  Prev: INDEX intrinsic,  Up: Intrinsic Procedures
13584
135859.148 'INT' -- Convert to integer type
13586======================================
13587
13588_Description_:
13589     Convert to integer type
13590
13591_Standard_:
13592     Fortran 77 and later
13593
13594_Class_:
13595     Elemental function
13596
13597_Syntax_:
13598     'RESULT = INT(A [, KIND))'
13599
13600_Arguments_:
13601     A           Shall be of type 'INTEGER', 'REAL', or
13602                 'COMPLEX'.
13603     KIND        (Optional) An 'INTEGER' initialization
13604                 expression indicating the kind parameter of the
13605                 result.
13606
13607_Return value_:
13608     These functions return a 'INTEGER' variable or array under the
13609     following rules:
13610
13611     (A)
13612          If A is of type 'INTEGER', 'INT(A) = A'
13613     (B)
13614          If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'.  If
13615          |A| \geq 1, then 'INT(A)' is the integer whose magnitude is
13616          the largest integer that does not exceed the magnitude of A
13617          and whose sign is the same as the sign of A.
13618     (C)
13619          If A is of type 'COMPLEX', rule B is applied to the real part
13620          of A.
13621
13622_Example_:
13623          program test_int
13624            integer :: i = 42
13625            complex :: z = (-3.7, 1.0)
13626            print *, int(i)
13627            print *, int(z), int(z,8)
13628          end program
13629
13630_Specific names_:
13631     Name           Argument       Return type    Standard
13632     'INT(A)'       'REAL(4) A'    'INTEGER'      Fortran 77 and
13633                                                  later
13634     'IFIX(A)'      'REAL(4) A'    'INTEGER'      Fortran 77 and
13635                                                  later
13636     'IDINT(A)'     'REAL(8) A'    'INTEGER'      Fortran 77 and
13637                                                  later
13638
13639
13640File: gfortran.info,  Node: INT2,  Next: INT8,  Prev: INT,  Up: Intrinsic Procedures
13641
136429.149 'INT2' -- Convert to 16-bit integer type
13643==============================================
13644
13645_Description_:
13646     Convert to a 'KIND=2' integer type.  This is equivalent to the
13647     standard 'INT' intrinsic with an optional argument of 'KIND=2', and
13648     is only included for backwards compatibility.
13649
13650     The 'SHORT' intrinsic is equivalent to 'INT2'.
13651
13652_Standard_:
13653     GNU extension
13654
13655_Class_:
13656     Elemental function
13657
13658_Syntax_:
13659     'RESULT = INT2(A)'
13660
13661_Arguments_:
13662     A           Shall be of type 'INTEGER', 'REAL', or
13663                 'COMPLEX'.
13664
13665_Return value_:
13666     The return value is a 'INTEGER(2)' variable.
13667
13668_See also_:
13669     *note INT::, *note INT8::, *note LONG::
13670
13671
13672File: gfortran.info,  Node: INT8,  Next: IOR,  Prev: INT2,  Up: Intrinsic Procedures
13673
136749.150 'INT8' -- Convert to 64-bit integer type
13675==============================================
13676
13677_Description_:
13678     Convert to a 'KIND=8' integer type.  This is equivalent to the
13679     standard 'INT' intrinsic with an optional argument of 'KIND=8', and
13680     is only included for backwards compatibility.
13681
13682_Standard_:
13683     GNU extension
13684
13685_Class_:
13686     Elemental function
13687
13688_Syntax_:
13689     'RESULT = INT8(A)'
13690
13691_Arguments_:
13692     A           Shall be of type 'INTEGER', 'REAL', or
13693                 'COMPLEX'.
13694
13695_Return value_:
13696     The return value is a 'INTEGER(8)' variable.
13697
13698_See also_:
13699     *note INT::, *note INT2::, *note LONG::
13700
13701
13702File: gfortran.info,  Node: IOR,  Next: IPARITY,  Prev: INT8,  Up: Intrinsic Procedures
13703
137049.151 'IOR' -- Bitwise logical or
13705=================================
13706
13707_Description_:
13708     'IOR' returns the bitwise Boolean inclusive-OR of I and J.
13709
13710_Standard_:
13711     Fortran 95 and later, has overloads that are GNU extensions
13712
13713_Class_:
13714     Elemental function
13715
13716_Syntax_:
13717     'RESULT = IOR(I, J)'
13718
13719_Arguments_:
13720     I           The type shall be 'INTEGER'.
13721     J           The type shall be 'INTEGER', of the same kind as
13722                 I.  (As a GNU extension, different kinds are
13723                 also permitted.)
13724
13725_Return value_:
13726     The return type is 'INTEGER', of the same kind as the arguments.
13727     (If the argument kinds differ, it is of the same kind as the larger
13728     argument.)
13729
13730_Specific names_:
13731     Name           Argument       Return type    Standard
13732     'IOR(A)'       'INTEGER A'    'INTEGER'      Fortran 95 and
13733                                                  later
13734     'BIOR(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
13735                    A'
13736     'IIOR(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
13737                    A'
13738     'JIOR(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
13739                    A'
13740     'KIOR(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
13741                    A'
13742
13743_See also_:
13744     *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
13745     IBCLR::, *note NOT::
13746
13747
13748File: gfortran.info,  Node: IPARITY,  Next: IRAND,  Prev: IOR,  Up: Intrinsic Procedures
13749
137509.152 'IPARITY' -- Bitwise XOR of array elements
13751================================================
13752
13753_Description_:
13754     Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
13755     dimension DIM if the corresponding element in MASK is 'TRUE'.
13756
13757_Standard_:
13758     Fortran 2008 and later
13759
13760_Class_:
13761     Transformational function
13762
13763_Syntax_:
13764     'RESULT = IPARITY(ARRAY[, MASK])'
13765     'RESULT = IPARITY(ARRAY, DIM[, MASK])'
13766
13767_Arguments_:
13768     ARRAY       Shall be an array of type 'INTEGER'
13769     DIM         (Optional) shall be a scalar of type 'INTEGER'
13770                 with a value in the range from 1 to n, where n
13771                 equals the rank of ARRAY.
13772     MASK        (Optional) shall be of type 'LOGICAL' and either
13773                 be a scalar or an array of the same shape as
13774                 ARRAY.
13775
13776_Return value_:
13777     The result is of the same type as ARRAY.
13778
13779     If DIM is absent, a scalar with the bitwise XOR of all elements in
13780     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13781     the rank of ARRAY, and a shape similar to that of ARRAY with
13782     dimension DIM dropped is returned.
13783
13784_Example_:
13785          PROGRAM test_iparity
13786            INTEGER(1) :: a(2)
13787
13788            a(1) = b'00100100'
13789            a(2) = b'01101010'
13790
13791            ! prints 01001110
13792            PRINT '(b8.8)', IPARITY(a)
13793          END PROGRAM
13794
13795_See also_:
13796     *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
13797
13798
13799File: gfortran.info,  Node: IRAND,  Next: IS_IOSTAT_END,  Prev: IPARITY,  Up: Intrinsic Procedures
13800
138019.153 'IRAND' -- Integer pseudo-random number
13802=============================================
13803
13804_Description_:
13805     'IRAND(FLAG)' returns a pseudo-random number from a uniform
13806     distribution between 0 and a system-dependent limit (which is in
13807     most cases 2147483647).  If FLAG is 0, the next number in the
13808     current sequence is returned; if FLAG is 1, the generator is
13809     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
13810     used as a new seed with 'SRAND'.
13811
13812     This intrinsic routine is provided for backwards compatibility with
13813     GNU Fortran 77.  It implements a simple modulo generator as
13814     provided by 'g77'.  For new code, one should consider the use of
13815     *note RANDOM_NUMBER:: as it implements a superior algorithm.
13816
13817_Standard_:
13818     GNU extension
13819
13820_Class_:
13821     Function
13822
13823_Syntax_:
13824     'RESULT = IRAND(I)'
13825
13826_Arguments_:
13827     I           Shall be a scalar 'INTEGER' of kind 4.
13828
13829_Return value_:
13830     The return value is of 'INTEGER(kind=4)' type.
13831
13832_Example_:
13833          program test_irand
13834            integer,parameter :: seed = 86456
13835
13836            call srand(seed)
13837            print *, irand(), irand(), irand(), irand()
13838            print *, irand(seed), irand(), irand(), irand()
13839          end program test_irand
13840
13841
13842File: gfortran.info,  Node: IS_IOSTAT_END,  Next: IS_IOSTAT_EOR,  Prev: IRAND,  Up: Intrinsic Procedures
13843
138449.154 'IS_IOSTAT_END' -- Test for end-of-file value
13845===================================================
13846
13847_Description_:
13848     'IS_IOSTAT_END' tests whether an variable has the value of the I/O
13849     status "end of file".  The function is equivalent to comparing the
13850     variable with the 'IOSTAT_END' parameter of the intrinsic module
13851     'ISO_FORTRAN_ENV'.
13852
13853_Standard_:
13854     Fortran 2003 and later
13855
13856_Class_:
13857     Elemental function
13858
13859_Syntax_:
13860     'RESULT = IS_IOSTAT_END(I)'
13861
13862_Arguments_:
13863     I           Shall be of the type 'INTEGER'.
13864
13865_Return value_:
13866     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
13867     the value which indicates an end of file condition for 'IOSTAT='
13868     specifiers, and is '.FALSE.' otherwise.
13869
13870_Example_:
13871          PROGRAM iostat
13872            IMPLICIT NONE
13873            INTEGER :: stat, i
13874            OPEN(88, FILE='test.dat')
13875            READ(88, *, IOSTAT=stat) i
13876            IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
13877          END PROGRAM
13878
13879
13880File: gfortran.info,  Node: IS_IOSTAT_EOR,  Next: ISATTY,  Prev: IS_IOSTAT_END,  Up: Intrinsic Procedures
13881
138829.155 'IS_IOSTAT_EOR' -- Test for end-of-record value
13883=====================================================
13884
13885_Description_:
13886     'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
13887     status "end of record".  The function is equivalent to comparing
13888     the variable with the 'IOSTAT_EOR' parameter of the intrinsic
13889     module 'ISO_FORTRAN_ENV'.
13890
13891_Standard_:
13892     Fortran 2003 and later
13893
13894_Class_:
13895     Elemental function
13896
13897_Syntax_:
13898     'RESULT = IS_IOSTAT_EOR(I)'
13899
13900_Arguments_:
13901     I           Shall be of the type 'INTEGER'.
13902
13903_Return value_:
13904     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
13905     the value which indicates an end of file condition for 'IOSTAT='
13906     specifiers, and is '.FALSE.' otherwise.
13907
13908_Example_:
13909          PROGRAM iostat
13910            IMPLICIT NONE
13911            INTEGER :: stat, i(50)
13912            OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
13913            READ(88, IOSTAT=stat) i
13914            IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
13915          END PROGRAM
13916
13917
13918File: gfortran.info,  Node: ISATTY,  Next: ISHFT,  Prev: IS_IOSTAT_EOR,  Up: Intrinsic Procedures
13919
139209.156 'ISATTY' -- Whether a unit is a terminal device.
13921======================================================
13922
13923_Description_:
13924     Determine whether a unit is connected to a terminal device.
13925
13926_Standard_:
13927     GNU extension
13928
13929_Class_:
13930     Function
13931
13932_Syntax_:
13933     'RESULT = ISATTY(UNIT)'
13934
13935_Arguments_:
13936     UNIT        Shall be a scalar 'INTEGER'.
13937
13938_Return value_:
13939     Returns '.TRUE.' if the UNIT is connected to a terminal device,
13940     '.FALSE.' otherwise.
13941
13942_Example_:
13943          PROGRAM test_isatty
13944            INTEGER(kind=1) :: unit
13945            DO unit = 1, 10
13946              write(*,*) isatty(unit=unit)
13947            END DO
13948          END PROGRAM
13949_See also_:
13950     *note TTYNAM::
13951
13952
13953File: gfortran.info,  Node: ISHFT,  Next: ISHFTC,  Prev: ISATTY,  Up: Intrinsic Procedures
13954
139559.157 'ISHFT' -- Shift bits
13956===========================
13957
13958_Description_:
13959     'ISHFT' returns a value corresponding to I with all of the bits
13960     shifted SHIFT places.  A value of SHIFT greater than zero
13961     corresponds to a left shift, a value of zero corresponds to no
13962     shift, and a value less than zero corresponds to a right shift.  If
13963     the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the
13964     value is undefined.  Bits shifted out from the left end or right
13965     end are lost; zeros are shifted in from the opposite end.
13966
13967_Standard_:
13968     Fortran 95 and later, has overloads that are GNU extensions
13969
13970_Class_:
13971     Elemental function
13972
13973_Syntax_:
13974     'RESULT = ISHFT(I, SHIFT)'
13975
13976_Arguments_:
13977     I           The type shall be 'INTEGER'.
13978     SHIFT       The type shall be 'INTEGER'.
13979
13980_Return value_:
13981     The return value is of type 'INTEGER' and of the same kind as I.
13982
13983_Specific names_:
13984     Name           Argument       Return type    Standard
13985     'ISHFT(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13986                                                  later
13987     'BSHFT(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13988                    A'
13989     'IISHFT(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13990                    A'
13991     'JISHFT(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13992                    A'
13993     'KISHFT(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13994                    A'
13995
13996_See also_:
13997     *note ISHFTC::
13998
13999
14000File: gfortran.info,  Node: ISHFTC,  Next: ISNAN,  Prev: ISHFT,  Up: Intrinsic Procedures
14001
140029.158 'ISHFTC' -- Shift bits circularly
14003=======================================
14004
14005_Description_:
14006     'ISHFTC' returns a value corresponding to I with the rightmost SIZE
14007     bits shifted circularly SHIFT places; that is, bits shifted out one
14008     end are shifted into the opposite end.  A value of SHIFT greater
14009     than zero corresponds to a left shift, a value of zero corresponds
14010     to no shift, and a value less than zero corresponds to a right
14011     shift.  The absolute value of SHIFT must be less than SIZE.  If the
14012     SIZE argument is omitted, it is taken to be equivalent to
14013     'BIT_SIZE(I)'.
14014
14015_Standard_:
14016     Fortran 95 and later, has overloads that are GNU extensions
14017
14018_Class_:
14019     Elemental function
14020
14021_Syntax_:
14022     'RESULT = ISHFTC(I, SHIFT [, SIZE])'
14023
14024_Arguments_:
14025     I           The type shall be 'INTEGER'.
14026     SHIFT       The type shall be 'INTEGER'.
14027     SIZE        (Optional) The type shall be 'INTEGER'; the
14028                 value must be greater than zero and less than or
14029                 equal to 'BIT_SIZE(I)'.
14030
14031_Return value_:
14032     The return value is of type 'INTEGER' and of the same kind as I.
14033
14034_Specific names_:
14035     Name           Argument       Return type    Standard
14036     'ISHFTC(A)'    'INTEGER A'    'INTEGER'      Fortran 95 and
14037                                                  later
14038     'BSHFTC(A)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
14039                    A'
14040     'IISHFTC(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
14041                    A'
14042     'JISHFTC(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
14043                    A'
14044     'KISHFTC(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
14045                    A'
14046
14047_See also_:
14048     *note ISHFT::
14049
14050
14051File: gfortran.info,  Node: ISNAN,  Next: ITIME,  Prev: ISHFTC,  Up: Intrinsic Procedures
14052
140539.159 'ISNAN' -- Test for a NaN
14054===============================
14055
14056_Description_:
14057     'ISNAN' tests whether a floating-point value is an IEEE
14058     Not-a-Number (NaN).
14059_Standard_:
14060     GNU extension
14061
14062_Class_:
14063     Elemental function
14064
14065_Syntax_:
14066     'ISNAN(X)'
14067
14068_Arguments_:
14069     X           Variable of the type 'REAL'.
14070
14071
14072_Return value_:
14073     Returns a default-kind 'LOGICAL'.  The returned value is 'TRUE' if
14074     X is a NaN and 'FALSE' otherwise.
14075
14076_Example_:
14077          program test_nan
14078            implicit none
14079            real :: x
14080            x = -1.0
14081            x = sqrt(x)
14082            if (isnan(x)) stop '"x" is a NaN'
14083          end program test_nan
14084
14085
14086File: gfortran.info,  Node: ITIME,  Next: KILL,  Prev: ISNAN,  Up: Intrinsic Procedures
14087
140889.160 'ITIME' -- Get current local time subroutine (hour/minutes/seconds)
14089=========================================================================
14090
14091_Description_:
14092     'ITIME(VALUES)' Fills VALUES with the numerical values at the
14093     current local time.  The hour (in the range 1-24), minute (in the
14094     range 1-60), and seconds (in the range 1-60) appear in elements 1,
14095     2, and 3 of VALUES, respectively.
14096
14097     This intrinsic routine is provided for backwards compatibility with
14098     GNU Fortran 77.  In new code, programmers should consider the use
14099     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
14100     standard.
14101
14102_Standard_:
14103     GNU extension
14104
14105_Class_:
14106     Subroutine
14107
14108_Syntax_:
14109     'CALL ITIME(VALUES)'
14110
14111_Arguments_:
14112     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
14113                 the kind shall be the default integer kind.
14114
14115_Return value_:
14116     Does not return anything.
14117
14118_Example_:
14119          program test_itime
14120            integer, dimension(3) :: tarray
14121            call itime(tarray)
14122            print *, tarray(1)
14123            print *, tarray(2)
14124            print *, tarray(3)
14125          end program test_itime
14126
14127_See also_:
14128     *note DATE_AND_TIME::
14129
14130
14131File: gfortran.info,  Node: KILL,  Next: KIND,  Prev: ITIME,  Up: Intrinsic Procedures
14132
141339.161 'KILL' -- Send a signal to a process
14134==========================================
14135
14136_Description_:
14137_Standard_:
14138     Sends the signal specified by SIG to the process PID.  See
14139     'kill(2)'.
14140
14141     This intrinsic is provided in both subroutine and function forms;
14142     however, only one form can be used in any given program unit.
14143
14144_Class_:
14145     Subroutine, function
14146
14147_Syntax_:
14148     'CALL KILL(PID, SIG [, STATUS])'
14149     'STATUS = KILL(PID, SIG)'
14150
14151_Arguments_:
14152     PID         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14153     SIG         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14154     STATUS      [Subroutine](Optional) Shall be a scalar
14155                 'INTEGER'.  Returns 0 on success; otherwise a
14156                 system-specific error code is returned.
14157     STATUS      [Function] The kind type parameter is that of
14158                 'pid'.  Returns 0 on success; otherwise a
14159                 system-specific error code is returned.
14160
14161_See also_:
14162     *note ABORT::, *note EXIT::
14163
14164
14165File: gfortran.info,  Node: KIND,  Next: LBOUND,  Prev: KILL,  Up: Intrinsic Procedures
14166
141679.162 'KIND' -- Kind of an entity
14168=================================
14169
14170_Description_:
14171     'KIND(X)' returns the kind value of the entity X.
14172
14173_Standard_:
14174     Fortran 95 and later
14175
14176_Class_:
14177     Inquiry function
14178
14179_Syntax_:
14180     'K = KIND(X)'
14181
14182_Arguments_:
14183     X           Shall be of type 'LOGICAL', 'INTEGER', 'REAL',
14184                 'COMPLEX' or 'CHARACTER'.
14185
14186_Return value_:
14187     The return value is a scalar of type 'INTEGER' and of the default
14188     integer kind.
14189
14190_Example_:
14191          program test_kind
14192            integer,parameter :: kc = kind(' ')
14193            integer,parameter :: kl = kind(.true.)
14194
14195            print *, "The default character kind is ", kc
14196            print *, "The default logical kind is ", kl
14197          end program test_kind
14198
14199
14200File: gfortran.info,  Node: LBOUND,  Next: LCOBOUND,  Prev: KIND,  Up: Intrinsic Procedures
14201
142029.163 'LBOUND' -- Lower dimension bounds of an array
14203====================================================
14204
14205_Description_:
14206     Returns the lower bounds of an array, or a single lower bound along
14207     the DIM dimension.
14208_Standard_:
14209     Fortran 95 and later, with KIND argument Fortran 2003 and later
14210
14211_Class_:
14212     Inquiry function
14213
14214_Syntax_:
14215     'RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
14216
14217_Arguments_:
14218     ARRAY       Shall be an array, of any type.
14219     DIM         (Optional) Shall be a scalar 'INTEGER'.
14220     KIND        (Optional) An 'INTEGER' initialization
14221                 expression indicating the kind parameter of the
14222                 result.
14223
14224_Return value_:
14225     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14226     absent, the return value is of default integer kind.  If DIM is
14227     absent, the result is an array of the lower bounds of ARRAY.  If
14228     DIM is present, the result is a scalar corresponding to the lower
14229     bound of the array along that dimension.  If ARRAY is an expression
14230     rather than a whole array or array structure component, or if it
14231     has a zero extent along the relevant dimension, the lower bound is
14232     taken to be 1.
14233
14234_See also_:
14235     *note UBOUND::, *note LCOBOUND::
14236
14237
14238File: gfortran.info,  Node: LCOBOUND,  Next: LEADZ,  Prev: LBOUND,  Up: Intrinsic Procedures
14239
142409.164 'LCOBOUND' -- Lower codimension bounds of an array
14241========================================================
14242
14243_Description_:
14244     Returns the lower bounds of a coarray, or a single lower cobound
14245     along the DIM codimension.
14246_Standard_:
14247     Fortran 2008 and later
14248
14249_Class_:
14250     Inquiry function
14251
14252_Syntax_:
14253     'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
14254
14255_Arguments_:
14256     ARRAY       Shall be an coarray, of any type.
14257     DIM         (Optional) Shall be a scalar 'INTEGER'.
14258     KIND        (Optional) An 'INTEGER' initialization
14259                 expression indicating the kind parameter of the
14260                 result.
14261
14262_Return value_:
14263     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14264     absent, the return value is of default integer kind.  If DIM is
14265     absent, the result is an array of the lower cobounds of COARRAY.
14266     If DIM is present, the result is a scalar corresponding to the
14267     lower cobound of the array along that codimension.
14268
14269_See also_:
14270     *note UCOBOUND::, *note LBOUND::
14271
14272
14273File: gfortran.info,  Node: LEADZ,  Next: LEN,  Prev: LCOBOUND,  Up: Intrinsic Procedures
14274
142759.165 'LEADZ' -- Number of leading zero bits of an integer
14276==========================================================
14277
14278_Description_:
14279     'LEADZ' returns the number of leading zero bits of an integer.
14280
14281_Standard_:
14282     Fortran 2008 and later
14283
14284_Class_:
14285     Elemental function
14286
14287_Syntax_:
14288     'RESULT = LEADZ(I)'
14289
14290_Arguments_:
14291     I           Shall be of type 'INTEGER'.
14292
14293_Return value_:
14294     The type of the return value is the default 'INTEGER'.  If all the
14295     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
14296
14297_Example_:
14298          PROGRAM test_leadz
14299            WRITE (*,*) BIT_SIZE(1)  ! prints 32
14300            WRITE (*,*) LEADZ(1)     ! prints 31
14301          END PROGRAM
14302
14303_See also_:
14304     *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
14305
14306
14307File: gfortran.info,  Node: LEN,  Next: LEN_TRIM,  Prev: LEADZ,  Up: Intrinsic Procedures
14308
143099.166 'LEN' -- Length of a character entity
14310===========================================
14311
14312_Description_:
14313     Returns the length of a character string.  If STRING is an array,
14314     the length of an element of STRING is returned.  Note that STRING
14315     need not be defined when this intrinsic is invoked, since only the
14316     length, not the content, of STRING is needed.
14317
14318_Standard_:
14319     Fortran 77 and later, with KIND argument Fortran 2003 and later
14320
14321_Class_:
14322     Inquiry function
14323
14324_Syntax_:
14325     'L = LEN(STRING [, KIND])'
14326
14327_Arguments_:
14328     STRING      Shall be a scalar or array of type 'CHARACTER',
14329                 with 'INTENT(IN)'
14330     KIND        (Optional) An 'INTEGER' initialization
14331                 expression indicating the kind parameter of the
14332                 result.
14333
14334_Return value_:
14335     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14336     absent, the return value is of default integer kind.
14337
14338_Specific names_:
14339     Name           Argument       Return type    Standard
14340     'LEN(STRING)'  'CHARACTER'    'INTEGER'      Fortran 77 and
14341                                                  later
14342
14343_See also_:
14344     *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
14345
14346
14347File: gfortran.info,  Node: LEN_TRIM,  Next: LGE,  Prev: LEN,  Up: Intrinsic Procedures
14348
143499.167 'LEN_TRIM' -- Length of a character entity without trailing blank characters
14350==================================================================================
14351
14352_Description_:
14353     Returns the length of a character string, ignoring any trailing
14354     blanks.
14355
14356_Standard_:
14357     Fortran 95 and later, with KIND argument Fortran 2003 and later
14358
14359_Class_:
14360     Elemental function
14361
14362_Syntax_:
14363     'RESULT = LEN_TRIM(STRING [, KIND])'
14364
14365_Arguments_:
14366     STRING      Shall be a scalar of type 'CHARACTER', with
14367                 'INTENT(IN)'
14368     KIND        (Optional) An 'INTEGER' initialization
14369                 expression indicating the kind parameter of the
14370                 result.
14371
14372_Return value_:
14373     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14374     absent, the return value is of default integer kind.
14375
14376_See also_:
14377     *note LEN::, *note ADJUSTL::, *note ADJUSTR::
14378
14379
14380File: gfortran.info,  Node: LGE,  Next: LGT,  Prev: LEN_TRIM,  Up: Intrinsic Procedures
14381
143829.168 'LGE' -- Lexical greater than or equal
14383============================================
14384
14385_Description_:
14386     Determines whether one string is lexically greater than or equal to
14387     another string, where the two strings are interpreted as containing
14388     ASCII character codes.  If the String A and String B are not the
14389     same length, the shorter is compared as if spaces were appended to
14390     it to form a value that has the same length as the longer.
14391
14392     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14393     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14394     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14395     character ordering (which is not ASCII on some targets), whereas
14396     the former always use the ASCII ordering.
14397
14398_Standard_:
14399     Fortran 77 and later
14400
14401_Class_:
14402     Elemental function
14403
14404_Syntax_:
14405     'RESULT = LGE(STRING_A, STRING_B)'
14406
14407_Arguments_:
14408     STRING_A    Shall be of default 'CHARACTER' type.
14409     STRING_B    Shall be of default 'CHARACTER' type.
14410
14411_Return value_:
14412     Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.'
14413     otherwise, based on the ASCII ordering.
14414
14415_Specific names_:
14416     Name           Argument       Return type    Standard
14417     'LGE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14418     STRING_B)'                                   later
14419
14420_See also_:
14421     *note LGT::, *note LLE::, *note LLT::
14422
14423
14424File: gfortran.info,  Node: LGT,  Next: LINK,  Prev: LGE,  Up: Intrinsic Procedures
14425
144269.169 'LGT' -- Lexical greater than
14427===================================
14428
14429_Description_:
14430     Determines whether one string is lexically greater than another
14431     string, where the two strings are interpreted as containing ASCII
14432     character codes.  If the String A and String B are not the same
14433     length, the shorter is compared as if spaces were appended to it to
14434     form a value that has the same length as the longer.
14435
14436     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14437     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14438     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14439     character ordering (which is not ASCII on some targets), whereas
14440     the former always use the ASCII ordering.
14441
14442_Standard_:
14443     Fortran 77 and later
14444
14445_Class_:
14446     Elemental function
14447
14448_Syntax_:
14449     'RESULT = LGT(STRING_A, STRING_B)'
14450
14451_Arguments_:
14452     STRING_A    Shall be of default 'CHARACTER' type.
14453     STRING_B    Shall be of default 'CHARACTER' type.
14454
14455_Return value_:
14456     Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise,
14457     based on the ASCII ordering.
14458
14459_Specific names_:
14460     Name           Argument       Return type    Standard
14461     'LGT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14462     STRING_B)'                                   later
14463
14464_See also_:
14465     *note LGE::, *note LLE::, *note LLT::
14466
14467
14468File: gfortran.info,  Node: LINK,  Next: LLE,  Prev: LGT,  Up: Intrinsic Procedures
14469
144709.170 'LINK' -- Create a hard link
14471==================================
14472
14473_Description_:
14474     Makes a (hard) link from file PATH1 to PATH2.  A null character
14475     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
14476     PATH2; otherwise, trailing blanks in the file names are ignored.
14477     If the STATUS argument is supplied, it contains 0 on success or a
14478     nonzero error code upon return; see 'link(2)'.
14479
14480     This intrinsic is provided in both subroutine and function forms;
14481     however, only one form can be used in any given program unit.
14482
14483_Standard_:
14484     GNU extension
14485
14486_Class_:
14487     Subroutine, function
14488
14489_Syntax_:
14490     'CALL LINK(PATH1, PATH2 [, STATUS])'
14491     'STATUS = LINK(PATH1, PATH2)'
14492
14493_Arguments_:
14494     PATH1       Shall be of default 'CHARACTER' type.
14495     PATH2       Shall be of default 'CHARACTER' type.
14496     STATUS      (Optional) Shall be of default 'INTEGER' type.
14497
14498_See also_:
14499     *note SYMLNK::, *note UNLINK::
14500
14501
14502File: gfortran.info,  Node: LLE,  Next: LLT,  Prev: LINK,  Up: Intrinsic Procedures
14503
145049.171 'LLE' -- Lexical less than or equal
14505=========================================
14506
14507_Description_:
14508     Determines whether one string is lexically less than or equal to
14509     another string, where the two strings are interpreted as containing
14510     ASCII character codes.  If the String A and String B are not the
14511     same length, the shorter is compared as if spaces were appended to
14512     it to form a value that has the same length as the longer.
14513
14514     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14515     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14516     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14517     character ordering (which is not ASCII on some targets), whereas
14518     the former always use the ASCII ordering.
14519
14520_Standard_:
14521     Fortran 77 and later
14522
14523_Class_:
14524     Elemental function
14525
14526_Syntax_:
14527     'RESULT = LLE(STRING_A, STRING_B)'
14528
14529_Arguments_:
14530     STRING_A    Shall be of default 'CHARACTER' type.
14531     STRING_B    Shall be of default 'CHARACTER' type.
14532
14533_Return value_:
14534     Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.'
14535     otherwise, based on the ASCII ordering.
14536
14537_Specific names_:
14538     Name           Argument       Return type    Standard
14539     'LLE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14540     STRING_B)'                                   later
14541
14542_See also_:
14543     *note LGE::, *note LGT::, *note LLT::
14544
14545
14546File: gfortran.info,  Node: LLT,  Next: LNBLNK,  Prev: LLE,  Up: Intrinsic Procedures
14547
145489.172 'LLT' -- Lexical less than
14549================================
14550
14551_Description_:
14552     Determines whether one string is lexically less than another
14553     string, where the two strings are interpreted as containing ASCII
14554     character codes.  If the String A and String B are not the same
14555     length, the shorter is compared as if spaces were appended to it to
14556     form a value that has the same length as the longer.
14557
14558     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14559     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14560     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14561     character ordering (which is not ASCII on some targets), whereas
14562     the former always use the ASCII ordering.
14563
14564_Standard_:
14565     Fortran 77 and later
14566
14567_Class_:
14568     Elemental function
14569
14570_Syntax_:
14571     'RESULT = LLT(STRING_A, STRING_B)'
14572
14573_Arguments_:
14574     STRING_A    Shall be of default 'CHARACTER' type.
14575     STRING_B    Shall be of default 'CHARACTER' type.
14576
14577_Return value_:
14578     Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise,
14579     based on the ASCII ordering.
14580
14581_Specific names_:
14582     Name           Argument       Return type    Standard
14583     'LLT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14584     STRING_B)'                                   later
14585
14586_See also_:
14587     *note LGE::, *note LGT::, *note LLE::
14588
14589
14590File: gfortran.info,  Node: LNBLNK,  Next: LOC,  Prev: LLT,  Up: Intrinsic Procedures
14591
145929.173 'LNBLNK' -- Index of the last non-blank character in a string
14593===================================================================
14594
14595_Description_:
14596     Returns the length of a character string, ignoring any trailing
14597     blanks.  This is identical to the standard 'LEN_TRIM' intrinsic,
14598     and is only included for backwards compatibility.
14599
14600_Standard_:
14601     GNU extension
14602
14603_Class_:
14604     Elemental function
14605
14606_Syntax_:
14607     'RESULT = LNBLNK(STRING)'
14608
14609_Arguments_:
14610     STRING      Shall be a scalar of type 'CHARACTER', with
14611                 'INTENT(IN)'
14612
14613_Return value_:
14614     The return value is of 'INTEGER(kind=4)' type.
14615
14616_See also_:
14617     *note INDEX intrinsic::, *note LEN_TRIM::
14618
14619
14620File: gfortran.info,  Node: LOC,  Next: LOG,  Prev: LNBLNK,  Up: Intrinsic Procedures
14621
146229.174 'LOC' -- Returns the address of a variable
14623================================================
14624
14625_Description_:
14626     'LOC(X)' returns the address of X as an integer.
14627
14628_Standard_:
14629     GNU extension
14630
14631_Class_:
14632     Inquiry function
14633
14634_Syntax_:
14635     'RESULT = LOC(X)'
14636
14637_Arguments_:
14638     X           Variable of any type.
14639
14640_Return value_:
14641     The return value is of type 'INTEGER', with a 'KIND' corresponding
14642     to the size (in bytes) of a memory address on the target machine.
14643
14644_Example_:
14645          program test_loc
14646            integer :: i
14647            real :: r
14648            i = loc(r)
14649            print *, i
14650          end program test_loc
14651
14652
14653File: gfortran.info,  Node: LOG,  Next: LOG10,  Prev: LOC,  Up: Intrinsic Procedures
14654
146559.175 'LOG' -- Natural logarithm function
14656=========================================
14657
14658_Description_:
14659     'LOG(X)' computes the natural logarithm of X, i.e.  the logarithm
14660     to the base e.
14661
14662_Standard_:
14663     Fortran 77 and later
14664
14665_Class_:
14666     Elemental function
14667
14668_Syntax_:
14669     'RESULT = LOG(X)'
14670
14671_Arguments_:
14672     X           The type shall be 'REAL' or 'COMPLEX'.
14673
14674_Return value_:
14675     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
14676     parameter is the same as X.  If X is 'COMPLEX', the imaginary part
14677     \omega is in the range -\pi < \omega \leq \pi.
14678
14679_Example_:
14680          program test_log
14681            real(8) :: x = 2.7182818284590451_8
14682            complex :: z = (1.0, 2.0)
14683            x = log(x)    ! will yield (approximately) 1
14684            z = log(z)
14685          end program test_log
14686
14687_Specific names_:
14688     Name           Argument       Return type    Standard
14689     'ALOG(X)'      'REAL(4) X'    'REAL(4)'      f95, gnu
14690     'DLOG(X)'      'REAL(8) X'    'REAL(8)'      f95, gnu
14691     'CLOG(X)'      'COMPLEX(4)    'COMPLEX(4)'   f95, gnu
14692                    X'
14693     'ZLOG(X)'      'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
14694                    X'
14695     'CDLOG(X)'     'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
14696                    X'
14697
14698
14699File: gfortran.info,  Node: LOG10,  Next: LOG_GAMMA,  Prev: LOG,  Up: Intrinsic Procedures
14700
147019.176 'LOG10' -- Base 10 logarithm function
14702===========================================
14703
14704_Description_:
14705     'LOG10(X)' computes the base 10 logarithm of X.
14706
14707_Standard_:
14708     Fortran 77 and later
14709
14710_Class_:
14711     Elemental function
14712
14713_Syntax_:
14714     'RESULT = LOG10(X)'
14715
14716_Arguments_:
14717     X           The type shall be 'REAL'.
14718
14719_Return value_:
14720     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
14721     parameter is the same as X.
14722
14723_Example_:
14724          program test_log10
14725            real(8) :: x = 10.0_8
14726            x = log10(x)
14727          end program test_log10
14728
14729_Specific names_:
14730     Name           Argument       Return type    Standard
14731     'ALOG10(X)'    'REAL(4) X'    'REAL(4)'      Fortran 95 and
14732                                                  later
14733     'DLOG10(X)'    'REAL(8) X'    'REAL(8)'      Fortran 95 and
14734                                                  later
14735
14736
14737File: gfortran.info,  Node: LOG_GAMMA,  Next: LOGICAL,  Prev: LOG10,  Up: Intrinsic Procedures
14738
147399.177 'LOG_GAMMA' -- Logarithm of the Gamma function
14740====================================================
14741
14742_Description_:
14743     'LOG_GAMMA(X)' computes the natural logarithm of the absolute value
14744     of the Gamma (\Gamma) function.
14745
14746_Standard_:
14747     Fortran 2008 and later
14748
14749_Class_:
14750     Elemental function
14751
14752_Syntax_:
14753     'X = LOG_GAMMA(X)'
14754
14755_Arguments_:
14756     X           Shall be of type 'REAL' and neither zero nor a
14757                 negative integer.
14758
14759_Return value_:
14760     The return value is of type 'REAL' of the same kind as X.
14761
14762_Example_:
14763          program test_log_gamma
14764            real :: x = 1.0
14765            x = lgamma(x) ! returns 0.0
14766          end program test_log_gamma
14767
14768_Specific names_:
14769     Name           Argument       Return type    Standard
14770     'LGAMMA(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
14771     'ALGAMA(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
14772     'DLGAMA(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
14773
14774_See also_:
14775     Gamma function: *note GAMMA::
14776
14777
14778File: gfortran.info,  Node: LOGICAL,  Next: LONG,  Prev: LOG_GAMMA,  Up: Intrinsic Procedures
14779
147809.178 'LOGICAL' -- Convert to logical type
14781==========================================
14782
14783_Description_:
14784     Converts one kind of 'LOGICAL' variable to another.
14785
14786_Standard_:
14787     Fortran 95 and later
14788
14789_Class_:
14790     Elemental function
14791
14792_Syntax_:
14793     'RESULT = LOGICAL(L [, KIND])'
14794
14795_Arguments_:
14796     L           The type shall be 'LOGICAL'.
14797     KIND        (Optional) An 'INTEGER' initialization
14798                 expression indicating the kind parameter of the
14799                 result.
14800
14801_Return value_:
14802     The return value is a 'LOGICAL' value equal to L, with a kind
14803     corresponding to KIND, or of the default logical kind if KIND is
14804     not given.
14805
14806_See also_:
14807     *note INT::, *note REAL::, *note CMPLX::
14808
14809
14810File: gfortran.info,  Node: LONG,  Next: LSHIFT,  Prev: LOGICAL,  Up: Intrinsic Procedures
14811
148129.179 'LONG' -- Convert to integer type
14813=======================================
14814
14815_Description_:
14816     Convert to a 'KIND=4' integer type, which is the same size as a C
14817     'long' integer.  This is equivalent to the standard 'INT' intrinsic
14818     with an optional argument of 'KIND=4', and is only included for
14819     backwards compatibility.
14820
14821_Standard_:
14822     GNU extension
14823
14824_Class_:
14825     Elemental function
14826
14827_Syntax_:
14828     'RESULT = LONG(A)'
14829
14830_Arguments_:
14831     A           Shall be of type 'INTEGER', 'REAL', or
14832                 'COMPLEX'.
14833
14834_Return value_:
14835     The return value is a 'INTEGER(4)' variable.
14836
14837_See also_:
14838     *note INT::, *note INT2::, *note INT8::
14839
14840
14841File: gfortran.info,  Node: LSHIFT,  Next: LSTAT,  Prev: LONG,  Up: Intrinsic Procedures
14842
148439.180 'LSHIFT' -- Left shift bits
14844=================================
14845
14846_Description_:
14847     'LSHIFT' returns a value corresponding to I with all of the bits
14848     shifted left by SHIFT places.  If the absolute value of SHIFT is
14849     greater than 'BIT_SIZE(I)', the value is undefined.  Bits shifted
14850     out from the left end are lost; zeros are shifted in from the
14851     opposite end.
14852
14853     This function has been superseded by the 'ISHFT' intrinsic, which
14854     is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic,
14855     which is standard in Fortran 2008 and later.
14856
14857_Standard_:
14858     GNU extension
14859
14860_Class_:
14861     Elemental function
14862
14863_Syntax_:
14864     'RESULT = LSHIFT(I, SHIFT)'
14865
14866_Arguments_:
14867     I           The type shall be 'INTEGER'.
14868     SHIFT       The type shall be 'INTEGER'.
14869
14870_Return value_:
14871     The return value is of type 'INTEGER' and of the same kind as I.
14872
14873_See also_:
14874     *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
14875     *note SHIFTL::, *note SHIFTR::
14876
14877
14878File: gfortran.info,  Node: LSTAT,  Next: LTIME,  Prev: LSHIFT,  Up: Intrinsic Procedures
14879
148809.181 'LSTAT' -- Get file status
14881================================
14882
14883_Description_:
14884     'LSTAT' is identical to *note STAT::, except that if path is a
14885     symbolic link, then the link itself is statted, not the file that
14886     it refers to.
14887
14888     The elements in 'VALUES' are the same as described by *note STAT::.
14889
14890     This intrinsic is provided in both subroutine and function forms;
14891     however, only one form can be used in any given program unit.
14892
14893_Standard_:
14894     GNU extension
14895
14896_Class_:
14897     Subroutine, function
14898
14899_Syntax_:
14900     'CALL LSTAT(NAME, VALUES [, STATUS])'
14901     'STATUS = LSTAT(NAME, VALUES)'
14902
14903_Arguments_:
14904     NAME        The type shall be 'CHARACTER' of the default
14905                 kind, a valid path within the file system.
14906     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
14907     STATUS      (Optional) status flag of type 'INTEGER(4)'.
14908                 Returns 0 on success and a system specific error
14909                 code otherwise.
14910
14911_Example_:
14912     See *note STAT:: for an example.
14913
14914_See also_:
14915     To stat an open file: *note FSTAT::, to stat a file: *note STAT::
14916
14917
14918File: gfortran.info,  Node: LTIME,  Next: MALLOC,  Prev: LSTAT,  Up: Intrinsic Procedures
14919
149209.182 'LTIME' -- Convert time to local time info
14921================================================
14922
14923_Description_:
14924     Given a system time value TIME (as provided by the *note TIME::
14925     intrinsic), fills VALUES with values extracted from it appropriate
14926     to the local time zone using 'localtime(3)'.
14927
14928     This intrinsic routine is provided for backwards compatibility with
14929     GNU Fortran 77.  In new code, programmers should consider the use
14930     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
14931     standard.
14932
14933_Standard_:
14934     GNU extension
14935
14936_Class_:
14937     Subroutine
14938
14939_Syntax_:
14940     'CALL LTIME(TIME, VALUES)'
14941
14942_Arguments_:
14943     TIME        An 'INTEGER' scalar expression corresponding to
14944                 a system time, with 'INTENT(IN)'.
14945     VALUES      A default 'INTEGER' array with 9 elements, with
14946                 'INTENT(OUT)'.
14947
14948_Return value_:
14949     The elements of VALUES are assigned as follows:
14950       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
14951          seconds
14952       2. Minutes after the hour, range 0-59
14953       3. Hours past midnight, range 0-23
14954       4. Day of month, range 1-31
14955       5. Number of months since January, range 0-11
14956       6. Years since 1900
14957       7. Number of days since Sunday, range 0-6
14958       8. Days since January 1, range 0-365
14959       9. Daylight savings indicator: positive if daylight savings is in
14960          effect, zero if not, and negative if the information is not
14961          available.
14962
14963_See also_:
14964     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::,
14965     *note TIME8::
14966
14967
14968File: gfortran.info,  Node: MALLOC,  Next: MASKL,  Prev: LTIME,  Up: Intrinsic Procedures
14969
149709.183 'MALLOC' -- Allocate dynamic memory
14971=========================================
14972
14973_Description_:
14974     'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
14975     the address of the allocated memory.  The 'MALLOC' intrinsic is an
14976     extension intended to be used with Cray pointers, and is provided
14977     in GNU Fortran to allow the user to compile legacy code.  For new
14978     code using Fortran 95 pointers, the memory allocation intrinsic is
14979     'ALLOCATE'.
14980
14981_Standard_:
14982     GNU extension
14983
14984_Class_:
14985     Function
14986
14987_Syntax_:
14988     'PTR = MALLOC(SIZE)'
14989
14990_Arguments_:
14991     SIZE        The type shall be 'INTEGER'.
14992
14993_Return value_:
14994     The return value is of type 'INTEGER(K)', with K such that
14995     variables of type 'INTEGER(K)' have the same size as C pointers
14996     ('sizeof(void *)').
14997
14998_Example_:
14999     The following example demonstrates the use of 'MALLOC' and 'FREE'
15000     with Cray pointers.
15001
15002          program test_malloc
15003            implicit none
15004            integer i
15005            real*8 x(*), z
15006            pointer(ptr_x,x)
15007
15008            ptr_x = malloc(20*8)
15009            do i = 1, 20
15010              x(i) = sqrt(1.0d0 / i)
15011            end do
15012            z = 0
15013            do i = 1, 20
15014              z = z + x(i)
15015              print *, z
15016            end do
15017            call free(ptr_x)
15018          end program test_malloc
15019
15020_See also_:
15021     *note FREE::
15022
15023
15024File: gfortran.info,  Node: MASKL,  Next: MASKR,  Prev: MALLOC,  Up: Intrinsic Procedures
15025
150269.184 'MASKL' -- Left justified mask
15027====================================
15028
15029_Description_:
15030     'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
15031     remaining bits set to 0.
15032
15033_Standard_:
15034     Fortran 2008 and later
15035
15036_Class_:
15037     Elemental function
15038
15039_Syntax_:
15040     'RESULT = MASKL(I[, KIND])'
15041
15042_Arguments_:
15043     I           Shall be of type 'INTEGER'.
15044     KIND        Shall be a scalar constant expression of type
15045                 'INTEGER'.
15046
15047_Return value_:
15048     The return value is of type 'INTEGER'.  If KIND is present, it
15049     specifies the kind value of the return type; otherwise, it is of
15050     the default integer kind.
15051
15052_See also_:
15053     *note MASKR::
15054
15055
15056File: gfortran.info,  Node: MASKR,  Next: MATMUL,  Prev: MASKL,  Up: Intrinsic Procedures
15057
150589.185 'MASKR' -- Right justified mask
15059=====================================
15060
15061_Description_:
15062     'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
15063     remaining bits set to 0.
15064
15065_Standard_:
15066     Fortran 2008 and later
15067
15068_Class_:
15069     Elemental function
15070
15071_Syntax_:
15072     'RESULT = MASKR(I[, KIND])'
15073
15074_Arguments_:
15075     I           Shall be of type 'INTEGER'.
15076     KIND        Shall be a scalar constant expression of type
15077                 'INTEGER'.
15078
15079_Return value_:
15080     The return value is of type 'INTEGER'.  If KIND is present, it
15081     specifies the kind value of the return type; otherwise, it is of
15082     the default integer kind.
15083
15084_See also_:
15085     *note MASKL::
15086
15087
15088File: gfortran.info,  Node: MATMUL,  Next: MAX,  Prev: MASKR,  Up: Intrinsic Procedures
15089
150909.186 'MATMUL' -- matrix multiplication
15091=======================================
15092
15093_Description_:
15094     Performs a matrix multiplication on numeric or logical arguments.
15095
15096_Standard_:
15097     Fortran 95 and later
15098
15099_Class_:
15100     Transformational function
15101
15102_Syntax_:
15103     'RESULT = MATMUL(MATRIX_A, MATRIX_B)'
15104
15105_Arguments_:
15106     MATRIX_A    An array of 'INTEGER', 'REAL', 'COMPLEX', or
15107                 'LOGICAL' type, with a rank of one or two.
15108     MATRIX_B    An array of 'INTEGER', 'REAL', or 'COMPLEX' type
15109                 if MATRIX_A is of a numeric type; otherwise, an
15110                 array of 'LOGICAL' type.  The rank shall be one
15111                 or two, and the first (or only) dimension of
15112                 MATRIX_B shall be equal to the last (or only)
15113                 dimension of MATRIX_A.  MATRIX_A and MATRIX_B
15114                 shall not both be rank one arrays.
15115
15116_Return value_:
15117     The matrix product of MATRIX_A and MATRIX_B.  The type and kind of
15118     the result follow the usual type and kind promotion rules, as for
15119     the '*' or '.AND.' operators.
15120
15121_See also_:
15122
15123
15124File: gfortran.info,  Node: MAX,  Next: MAXEXPONENT,  Prev: MATMUL,  Up: Intrinsic Procedures
15125
151269.187 'MAX' -- Maximum value of an argument list
15127================================================
15128
15129_Description_:
15130     Returns the argument with the largest (most positive) value.
15131
15132_Standard_:
15133     Fortran 77 and later
15134
15135_Class_:
15136     Elemental function
15137
15138_Syntax_:
15139     'RESULT = MAX(A1, A2 [, A3 [, ...]])'
15140
15141_Arguments_:
15142     A1          The type shall be 'INTEGER' or 'REAL'.
15143     A2, A3,     An expression of the same type and kind as A1.
15144     ...         (As a GNU extension, arguments of different
15145                 kinds are permitted.)
15146
15147_Return value_:
15148     The return value corresponds to the maximum value among the
15149     arguments, and has the same type and kind as the first argument.
15150
15151_Specific names_:
15152     Name           Argument       Return type    Standard
15153     'MAX0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15154                    A1'                           later
15155     'AMAX0(A1)'    'INTEGER(4)    'REAL(MAX(X))' Fortran 77 and
15156                    A1'                           later
15157     'MAX1(A1)'     'REAL A1'      'INT(MAX(X))'  Fortran 77 and
15158                                                  later
15159     'AMAX1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15160                                                  later
15161     'DMAX1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15162                                                  later
15163
15164_See also_:
15165     *note MAXLOC:: *note MAXVAL::, *note MIN::
15166
15167
15168File: gfortran.info,  Node: MAXEXPONENT,  Next: MAXLOC,  Prev: MAX,  Up: Intrinsic Procedures
15169
151709.188 'MAXEXPONENT' -- Maximum exponent of a real kind
15171======================================================
15172
15173_Description_:
15174     'MAXEXPONENT(X)' returns the maximum exponent in the model of the
15175     type of 'X'.
15176
15177_Standard_:
15178     Fortran 95 and later
15179
15180_Class_:
15181     Inquiry function
15182
15183_Syntax_:
15184     'RESULT = MAXEXPONENT(X)'
15185
15186_Arguments_:
15187     X           Shall be of type 'REAL'.
15188
15189_Return value_:
15190     The return value is of type 'INTEGER' and of the default integer
15191     kind.
15192
15193_Example_:
15194          program exponents
15195            real(kind=4) :: x
15196            real(kind=8) :: y
15197
15198            print *, minexponent(x), maxexponent(x)
15199            print *, minexponent(y), maxexponent(y)
15200          end program exponents
15201
15202
15203File: gfortran.info,  Node: MAXLOC,  Next: MAXVAL,  Prev: MAXEXPONENT,  Up: Intrinsic Procedures
15204
152059.189 'MAXLOC' -- Location of the maximum value within an array
15206===============================================================
15207
15208_Description_:
15209     Determines the location of the element in the array with the
15210     maximum value, or, if the DIM argument is supplied, determines the
15211     locations of the maximum element along each row of the array in the
15212     DIM direction.  If MASK is present, only the elements for which
15213     MASK is '.TRUE.' are considered.  If more than one element in the
15214     array has the maximum value, the location returned is that of the
15215     first such element in array element order.  If the array has zero
15216     size, or all of the elements of MASK are '.FALSE.', then the result
15217     is an array of zeroes.  Similarly, if DIM is supplied and all of
15218     the elements of MASK along a given row are zero, the result value
15219     for that row is zero.
15220
15221_Standard_:
15222     Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
15223     are available in Fortran 2003 and later.
15224
15225_Class_:
15226     Transformational function
15227
15228_Syntax_:
15229     'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND])'
15230     'RESULT = MAXLOC(ARRAY [, MASK] [,KIND])'
15231
15232_Arguments_:
15233     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15234     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15235                 with a value between one and the rank of ARRAY,
15236                 inclusive.  It may not be an optional dummy
15237                 argument.
15238     MASK        Shall be an array of type 'LOGICAL', and
15239                 conformable with ARRAY.
15240     KIND        (Optional) An 'INTEGER' initialization
15241                 expression indicating the kind parameter of the
15242                 result.
15243
15244_Return value_:
15245     If DIM is absent, the result is a rank-one array with a length
15246     equal to the rank of ARRAY.  If DIM is present, the result is an
15247     array with a rank one less than the rank of ARRAY, and a size
15248     corresponding to the size of ARRAY with the DIM dimension removed.
15249     If DIM is present and ARRAY has a rank of one, the result is a
15250     scalar.  If the optional argument KIND is present, the result is an
15251     integer of kind KIND, otherwise it is of default kind.
15252
15253_See also_:
15254     *note MAX::, *note MAXVAL::
15255
15256
15257File: gfortran.info,  Node: MAXVAL,  Next: MCLOCK,  Prev: MAXLOC,  Up: Intrinsic Procedures
15258
152599.190 'MAXVAL' -- Maximum value of an array
15260===========================================
15261
15262_Description_:
15263     Determines the maximum value of the elements in an array value, or,
15264     if the DIM argument is supplied, determines the maximum value along
15265     each row of the array in the DIM direction.  If MASK is present,
15266     only the elements for which MASK is '.TRUE.' are considered.  If
15267     the array has zero size, or all of the elements of MASK are
15268     '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric,
15269     or a string of nulls if ARRAY is of character type.
15270
15271_Standard_:
15272     Fortran 95 and later
15273
15274_Class_:
15275     Transformational function
15276
15277_Syntax_:
15278     'RESULT = MAXVAL(ARRAY, DIM [, MASK])'
15279     'RESULT = MAXVAL(ARRAY [, MASK])'
15280
15281_Arguments_:
15282     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15283     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15284                 with a value between one and the rank of ARRAY,
15285                 inclusive.  It may not be an optional dummy
15286                 argument.
15287     MASK        Shall be an array of type 'LOGICAL', and
15288                 conformable with ARRAY.
15289
15290_Return value_:
15291     If DIM is absent, or if ARRAY has a rank of one, the result is a
15292     scalar.  If DIM is present, the result is an array with a rank one
15293     less than the rank of ARRAY, and a size corresponding to the size
15294     of ARRAY with the DIM dimension removed.  In all cases, the result
15295     is of the same type and kind as ARRAY.
15296
15297_See also_:
15298     *note MAX::, *note MAXLOC::
15299
15300
15301File: gfortran.info,  Node: MCLOCK,  Next: MCLOCK8,  Prev: MAXVAL,  Up: Intrinsic Procedures
15302
153039.191 'MCLOCK' -- Time function
15304===============================
15305
15306_Description_:
15307     Returns the number of clock ticks since the start of the process,
15308     based on the function 'clock(3)' in the C standard library.
15309
15310     This intrinsic is not fully portable, such as to systems with
15311     32-bit 'INTEGER' types but supporting times wider than 32 bits.
15312     Therefore, the values returned by this intrinsic might be, or
15313     become, negative, or numerically less than previous values, during
15314     a single run of the compiled program.
15315
15316_Standard_:
15317     GNU extension
15318
15319_Class_:
15320     Function
15321
15322_Syntax_:
15323     'RESULT = MCLOCK()'
15324
15325_Return value_:
15326     The return value is a scalar of type 'INTEGER(4)', equal to the
15327     number of clock ticks since the start of the process, or '-1' if
15328     the system does not support 'clock(3)'.
15329
15330_See also_:
15331     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15332     TIME::
15333
15334
15335File: gfortran.info,  Node: MCLOCK8,  Next: MERGE,  Prev: MCLOCK,  Up: Intrinsic Procedures
15336
153379.192 'MCLOCK8' -- Time function (64-bit)
15338=========================================
15339
15340_Description_:
15341     Returns the number of clock ticks since the start of the process,
15342     based on the function 'clock(3)' in the C standard library.
15343
15344     _Warning:_ this intrinsic does not increase the range of the timing
15345     values over that returned by 'clock(3)'.  On a system with a 32-bit
15346     'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is
15347     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
15348     the 32-bit value can still occur.  Therefore, the values returned
15349     by this intrinsic might be or become negative or numerically less
15350     than previous values during a single run of the compiled program.
15351
15352_Standard_:
15353     GNU extension
15354
15355_Class_:
15356     Function
15357
15358_Syntax_:
15359     'RESULT = MCLOCK8()'
15360
15361_Return value_:
15362     The return value is a scalar of type 'INTEGER(8)', equal to the
15363     number of clock ticks since the start of the process, or '-1' if
15364     the system does not support 'clock(3)'.
15365
15366_See also_:
15367     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15368     TIME8::
15369
15370
15371File: gfortran.info,  Node: MERGE,  Next: MERGE_BITS,  Prev: MCLOCK8,  Up: Intrinsic Procedures
15372
153739.193 'MERGE' -- Merge variables
15374================================
15375
15376_Description_:
15377     Select values from two arrays according to a logical mask.  The
15378     result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE
15379     if it is '.FALSE.'.
15380
15381_Standard_:
15382     Fortran 95 and later
15383
15384_Class_:
15385     Elemental function
15386
15387_Syntax_:
15388     'RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
15389
15390_Arguments_:
15391     TSOURCE     May be of any type.
15392     FSOURCE     Shall be of the same type and type parameters as
15393                 TSOURCE.
15394     MASK        Shall be of type 'LOGICAL'.
15395
15396_Return value_:
15397     The result is of the same type and type parameters as TSOURCE.
15398
15399
15400File: gfortran.info,  Node: MERGE_BITS,  Next: MIN,  Prev: MERGE,  Up: Intrinsic Procedures
15401
154029.194 'MERGE_BITS' -- Merge of bits under mask
15403==============================================
15404
15405_Description_:
15406     'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
15407     by the mask.  The i-th bit of the result is equal to the i-th bit
15408     of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J
15409     otherwise.
15410
15411_Standard_:
15412     Fortran 2008 and later
15413
15414_Class_:
15415     Elemental function
15416
15417_Syntax_:
15418     'RESULT = MERGE_BITS(I, J, MASK)'
15419
15420_Arguments_:
15421     I           Shall be of type 'INTEGER'.
15422     J           Shall be of type 'INTEGER' and of the same kind
15423                 as I.
15424     MASK        Shall be of type 'INTEGER' and of the same kind
15425                 as I.
15426
15427_Return value_:
15428     The result is of the same type and kind as I.
15429
15430
15431File: gfortran.info,  Node: MIN,  Next: MINEXPONENT,  Prev: MERGE_BITS,  Up: Intrinsic Procedures
15432
154339.195 'MIN' -- Minimum value of an argument list
15434================================================
15435
15436_Description_:
15437     Returns the argument with the smallest (most negative) value.
15438
15439_Standard_:
15440     Fortran 77 and later
15441
15442_Class_:
15443     Elemental function
15444
15445_Syntax_:
15446     'RESULT = MIN(A1, A2 [, A3, ...])'
15447
15448_Arguments_:
15449     A1          The type shall be 'INTEGER' or 'REAL'.
15450     A2, A3,     An expression of the same type and kind as A1.
15451     ...         (As a GNU extension, arguments of different
15452                 kinds are permitted.)
15453
15454_Return value_:
15455     The return value corresponds to the maximum value among the
15456     arguments, and has the same type and kind as the first argument.
15457
15458_Specific names_:
15459     Name           Argument       Return type    Standard
15460     'MIN0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15461                    A1'                           later
15462     'AMIN0(A1)'    'INTEGER(4)    'REAL(4)'      Fortran 77 and
15463                    A1'                           later
15464     'MIN1(A1)'     'REAL A1'      'INTEGER(4)'   Fortran 77 and
15465                                                  later
15466     'AMIN1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15467                                                  later
15468     'DMIN1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15469                                                  later
15470
15471_See also_:
15472     *note MAX::, *note MINLOC::, *note MINVAL::
15473
15474
15475File: gfortran.info,  Node: MINEXPONENT,  Next: MINLOC,  Prev: MIN,  Up: Intrinsic Procedures
15476
154779.196 'MINEXPONENT' -- Minimum exponent of a real kind
15478======================================================
15479
15480_Description_:
15481     'MINEXPONENT(X)' returns the minimum exponent in the model of the
15482     type of 'X'.
15483
15484_Standard_:
15485     Fortran 95 and later
15486
15487_Class_:
15488     Inquiry function
15489
15490_Syntax_:
15491     'RESULT = MINEXPONENT(X)'
15492
15493_Arguments_:
15494     X           Shall be of type 'REAL'.
15495
15496_Return value_:
15497     The return value is of type 'INTEGER' and of the default integer
15498     kind.
15499
15500_Example_:
15501     See 'MAXEXPONENT' for an example.
15502
15503
15504File: gfortran.info,  Node: MINLOC,  Next: MINVAL,  Prev: MINEXPONENT,  Up: Intrinsic Procedures
15505
155069.197 'MINLOC' -- Location of the minimum value within an array
15507===============================================================
15508
15509_Description_:
15510     Determines the location of the element in the array with the
15511     minimum value, or, if the DIM argument is supplied, determines the
15512     locations of the minimum element along each row of the array in the
15513     DIM direction.  If MASK is present, only the elements for which
15514     MASK is '.TRUE.' are considered.  If more than one element in the
15515     array has the minimum value, the location returned is that of the
15516     first such element in array element order.  If the array has zero
15517     size, or all of the elements of MASK are '.FALSE.', then the result
15518     is an array of zeroes.  Similarly, if DIM is supplied and all of
15519     the elements of MASK along a given row are zero, the result value
15520     for that row is zero.
15521
15522_Standard_:
15523     Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
15524     are available in Fortran 2003 and later.
15525
15526_Class_:
15527     Transformational function
15528
15529_Syntax_:
15530     'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND])'
15531     'RESULT = MINLOC(ARRAY [, MASK], [,KIND])'
15532
15533_Arguments_:
15534     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
15535                 'CHARACTER'.
15536     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15537                 with a value between one and the rank of ARRAY,
15538                 inclusive.  It may not be an optional dummy
15539                 argument.
15540     MASK        Shall be an array of type 'LOGICAL', and
15541                 conformable with ARRAY.
15542     KIND        (Optional) An 'INTEGER' initialization
15543                 expression indicating the kind parameter of the
15544                 result.
15545
15546_Return value_:
15547     If DIM is absent, the result is a rank-one array with a length
15548     equal to the rank of ARRAY.  If DIM is present, the result is an
15549     array with a rank one less than the rank of ARRAY, and a size
15550     corresponding to the size of ARRAY with the DIM dimension removed.
15551     If DIM is present and ARRAY has a rank of one, the result is a
15552     scalar.  If the optional argument KIND is present, the result is an
15553     integer of kind KIND, otherwise it is of default kind.
15554
15555_See also_:
15556     *note MIN::, *note MINVAL::
15557
15558
15559File: gfortran.info,  Node: MINVAL,  Next: MOD,  Prev: MINLOC,  Up: Intrinsic Procedures
15560
155619.198 'MINVAL' -- Minimum value of an array
15562===========================================
15563
15564_Description_:
15565     Determines the minimum value of the elements in an array value, or,
15566     if the DIM argument is supplied, determines the minimum value along
15567     each row of the array in the DIM direction.  If MASK is present,
15568     only the elements for which MASK is '.TRUE.' are considered.  If
15569     the array has zero size, or all of the elements of MASK are
15570     '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or
15571     a string of 'CHAR(255)' characters if ARRAY is of character type.
15572
15573_Standard_:
15574     Fortran 95 and later
15575
15576_Class_:
15577     Transformational function
15578
15579_Syntax_:
15580     'RESULT = MINVAL(ARRAY, DIM [, MASK])'
15581     'RESULT = MINVAL(ARRAY [, MASK])'
15582
15583_Arguments_:
15584     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15585     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15586                 with a value between one and the rank of ARRAY,
15587                 inclusive.  It may not be an optional dummy
15588                 argument.
15589     MASK        Shall be an array of type 'LOGICAL', and
15590                 conformable with ARRAY.
15591
15592_Return value_:
15593     If DIM is absent, or if ARRAY has a rank of one, the result is a
15594     scalar.  If DIM is present, the result is an array with a rank one
15595     less than the rank of ARRAY, and a size corresponding to the size
15596     of ARRAY with the DIM dimension removed.  In all cases, the result
15597     is of the same type and kind as ARRAY.
15598
15599_See also_:
15600     *note MIN::, *note MINLOC::
15601
15602
15603File: gfortran.info,  Node: MOD,  Next: MODULO,  Prev: MINVAL,  Up: Intrinsic Procedures
15604
156059.199 'MOD' -- Remainder function
15606=================================
15607
15608_Description_:
15609     'MOD(A,P)' computes the remainder of the division of A by P.
15610
15611_Standard_:
15612     Fortran 77 and later, has overloads that are GNU extensions
15613
15614_Class_:
15615     Elemental function
15616
15617_Syntax_:
15618     'RESULT = MOD(A, P)'
15619
15620_Arguments_:
15621     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
15622     P           Shall be a scalar of the same type and kind as A
15623                 and not equal to zero.
15624
15625_Return value_:
15626     The return value is the result of 'A - (INT(A/P) * P)'.  The type
15627     and kind of the return value is the same as that of the arguments.
15628     The returned value has the same sign as A and a magnitude less than
15629     the magnitude of P.
15630
15631_Example_:
15632          program test_mod
15633            print *, mod(17,3)
15634            print *, mod(17.5,5.5)
15635            print *, mod(17.5d0,5.5)
15636            print *, mod(17.5,5.5d0)
15637
15638            print *, mod(-17,3)
15639            print *, mod(-17.5,5.5)
15640            print *, mod(-17.5d0,5.5)
15641            print *, mod(-17.5,5.5d0)
15642
15643            print *, mod(17,-3)
15644            print *, mod(17.5,-5.5)
15645            print *, mod(17.5d0,-5.5)
15646            print *, mod(17.5,-5.5d0)
15647          end program test_mod
15648
15649_Specific names_:
15650     Name           Arguments      Return type    Standard
15651     'MOD(A,P)'     'INTEGER       'INTEGER'      Fortran 95 and
15652                    A,P'                          later
15653     'AMOD(A,P)'    'REAL(4)       'REAL(4)'      Fortran 95 and
15654                    A,P'                          later
15655     'DMOD(A,P)'    'REAL(8)       'REAL(8)'      Fortran 95 and
15656                    A,P'                          later
15657     'BMOD(A,P)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
15658                    A,P'
15659     'IMOD(A,P)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
15660                    A,P'
15661     'JMOD(A,P)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
15662                    A,P'
15663     'KMOD(A,P)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
15664                    A,P'
15665
15666_See also_:
15667     *note MODULO::
15668
15669
15670File: gfortran.info,  Node: MODULO,  Next: MOVE_ALLOC,  Prev: MOD,  Up: Intrinsic Procedures
15671
156729.200 'MODULO' -- Modulo function
15673=================================
15674
15675_Description_:
15676     'MODULO(A,P)' computes the A modulo P.
15677
15678_Standard_:
15679     Fortran 95 and later
15680
15681_Class_:
15682     Elemental function
15683
15684_Syntax_:
15685     'RESULT = MODULO(A, P)'
15686
15687_Arguments_:
15688     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
15689     P           Shall be a scalar of the same type and kind as
15690                 A.  It shall not be zero.
15691
15692_Return value_:
15693     The type and kind of the result are those of the arguments.
15694     If A and P are of type 'INTEGER':
15695          'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is
15696          an integer and R is between 0 (inclusive) and P (exclusive).
15697     If A and P are of type 'REAL':
15698          'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'.
15699     The returned value has the same sign as P and a magnitude less than
15700     the magnitude of P.
15701
15702_Example_:
15703          program test_modulo
15704            print *, modulo(17,3)
15705            print *, modulo(17.5,5.5)
15706
15707            print *, modulo(-17,3)
15708            print *, modulo(-17.5,5.5)
15709
15710            print *, modulo(17,-3)
15711            print *, modulo(17.5,-5.5)
15712          end program
15713
15714_See also_:
15715     *note MOD::
15716
15717
15718File: gfortran.info,  Node: MOVE_ALLOC,  Next: MVBITS,  Prev: MODULO,  Up: Intrinsic Procedures
15719
157209.201 'MOVE_ALLOC' -- Move allocation from one object to another
15721================================================================
15722
15723_Description_:
15724     'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO.  FROM
15725     will become deallocated in the process.
15726
15727_Standard_:
15728     Fortran 2003 and later
15729
15730_Class_:
15731     Pure subroutine
15732
15733_Syntax_:
15734     'CALL MOVE_ALLOC(FROM, TO)'
15735
15736_Arguments_:
15737     FROM        'ALLOCATABLE', 'INTENT(INOUT)', may be of any
15738                 type and kind.
15739     TO          'ALLOCATABLE', 'INTENT(OUT)', shall be of the
15740                 same type, kind and rank as FROM.
15741
15742_Return value_:
15743     None
15744
15745_Example_:
15746          program test_move_alloc
15747              integer, allocatable :: a(:), b(:)
15748
15749              allocate(a(3))
15750              a = [ 1, 2, 3 ]
15751              call move_alloc(a, b)
15752              print *, allocated(a), allocated(b)
15753              print *, b
15754          end program test_move_alloc
15755
15756
15757File: gfortran.info,  Node: MVBITS,  Next: NEAREST,  Prev: MOVE_ALLOC,  Up: Intrinsic Procedures
15758
157599.202 'MVBITS' -- Move bits from one integer to another
15760=======================================================
15761
15762_Description_:
15763     Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of
15764     FROM to positions TOPOS through 'TOPOS+LEN-1' of TO.  The portion
15765     of argument TO not affected by the movement of bits is unchanged.
15766     The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than
15767     'BIT_SIZE(FROM)'.
15768
15769_Standard_:
15770     Fortran 95 and later, has overloads that are GNU extensions
15771
15772_Class_:
15773     Elemental subroutine
15774
15775_Syntax_:
15776     'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
15777
15778_Arguments_:
15779     FROM        The type shall be 'INTEGER'.
15780     FROMPOS     The type shall be 'INTEGER'.
15781     LEN         The type shall be 'INTEGER'.
15782     TO          The type shall be 'INTEGER', of the same kind as
15783                 FROM.
15784     TOPOS       The type shall be 'INTEGER'.
15785
15786_Specific names_:
15787     Name           Argument       Return type    Standard
15788     'MVBITS(A)'    'INTEGER A'    'INTEGER'      Fortran 95 and
15789                                                  later
15790     'BMVBITS(A)'   'INTEGER(1)    'INTEGER(1)'   GNU extension
15791                    A'
15792     'IMVBITS(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
15793                    A'
15794     'JMVBITS(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
15795                    A'
15796     'KMVBITS(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
15797                    A'
15798
15799_See also_:
15800     *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
15801     IOR::, *note IEOR::
15802
15803
15804File: gfortran.info,  Node: NEAREST,  Next: NEW_LINE,  Prev: MVBITS,  Up: Intrinsic Procedures
15805
158069.203 'NEAREST' -- Nearest representable number
15807===============================================
15808
15809_Description_:
15810     'NEAREST(X, S)' returns the processor-representable number nearest
15811     to 'X' in the direction indicated by the sign of 'S'.
15812
15813_Standard_:
15814     Fortran 95 and later
15815
15816_Class_:
15817     Elemental function
15818
15819_Syntax_:
15820     'RESULT = NEAREST(X, S)'
15821
15822_Arguments_:
15823     X           Shall be of type 'REAL'.
15824     S           Shall be of type 'REAL' and not equal to zero.
15825
15826_Return value_:
15827     The return value is of the same type as 'X'.  If 'S' is positive,
15828     'NEAREST' returns the processor-representable number greater than
15829     'X' and nearest to it.  If 'S' is negative, 'NEAREST' returns the
15830     processor-representable number smaller than 'X' and nearest to it.
15831
15832_Example_:
15833          program test_nearest
15834            real :: x, y
15835            x = nearest(42.0, 1.0)
15836            y = nearest(42.0, -1.0)
15837            write (*,"(3(G20.15))") x, y, x - y
15838          end program test_nearest
15839
15840
15841File: gfortran.info,  Node: NEW_LINE,  Next: NINT,  Prev: NEAREST,  Up: Intrinsic Procedures
15842
158439.204 'NEW_LINE' -- New line character
15844======================================
15845
15846_Description_:
15847     'NEW_LINE(C)' returns the new-line character.
15848
15849_Standard_:
15850     Fortran 2003 and later
15851
15852_Class_:
15853     Inquiry function
15854
15855_Syntax_:
15856     'RESULT = NEW_LINE(C)'
15857
15858_Arguments_:
15859     C           The argument shall be a scalar or array of the
15860                 type 'CHARACTER'.
15861
15862_Return value_:
15863     Returns a CHARACTER scalar of length one with the new-line
15864     character of the same kind as parameter C.
15865
15866_Example_:
15867          program newline
15868            implicit none
15869            write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
15870          end program newline
15871
15872
15873File: gfortran.info,  Node: NINT,  Next: NORM2,  Prev: NEW_LINE,  Up: Intrinsic Procedures
15874
158759.205 'NINT' -- Nearest whole number
15876====================================
15877
15878_Description_:
15879     'NINT(A)' rounds its argument to the nearest whole number.
15880
15881_Standard_:
15882     Fortran 77 and later, with KIND argument Fortran 90 and later
15883
15884_Class_:
15885     Elemental function
15886
15887_Syntax_:
15888     'RESULT = NINT(A [, KIND])'
15889
15890_Arguments_:
15891     A           The type of the argument shall be 'REAL'.
15892     KIND        (Optional) An 'INTEGER' initialization
15893                 expression indicating the kind parameter of the
15894                 result.
15895
15896_Return value_:
15897     Returns A with the fractional portion of its magnitude eliminated
15898     by rounding to the nearest whole number and with its sign
15899     preserved, converted to an 'INTEGER' of the default kind.
15900
15901_Example_:
15902          program test_nint
15903            real(4) x4
15904            real(8) x8
15905            x4 = 1.234E0_4
15906            x8 = 4.321_8
15907            print *, nint(x4), idnint(x8)
15908          end program test_nint
15909
15910_Specific names_:
15911     Name           Argument       Return Type    Standard
15912     'NINT(A)'      'REAL(4) A'    'INTEGER'      Fortran 95 and
15913                                                  later
15914     'IDNINT(A)'    'REAL(8) A'    'INTEGER'      Fortran 95 and
15915                                                  later
15916
15917_See also_:
15918     *note CEILING::, *note FLOOR::
15919
15920
15921File: gfortran.info,  Node: NORM2,  Next: NOT,  Prev: NINT,  Up: Intrinsic Procedures
15922
159239.206 'NORM2' -- Euclidean vector norms
15924=======================================
15925
15926_Description_:
15927     Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
15928     dimension DIM.
15929
15930_Standard_:
15931     Fortran 2008 and later
15932
15933_Class_:
15934     Transformational function
15935
15936_Syntax_:
15937     'RESULT = NORM2(ARRAY[, DIM])'
15938
15939_Arguments_:
15940     ARRAY       Shall be an array of type 'REAL'
15941     DIM         (Optional) shall be a scalar of type 'INTEGER'
15942                 with a value in the range from 1 to n, where n
15943                 equals the rank of ARRAY.
15944
15945_Return value_:
15946     The result is of the same type as ARRAY.
15947
15948     If DIM is absent, a scalar with the square root of the sum of all
15949     elements in ARRAY squared is returned.  Otherwise, an array of rank
15950     n-1, where n equals the rank of ARRAY, and a shape similar to that
15951     of ARRAY with dimension DIM dropped is returned.
15952
15953_Example_:
15954          PROGRAM test_sum
15955            REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
15956            print *, NORM2(x)  ! = sqrt(55.) ~ 7.416
15957          END PROGRAM
15958
15959
15960File: gfortran.info,  Node: NOT,  Next: NULL,  Prev: NORM2,  Up: Intrinsic Procedures
15961
159629.207 'NOT' -- Logical negation
15963===============================
15964
15965_Description_:
15966     'NOT' returns the bitwise Boolean inverse of I.
15967
15968_Standard_:
15969     Fortran 95 and later, has overloads that are GNU extensions
15970
15971_Class_:
15972     Elemental function
15973
15974_Syntax_:
15975     'RESULT = NOT(I)'
15976
15977_Arguments_:
15978     I           The type shall be 'INTEGER'.
15979
15980_Return value_:
15981     The return type is 'INTEGER', of the same kind as the argument.
15982
15983_Specific names_:
15984     Name           Argument       Return type    Standard
15985     'NOT(A)'       'INTEGER A'    'INTEGER'      Fortran 95 and
15986                                                  later
15987     'BNOT(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
15988                    A'
15989     'INOT(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
15990                    A'
15991     'JNOT(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
15992                    A'
15993     'KNOT(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
15994                    A'
15995
15996_See also_:
15997     *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
15998     IBSET::, *note IBCLR::
15999
16000
16001File: gfortran.info,  Node: NULL,  Next: NUM_IMAGES,  Prev: NOT,  Up: Intrinsic Procedures
16002
160039.208 'NULL' -- Function that returns an disassociated pointer
16004==============================================================
16005
16006_Description_:
16007     Returns a disassociated pointer.
16008
16009     If MOLD is present, a disassociated pointer of the same type is
16010     returned, otherwise the type is determined by context.
16011
16012     In Fortran 95, MOLD is optional.  Please note that Fortran 2003
16013     includes cases where it is required.
16014
16015_Standard_:
16016     Fortran 95 and later
16017
16018_Class_:
16019     Transformational function
16020
16021_Syntax_:
16022     'PTR => NULL([MOLD])'
16023
16024_Arguments_:
16025     MOLD        (Optional) shall be a pointer of any association
16026                 status and of any type.
16027
16028_Return value_:
16029     A disassociated pointer.
16030
16031_Example_:
16032          REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
16033
16034_See also_:
16035     *note ASSOCIATED::
16036
16037
16038File: gfortran.info,  Node: NUM_IMAGES,  Next: OR,  Prev: NULL,  Up: Intrinsic Procedures
16039
160409.209 'NUM_IMAGES' -- Function that returns the number of images
16041================================================================
16042
16043_Description_:
16044     Returns the number of images.
16045
16046_Standard_:
16047     Fortran 2008 and later.  With DISTANCE or FAILED argument,
16048     Technical Specification (TS) 18508 or later
16049
16050_Class_:
16051     Transformational function
16052
16053_Syntax_:
16054     'RESULT = NUM_IMAGES(DISTANCE, FAILED)'
16055
16056_Arguments_:
16057     DISTANCE    (optional, intent(in)) Nonnegative scalar
16058                 integer
16059     FAILED      (optional, intent(in)) Scalar logical expression
16060
16061_Return value_:
16062     Scalar default-kind integer.  If DISTANCE is not present or has
16063     value 0, the number of images in the current team is returned.  For
16064     values smaller or equal distance to the initial team, it returns
16065     the number of images index on the ancestor team which has a
16066     distance of DISTANCE from the invoking team.  If DISTANCE is larger
16067     than the distance to the initial team, the number of images of the
16068     initial team is returned.  If FAILED is not present the total
16069     number of images is returned; if it has the value '.TRUE.', the
16070     number of failed images is returned, otherwise, the number of
16071     images which do have not the failed status.
16072
16073_Example_:
16074          INTEGER :: value[*]
16075          INTEGER :: i
16076          value = THIS_IMAGE()
16077          SYNC ALL
16078          IF (THIS_IMAGE() == 1) THEN
16079            DO i = 1, NUM_IMAGES()
16080              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
16081            END DO
16082          END IF
16083
16084_See also_:
16085     *note THIS_IMAGE::, *note IMAGE_INDEX::
16086
16087
16088File: gfortran.info,  Node: OR,  Next: PACK,  Prev: NUM_IMAGES,  Up: Intrinsic Procedures
16089
160909.210 'OR' -- Bitwise logical OR
16091================================
16092
16093_Description_:
16094     Bitwise logical 'OR'.
16095
16096     This intrinsic routine is provided for backwards compatibility with
16097     GNU Fortran 77.  For integer arguments, programmers should consider
16098     the use of the *note IOR:: intrinsic defined by the Fortran
16099     standard.
16100
16101_Standard_:
16102     GNU extension
16103
16104_Class_:
16105     Function
16106
16107_Syntax_:
16108     'RESULT = OR(I, J)'
16109
16110_Arguments_:
16111     I           The type shall be either a scalar 'INTEGER' type
16112                 or a scalar 'LOGICAL' type.
16113     J           The type shall be the same as the type of J.
16114
16115_Return value_:
16116     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
16117     If the kind type parameters differ, then the smaller kind type is
16118     implicitly converted to larger kind, and the return has the larger
16119     kind.
16120
16121_Example_:
16122          PROGRAM test_or
16123            LOGICAL :: T = .TRUE., F = .FALSE.
16124            INTEGER :: a, b
16125            DATA a / Z'F' /, b / Z'3' /
16126
16127            WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
16128            WRITE (*,*) OR(a, b)
16129          END PROGRAM
16130
16131_See also_:
16132     Fortran 95 elemental function: *note IOR::
16133
16134
16135File: gfortran.info,  Node: PACK,  Next: PARITY,  Prev: OR,  Up: Intrinsic Procedures
16136
161379.211 'PACK' -- Pack an array into an array of rank one
16138=======================================================
16139
16140_Description_:
16141     Stores the elements of ARRAY in an array of rank one.
16142
16143     The beginning of the resulting array is made up of elements whose
16144     MASK equals 'TRUE'.  Afterwards, positions are filled with elements
16145     taken from VECTOR.
16146
16147_Standard_:
16148     Fortran 95 and later
16149
16150_Class_:
16151     Transformational function
16152
16153_Syntax_:
16154     'RESULT = PACK(ARRAY, MASK[,VECTOR])'
16155
16156_Arguments_:
16157     ARRAY       Shall be an array of any type.
16158     MASK        Shall be an array of type 'LOGICAL' and of the
16159                 same size as ARRAY.  Alternatively, it may be a
16160                 'LOGICAL' scalar.
16161     VECTOR      (Optional) shall be an array of the same type as
16162                 ARRAY and of rank one.  If present, the number
16163                 of elements in VECTOR shall be equal to or
16164                 greater than the number of true elements in
16165                 MASK.  If MASK is scalar, the number of elements
16166                 in VECTOR shall be equal to or greater than the
16167                 number of elements in ARRAY.
16168
16169_Return value_:
16170     The result is an array of rank one and the same type as that of
16171     ARRAY.  If VECTOR is present, the result size is that of VECTOR,
16172     the number of 'TRUE' values in MASK otherwise.
16173
16174_Example_:
16175     Gathering nonzero elements from an array:
16176          PROGRAM test_pack_1
16177            INTEGER :: m(6)
16178            m = (/ 1, 0, 0, 0, 5, 0 /)
16179            WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0)  ! "1 5"
16180          END PROGRAM
16181
16182     Gathering nonzero elements from an array and appending elements
16183     from VECTOR:
16184          PROGRAM test_pack_2
16185            INTEGER :: m(4)
16186            m = (/ 1, 0, 0, 2 /)
16187            WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /))  ! "1 2 3 4"
16188          END PROGRAM
16189
16190_See also_:
16191     *note UNPACK::
16192
16193
16194File: gfortran.info,  Node: PARITY,  Next: PERROR,  Prev: PACK,  Up: Intrinsic Procedures
16195
161969.212 'PARITY' -- Reduction with exclusive OR
16197=============================================
16198
16199_Description_:
16200     Calculates the parity, i.e.  the reduction using '.XOR.', of MASK
16201     along dimension DIM.
16202
16203_Standard_:
16204     Fortran 2008 and later
16205
16206_Class_:
16207     Transformational function
16208
16209_Syntax_:
16210     'RESULT = PARITY(MASK[, DIM])'
16211
16212_Arguments_:
16213     LOGICAL     Shall be an array of type 'LOGICAL'
16214     DIM         (Optional) shall be a scalar of type 'INTEGER'
16215                 with a value in the range from 1 to n, where n
16216                 equals the rank of MASK.
16217
16218_Return value_:
16219     The result is of the same type as MASK.
16220
16221     If DIM is absent, a scalar with the parity of all elements in MASK
16222     is returned, i.e.  true if an odd number of elements is '.true.'
16223     and false otherwise.  If DIM is present, an array of rank n-1,
16224     where n equals the rank of ARRAY, and a shape similar to that of
16225     MASK with dimension DIM dropped is returned.
16226
16227_Example_:
16228          PROGRAM test_sum
16229            LOGICAL :: x(2) = [ .true., .false. ]
16230            print *, PARITY(x) ! prints "T" (true).
16231          END PROGRAM
16232
16233
16234File: gfortran.info,  Node: PERROR,  Next: POPCNT,  Prev: PARITY,  Up: Intrinsic Procedures
16235
162369.213 'PERROR' -- Print system error message
16237============================================
16238
16239_Description_:
16240     Prints (on the C 'stderr' stream) a newline-terminated error
16241     message corresponding to the last system error.  This is prefixed
16242     by STRING, a colon and a space.  See 'perror(3)'.
16243
16244_Standard_:
16245     GNU extension
16246
16247_Class_:
16248     Subroutine
16249
16250_Syntax_:
16251     'CALL PERROR(STRING)'
16252
16253_Arguments_:
16254     STRING      A scalar of type 'CHARACTER' and of the default
16255                 kind.
16256
16257_See also_:
16258     *note IERRNO::
16259
16260
16261File: gfortran.info,  Node: POPCNT,  Next: POPPAR,  Prev: PERROR,  Up: Intrinsic Procedures
16262
162639.214 'POPCNT' -- Number of bits set
16264====================================
16265
16266_Description_:
16267     'POPCNT(I)' returns the number of bits set ('1' bits) in the binary
16268     representation of 'I'.
16269
16270_Standard_:
16271     Fortran 2008 and later
16272
16273_Class_:
16274     Elemental function
16275
16276_Syntax_:
16277     'RESULT = POPCNT(I)'
16278
16279_Arguments_:
16280     I           Shall be of type 'INTEGER'.
16281
16282_Return value_:
16283     The return value is of type 'INTEGER' and of the default integer
16284     kind.
16285
16286_See also_:
16287     *note POPPAR::, *note LEADZ::, *note TRAILZ::
16288
16289_Example_:
16290          program test_population
16291            print *, popcnt(127),       poppar(127)
16292            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16293            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16294          end program test_population
16295
16296
16297File: gfortran.info,  Node: POPPAR,  Next: PRECISION,  Prev: POPCNT,  Up: Intrinsic Procedures
16298
162999.215 'POPPAR' -- Parity of the number of bits set
16300==================================================
16301
16302_Description_:
16303     'POPPAR(I)' returns parity of the integer 'I', i.e.  the parity of
16304     the number of bits set ('1' bits) in the binary representation of
16305     'I'.  It is equal to 0 if 'I' has an even number of bits set, and 1
16306     for an odd number of '1' bits.
16307
16308_Standard_:
16309     Fortran 2008 and later
16310
16311_Class_:
16312     Elemental function
16313
16314_Syntax_:
16315     'RESULT = POPPAR(I)'
16316
16317_Arguments_:
16318     I           Shall be of type 'INTEGER'.
16319
16320_Return value_:
16321     The return value is of type 'INTEGER' and of the default integer
16322     kind.
16323
16324_See also_:
16325     *note POPCNT::, *note LEADZ::, *note TRAILZ::
16326
16327_Example_:
16328          program test_population
16329            print *, popcnt(127),       poppar(127)
16330            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16331            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16332          end program test_population
16333
16334
16335File: gfortran.info,  Node: PRECISION,  Next: PRESENT,  Prev: POPPAR,  Up: Intrinsic Procedures
16336
163379.216 'PRECISION' -- Decimal precision of a real kind
16338=====================================================
16339
16340_Description_:
16341     'PRECISION(X)' returns the decimal precision in the model of the
16342     type of 'X'.
16343
16344_Standard_:
16345     Fortran 95 and later
16346
16347_Class_:
16348     Inquiry function
16349
16350_Syntax_:
16351     'RESULT = PRECISION(X)'
16352
16353_Arguments_:
16354     X           Shall be of type 'REAL' or 'COMPLEX'.
16355
16356_Return value_:
16357     The return value is of type 'INTEGER' and of the default integer
16358     kind.
16359
16360_See also_:
16361     *note SELECTED_REAL_KIND::, *note RANGE::
16362
16363_Example_:
16364          program prec_and_range
16365            real(kind=4) :: x(2)
16366            complex(kind=8) :: y
16367
16368            print *, precision(x), range(x)
16369            print *, precision(y), range(y)
16370          end program prec_and_range
16371
16372
16373File: gfortran.info,  Node: PRESENT,  Next: PRODUCT,  Prev: PRECISION,  Up: Intrinsic Procedures
16374
163759.217 'PRESENT' -- Determine whether an optional dummy argument is specified
16376============================================================================
16377
16378_Description_:
16379     Determines whether an optional dummy argument is present.
16380
16381_Standard_:
16382     Fortran 95 and later
16383
16384_Class_:
16385     Inquiry function
16386
16387_Syntax_:
16388     'RESULT = PRESENT(A)'
16389
16390_Arguments_:
16391     A           May be of any type and may be a pointer, scalar
16392                 or array value, or a dummy procedure.  It shall
16393                 be the name of an optional dummy argument
16394                 accessible within the current subroutine or
16395                 function.
16396
16397_Return value_:
16398     Returns either 'TRUE' if the optional argument A is present, or
16399     'FALSE' otherwise.
16400
16401_Example_:
16402          PROGRAM test_present
16403            WRITE(*,*) f(), f(42)      ! "F T"
16404          CONTAINS
16405            LOGICAL FUNCTION f(x)
16406              INTEGER, INTENT(IN), OPTIONAL :: x
16407              f = PRESENT(x)
16408            END FUNCTION
16409          END PROGRAM
16410
16411
16412File: gfortran.info,  Node: PRODUCT,  Next: RADIX,  Prev: PRESENT,  Up: Intrinsic Procedures
16413
164149.218 'PRODUCT' -- Product of array elements
16415============================================
16416
16417_Description_:
16418     Multiplies the elements of ARRAY along dimension DIM if the
16419     corresponding element in MASK is 'TRUE'.
16420
16421_Standard_:
16422     Fortran 95 and later
16423
16424_Class_:
16425     Transformational function
16426
16427_Syntax_:
16428     'RESULT = PRODUCT(ARRAY[, MASK])'
16429     'RESULT = PRODUCT(ARRAY, DIM[, MASK])'
16430
16431_Arguments_:
16432     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
16433                 'COMPLEX'.
16434     DIM         (Optional) shall be a scalar of type 'INTEGER'
16435                 with a value in the range from 1 to n, where n
16436                 equals the rank of ARRAY.
16437     MASK        (Optional) shall be of type 'LOGICAL' and either
16438                 be a scalar or an array of the same shape as
16439                 ARRAY.
16440
16441_Return value_:
16442     The result is of the same type as ARRAY.
16443
16444     If DIM is absent, a scalar with the product of all elements in
16445     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
16446     the rank of ARRAY, and a shape similar to that of ARRAY with
16447     dimension DIM dropped is returned.
16448
16449_Example_:
16450          PROGRAM test_product
16451            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
16452            print *, PRODUCT(x)                    ! all elements, product = 120
16453            print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
16454          END PROGRAM
16455
16456_See also_:
16457     *note SUM::
16458
16459
16460File: gfortran.info,  Node: RADIX,  Next: RAN,  Prev: PRODUCT,  Up: Intrinsic Procedures
16461
164629.219 'RADIX' -- Base of a model number
16463=======================================
16464
16465_Description_:
16466     'RADIX(X)' returns the base of the model representing the entity X.
16467
16468_Standard_:
16469     Fortran 95 and later
16470
16471_Class_:
16472     Inquiry function
16473
16474_Syntax_:
16475     'RESULT = RADIX(X)'
16476
16477_Arguments_:
16478     X           Shall be of type 'INTEGER' or 'REAL'
16479
16480_Return value_:
16481     The return value is a scalar of type 'INTEGER' and of the default
16482     integer kind.
16483
16484_See also_:
16485     *note SELECTED_REAL_KIND::
16486
16487_Example_:
16488          program test_radix
16489            print *, "The radix for the default integer kind is", radix(0)
16490            print *, "The radix for the default real kind is", radix(0.0)
16491          end program test_radix
16492
16493
16494File: gfortran.info,  Node: RAN,  Next: RAND,  Prev: RADIX,  Up: Intrinsic Procedures
16495
164969.220 'RAN' -- Real pseudo-random number
16497========================================
16498
16499_Description_:
16500     For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is
16501     provided as an alias for 'RAND'.  See *note RAND:: for complete
16502     documentation.
16503
16504_Standard_:
16505     GNU extension
16506
16507_Class_:
16508     Function
16509
16510_See also_:
16511     *note RAND::, *note RANDOM_NUMBER::
16512
16513
16514File: gfortran.info,  Node: RAND,  Next: RANDOM_NUMBER,  Prev: RAN,  Up: Intrinsic Procedures
16515
165169.221 'RAND' -- Real pseudo-random number
16517=========================================
16518
16519_Description_:
16520     'RAND(FLAG)' returns a pseudo-random number from a uniform
16521     distribution between 0 and 1.  If FLAG is 0, the next number in the
16522     current sequence is returned; if FLAG is 1, the generator is
16523     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
16524     used as a new seed with 'SRAND'.
16525
16526     This intrinsic routine is provided for backwards compatibility with
16527     GNU Fortran 77.  It implements a simple modulo generator as
16528     provided by 'g77'.  For new code, one should consider the use of
16529     *note RANDOM_NUMBER:: as it implements a superior algorithm.
16530
16531_Standard_:
16532     GNU extension
16533
16534_Class_:
16535     Function
16536
16537_Syntax_:
16538     'RESULT = RAND(I)'
16539
16540_Arguments_:
16541     I           Shall be a scalar 'INTEGER' of kind 4.
16542
16543_Return value_:
16544     The return value is of 'REAL' type and the default kind.
16545
16546_Example_:
16547          program test_rand
16548            integer,parameter :: seed = 86456
16549
16550            call srand(seed)
16551            print *, rand(), rand(), rand(), rand()
16552            print *, rand(seed), rand(), rand(), rand()
16553          end program test_rand
16554
16555_See also_:
16556     *note SRAND::, *note RANDOM_NUMBER::
16557
16558
16559File: gfortran.info,  Node: RANDOM_NUMBER,  Next: RANDOM_SEED,  Prev: RAND,  Up: Intrinsic Procedures
16560
165619.222 'RANDOM_NUMBER' -- Pseudo-random number
16562=============================================
16563
16564_Description_:
16565     Returns a single pseudorandom number or an array of pseudorandom
16566     numbers from the uniform distribution over the range 0 \leq x < 1.
16567
16568     The runtime-library implements the xorshift1024* random number
16569     generator (RNG). This generator has a period of 2^{1024} - 1, and
16570     when using multiple threads up to 2^{512} threads can each generate
16571     2^{512} random numbers before any aliasing occurs.
16572
16573     Note that in a multi-threaded program (e.g.  using OpenMP
16574     directives), each thread will have its own random number state.
16575     For details of the seeding procedure, see the documentation for the
16576     'RANDOM_SEED' intrinsic.
16577
16578_Standard_:
16579     Fortran 95 and later
16580
16581_Class_:
16582     Subroutine
16583
16584_Syntax_:
16585     'RANDOM_NUMBER(HARVEST)'
16586
16587_Arguments_:
16588     HARVEST     Shall be a scalar or an array of type 'REAL'.
16589
16590_Example_:
16591          program test_random_number
16592            REAL :: r(5,5)
16593            CALL RANDOM_NUMBER(r)
16594          end program
16595
16596_See also_:
16597     *note RANDOM_SEED::
16598
16599
16600File: gfortran.info,  Node: RANDOM_SEED,  Next: RANGE,  Prev: RANDOM_NUMBER,  Up: Intrinsic Procedures
16601
166029.223 'RANDOM_SEED' -- Initialize a pseudo-random number sequence
16603=================================================================
16604
16605_Description_:
16606     Restarts or queries the state of the pseudorandom number generator
16607     used by 'RANDOM_NUMBER'.
16608
16609     If 'RANDOM_SEED' is called without arguments, it is seeded with
16610     random data retrieved from the operating system.
16611
16612     As an extension to the Fortran standard, the GFortran
16613     'RANDOM_NUMBER' supports multiple threads.  Each thread in a
16614     multi-threaded program has its own seed.  When 'RANDOM_SEED' is
16615     called either without arguments or with the PUT argument, the given
16616     seed is copied into a master seed as well as the seed of the
16617     current thread.  When a new thread uses 'RANDOM_NUMBER' for the
16618     first time, the seed is copied from the master seed, and forwarded
16619     N * 2^{512} steps to guarantee that the random stream does not
16620     alias any other stream in the system, where N is the number of
16621     threads that have used 'RANDOM_NUMBER' so far during the program
16622     execution.
16623
16624_Standard_:
16625     Fortran 95 and later
16626
16627_Class_:
16628     Subroutine
16629
16630_Syntax_:
16631     'CALL RANDOM_SEED([SIZE, PUT, GET])'
16632
16633_Arguments_:
16634     SIZE        (Optional) Shall be a scalar and of type default
16635                 'INTEGER', with 'INTENT(OUT)'.  It specifies the
16636                 minimum size of the arrays used with the PUT and
16637                 GET arguments.
16638     PUT         (Optional) Shall be an array of type default
16639                 'INTEGER' and rank one.  It is 'INTENT(IN)' and
16640                 the size of the array must be larger than or
16641                 equal to the number returned by the SIZE
16642                 argument.
16643     GET         (Optional) Shall be an array of type default
16644                 'INTEGER' and rank one.  It is 'INTENT(OUT)' and
16645                 the size of the array must be larger than or
16646                 equal to the number returned by the SIZE
16647                 argument.
16648
16649_Example_:
16650          program test_random_seed
16651            implicit none
16652            integer, allocatable :: seed(:)
16653            integer :: n
16654
16655            call random_seed(size = n)
16656            allocate(seed(n))
16657            call random_seed(get=seed)
16658            write (*, *) seed
16659          end program test_random_seed
16660
16661_See also_:
16662     *note RANDOM_NUMBER::
16663
16664
16665File: gfortran.info,  Node: RANGE,  Next: RANK,  Prev: RANDOM_SEED,  Up: Intrinsic Procedures
16666
166679.224 'RANGE' -- Decimal exponent range
16668=======================================
16669
16670_Description_:
16671     'RANGE(X)' returns the decimal exponent range in the model of the
16672     type of 'X'.
16673
16674_Standard_:
16675     Fortran 95 and later
16676
16677_Class_:
16678     Inquiry function
16679
16680_Syntax_:
16681     'RESULT = RANGE(X)'
16682
16683_Arguments_:
16684     X           Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'.
16685
16686_Return value_:
16687     The return value is of type 'INTEGER' and of the default integer
16688     kind.
16689
16690_See also_:
16691     *note SELECTED_REAL_KIND::, *note PRECISION::
16692
16693_Example_:
16694     See 'PRECISION' for an example.
16695
16696
16697File: gfortran.info,  Node: RANK,  Next: REAL,  Prev: RANGE,  Up: Intrinsic Procedures
16698
166999.225 'RANK' -- Rank of a data object
16700=====================================
16701
16702_Description_:
16703     'RANK(A)' returns the rank of a scalar or array data object.
16704
16705_Standard_:
16706     Technical Specification (TS) 29113
16707
16708_Class_:
16709     Inquiry function
16710
16711_Syntax_:
16712     'RESULT = RANK(A)'
16713
16714_Arguments_:
16715     A           can be of any type
16716
16717_Return value_:
16718     The return value is of type 'INTEGER' and of the default integer
16719     kind.  For arrays, their rank is returned; for scalars zero is
16720     returned.
16721
16722_Example_:
16723          program test_rank
16724            integer :: a
16725            real, allocatable :: b(:,:)
16726
16727            print *, rank(a), rank(b) ! Prints:  0  2
16728          end program test_rank
16729
16730
16731File: gfortran.info,  Node: REAL,  Next: RENAME,  Prev: RANK,  Up: Intrinsic Procedures
16732
167339.226 'REAL' -- Convert to real type
16734====================================
16735
16736_Description_:
16737     'REAL(A [, KIND])' converts its argument A to a real type.  The
16738     'REALPART' function is provided for compatibility with 'g77', and
16739     its use is strongly discouraged.
16740
16741_Standard_:
16742     Fortran 77 and later
16743
16744_Class_:
16745     Elemental function
16746
16747_Syntax_:
16748     'RESULT = REAL(A [, KIND])'
16749     'RESULT = REALPART(Z)'
16750
16751_Arguments_:
16752     A           Shall be 'INTEGER', 'REAL', or 'COMPLEX'.
16753     KIND        (Optional) An 'INTEGER' initialization
16754                 expression indicating the kind parameter of the
16755                 result.
16756
16757_Return value_:
16758     These functions return a 'REAL' variable or array under the
16759     following rules:
16760
16761     (A)
16762          'REAL(A)' is converted to a default real type if A is an
16763          integer or real variable.
16764     (B)
16765          'REAL(A)' is converted to a real type with the kind type
16766          parameter of A if A is a complex variable.
16767     (C)
16768          'REAL(A, KIND)' is converted to a real type with kind type
16769          parameter KIND if A is a complex, integer, or real variable.
16770
16771_Example_:
16772          program test_real
16773            complex :: x = (1.0, 2.0)
16774            print *, real(x), real(x,8), realpart(x)
16775          end program test_real
16776
16777_Specific names_:
16778     Name           Argument       Return type    Standard
16779     'FLOAT(A)'     'INTEGER(4)'   'REAL(4)'      Fortran 77 and
16780                                                  later
16781     'DFLOAT(A)'    'INTEGER(4)'   'REAL(8)'      GNU extension
16782     'FLOATI(A)'    'INTEGER(2)'   'REAL(4)'      GNU extension
16783     'FLOATJ(A)'    'INTEGER(4)'   'REAL(4)'      GNU extension
16784     'FLOATK(A)'    'INTEGER(8)'   'REAL(4)'      GNU extension
16785     'SNGL(A)'      'INTEGER(8)'   'REAL(4)'      Fortran 77 and
16786                                                  later
16787
16788_See also_:
16789     *note DBLE::
16790
16791
16792File: gfortran.info,  Node: RENAME,  Next: REPEAT,  Prev: REAL,  Up: Intrinsic Procedures
16793
167949.227 'RENAME' -- Rename a file
16795===============================
16796
16797_Description_:
16798     Renames a file from file PATH1 to PATH2.  A null character
16799     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
16800     PATH2; otherwise, trailing blanks in the file names are ignored.
16801     If the STATUS argument is supplied, it contains 0 on success or a
16802     nonzero error code upon return; see 'rename(2)'.
16803
16804     This intrinsic is provided in both subroutine and function forms;
16805     however, only one form can be used in any given program unit.
16806
16807_Standard_:
16808     GNU extension
16809
16810_Class_:
16811     Subroutine, function
16812
16813_Syntax_:
16814     'CALL RENAME(PATH1, PATH2 [, STATUS])'
16815     'STATUS = RENAME(PATH1, PATH2)'
16816
16817_Arguments_:
16818     PATH1       Shall be of default 'CHARACTER' type.
16819     PATH2       Shall be of default 'CHARACTER' type.
16820     STATUS      (Optional) Shall be of default 'INTEGER' type.
16821
16822_See also_:
16823     *note LINK::
16824
16825
16826File: gfortran.info,  Node: REPEAT,  Next: RESHAPE,  Prev: RENAME,  Up: Intrinsic Procedures
16827
168289.228 'REPEAT' -- Repeated string concatenation
16829===============================================
16830
16831_Description_:
16832     Concatenates NCOPIES copies of a string.
16833
16834_Standard_:
16835     Fortran 95 and later
16836
16837_Class_:
16838     Transformational function
16839
16840_Syntax_:
16841     'RESULT = REPEAT(STRING, NCOPIES)'
16842
16843_Arguments_:
16844     STRING      Shall be scalar and of type 'CHARACTER'.
16845     NCOPIES     Shall be scalar and of type 'INTEGER'.
16846
16847_Return value_:
16848     A new scalar of type 'CHARACTER' built up from NCOPIES copies of
16849     STRING.
16850
16851_Example_:
16852          program test_repeat
16853            write(*,*) repeat("x", 5)   ! "xxxxx"
16854          end program
16855
16856
16857File: gfortran.info,  Node: RESHAPE,  Next: RRSPACING,  Prev: REPEAT,  Up: Intrinsic Procedures
16858
168599.229 'RESHAPE' -- Function to reshape an array
16860===============================================
16861
16862_Description_:
16863     Reshapes SOURCE to correspond to SHAPE.  If necessary, the new
16864     array may be padded with elements from PAD or permuted as defined
16865     by ORDER.
16866
16867_Standard_:
16868     Fortran 95 and later
16869
16870_Class_:
16871     Transformational function
16872
16873_Syntax_:
16874     'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
16875
16876_Arguments_:
16877     SOURCE      Shall be an array of any type.
16878     SHAPE       Shall be of type 'INTEGER' and an array of rank
16879                 one.  Its values must be positive or zero.
16880     PAD         (Optional) shall be an array of the same type as
16881                 SOURCE.
16882     ORDER       (Optional) shall be of type 'INTEGER' and an
16883                 array of the same shape as SHAPE.  Its values
16884                 shall be a permutation of the numbers from 1 to
16885                 n, where n is the size of SHAPE.  If ORDER is
16886                 absent, the natural ordering shall be assumed.
16887
16888_Return value_:
16889     The result is an array of shape SHAPE with the same type as SOURCE.
16890
16891_Example_:
16892          PROGRAM test_reshape
16893            INTEGER, DIMENSION(4) :: x
16894            WRITE(*,*) SHAPE(x)                       ! prints "4"
16895            WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/)))    ! prints "2 2"
16896          END PROGRAM
16897
16898_See also_:
16899     *note SHAPE::
16900
16901
16902File: gfortran.info,  Node: RRSPACING,  Next: RSHIFT,  Prev: RESHAPE,  Up: Intrinsic Procedures
16903
169049.230 'RRSPACING' -- Reciprocal of the relative spacing
16905=======================================================
16906
16907_Description_:
16908     'RRSPACING(X)' returns the reciprocal of the relative spacing of
16909     model numbers near X.
16910
16911_Standard_:
16912     Fortran 95 and later
16913
16914_Class_:
16915     Elemental function
16916
16917_Syntax_:
16918     'RESULT = RRSPACING(X)'
16919
16920_Arguments_:
16921     X           Shall be of type 'REAL'.
16922
16923_Return value_:
16924     The return value is of the same type and kind as X.  The value
16925     returned is equal to 'ABS(FRACTION(X)) *
16926     FLOAT(RADIX(X))**DIGITS(X)'.
16927
16928_See also_:
16929     *note SPACING::
16930
16931
16932File: gfortran.info,  Node: RSHIFT,  Next: SAME_TYPE_AS,  Prev: RRSPACING,  Up: Intrinsic Procedures
16933
169349.231 'RSHIFT' -- Right shift bits
16935==================================
16936
16937_Description_:
16938     'RSHIFT' returns a value corresponding to I with all of the bits
16939     shifted right by SHIFT places.  If the absolute value of SHIFT is
16940     greater than 'BIT_SIZE(I)', the value is undefined.  Bits shifted
16941     out from the right end are lost.  The fill is arithmetic: the bits
16942     shifted in from the left end are equal to the leftmost bit, which
16943     in two's complement representation is the sign bit.
16944
16945     This function has been superseded by the 'SHIFTA' intrinsic, which
16946     is standard in Fortran 2008 and later.
16947
16948_Standard_:
16949     GNU extension
16950
16951_Class_:
16952     Elemental function
16953
16954_Syntax_:
16955     'RESULT = RSHIFT(I, SHIFT)'
16956
16957_Arguments_:
16958     I           The type shall be 'INTEGER'.
16959     SHIFT       The type shall be 'INTEGER'.
16960
16961_Return value_:
16962     The return value is of type 'INTEGER' and of the same kind as I.
16963
16964_See also_:
16965     *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
16966     *note SHIFTR::, *note SHIFTL::
16967
16968
16969File: gfortran.info,  Node: SAME_TYPE_AS,  Next: SCALE,  Prev: RSHIFT,  Up: Intrinsic Procedures
16970
169719.232 'SAME_TYPE_AS' -- Query dynamic types for equality
16972========================================================
16973
16974_Description_:
16975     Query dynamic types for equality.
16976
16977_Standard_:
16978     Fortran 2003 and later
16979
16980_Class_:
16981     Inquiry function
16982
16983_Syntax_:
16984     'RESULT = SAME_TYPE_AS(A, B)'
16985
16986_Arguments_:
16987     A           Shall be an object of extensible declared type
16988                 or unlimited polymorphic.
16989     B           Shall be an object of extensible declared type
16990                 or unlimited polymorphic.
16991
16992_Return value_:
16993     The return value is a scalar of type default logical.  It is true
16994     if and only if the dynamic type of A is the same as the dynamic
16995     type of B.
16996
16997_See also_:
16998     *note EXTENDS_TYPE_OF::
16999
17000
17001File: gfortran.info,  Node: SCALE,  Next: SCAN,  Prev: SAME_TYPE_AS,  Up: Intrinsic Procedures
17002
170039.233 'SCALE' -- Scale a real value
17004===================================
17005
17006_Description_:
17007     'SCALE(X,I)' returns 'X * RADIX(X)**I'.
17008
17009_Standard_:
17010     Fortran 95 and later
17011
17012_Class_:
17013     Elemental function
17014
17015_Syntax_:
17016     'RESULT = SCALE(X, I)'
17017
17018_Arguments_:
17019     X           The type of the argument shall be a 'REAL'.
17020     I           The type of the argument shall be a 'INTEGER'.
17021
17022_Return value_:
17023     The return value is of the same type and kind as X.  Its value is
17024     'X * RADIX(X)**I'.
17025
17026_Example_:
17027          program test_scale
17028            real :: x = 178.1387e-4
17029            integer :: i = 5
17030            print *, scale(x,i), x*radix(x)**i
17031          end program test_scale
17032
17033
17034File: gfortran.info,  Node: SCAN,  Next: SECNDS,  Prev: SCALE,  Up: Intrinsic Procedures
17035
170369.234 'SCAN' -- Scan a string for the presence of a set of characters
17037=====================================================================
17038
17039_Description_:
17040     Scans a STRING for any of the characters in a SET of characters.
17041
17042     If BACK is either absent or equals 'FALSE', this function returns
17043     the position of the leftmost character of STRING that is in SET.
17044     If BACK equals 'TRUE', the rightmost position is returned.  If no
17045     character of SET is found in STRING, the result is zero.
17046
17047_Standard_:
17048     Fortran 95 and later, with KIND argument Fortran 2003 and later
17049
17050_Class_:
17051     Elemental function
17052
17053_Syntax_:
17054     'RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
17055
17056_Arguments_:
17057     STRING      Shall be of type 'CHARACTER'.
17058     SET         Shall be of type 'CHARACTER'.
17059     BACK        (Optional) shall be of type 'LOGICAL'.
17060     KIND        (Optional) An 'INTEGER' initialization
17061                 expression indicating the kind parameter of the
17062                 result.
17063
17064_Return value_:
17065     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
17066     absent, the return value is of default integer kind.
17067
17068_Example_:
17069          PROGRAM test_scan
17070            WRITE(*,*) SCAN("FORTRAN", "AO")          ! 2, found 'O'
17071            WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.)  ! 6, found 'A'
17072            WRITE(*,*) SCAN("FORTRAN", "C++")         ! 0, found none
17073          END PROGRAM
17074
17075_See also_:
17076     *note INDEX intrinsic::, *note VERIFY::
17077
17078
17079File: gfortran.info,  Node: SECNDS,  Next: SECOND,  Prev: SCAN,  Up: Intrinsic Procedures
17080
170819.235 'SECNDS' -- Time function
17082===============================
17083
17084_Description_:
17085     'SECNDS(X)' gets the time in seconds from the real-time system
17086     clock.  X is a reference time, also in seconds.  If this is zero,
17087     the time in seconds from midnight is returned.  This function is
17088     non-standard and its use is discouraged.
17089
17090_Standard_:
17091     GNU extension
17092
17093_Class_:
17094     Function
17095
17096_Syntax_:
17097     'RESULT = SECNDS (X)'
17098
17099_Arguments_:
17100     T           Shall be of type 'REAL(4)'.
17101     X           Shall be of type 'REAL(4)'.
17102
17103_Return value_:
17104     None
17105
17106_Example_:
17107          program test_secnds
17108              integer :: i
17109              real(4) :: t1, t2
17110              print *, secnds (0.0)   ! seconds since midnight
17111              t1 = secnds (0.0)       ! reference time
17112              do i = 1, 10000000      ! do something
17113              end do
17114              t2 = secnds (t1)        ! elapsed time
17115              print *, "Something took ", t2, " seconds."
17116          end program test_secnds
17117
17118
17119File: gfortran.info,  Node: SECOND,  Next: SELECTED_CHAR_KIND,  Prev: SECNDS,  Up: Intrinsic Procedures
17120
171219.236 'SECOND' -- CPU time function
17122===================================
17123
17124_Description_:
17125     Returns a 'REAL(4)' value representing the elapsed CPU time in
17126     seconds.  This provides the same functionality as the standard
17127     'CPU_TIME' intrinsic, and is only included for backwards
17128     compatibility.
17129
17130     This intrinsic is provided in both subroutine and function forms;
17131     however, only one form can be used in any given program unit.
17132
17133_Standard_:
17134     GNU extension
17135
17136_Class_:
17137     Subroutine, function
17138
17139_Syntax_:
17140     'CALL SECOND(TIME)'
17141     'TIME = SECOND()'
17142
17143_Arguments_:
17144     TIME        Shall be of type 'REAL(4)'.
17145
17146_Return value_:
17147     In either syntax, TIME is set to the process's current runtime in
17148     seconds.
17149
17150_See also_:
17151     *note CPU_TIME::
17152
17153
17154File: gfortran.info,  Node: SELECTED_CHAR_KIND,  Next: SELECTED_INT_KIND,  Prev: SECOND,  Up: Intrinsic Procedures
17155
171569.237 'SELECTED_CHAR_KIND' -- Choose character kind
17157===================================================
17158
17159_Description_:
17160
17161     'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
17162     set named NAME, if a character set with such a name is supported,
17163     or -1 otherwise.  Currently, supported character sets include
17164     "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
17165     (Universal Character Set, UCS-4) which is commonly known as
17166     Unicode.
17167
17168_Standard_:
17169     Fortran 2003 and later
17170
17171_Class_:
17172     Transformational function
17173
17174_Syntax_:
17175     'RESULT = SELECTED_CHAR_KIND(NAME)'
17176
17177_Arguments_:
17178     NAME        Shall be a scalar and of the default character
17179                 type.
17180
17181_Example_:
17182          program character_kind
17183            use iso_fortran_env
17184            implicit none
17185            integer, parameter :: ascii = selected_char_kind ("ascii")
17186            integer, parameter :: ucs4  = selected_char_kind ('ISO_10646')
17187
17188            character(kind=ascii, len=26) :: alphabet
17189            character(kind=ucs4,  len=30) :: hello_world
17190
17191            alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
17192            hello_world = ucs4_'Hello World and Ni Hao -- ' &
17193                          // char (int (z'4F60'), ucs4)     &
17194                          // char (int (z'597D'), ucs4)
17195
17196            write (*,*) alphabet
17197
17198            open (output_unit, encoding='UTF-8')
17199            write (*,*) trim (hello_world)
17200          end program character_kind
17201
17202
17203File: gfortran.info,  Node: SELECTED_INT_KIND,  Next: SELECTED_REAL_KIND,  Prev: SELECTED_CHAR_KIND,  Up: Intrinsic Procedures
17204
172059.238 'SELECTED_INT_KIND' -- Choose integer kind
17206================================================
17207
17208_Description_:
17209     'SELECTED_INT_KIND(R)' return the kind value of the smallest
17210     integer type that can represent all values ranging from -10^R
17211     (exclusive) to 10^R (exclusive).  If there is no integer kind that
17212     accommodates this range, 'SELECTED_INT_KIND' returns -1.
17213
17214_Standard_:
17215     Fortran 95 and later
17216
17217_Class_:
17218     Transformational function
17219
17220_Syntax_:
17221     'RESULT = SELECTED_INT_KIND(R)'
17222
17223_Arguments_:
17224     R           Shall be a scalar and of type 'INTEGER'.
17225
17226_Example_:
17227          program large_integers
17228            integer,parameter :: k5 = selected_int_kind(5)
17229            integer,parameter :: k15 = selected_int_kind(15)
17230            integer(kind=k5) :: i5
17231            integer(kind=k15) :: i15
17232
17233            print *, huge(i5), huge(i15)
17234
17235            ! The following inequalities are always true
17236            print *, huge(i5) >= 10_k5**5-1
17237            print *, huge(i15) >= 10_k15**15-1
17238          end program large_integers
17239
17240
17241File: gfortran.info,  Node: SELECTED_REAL_KIND,  Next: SET_EXPONENT,  Prev: SELECTED_INT_KIND,  Up: Intrinsic Procedures
17242
172439.239 'SELECTED_REAL_KIND' -- Choose real kind
17244==============================================
17245
17246_Description_:
17247     'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
17248     type with decimal precision of at least 'P' digits, exponent range
17249     of at least 'R', and with a radix of 'RADIX'.
17250
17251_Standard_:
17252     Fortran 95 and later, with 'RADIX' Fortran 2008 or later
17253
17254_Class_:
17255     Transformational function
17256
17257_Syntax_:
17258     'RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
17259
17260_Arguments_:
17261     P           (Optional) shall be a scalar and of type
17262                 'INTEGER'.
17263     R           (Optional) shall be a scalar and of type
17264                 'INTEGER'.
17265     RADIX       (Optional) shall be a scalar and of type
17266                 'INTEGER'.
17267     Before Fortran 2008, at least one of the arguments R or P shall be
17268     present; since Fortran 2008, they are assumed to be zero if absent.
17269
17270_Return value_:
17271
17272     'SELECTED_REAL_KIND' returns the value of the kind type parameter
17273     of a real data type with decimal precision of at least 'P' digits,
17274     a decimal exponent range of at least 'R', and with the requested
17275     'RADIX'.  If the 'RADIX' parameter is absent, real kinds with any
17276     radix can be returned.  If more than one real data type meet the
17277     criteria, the kind of the data type with the smallest decimal
17278     precision is returned.  If no real data type matches the criteria,
17279     the result is
17280     -1 if the processor does not support a real data type with a
17281          precision greater than or equal to 'P', but the 'R' and
17282          'RADIX' requirements can be fulfilled
17283     -2 if the processor does not support a real type with an exponent
17284          range greater than or equal to 'R', but 'P' and 'RADIX' are
17285          fulfillable
17286     -3 if 'RADIX' but not 'P' and 'R' requirements
17287          are fulfillable
17288     -4 if 'RADIX' and either 'P' or 'R' requirements
17289          are fulfillable
17290     -5 if there is no real type with the given 'RADIX'
17291
17292_See also_:
17293     *note PRECISION::, *note RANGE::, *note RADIX::
17294
17295_Example_:
17296          program real_kinds
17297            integer,parameter :: p6 = selected_real_kind(6)
17298            integer,parameter :: p10r100 = selected_real_kind(10,100)
17299            integer,parameter :: r400 = selected_real_kind(r=400)
17300            real(kind=p6) :: x
17301            real(kind=p10r100) :: y
17302            real(kind=r400) :: z
17303
17304            print *, precision(x), range(x)
17305            print *, precision(y), range(y)
17306            print *, precision(z), range(z)
17307          end program real_kinds
17308
17309
17310File: gfortran.info,  Node: SET_EXPONENT,  Next: SHAPE,  Prev: SELECTED_REAL_KIND,  Up: Intrinsic Procedures
17311
173129.240 'SET_EXPONENT' -- Set the exponent of the model
17313=====================================================
17314
17315_Description_:
17316     'SET_EXPONENT(X, I)' returns the real number whose fractional part
17317     is that that of X and whose exponent part is I.
17318
17319_Standard_:
17320     Fortran 95 and later
17321
17322_Class_:
17323     Elemental function
17324
17325_Syntax_:
17326     'RESULT = SET_EXPONENT(X, I)'
17327
17328_Arguments_:
17329     X           Shall be of type 'REAL'.
17330     I           Shall be of type 'INTEGER'.
17331
17332_Return value_:
17333     The return value is of the same type and kind as X.  The real
17334     number whose fractional part is that that of X and whose exponent
17335     part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'.
17336
17337_Example_:
17338          PROGRAM test_setexp
17339            REAL :: x = 178.1387e-4
17340            INTEGER :: i = 17
17341            PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
17342          END PROGRAM
17343
17344
17345File: gfortran.info,  Node: SHAPE,  Next: SHIFTA,  Prev: SET_EXPONENT,  Up: Intrinsic Procedures
17346
173479.241 'SHAPE' -- Determine the shape of an array
17348================================================
17349
17350_Description_:
17351     Determines the shape of an array.
17352
17353_Standard_:
17354     Fortran 95 and later, with KIND argument Fortran 2003 and later
17355
17356_Class_:
17357     Inquiry function
17358
17359_Syntax_:
17360     'RESULT = SHAPE(SOURCE [, KIND])'
17361
17362_Arguments_:
17363     SOURCE      Shall be an array or scalar of any type.  If
17364                 SOURCE is a pointer it must be associated and
17365                 allocatable arrays must be allocated.
17366     KIND        (Optional) An 'INTEGER' initialization
17367                 expression indicating the kind parameter of the
17368                 result.
17369
17370_Return value_:
17371     An 'INTEGER' array of rank one with as many elements as SOURCE has
17372     dimensions.  The elements of the resulting array correspond to the
17373     extend of SOURCE along the respective dimensions.  If SOURCE is a
17374     scalar, the result is the rank one array of size zero.  If KIND is
17375     absent, the return value has the default integer kind otherwise the
17376     specified kind.
17377
17378_Example_:
17379          PROGRAM test_shape
17380            INTEGER, DIMENSION(-1:1, -1:2) :: A
17381            WRITE(*,*) SHAPE(A)             ! (/ 3, 4 /)
17382            WRITE(*,*) SIZE(SHAPE(42))      ! (/ /)
17383          END PROGRAM
17384
17385_See also_:
17386     *note RESHAPE::, *note SIZE::
17387
17388
17389File: gfortran.info,  Node: SHIFTA,  Next: SHIFTL,  Prev: SHAPE,  Up: Intrinsic Procedures
17390
173919.242 'SHIFTA' -- Right shift with fill
17392=======================================
17393
17394_Description_:
17395     'SHIFTA' returns a value corresponding to I with all of the bits
17396     shifted right by SHIFT places.  If the absolute value of SHIFT is
17397     greater than 'BIT_SIZE(I)', the value is undefined.  Bits shifted
17398     out from the right end are lost.  The fill is arithmetic: the bits
17399     shifted in from the left end are equal to the leftmost bit, which
17400     in two's complement representation is the sign bit.
17401
17402_Standard_:
17403     Fortran 2008 and later
17404
17405_Class_:
17406     Elemental function
17407
17408_Syntax_:
17409     'RESULT = SHIFTA(I, SHIFT)'
17410
17411_Arguments_:
17412     I           The type shall be 'INTEGER'.
17413     SHIFT       The type shall be 'INTEGER'.
17414
17415_Return value_:
17416     The return value is of type 'INTEGER' and of the same kind as I.
17417
17418_See also_:
17419     *note SHIFTL::, *note SHIFTR::
17420
17421
17422File: gfortran.info,  Node: SHIFTL,  Next: SHIFTR,  Prev: SHIFTA,  Up: Intrinsic Procedures
17423
174249.243 'SHIFTL' -- Left shift
17425============================
17426
17427_Description_:
17428     'SHIFTL' returns a value corresponding to I with all of the bits
17429     shifted left by SHIFT places.  If the absolute value of SHIFT is
17430     greater than 'BIT_SIZE(I)', the value is undefined.  Bits shifted
17431     out from the left end are lost, and bits shifted in from the right
17432     end are set to 0.
17433
17434_Standard_:
17435     Fortran 2008 and later
17436
17437_Class_:
17438     Elemental function
17439
17440_Syntax_:
17441     'RESULT = SHIFTL(I, SHIFT)'
17442
17443_Arguments_:
17444     I           The type shall be 'INTEGER'.
17445     SHIFT       The type shall be 'INTEGER'.
17446
17447_Return value_:
17448     The return value is of type 'INTEGER' and of the same kind as I.
17449
17450_See also_:
17451     *note SHIFTA::, *note SHIFTR::
17452
17453
17454File: gfortran.info,  Node: SHIFTR,  Next: SIGN,  Prev: SHIFTL,  Up: Intrinsic Procedures
17455
174569.244 'SHIFTR' -- Right shift
17457=============================
17458
17459_Description_:
17460     'SHIFTR' returns a value corresponding to I with all of the bits
17461     shifted right by SHIFT places.  If the absolute value of SHIFT is
17462     greater than 'BIT_SIZE(I)', the value is undefined.  Bits shifted
17463     out from the right end are lost, and bits shifted in from the left
17464     end are set to 0.
17465
17466_Standard_:
17467     Fortran 2008 and later
17468
17469_Class_:
17470     Elemental function
17471
17472_Syntax_:
17473     'RESULT = SHIFTR(I, SHIFT)'
17474
17475_Arguments_:
17476     I           The type shall be 'INTEGER'.
17477     SHIFT       The type shall be 'INTEGER'.
17478
17479_Return value_:
17480     The return value is of type 'INTEGER' and of the same kind as I.
17481
17482_See also_:
17483     *note SHIFTA::, *note SHIFTL::
17484
17485
17486File: gfortran.info,  Node: SIGN,  Next: SIGNAL,  Prev: SHIFTR,  Up: Intrinsic Procedures
17487
174889.245 'SIGN' -- Sign copying function
17489=====================================
17490
17491_Description_:
17492     'SIGN(A,B)' returns the value of A with the sign of B.
17493
17494_Standard_:
17495     Fortran 77 and later
17496
17497_Class_:
17498     Elemental function
17499
17500_Syntax_:
17501     'RESULT = SIGN(A, B)'
17502
17503_Arguments_:
17504     A           Shall be of type 'INTEGER' or 'REAL'
17505     B           Shall be of the same type and kind as A
17506
17507_Return value_:
17508     The kind of the return value is that of A and B.  If B\ge 0 then
17509     the result is 'ABS(A)', else it is '-ABS(A)'.
17510
17511_Example_:
17512          program test_sign
17513            print *, sign(-12,1)
17514            print *, sign(-12,0)
17515            print *, sign(-12,-1)
17516
17517            print *, sign(-12.,1.)
17518            print *, sign(-12.,0.)
17519            print *, sign(-12.,-1.)
17520          end program test_sign
17521
17522_Specific names_:
17523     Name           Arguments      Return type    Standard
17524     'SIGN(A,B)'    'REAL(4) A,    'REAL(4)'      f77, gnu
17525                    B'
17526     'ISIGN(A,B)'   'INTEGER(4)    'INTEGER(4)'   f77, gnu
17527                    A, B'
17528     'DSIGN(A,B)'   'REAL(8) A,    'REAL(8)'      f77, gnu
17529                    B'
17530
17531
17532File: gfortran.info,  Node: SIGNAL,  Next: SIN,  Prev: SIGN,  Up: Intrinsic Procedures
17533
175349.246 'SIGNAL' -- Signal handling subroutine (or function)
17535==========================================================
17536
17537_Description_:
17538     'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
17539     HANDLER to be executed with a single integer argument when signal
17540     NUMBER occurs.  If HANDLER is an integer, it can be used to turn
17541     off handling of signal NUMBER or revert to its default action.  See
17542     'signal(2)'.
17543
17544     If 'SIGNAL' is called as a subroutine and the STATUS argument is
17545     supplied, it is set to the value returned by 'signal(2)'.
17546
17547_Standard_:
17548     GNU extension
17549
17550_Class_:
17551     Subroutine, function
17552
17553_Syntax_:
17554     'CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
17555     'STATUS = SIGNAL(NUMBER, HANDLER)'
17556
17557_Arguments_:
17558     NUMBER      Shall be a scalar integer, with 'INTENT(IN)'
17559     HANDLER     Signal handler ('INTEGER FUNCTION' or
17560                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
17561                 'INTEGER'.  It is 'INTENT(IN)'.
17562     STATUS      (Optional) STATUS shall be a scalar integer.  It
17563                 has 'INTENT(OUT)'.
17564
17565_Return value_:
17566     The 'SIGNAL' function returns the value returned by 'signal(2)'.
17567
17568_Example_:
17569          program test_signal
17570            intrinsic signal
17571            external handler_print
17572
17573            call signal (12, handler_print)
17574            call signal (10, 1)
17575
17576            call sleep (30)
17577          end program test_signal
17578
17579
17580File: gfortran.info,  Node: SIN,  Next: SIND,  Prev: SIGNAL,  Up: Intrinsic Procedures
17581
175829.247 'SIN' -- Sine function
17583============================
17584
17585_Description_:
17586     'SIN(X)' computes the sine of X.
17587
17588_Standard_:
17589     Fortran 77 and later
17590
17591_Class_:
17592     Elemental function
17593
17594_Syntax_:
17595     'RESULT = SIN(X)'
17596
17597_Arguments_:
17598     X           The type shall be 'REAL' or 'COMPLEX'.
17599
17600_Return value_:
17601     The return value has same type and kind as X.
17602
17603_Example_:
17604          program test_sin
17605            real :: x = 0.0
17606            x = sin(x)
17607          end program test_sin
17608
17609_Specific names_:
17610     Name           Argument       Return type    Standard
17611     'SIN(X)'       'REAL(4) X'    'REAL(4)'      f77, gnu
17612     'DSIN(X)'      'REAL(8) X'    'REAL(8)'      f95, gnu
17613     'CSIN(X)'      'COMPLEX(4)    'COMPLEX(4)'   f95, gnu
17614                    X'
17615     'ZSIN(X)'      'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
17616                    X'
17617     'CDSIN(X)'     'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
17618                    X'
17619
17620_See also_:
17621     Inverse function: *note ASIN:: Degrees function: *note SIND::
17622
17623
17624File: gfortran.info,  Node: SIND,  Next: SINH,  Prev: SIN,  Up: Intrinsic Procedures
17625
176269.248 'SIND' -- Sine function, degrees
17627======================================
17628
17629_Description_:
17630     'SIND(X)' computes the sine of X in degrees.
17631
17632     This function is for compatibility only and should be avoided in
17633     favor of standard constructs wherever possible.
17634
17635_Standard_:
17636     GNU Extension, enabled with '-fdec-math'.
17637
17638_Class_:
17639     Elemental function
17640
17641_Syntax_:
17642     'RESULT = SIND(X)'
17643
17644_Arguments_:
17645     X           The type shall be 'REAL' or 'COMPLEX'.
17646
17647_Return value_:
17648     The return value has same type and kind as X, and its value is in
17649     degrees.
17650
17651_Example_:
17652          program test_sind
17653            real :: x = 0.0
17654            x = sind(x)
17655          end program test_sind
17656
17657_Specific names_:
17658     Name           Argument       Return type    Standard
17659     'SIND(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
17660     'DSIND(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
17661     'CSIND(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU Extension
17662                    X'
17663     'ZSIND(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU Extension
17664                    X'
17665     'CDSIND(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU Extension
17666                    X'
17667
17668_See also_:
17669     Inverse function: *note ASIND:: Radians function: *note SIN::
17670
17671
17672File: gfortran.info,  Node: SINH,  Next: SIZE,  Prev: SIND,  Up: Intrinsic Procedures
17673
176749.249 'SINH' -- Hyperbolic sine function
17675========================================
17676
17677_Description_:
17678     'SINH(X)' computes the hyperbolic sine of X.
17679
17680_Standard_:
17681     Fortran 95 and later, for a complex argument Fortran 2008 or later
17682
17683_Class_:
17684     Elemental function
17685
17686_Syntax_:
17687     'RESULT = SINH(X)'
17688
17689_Arguments_:
17690     X           The type shall be 'REAL' or 'COMPLEX'.
17691
17692_Return value_:
17693     The return value has same type and kind as X.
17694
17695_Example_:
17696          program test_sinh
17697            real(8) :: x = - 1.0_8
17698            x = sinh(x)
17699          end program test_sinh
17700
17701_Specific names_:
17702     Name           Argument       Return type    Standard
17703     'SINH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
17704                                                  later
17705     'DSINH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
17706                                                  later
17707
17708_See also_:
17709     *note ASINH::
17710
17711
17712File: gfortran.info,  Node: SIZE,  Next: SIZEOF,  Prev: SINH,  Up: Intrinsic Procedures
17713
177149.250 'SIZE' -- Determine the size of an array
17715==============================================
17716
17717_Description_:
17718     Determine the extent of ARRAY along a specified dimension DIM, or
17719     the total number of elements in ARRAY if DIM is absent.
17720
17721_Standard_:
17722     Fortran 95 and later, with KIND argument Fortran 2003 and later
17723
17724_Class_:
17725     Inquiry function
17726
17727_Syntax_:
17728     'RESULT = SIZE(ARRAY[, DIM [, KIND]])'
17729
17730_Arguments_:
17731     ARRAY       Shall be an array of any type.  If ARRAY is a
17732                 pointer it must be associated and allocatable
17733                 arrays must be allocated.
17734     DIM         (Optional) shall be a scalar of type 'INTEGER'
17735                 and its value shall be in the range from 1 to n,
17736                 where n equals the rank of ARRAY.
17737     KIND        (Optional) An 'INTEGER' initialization
17738                 expression indicating the kind parameter of the
17739                 result.
17740
17741_Return value_:
17742     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
17743     absent, the return value is of default integer kind.
17744
17745_Example_:
17746          PROGRAM test_size
17747            WRITE(*,*) SIZE((/ 1, 2 /))    ! 2
17748          END PROGRAM
17749
17750_See also_:
17751     *note SHAPE::, *note RESHAPE::
17752
17753
17754File: gfortran.info,  Node: SIZEOF,  Next: SLEEP,  Prev: SIZE,  Up: Intrinsic Procedures
17755
177569.251 'SIZEOF' -- Size in bytes of an expression
17757================================================
17758
17759_Description_:
17760     'SIZEOF(X)' calculates the number of bytes of storage the
17761     expression 'X' occupies.
17762
17763_Standard_:
17764     GNU extension
17765
17766_Class_:
17767     Inquiry function
17768
17769_Syntax_:
17770     'N = SIZEOF(X)'
17771
17772_Arguments_:
17773     X           The argument shall be of any type, rank or
17774                 shape.
17775
17776_Return value_:
17777     The return value is of type integer and of the system-dependent
17778     kind C_SIZE_T (from the ISO_C_BINDING module).  Its value is the
17779     number of bytes occupied by the argument.  If the argument has the
17780     'POINTER' attribute, the number of bytes of the storage area
17781     pointed to is returned.  If the argument is of a derived type with
17782     'POINTER' or 'ALLOCATABLE' components, the return value does not
17783     account for the sizes of the data pointed to by these components.
17784     If the argument is polymorphic, the size according to the dynamic
17785     type is returned.  The argument may not be a procedure or procedure
17786     pointer.  Note that the code assumes for arrays that those are
17787     contiguous; for contiguous arrays, it returns the storage or an
17788     array element multiplied by the size of the array.
17789
17790_Example_:
17791             integer :: i
17792             real :: r, s(5)
17793             print *, (sizeof(s)/sizeof(r) == 5)
17794             end
17795     The example will print '.TRUE.' unless you are using a platform
17796     where default 'REAL' variables are unusually padded.
17797
17798_See also_:
17799     *note C_SIZEOF::, *note STORAGE_SIZE::
17800
17801
17802File: gfortran.info,  Node: SLEEP,  Next: SPACING,  Prev: SIZEOF,  Up: Intrinsic Procedures
17803
178049.252 'SLEEP' -- Sleep for the specified number of seconds
17805==========================================================
17806
17807_Description_:
17808     Calling this subroutine causes the process to pause for SECONDS
17809     seconds.
17810
17811_Standard_:
17812     GNU extension
17813
17814_Class_:
17815     Subroutine
17816
17817_Syntax_:
17818     'CALL SLEEP(SECONDS)'
17819
17820_Arguments_:
17821     SECONDS     The type shall be of default 'INTEGER'.
17822
17823_Example_:
17824          program test_sleep
17825            call sleep(5)
17826          end
17827
17828
17829File: gfortran.info,  Node: SPACING,  Next: SPREAD,  Prev: SLEEP,  Up: Intrinsic Procedures
17830
178319.253 'SPACING' -- Smallest distance between two numbers of a given type
17832========================================================================
17833
17834_Description_:
17835     Determines the distance between the argument X and the nearest
17836     adjacent number of the same type.
17837
17838_Standard_:
17839     Fortran 95 and later
17840
17841_Class_:
17842     Elemental function
17843
17844_Syntax_:
17845     'RESULT = SPACING(X)'
17846
17847_Arguments_:
17848     X           Shall be of type 'REAL'.
17849
17850_Return value_:
17851     The result is of the same type as the input argument X.
17852
17853_Example_:
17854          PROGRAM test_spacing
17855            INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
17856            INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
17857
17858            WRITE(*,*) spacing(1.0_SGL)      ! "1.1920929E-07"          on i686
17859            WRITE(*,*) spacing(1.0_DBL)      ! "2.220446049250313E-016" on i686
17860          END PROGRAM
17861
17862_See also_:
17863     *note RRSPACING::
17864
17865
17866File: gfortran.info,  Node: SPREAD,  Next: SQRT,  Prev: SPACING,  Up: Intrinsic Procedures
17867
178689.254 'SPREAD' -- Add a dimension to an array
17869=============================================
17870
17871_Description_:
17872     Replicates a SOURCE array NCOPIES times along a specified dimension
17873     DIM.
17874
17875_Standard_:
17876     Fortran 95 and later
17877
17878_Class_:
17879     Transformational function
17880
17881_Syntax_:
17882     'RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
17883
17884_Arguments_:
17885     SOURCE      Shall be a scalar or an array of any type and a
17886                 rank less than seven.
17887     DIM         Shall be a scalar of type 'INTEGER' with a value
17888                 in the range from 1 to n+1, where n equals the
17889                 rank of SOURCE.
17890     NCOPIES     Shall be a scalar of type 'INTEGER'.
17891
17892_Return value_:
17893     The result is an array of the same type as SOURCE and has rank n+1
17894     where n equals the rank of SOURCE.
17895
17896_Example_:
17897          PROGRAM test_spread
17898            INTEGER :: a = 1, b(2) = (/ 1, 2 /)
17899            WRITE(*,*) SPREAD(A, 1, 2)            ! "1 1"
17900            WRITE(*,*) SPREAD(B, 1, 2)            ! "1 1 2 2"
17901          END PROGRAM
17902
17903_See also_:
17904     *note UNPACK::
17905
17906
17907File: gfortran.info,  Node: SQRT,  Next: SRAND,  Prev: SPREAD,  Up: Intrinsic Procedures
17908
179099.255 'SQRT' -- Square-root function
17910====================================
17911
17912_Description_:
17913     'SQRT(X)' computes the square root of X.
17914
17915_Standard_:
17916     Fortran 77 and later
17917
17918_Class_:
17919     Elemental function
17920
17921_Syntax_:
17922     'RESULT = SQRT(X)'
17923
17924_Arguments_:
17925     X           The type shall be 'REAL' or 'COMPLEX'.
17926
17927_Return value_:
17928     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
17929     parameter is the same as X.
17930
17931_Example_:
17932          program test_sqrt
17933            real(8) :: x = 2.0_8
17934            complex :: z = (1.0, 2.0)
17935            x = sqrt(x)
17936            z = sqrt(z)
17937          end program test_sqrt
17938
17939_Specific names_:
17940     Name           Argument       Return type    Standard
17941     'SQRT(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
17942                                                  later
17943     'DSQRT(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
17944                                                  later
17945     'CSQRT(X)'     'COMPLEX(4)    'COMPLEX(4)'   Fortran 95 and
17946                    X'                            later
17947     'ZSQRT(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
17948                    X'
17949     'CDSQRT(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
17950                    X'
17951
17952
17953File: gfortran.info,  Node: SRAND,  Next: STAT,  Prev: SQRT,  Up: Intrinsic Procedures
17954
179559.256 'SRAND' -- Reinitialize the random number generator
17956=========================================================
17957
17958_Description_:
17959     'SRAND' reinitializes the pseudo-random number generator called by
17960     'RAND' and 'IRAND'.  The new seed used by the generator is
17961     specified by the required argument SEED.
17962
17963_Standard_:
17964     GNU extension
17965
17966_Class_:
17967     Subroutine
17968
17969_Syntax_:
17970     'CALL SRAND(SEED)'
17971
17972_Arguments_:
17973     SEED        Shall be a scalar 'INTEGER(kind=4)'.
17974
17975_Return value_:
17976     Does not return anything.
17977
17978_Example_:
17979     See 'RAND' and 'IRAND' for examples.
17980
17981_Notes_:
17982     The Fortran standard specifies the intrinsic subroutines
17983     'RANDOM_SEED' to initialize the pseudo-random number generator and
17984     'RANDOM_NUMBER' to generate pseudo-random numbers.  These
17985     subroutines should be used in new codes.
17986
17987     Please note that in GNU Fortran, these two sets of intrinsics
17988     ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and
17989     'RANDOM_SEED' on the other hand) access two independent
17990     pseudo-random number generators.
17991
17992_See also_:
17993     *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
17994
17995
17996File: gfortran.info,  Node: STAT,  Next: STORAGE_SIZE,  Prev: SRAND,  Up: Intrinsic Procedures
17997
179989.257 'STAT' -- Get file status
17999===============================
18000
18001_Description_:
18002     This function returns information about a file.  No permissions are
18003     required on the file itself, but execute (search) permission is
18004     required on all of the directories in path that lead to the file.
18005
18006     The elements that are obtained and stored in the array 'VALUES':
18007     'VALUES(1)' Device ID
18008     'VALUES(2)' Inode number
18009     'VALUES(3)' File mode
18010     'VALUES(4)' Number of links
18011     'VALUES(5)' Owner's uid
18012     'VALUES(6)' Owner's gid
18013     'VALUES(7)' ID of device containing directory entry for file
18014                 (0 if not available)
18015     'VALUES(8)' File size (bytes)
18016     'VALUES(9)' Last access time
18017     'VALUES(10)'Last modification time
18018     'VALUES(11)'Last file status change time
18019     'VALUES(12)'Preferred I/O block size (-1 if not available)
18020     'VALUES(13)'Number of blocks allocated (-1 if not available)
18021
18022     Not all these elements are relevant on all systems.  If an element
18023     is not relevant, it is returned as 0.
18024
18025     This intrinsic is provided in both subroutine and function forms;
18026     however, only one form can be used in any given program unit.
18027
18028_Standard_:
18029     GNU extension
18030
18031_Class_:
18032     Subroutine, function
18033
18034_Syntax_:
18035     'CALL STAT(NAME, VALUES [, STATUS])'
18036     'STATUS = STAT(NAME, VALUES)'
18037
18038_Arguments_:
18039     NAME        The type shall be 'CHARACTER', of the default
18040                 kind and a valid path within the file system.
18041     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
18042     STATUS      (Optional) status flag of type 'INTEGER(4)'.
18043                 Returns 0 on success and a system specific error
18044                 code otherwise.
18045
18046_Example_:
18047          PROGRAM test_stat
18048            INTEGER, DIMENSION(13) :: buff
18049            INTEGER :: status
18050
18051            CALL STAT("/etc/passwd", buff, status)
18052
18053            IF (status == 0) THEN
18054              WRITE (*, FMT="('Device ID:',               T30, I19)") buff(1)
18055              WRITE (*, FMT="('Inode number:',            T30, I19)") buff(2)
18056              WRITE (*, FMT="('File mode (octal):',       T30, O19)") buff(3)
18057              WRITE (*, FMT="('Number of links:',         T30, I19)") buff(4)
18058              WRITE (*, FMT="('Owner''s uid:',            T30, I19)") buff(5)
18059              WRITE (*, FMT="('Owner''s gid:',            T30, I19)") buff(6)
18060              WRITE (*, FMT="('Device where located:',    T30, I19)") buff(7)
18061              WRITE (*, FMT="('File size:',               T30, I19)") buff(8)
18062              WRITE (*, FMT="('Last access time:',        T30, A19)") CTIME(buff(9))
18063              WRITE (*, FMT="('Last modification time',   T30, A19)") CTIME(buff(10))
18064              WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
18065              WRITE (*, FMT="('Preferred block size:',    T30, I19)") buff(12)
18066              WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
18067            END IF
18068          END PROGRAM
18069
18070_See also_:
18071     To stat an open file: *note FSTAT::, to stat a link: *note LSTAT::
18072
18073
18074File: gfortran.info,  Node: STORAGE_SIZE,  Next: SUM,  Prev: STAT,  Up: Intrinsic Procedures
18075
180769.258 'STORAGE_SIZE' -- Storage size in bits
18077============================================
18078
18079_Description_:
18080     Returns the storage size of argument A in bits.
18081_Standard_:
18082     Fortran 2008 and later
18083_Class_:
18084     Inquiry function
18085_Syntax_:
18086     'RESULT = STORAGE_SIZE(A [, KIND])'
18087
18088_Arguments_:
18089     A           Shall be a scalar or array of any type.
18090     KIND        (Optional) shall be a scalar integer constant
18091                 expression.
18092
18093_Return Value_:
18094     The result is a scalar integer with the kind type parameter
18095     specified by KIND (or default integer type if KIND is missing).
18096     The result value is the size expressed in bits for an element of an
18097     array that has the dynamic type and type parameters of A.
18098
18099_See also_:
18100     *note C_SIZEOF::, *note SIZEOF::
18101
18102
18103File: gfortran.info,  Node: SUM,  Next: SYMLNK,  Prev: STORAGE_SIZE,  Up: Intrinsic Procedures
18104
181059.259 'SUM' -- Sum of array elements
18106====================================
18107
18108_Description_:
18109     Adds the elements of ARRAY along dimension DIM if the corresponding
18110     element in MASK is 'TRUE'.
18111
18112_Standard_:
18113     Fortran 95 and later
18114
18115_Class_:
18116     Transformational function
18117
18118_Syntax_:
18119     'RESULT = SUM(ARRAY[, MASK])'
18120     'RESULT = SUM(ARRAY, DIM[, MASK])'
18121
18122_Arguments_:
18123     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
18124                 'COMPLEX'.
18125     DIM         (Optional) shall be a scalar of type 'INTEGER'
18126                 with a value in the range from 1 to n, where n
18127                 equals the rank of ARRAY.
18128     MASK        (Optional) shall be of type 'LOGICAL' and either
18129                 be a scalar or an array of the same shape as
18130                 ARRAY.
18131
18132_Return value_:
18133     The result is of the same type as ARRAY.
18134
18135     If DIM is absent, a scalar with the sum of all elements in ARRAY is
18136     returned.  Otherwise, an array of rank n-1, where n equals the rank
18137     of ARRAY, and a shape similar to that of ARRAY with dimension DIM
18138     dropped is returned.
18139
18140_Example_:
18141          PROGRAM test_sum
18142            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
18143            print *, SUM(x)                        ! all elements, sum = 15
18144            print *, SUM(x, MASK=MOD(x, 2)==1)     ! odd elements, sum = 9
18145          END PROGRAM
18146
18147_See also_:
18148     *note PRODUCT::
18149
18150
18151File: gfortran.info,  Node: SYMLNK,  Next: SYSTEM,  Prev: SUM,  Up: Intrinsic Procedures
18152
181539.260 'SYMLNK' -- Create a symbolic link
18154========================================
18155
18156_Description_:
18157     Makes a symbolic link from file PATH1 to PATH2.  A null character
18158     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
18159     PATH2; otherwise, trailing blanks in the file names are ignored.
18160     If the STATUS argument is supplied, it contains 0 on success or a
18161     nonzero error code upon return; see 'symlink(2)'.  If the system
18162     does not supply 'symlink(2)', 'ENOSYS' is returned.
18163
18164     This intrinsic is provided in both subroutine and function forms;
18165     however, only one form can be used in any given program unit.
18166
18167_Standard_:
18168     GNU extension
18169
18170_Class_:
18171     Subroutine, function
18172
18173_Syntax_:
18174     'CALL SYMLNK(PATH1, PATH2 [, STATUS])'
18175     'STATUS = SYMLNK(PATH1, PATH2)'
18176
18177_Arguments_:
18178     PATH1       Shall be of default 'CHARACTER' type.
18179     PATH2       Shall be of default 'CHARACTER' type.
18180     STATUS      (Optional) Shall be of default 'INTEGER' type.
18181
18182_See also_:
18183     *note LINK::, *note UNLINK::
18184
18185
18186File: gfortran.info,  Node: SYSTEM,  Next: SYSTEM_CLOCK,  Prev: SYMLNK,  Up: Intrinsic Procedures
18187
181889.261 'SYSTEM' -- Execute a shell command
18189=========================================
18190
18191_Description_:
18192     Passes the command COMMAND to a shell (see 'system(3)').  If
18193     argument STATUS is present, it contains the value returned by
18194     'system(3)', which is presumably 0 if the shell command succeeded.
18195     Note that which shell is used to invoke the command is
18196     system-dependent and environment-dependent.
18197
18198     This intrinsic is provided in both subroutine and function forms;
18199     however, only one form can be used in any given program unit.
18200
18201     Note that the 'system' function need not be thread-safe.  It is the
18202     responsibility of the user to ensure that 'system' is not called
18203     concurrently.
18204
18205_Standard_:
18206     GNU extension
18207
18208_Class_:
18209     Subroutine, function
18210
18211_Syntax_:
18212     'CALL SYSTEM(COMMAND [, STATUS])'
18213     'STATUS = SYSTEM(COMMAND)'
18214
18215_Arguments_:
18216     COMMAND     Shall be of default 'CHARACTER' type.
18217     STATUS      (Optional) Shall be of default 'INTEGER' type.
18218
18219_See also_:
18220     *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
18221     standard and should considered in new code for future portability.
18222
18223
18224File: gfortran.info,  Node: SYSTEM_CLOCK,  Next: TAN,  Prev: SYSTEM,  Up: Intrinsic Procedures
18225
182269.262 'SYSTEM_CLOCK' -- Time function
18227=====================================
18228
18229_Description_:
18230     Determines the COUNT of a processor clock since an unspecified time
18231     in the past modulo COUNT_MAX, COUNT_RATE determines the number of
18232     clock ticks per second.  If the platform supports a monotonic
18233     clock, that clock is used and can, depending on the platform clock
18234     implementation, provide up to nanosecond resolution.  If a
18235     monotonic clock is not available, the implementation falls back to
18236     a realtime clock.
18237
18238     COUNT_RATE is system dependent and can vary depending on the kind
18239     of the arguments.  For KIND=4 arguments (and smaller integer
18240     kinds), COUNT represents milliseconds, while for KIND=8 arguments
18241     (and larger integer kinds), COUNT typically represents micro- or
18242     nanoseconds depending on resolution of the underlying platform
18243     clock.  COUNT_MAX usually equals 'HUGE(COUNT_MAX)'.  Note that the
18244     millisecond resolution of the KIND=4 version implies that the COUNT
18245     will wrap around in roughly 25 days.  In order to avoid issues with
18246     the wrap around and for more precise timing, please use the KIND=8
18247     version.
18248
18249     If there is no clock, or querying the clock fails, COUNT is set to
18250     '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
18251
18252     When running on a platform using the GNU C library (glibc) version
18253     2.16 or older, or a derivative thereof, the high resolution
18254     monotonic clock is available only when linking with the RT library.
18255     This can be done explicitly by adding the '-lrt' flag when linking
18256     the application, but is also done implicitly when using OpenMP.
18257
18258     On the Windows platform, the version with KIND=4 arguments uses the
18259     'GetTickCount' function, whereas the KIND=8 version uses
18260     'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'.
18261     For more information, and potential caveats, please see the
18262     platform documentation.
18263
18264_Standard_:
18265     Fortran 95 and later
18266
18267_Class_:
18268     Subroutine
18269
18270_Syntax_:
18271     'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
18272
18273_Arguments_:
18274     COUNT       (Optional) shall be a scalar of type 'INTEGER'
18275                 with 'INTENT(OUT)'.
18276     COUNT_RATE  (Optional) shall be a scalar of type 'INTEGER'
18277                 or 'REAL', with 'INTENT(OUT)'.
18278     COUNT_MAX   (Optional) shall be a scalar of type 'INTEGER'
18279                 with 'INTENT(OUT)'.
18280
18281_Example_:
18282          PROGRAM test_system_clock
18283            INTEGER :: count, count_rate, count_max
18284            CALL SYSTEM_CLOCK(count, count_rate, count_max)
18285            WRITE(*,*) count, count_rate, count_max
18286          END PROGRAM
18287
18288_See also_:
18289     *note DATE_AND_TIME::, *note CPU_TIME::
18290
18291
18292File: gfortran.info,  Node: TAN,  Next: TAND,  Prev: SYSTEM_CLOCK,  Up: Intrinsic Procedures
18293
182949.263 'TAN' -- Tangent function
18295===============================
18296
18297_Description_:
18298     'TAN(X)' computes the tangent of X.
18299
18300_Standard_:
18301     Fortran 77 and later, for a complex argument Fortran 2008 or later
18302
18303_Class_:
18304     Elemental function
18305
18306_Syntax_:
18307     'RESULT = TAN(X)'
18308
18309_Arguments_:
18310     X           The type shall be 'REAL' or 'COMPLEX'.
18311
18312_Return value_:
18313     The return value has same type and kind as X, and its value is in
18314     radians.
18315
18316_Example_:
18317          program test_tan
18318            real(8) :: x = 0.165_8
18319            x = tan(x)
18320          end program test_tan
18321
18322_Specific names_:
18323     Name           Argument       Return type    Standard
18324     'TAN(X)'       'REAL(4) X'    'REAL(4)'      Fortran 95 and
18325                                                  later
18326     'DTAN(X)'      'REAL(8) X'    'REAL(8)'      Fortran 95 and
18327                                                  later
18328
18329_See also_:
18330     Inverse function: *note ATAN:: Degrees function: *note TAND::
18331
18332
18333File: gfortran.info,  Node: TAND,  Next: TANH,  Prev: TAN,  Up: Intrinsic Procedures
18334
183359.264 'TAND' -- Tangent function, degrees
18336=========================================
18337
18338_Description_:
18339     'TAND(X)' computes the tangent of X in degrees.
18340
18341     This function is for compatibility only and should be avoided in
18342     favor of standard constructs wherever possible.
18343
18344_Standard_:
18345     GNU Extension, enabled with '-fdec-math'.
18346
18347_Class_:
18348     Elemental function
18349
18350_Syntax_:
18351     'RESULT = TAND(X)'
18352
18353_Arguments_:
18354     X           The type shall be 'REAL' or 'COMPLEX'.
18355
18356_Return value_:
18357     The return value has same type and kind as X, and its value is in
18358     degrees.
18359
18360_Example_:
18361          program test_tand
18362            real(8) :: x = 0.165_8
18363            x = tand(x)
18364          end program test_tand
18365
18366_Specific names_:
18367     Name           Argument       Return type    Standard
18368     'TAND(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
18369     'DTAND(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
18370
18371_See also_:
18372     Inverse function: *note ATAND:: Radians function: *note TAN::
18373
18374
18375File: gfortran.info,  Node: TANH,  Next: THIS_IMAGE,  Prev: TAND,  Up: Intrinsic Procedures
18376
183779.265 'TANH' -- Hyperbolic tangent function
18378===========================================
18379
18380_Description_:
18381     'TANH(X)' computes the hyperbolic tangent of X.
18382
18383_Standard_:
18384     Fortran 77 and later, for a complex argument Fortran 2008 or later
18385
18386_Class_:
18387     Elemental function
18388
18389_Syntax_:
18390     'X = TANH(X)'
18391
18392_Arguments_:
18393     X           The type shall be 'REAL' or 'COMPLEX'.
18394
18395_Return value_:
18396     The return value has same type and kind as X.  If X is complex, the
18397     imaginary part of the result is in radians.  If X is 'REAL', the
18398     return value lies in the range - 1 \leq tanh(x) \leq 1 .
18399
18400_Example_:
18401          program test_tanh
18402            real(8) :: x = 2.1_8
18403            x = tanh(x)
18404          end program test_tanh
18405
18406_Specific names_:
18407     Name           Argument       Return type    Standard
18408     'TANH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
18409                                                  later
18410     'DTANH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
18411                                                  later
18412
18413_See also_:
18414     *note ATANH::
18415
18416
18417File: gfortran.info,  Node: THIS_IMAGE,  Next: TIME,  Prev: TANH,  Up: Intrinsic Procedures
18418
184199.266 'THIS_IMAGE' -- Function that returns the cosubscript index of this image
18420===============================================================================
18421
18422_Description_:
18423     Returns the cosubscript for this image.
18424
18425_Standard_:
18426     Fortran 2008 and later.  With DISTANCE argument, Technical
18427     Specification (TS) 18508 or later
18428
18429_Class_:
18430     Transformational function
18431
18432_Syntax_:
18433     'RESULT = THIS_IMAGE()'
18434     'RESULT = THIS_IMAGE(DISTANCE)'
18435     'RESULT = THIS_IMAGE(COARRAY [, DIM])'
18436
18437_Arguments_:
18438     DISTANCE    (optional, intent(in)) Nonnegative scalar
18439                 integer (not permitted together with COARRAY).
18440     COARRAY     Coarray of any type (optional; if DIM present,
18441                 required).
18442     DIM         default integer scalar (optional).  If present,
18443                 DIM shall be between one and the corank of
18444                 COARRAY.
18445
18446_Return value_:
18447     Default integer.  If COARRAY is not present, it is scalar; if
18448     DISTANCE is not present or has value 0, its value is the image
18449     index on the invoking image for the current team, for values
18450     smaller or equal distance to the initial team, it returns the image
18451     index on the ancestor team which has a distance of DISTANCE from
18452     the invoking team.  If DISTANCE is larger than the distance to the
18453     initial team, the image index of the initial team is returned.
18454     Otherwise when the COARRAY is present, if DIM is not present, a
18455     rank-1 array with corank elements is returned, containing the
18456     cosubscripts for COARRAY specifying the invoking image.  If DIM is
18457     present, a scalar is returned, with the value of the DIM element of
18458     'THIS_IMAGE(COARRAY)'.
18459
18460_Example_:
18461          INTEGER :: value[*]
18462          INTEGER :: i
18463          value = THIS_IMAGE()
18464          SYNC ALL
18465          IF (THIS_IMAGE() == 1) THEN
18466            DO i = 1, NUM_IMAGES()
18467              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
18468            END DO
18469          END IF
18470
18471          ! Check whether the current image is the initial image
18472          IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
18473            error stop "something is rotten here"
18474
18475_See also_:
18476     *note NUM_IMAGES::, *note IMAGE_INDEX::
18477
18478
18479File: gfortran.info,  Node: TIME,  Next: TIME8,  Prev: THIS_IMAGE,  Up: Intrinsic Procedures
18480
184819.267 'TIME' -- Time function
18482=============================
18483
18484_Description_:
18485     Returns the current time encoded as an integer (in the manner of
18486     the function 'time(3)' in the C standard library).  This value is
18487     suitable for passing to *note CTIME::, *note GMTIME::, and *note
18488     LTIME::.
18489
18490     This intrinsic is not fully portable, such as to systems with
18491     32-bit 'INTEGER' types but supporting times wider than 32 bits.
18492     Therefore, the values returned by this intrinsic might be, or
18493     become, negative, or numerically less than previous values, during
18494     a single run of the compiled program.
18495
18496     See *note TIME8::, for information on a similar intrinsic that
18497     might be portable to more GNU Fortran implementations, though to
18498     fewer Fortran compilers.
18499
18500_Standard_:
18501     GNU extension
18502
18503_Class_:
18504     Function
18505
18506_Syntax_:
18507     'RESULT = TIME()'
18508
18509_Return value_:
18510     The return value is a scalar of type 'INTEGER(4)'.
18511
18512_See also_:
18513     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
18514     LTIME::, *note MCLOCK::, *note TIME8::
18515
18516
18517File: gfortran.info,  Node: TIME8,  Next: TINY,  Prev: TIME,  Up: Intrinsic Procedures
18518
185199.268 'TIME8' -- Time function (64-bit)
18520=======================================
18521
18522_Description_:
18523     Returns the current time encoded as an integer (in the manner of
18524     the function 'time(3)' in the C standard library).  This value is
18525     suitable for passing to *note CTIME::, *note GMTIME::, and *note
18526     LTIME::.
18527
18528     _Warning:_ this intrinsic does not increase the range of the timing
18529     values over that returned by 'time(3)'.  On a system with a 32-bit
18530     'time(3)', 'TIME8' will return a 32-bit value, even though it is
18531     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
18532     the 32-bit value can still occur.  Therefore, the values returned
18533     by this intrinsic might be or become negative or numerically less
18534     than previous values during a single run of the compiled program.
18535
18536_Standard_:
18537     GNU extension
18538
18539_Class_:
18540     Function
18541
18542_Syntax_:
18543     'RESULT = TIME8()'
18544
18545_Return value_:
18546     The return value is a scalar of type 'INTEGER(8)'.
18547
18548_See also_:
18549     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
18550     LTIME::, *note MCLOCK8::, *note TIME::
18551
18552
18553File: gfortran.info,  Node: TINY,  Next: TRAILZ,  Prev: TIME8,  Up: Intrinsic Procedures
18554
185559.269 'TINY' -- Smallest positive number of a real kind
18556=======================================================
18557
18558_Description_:
18559     'TINY(X)' returns the smallest positive (non zero) number in the
18560     model of the type of 'X'.
18561
18562_Standard_:
18563     Fortran 95 and later
18564
18565_Class_:
18566     Inquiry function
18567
18568_Syntax_:
18569     'RESULT = TINY(X)'
18570
18571_Arguments_:
18572     X           Shall be of type 'REAL'.
18573
18574_Return value_:
18575     The return value is of the same type and kind as X
18576
18577_Example_:
18578     See 'HUGE' for an example.
18579
18580
18581File: gfortran.info,  Node: TRAILZ,  Next: TRANSFER,  Prev: TINY,  Up: Intrinsic Procedures
18582
185839.270 'TRAILZ' -- Number of trailing zero bits of an integer
18584============================================================
18585
18586_Description_:
18587     'TRAILZ' returns the number of trailing zero bits of an integer.
18588
18589_Standard_:
18590     Fortran 2008 and later
18591
18592_Class_:
18593     Elemental function
18594
18595_Syntax_:
18596     'RESULT = TRAILZ(I)'
18597
18598_Arguments_:
18599     I           Shall be of type 'INTEGER'.
18600
18601_Return value_:
18602     The type of the return value is the default 'INTEGER'.  If all the
18603     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
18604
18605_Example_:
18606          PROGRAM test_trailz
18607            WRITE (*,*) TRAILZ(8)  ! prints 3
18608          END PROGRAM
18609
18610_See also_:
18611     *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
18612
18613
18614File: gfortran.info,  Node: TRANSFER,  Next: TRANSPOSE,  Prev: TRAILZ,  Up: Intrinsic Procedures
18615
186169.271 'TRANSFER' -- Transfer bit patterns
18617=========================================
18618
18619_Description_:
18620     Interprets the bitwise representation of SOURCE in memory as if it
18621     is the representation of a variable or array of the same type and
18622     type parameters as MOLD.
18623
18624     This is approximately equivalent to the C concept of _casting_ one
18625     type to another.
18626
18627_Standard_:
18628     Fortran 95 and later
18629
18630_Class_:
18631     Transformational function
18632
18633_Syntax_:
18634     'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
18635
18636_Arguments_:
18637     SOURCE      Shall be a scalar or an array of any type.
18638     MOLD        Shall be a scalar or an array of any type.
18639     SIZE        (Optional) shall be a scalar of type 'INTEGER'.
18640
18641_Return value_:
18642     The result has the same type as MOLD, with the bit level
18643     representation of SOURCE.  If SIZE is present, the result is a
18644     one-dimensional array of length SIZE.  If SIZE is absent but MOLD
18645     is an array (of any size or shape), the result is a one-
18646     dimensional array of the minimum length needed to contain the
18647     entirety of the bitwise representation of SOURCE.  If SIZE is
18648     absent and MOLD is a scalar, the result is a scalar.
18649
18650     If the bitwise representation of the result is longer than that of
18651     SOURCE, then the leading bits of the result correspond to those of
18652     SOURCE and any trailing bits are filled arbitrarily.
18653
18654     When the resulting bit representation does not correspond to a
18655     valid representation of a variable of the same type as MOLD, the
18656     results are undefined, and subsequent operations on the result
18657     cannot be guaranteed to produce sensible behavior.  For example, it
18658     is possible to create 'LOGICAL' variables for which 'VAR' and
18659     '.NOT.VAR' both appear to be true.
18660
18661_Example_:
18662          PROGRAM test_transfer
18663            integer :: x = 2143289344
18664            print *, transfer(x, 1.0)    ! prints "NaN" on i686
18665          END PROGRAM
18666
18667
18668File: gfortran.info,  Node: TRANSPOSE,  Next: TRIM,  Prev: TRANSFER,  Up: Intrinsic Procedures
18669
186709.272 'TRANSPOSE' -- Transpose an array of rank two
18671===================================================
18672
18673_Description_:
18674     Transpose an array of rank two.  Element (i, j) of the result has
18675     the value 'MATRIX(j, i)', for all i, j.
18676
18677_Standard_:
18678     Fortran 95 and later
18679
18680_Class_:
18681     Transformational function
18682
18683_Syntax_:
18684     'RESULT = TRANSPOSE(MATRIX)'
18685
18686_Arguments_:
18687     MATRIX      Shall be an array of any type and have a rank of
18688                 two.
18689
18690_Return value_:
18691     The result has the same type as MATRIX, and has shape '(/ m, n /)'
18692     if MATRIX has shape '(/ n, m /)'.
18693
18694
18695File: gfortran.info,  Node: TRIM,  Next: TTYNAM,  Prev: TRANSPOSE,  Up: Intrinsic Procedures
18696
186979.273 'TRIM' -- Remove trailing blank characters of a string
18698============================================================
18699
18700_Description_:
18701     Removes trailing blank characters of a string.
18702
18703_Standard_:
18704     Fortran 95 and later
18705
18706_Class_:
18707     Transformational function
18708
18709_Syntax_:
18710     'RESULT = TRIM(STRING)'
18711
18712_Arguments_:
18713     STRING      Shall be a scalar of type 'CHARACTER'.
18714
18715_Return value_:
18716     A scalar of type 'CHARACTER' which length is that of STRING less
18717     the number of trailing blanks.
18718
18719_Example_:
18720          PROGRAM test_trim
18721            CHARACTER(len=10), PARAMETER :: s = "GFORTRAN  "
18722            WRITE(*,*) LEN(s), LEN(TRIM(s))  ! "10 8", with/without trailing blanks
18723          END PROGRAM
18724
18725_See also_:
18726     *note ADJUSTL::, *note ADJUSTR::
18727
18728
18729File: gfortran.info,  Node: TTYNAM,  Next: UBOUND,  Prev: TRIM,  Up: Intrinsic Procedures
18730
187319.274 'TTYNAM' -- Get the name of a terminal device.
18732====================================================
18733
18734_Description_:
18735     Get the name of a terminal device.  For more information, see
18736     'ttyname(3)'.
18737
18738     This intrinsic is provided in both subroutine and function forms;
18739     however, only one form can be used in any given program unit.
18740
18741_Standard_:
18742     GNU extension
18743
18744_Class_:
18745     Subroutine, function
18746
18747_Syntax_:
18748     'CALL TTYNAM(UNIT, NAME)'
18749     'NAME = TTYNAM(UNIT)'
18750
18751_Arguments_:
18752     UNIT        Shall be a scalar 'INTEGER'.
18753     NAME        Shall be of type 'CHARACTER'.
18754
18755_Example_:
18756          PROGRAM test_ttynam
18757            INTEGER :: unit
18758            DO unit = 1, 10
18759              IF (isatty(unit=unit)) write(*,*) ttynam(unit)
18760            END DO
18761          END PROGRAM
18762
18763_See also_:
18764     *note ISATTY::
18765
18766
18767File: gfortran.info,  Node: UBOUND,  Next: UCOBOUND,  Prev: TTYNAM,  Up: Intrinsic Procedures
18768
187699.275 'UBOUND' -- Upper dimension bounds of an array
18770====================================================
18771
18772_Description_:
18773     Returns the upper bounds of an array, or a single upper bound along
18774     the DIM dimension.
18775_Standard_:
18776     Fortran 95 and later, with KIND argument Fortran 2003 and later
18777
18778_Class_:
18779     Inquiry function
18780
18781_Syntax_:
18782     'RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
18783
18784_Arguments_:
18785     ARRAY       Shall be an array, of any type.
18786     DIM         (Optional) Shall be a scalar 'INTEGER'.
18787     KIND        (Optional) An 'INTEGER' initialization
18788                 expression indicating the kind parameter of the
18789                 result.
18790
18791_Return value_:
18792     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
18793     absent, the return value is of default integer kind.  If DIM is
18794     absent, the result is an array of the upper bounds of ARRAY.  If
18795     DIM is present, the result is a scalar corresponding to the upper
18796     bound of the array along that dimension.  If ARRAY is an expression
18797     rather than a whole array or array structure component, or if it
18798     has a zero extent along the relevant dimension, the upper bound is
18799     taken to be the number of elements along the relevant dimension.
18800
18801_See also_:
18802     *note LBOUND::, *note LCOBOUND::
18803
18804
18805File: gfortran.info,  Node: UCOBOUND,  Next: UMASK,  Prev: UBOUND,  Up: Intrinsic Procedures
18806
188079.276 'UCOBOUND' -- Upper codimension bounds of an array
18808========================================================
18809
18810_Description_:
18811     Returns the upper cobounds of a coarray, or a single upper cobound
18812     along the DIM codimension.
18813_Standard_:
18814     Fortran 2008 and later
18815
18816_Class_:
18817     Inquiry function
18818
18819_Syntax_:
18820     'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
18821
18822_Arguments_:
18823     ARRAY       Shall be an coarray, of any type.
18824     DIM         (Optional) Shall be a scalar 'INTEGER'.
18825     KIND        (Optional) An 'INTEGER' initialization
18826                 expression indicating the kind parameter of the
18827                 result.
18828
18829_Return value_:
18830     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
18831     absent, the return value is of default integer kind.  If DIM is
18832     absent, the result is an array of the lower cobounds of COARRAY.
18833     If DIM is present, the result is a scalar corresponding to the
18834     lower cobound of the array along that codimension.
18835
18836_See also_:
18837     *note LCOBOUND::, *note LBOUND::
18838
18839
18840File: gfortran.info,  Node: UMASK,  Next: UNLINK,  Prev: UCOBOUND,  Up: Intrinsic Procedures
18841
188429.277 'UMASK' -- Set the file creation mask
18843===========================================
18844
18845_Description_:
18846     Sets the file creation mask to MASK.  If called as a function, it
18847     returns the old value.  If called as a subroutine and argument OLD
18848     if it is supplied, it is set to the old value.  See 'umask(2)'.
18849
18850_Standard_:
18851     GNU extension
18852
18853_Class_:
18854     Subroutine, function
18855
18856_Syntax_:
18857     'CALL UMASK(MASK [, OLD])'
18858     'OLD = UMASK(MASK)'
18859
18860_Arguments_:
18861     MASK        Shall be a scalar of type 'INTEGER'.
18862     OLD         (Optional) Shall be a scalar of type 'INTEGER'.
18863
18864
18865File: gfortran.info,  Node: UNLINK,  Next: UNPACK,  Prev: UMASK,  Up: Intrinsic Procedures
18866
188679.278 'UNLINK' -- Remove a file from the file system
18868====================================================
18869
18870_Description_:
18871     Unlinks the file PATH.  A null character ('CHAR(0)') can be used to
18872     mark the end of the name in PATH; otherwise, trailing blanks in the
18873     file name are ignored.  If the STATUS argument is supplied, it
18874     contains 0 on success or a nonzero error code upon return; see
18875     'unlink(2)'.
18876
18877     This intrinsic is provided in both subroutine and function forms;
18878     however, only one form can be used in any given program unit.
18879
18880_Standard_:
18881     GNU extension
18882
18883_Class_:
18884     Subroutine, function
18885
18886_Syntax_:
18887     'CALL UNLINK(PATH [, STATUS])'
18888     'STATUS = UNLINK(PATH)'
18889
18890_Arguments_:
18891     PATH        Shall be of default 'CHARACTER' type.
18892     STATUS      (Optional) Shall be of default 'INTEGER' type.
18893
18894_See also_:
18895     *note LINK::, *note SYMLNK::
18896
18897
18898File: gfortran.info,  Node: UNPACK,  Next: VERIFY,  Prev: UNLINK,  Up: Intrinsic Procedures
18899
189009.279 'UNPACK' -- Unpack an array of rank one into an array
18901===========================================================
18902
18903_Description_:
18904     Store the elements of VECTOR in an array of higher rank.
18905
18906_Standard_:
18907     Fortran 95 and later
18908
18909_Class_:
18910     Transformational function
18911
18912_Syntax_:
18913     'RESULT = UNPACK(VECTOR, MASK, FIELD)'
18914
18915_Arguments_:
18916     VECTOR      Shall be an array of any type and rank one.  It
18917                 shall have at least as many elements as MASK has
18918                 'TRUE' values.
18919     MASK        Shall be an array of type 'LOGICAL'.
18920     FIELD       Shall be of the same type as VECTOR and have the
18921                 same shape as MASK.
18922
18923_Return value_:
18924     The resulting array corresponds to FIELD with 'TRUE' elements of
18925     MASK replaced by values from VECTOR in array element order.
18926
18927_Example_:
18928          PROGRAM test_unpack
18929            integer :: vector(2)  = (/1,1/)
18930            logical :: mask(4)  = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
18931            integer :: field(2,2) = 0, unity(2,2)
18932
18933            ! result: unity matrix
18934            unity = unpack(vector, reshape(mask, (/2,2/)), field)
18935          END PROGRAM
18936
18937_See also_:
18938     *note PACK::, *note SPREAD::
18939
18940
18941File: gfortran.info,  Node: VERIFY,  Next: XOR,  Prev: UNPACK,  Up: Intrinsic Procedures
18942
189439.280 'VERIFY' -- Scan a string for characters not a given set
18944==============================================================
18945
18946_Description_:
18947     Verifies that all the characters in STRING belong to the set of
18948     characters in SET.
18949
18950     If BACK is either absent or equals 'FALSE', this function returns
18951     the position of the leftmost character of STRING that is not in
18952     SET.  If BACK equals 'TRUE', the rightmost position is returned.
18953     If all characters of STRING are found in SET, the result is zero.
18954
18955_Standard_:
18956     Fortran 95 and later, with KIND argument Fortran 2003 and later
18957
18958_Class_:
18959     Elemental function
18960
18961_Syntax_:
18962     'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
18963
18964_Arguments_:
18965     STRING      Shall be of type 'CHARACTER'.
18966     SET         Shall be of type 'CHARACTER'.
18967     BACK        (Optional) shall be of type 'LOGICAL'.
18968     KIND        (Optional) An 'INTEGER' initialization
18969                 expression indicating the kind parameter of the
18970                 result.
18971
18972_Return value_:
18973     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
18974     absent, the return value is of default integer kind.
18975
18976_Example_:
18977          PROGRAM test_verify
18978            WRITE(*,*) VERIFY("FORTRAN", "AO")           ! 1, found 'F'
18979            WRITE(*,*) VERIFY("FORTRAN", "FOO")          ! 3, found 'R'
18980            WRITE(*,*) VERIFY("FORTRAN", "C++")          ! 1, found 'F'
18981            WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.)  ! 7, found 'N'
18982            WRITE(*,*) VERIFY("FORTRAN", "FORTRAN")      ! 0' found none
18983          END PROGRAM
18984
18985_See also_:
18986     *note SCAN::, *note INDEX intrinsic::
18987
18988
18989File: gfortran.info,  Node: XOR,  Prev: VERIFY,  Up: Intrinsic Procedures
18990
189919.281 'XOR' -- Bitwise logical exclusive OR
18992===========================================
18993
18994_Description_:
18995     Bitwise logical exclusive or.
18996
18997     This intrinsic routine is provided for backwards compatibility with
18998     GNU Fortran 77.  For integer arguments, programmers should consider
18999     the use of the *note IEOR:: intrinsic and for logical arguments the
19000     '.NEQV.' operator, which are both defined by the Fortran standard.
19001
19002_Standard_:
19003     GNU extension
19004
19005_Class_:
19006     Function
19007
19008_Syntax_:
19009     'RESULT = XOR(I, J)'
19010
19011_Arguments_:
19012     I           The type shall be either a scalar 'INTEGER' type
19013                 or a scalar 'LOGICAL' type.
19014     J           The type shall be the same as the type of I.
19015
19016_Return value_:
19017     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
19018     If the kind type parameters differ, then the smaller kind type is
19019     implicitly converted to larger kind, and the return has the larger
19020     kind.
19021
19022_Example_:
19023          PROGRAM test_xor
19024            LOGICAL :: T = .TRUE., F = .FALSE.
19025            INTEGER :: a, b
19026            DATA a / Z'F' /, b / Z'3' /
19027
19028            WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
19029            WRITE (*,*) XOR(a, b)
19030          END PROGRAM
19031
19032_See also_:
19033     Fortran 95 elemental function: *note IEOR::
19034
19035
19036File: gfortran.info,  Node: Intrinsic Modules,  Next: Contributing,  Prev: Intrinsic Procedures,  Up: Top
19037
1903810 Intrinsic Modules
19039********************
19040
19041* Menu:
19042
19043* ISO_FORTRAN_ENV::
19044* ISO_C_BINDING::
19045* IEEE modules::
19046* OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
19047* OpenACC Module OPENACC::
19048
19049
19050File: gfortran.info,  Node: ISO_FORTRAN_ENV,  Next: ISO_C_BINDING,  Up: Intrinsic Modules
19051
1905210.1 'ISO_FORTRAN_ENV'
19053======================
19054
19055_Standard_:
19056     Fortran 2003 and later, except when otherwise noted
19057
19058   The 'ISO_FORTRAN_ENV' module provides the following scalar
19059default-integer named constants:
19060
19061'ATOMIC_INT_KIND':
19062     Default-kind integer constant to be used as kind parameter when
19063     defining integer variables used in atomic operations.  (Fortran
19064     2008 or later.)
19065
19066'ATOMIC_LOGICAL_KIND':
19067     Default-kind integer constant to be used as kind parameter when
19068     defining logical variables used in atomic operations.  (Fortran
19069     2008 or later.)
19070
19071'CHARACTER_KINDS':
19072     Default-kind integer constant array of rank one containing the
19073     supported kind parameters of the 'CHARACTER' type.  (Fortran 2008
19074     or later.)
19075
19076'CHARACTER_STORAGE_SIZE':
19077     Size in bits of the character storage unit.
19078
19079'ERROR_UNIT':
19080     Identifies the preconnected unit used for error reporting.
19081
19082'FILE_STORAGE_SIZE':
19083     Size in bits of the file-storage unit.
19084
19085'INPUT_UNIT':
19086     Identifies the preconnected unit identified by the asterisk ('*')
19087     in 'READ' statement.
19088
19089'INT8', 'INT16', 'INT32', 'INT64':
19090     Kind type parameters to specify an INTEGER type with a storage size
19091     of 16, 32, and 64 bits.  It is negative if a target platform does
19092     not support the particular kind.  (Fortran 2008 or later.)
19093
19094'INTEGER_KINDS':
19095     Default-kind integer constant array of rank one containing the
19096     supported kind parameters of the 'INTEGER' type.  (Fortran 2008 or
19097     later.)
19098
19099'IOSTAT_END':
19100     The value assigned to the variable passed to the 'IOSTAT='
19101     specifier of an input/output statement if an end-of-file condition
19102     occurred.
19103
19104'IOSTAT_EOR':
19105     The value assigned to the variable passed to the 'IOSTAT='
19106     specifier of an input/output statement if an end-of-record
19107     condition occurred.
19108
19109'IOSTAT_INQUIRE_INTERNAL_UNIT':
19110     Scalar default-integer constant, used by 'INQUIRE' for the
19111     'IOSTAT=' specifier to denote an that a unit number identifies an
19112     internal unit.  (Fortran 2008 or later.)
19113
19114'NUMERIC_STORAGE_SIZE':
19115     The size in bits of the numeric storage unit.
19116
19117'LOGICAL_KINDS':
19118     Default-kind integer constant array of rank one containing the
19119     supported kind parameters of the 'LOGICAL' type.  (Fortran 2008 or
19120     later.)
19121
19122'OUTPUT_UNIT':
19123     Identifies the preconnected unit identified by the asterisk ('*')
19124     in 'WRITE' statement.
19125
19126'REAL32', 'REAL64', 'REAL128':
19127     Kind type parameters to specify a REAL type with a storage size of
19128     32, 64, and 128 bits.  It is negative if a target platform does not
19129     support the particular kind.  (Fortran 2008 or later.)
19130
19131'REAL_KINDS':
19132     Default-kind integer constant array of rank one containing the
19133     supported kind parameters of the 'REAL' type.  (Fortran 2008 or
19134     later.)
19135
19136'STAT_LOCKED':
19137     Scalar default-integer constant used as STAT= return value by
19138     'LOCK' to denote that the lock variable is locked by the executing
19139     image.  (Fortran 2008 or later.)
19140
19141'STAT_LOCKED_OTHER_IMAGE':
19142     Scalar default-integer constant used as STAT= return value by
19143     'UNLOCK' to denote that the lock variable is locked by another
19144     image.  (Fortran 2008 or later.)
19145
19146'STAT_STOPPED_IMAGE':
19147     Positive, scalar default-integer constant used as STAT= return
19148     value if the argument in the statement requires synchronisation
19149     with an image, which has initiated the termination of the
19150     execution.  (Fortran 2008 or later.)
19151
19152'STAT_FAILED_IMAGE':
19153     Positive, scalar default-integer constant used as STAT= return
19154     value if the argument in the statement requires communication with
19155     an image, which has is in the failed state.  (TS 18508 or later.)
19156
19157'STAT_UNLOCKED':
19158     Scalar default-integer constant used as STAT= return value by
19159     'UNLOCK' to denote that the lock variable is unlocked.  (Fortran
19160     2008 or later.)
19161
19162   The module provides the following derived type:
19163
19164'LOCK_TYPE':
19165     Derived type with private components to be use with the 'LOCK' and
19166     'UNLOCK' statement.  A variable of its type has to be always
19167     declared as coarray and may not appear in a variable-definition
19168     context.  (Fortran 2008 or later.)
19169
19170   The module also provides the following intrinsic procedures: *note
19171COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
19172
19173
19174File: gfortran.info,  Node: ISO_C_BINDING,  Next: IEEE modules,  Prev: ISO_FORTRAN_ENV,  Up: Intrinsic Modules
19175
1917610.2 'ISO_C_BINDING'
19177====================
19178
19179_Standard_:
19180     Fortran 2003 and later, GNU extensions
19181
19182   The following intrinsic procedures are provided by the module; their
19183definition can be found in the section Intrinsic Procedures of this
19184manual.
19185
19186'C_ASSOCIATED'
19187'C_F_POINTER'
19188'C_F_PROCPOINTER'
19189'C_FUNLOC'
19190'C_LOC'
19191'C_SIZEOF'
19192
19193   The 'ISO_C_BINDING' module provides the following named constants of
19194type default integer, which can be used as KIND type parameters.
19195
19196   In addition to the integer named constants required by the Fortran
191972003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
19198extension named constants for the 128-bit integer types supported by the
19199C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
19200Furthermore, if '__float128' is supported in C, the named constants
19201'C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
19202
19203Fortran     Named constant            C type                    Extension
19204Type
19205'INTEGER'   'C_INT'                   'int'
19206'INTEGER'   'C_SHORT'                 'short int'
19207'INTEGER'   'C_LONG'                  'long int'
19208'INTEGER'   'C_LONG_LONG'             'long long int'
19209'INTEGER'   'C_SIGNED_CHAR'           'signed char'/'unsigned
19210                                      char'
19211'INTEGER'   'C_SIZE_T'                'size_t'
19212'INTEGER'   'C_INT8_T'                'int8_t'
19213'INTEGER'   'C_INT16_T'               'int16_t'
19214'INTEGER'   'C_INT32_T'               'int32_t'
19215'INTEGER'   'C_INT64_T'               'int64_t'
19216'INTEGER'   'C_INT128_T'              'int128_t'                Ext.
19217'INTEGER'   'C_INT_LEAST8_T'          'int_least8_t'
19218'INTEGER'   'C_INT_LEAST16_T'         'int_least16_t'
19219'INTEGER'   'C_INT_LEAST32_T'         'int_least32_t'
19220'INTEGER'   'C_INT_LEAST64_T'         'int_least64_t'
19221'INTEGER'   'C_INT_LEAST128_T'        'int_least128_t'          Ext.
19222'INTEGER'   'C_INT_FAST8_T'           'int_fast8_t'
19223'INTEGER'   'C_INT_FAST16_T'          'int_fast16_t'
19224'INTEGER'   'C_INT_FAST32_T'          'int_fast32_t'
19225'INTEGER'   'C_INT_FAST64_T'          'int_fast64_t'
19226'INTEGER'   'C_INT_FAST128_T'         'int_fast128_t'           Ext.
19227'INTEGER'   'C_INTMAX_T'              'intmax_t'
19228'INTEGER'   'C_INTPTR_T'              'intptr_t'
19229'INTEGER'   'C_PTRDIFF_T'             'ptrdiff_t'               TS 29113
19230'REAL'      'C_FLOAT'                 'float'
19231'REAL'      'C_DOUBLE'                'double'
19232'REAL'      'C_LONG_DOUBLE'           'long double'
19233'REAL'      'C_FLOAT128'              '__float128'              Ext.
19234'COMPLEX'   'C_FLOAT_COMPLEX'         'float _Complex'
19235'COMPLEX'   'C_DOUBLE_COMPLEX'        'double _Complex'
19236'COMPLEX'   'C_LONG_DOUBLE_COMPLEX'   'long double _Complex'
19237'REAL'      'C_FLOAT128_COMPLEX'      '__float128 _Complex'     Ext.
19238'LOGICAL'   'C_BOOL'                  '_Bool'
19239'CHARACTER' 'C_CHAR'                  'char'
19240
19241   Additionally, the following parameters of type
19242'CHARACTER(KIND=C_CHAR)' are defined.
19243
19244Name           C definition                     Value
19245'C_NULL_CHAR'  null character                   ''\0''
19246'C_ALERT'      alert                            ''\a''
19247'C_BACKSPACE'  backspace                        ''\b''
19248'C_FORM_FEED'  form feed                        ''\f''
19249'C_NEW_LINE'   new line                         ''\n''
19250'C_CARRIAGE_RETURN'carriage return              ''\r''
19251'C_HORIZONTAL_TAB'horizontal tab                ''\t''
19252'C_VERTICAL_TAB'vertical tab                    ''\v''
19253
19254   Moreover, the following two named constants are defined:
19255
19256Name           Type
19257'C_NULL_PTR'   'C_PTR'
19258'C_NULL_FUNPTR''C_FUNPTR'
19259
19260   Both are equivalent to the value 'NULL' in C.
19261
19262
19263File: gfortran.info,  Node: IEEE modules,  Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Prev: ISO_C_BINDING,  Up: Intrinsic Modules
19264
1926510.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19266============================================================================
19267
19268_Standard_:
19269     Fortran 2003 and later
19270
19271   The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19272intrinsic modules provide support for exceptions and IEEE arithmetic, as
19273defined in Fortran 2003 and later standards, and the IEC 60559:1989
19274standard (_Binary floating-point arithmetic for microprocessor
19275systems_).  These modules are only provided on the following supported
19276platforms:
19277
19278   * i386 and x86_64 processors
19279   * platforms which use the GNU C Library (glibc)
19280   * platforms with support for SysV/386 routines for floating point
19281     interface (including Solaris and BSDs)
19282   * platforms with the AIX OS
19283
19284   For full compliance with the Fortran standards, code using the
19285'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with
19286the following options: '-fno-unsafe-math-optimizations -frounding-math
19287-fsignaling-nans'.
19288
19289
19290File: gfortran.info,  Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Next: OpenACC Module OPENACC,  Prev: IEEE modules,  Up: Intrinsic Modules
19291
1929210.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS'
19293=================================================
19294
19295_Standard_:
19296     OpenMP Application Program Interface v4.5
19297
19298   The OpenMP Fortran runtime library routines are provided both in a
19299form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and
19300in a form of a Fortran 'include' file named 'omp_lib.h'.  The procedures
19301provided by 'OMP_LIB' can be found in the *note Introduction:
19302(libgomp)Top. manual, the named constants defined in the modules are
19303listed below.
19304
19305   For details refer to the actual OpenMP Application Program Interface
19306v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf).
19307
19308   'OMP_LIB_KINDS' provides the following scalar default-integer named
19309constants:
19310
19311'omp_lock_kind'
19312'omp_lock_hint_kind'
19313'omp_nest_lock_kind'
19314'omp_proc_bind_kind'
19315'omp_sched_kind'
19316
19317   'OMP_LIB' provides the scalar default-integer named constant
19318'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the
19319year and MM the month of the OpenMP version; for OpenMP v4.5 the value
19320is '201511'.
19321
19322   The following scalar integer named constants of the kind
19323'omp_sched_kind':
19324
19325'omp_sched_static'
19326'omp_sched_dynamic'
19327'omp_sched_guided'
19328'omp_sched_auto'
19329
19330   And the following scalar integer named constants of the kind
19331'omp_proc_bind_kind':
19332
19333'omp_proc_bind_false'
19334'omp_proc_bind_true'
19335'omp_proc_bind_master'
19336'omp_proc_bind_close'
19337'omp_proc_bind_spread'
19338
19339   The following scalar integer named constants are of the kind
19340'omp_lock_hint_kind':
19341
19342'omp_lock_hint_none'
19343'omp_lock_hint_uncontended'
19344'omp_lock_hint_contended'
19345'omp_lock_hint_nonspeculative'
19346'omp_lock_hint_speculative'
19347
19348
19349File: gfortran.info,  Node: OpenACC Module OPENACC,  Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Up: Intrinsic Modules
19350
1935110.5 OpenACC Module 'OPENACC'
19352=============================
19353
19354_Standard_:
19355     OpenACC Application Programming Interface v2.0
19356
19357   The OpenACC Fortran runtime library routines are provided both in a
19358form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran
19359'include' file named 'openacc_lib.h'.  The procedures provided by
19360'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
19361the named constants defined in the modules are listed below.
19362
19363   For details refer to the actual OpenACC Application Programming
19364Interface v2.0 (http://www.openacc.org/).
19365
19366   'OPENACC' provides the scalar default-integer named constant
19367'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the
19368year and MM the month of the OpenACC version; for OpenACC v2.0 the value
19369is '201306'.
19370
19371
19372File: gfortran.info,  Node: Contributing,  Next: Copying,  Prev: Intrinsic Modules,  Up: Top
19373
19374Contributing
19375************
19376
19377Free software is only possible if people contribute to efforts to create
19378it.  We're always in need of more people helping out with ideas and
19379comments, writing documentation and contributing code.
19380
19381   If you want to contribute to GNU Fortran, have a look at the long
19382lists of projects you can take on.  Some of these projects are small,
19383some of them are large; some are completely orthogonal to the rest of
19384what is happening on GNU Fortran, but others are "mainstream" projects
19385in need of enthusiastic hackers.  All of these projects are important!
19386We will eventually get around to the things here, but they are also
19387things doable by someone who is willing and able.
19388
19389* Menu:
19390
19391* Contributors::
19392* Projects::
19393* Proposed Extensions::
19394
19395
19396File: gfortran.info,  Node: Contributors,  Next: Projects,  Up: Contributing
19397
19398Contributors to GNU Fortran
19399===========================
19400
19401Most of the parser was hand-crafted by _Andy Vaught_, who is also the
19402initiator of the whole project.  Thanks Andy!  Most of the interface
19403with GCC was written by _Paul Brook_.
19404
19405   The following individuals have contributed code and/or ideas and
19406significant help to the GNU Fortran project (in alphabetical order):
19407
19408   - Janne Blomqvist
19409   - Steven Bosscher
19410   - Paul Brook
19411   - Tobias Burnus
19412   - Franc,ois-Xavier Coudert
19413   - Bud Davis
19414   - Jerry DeLisle
19415   - Erik Edelmann
19416   - Bernhard Fischer
19417   - Daniel Franke
19418   - Richard Guenther
19419   - Richard Henderson
19420   - Katherine Holcomb
19421   - Jakub Jelinek
19422   - Niels Kristian Bech Jensen
19423   - Steven Johnson
19424   - Steven G. Kargl
19425   - Thomas Koenig
19426   - Asher Langton
19427   - H. J. Lu
19428   - Toon Moene
19429   - Brooks Moses
19430   - Andrew Pinski
19431   - Tim Prince
19432   - Christopher D. Rickett
19433   - Richard Sandiford
19434   - Tobias Schlu"ter
19435   - Roger Sayle
19436   - Paul Thomas
19437   - Andy Vaught
19438   - Feng Wang
19439   - Janus Weil
19440   - Daniel Kraft
19441
19442   The following people have contributed bug reports, smaller or larger
19443patches, and much needed feedback and encouragement for the GNU Fortran
19444project:
19445
19446   - Bill Clodius
19447   - Dominique d'Humie`res
19448   - Kate Hedstrom
19449   - Erik Schnetter
19450   - Joost VandeVondele
19451
19452   Many other individuals have helped debug, test and improve the GNU
19453Fortran compiler over the past few years, and we welcome you to do the
19454same!  If you already have done so, and you would like to see your name
19455listed in the list above, please contact us.
19456
19457
19458File: gfortran.info,  Node: Projects,  Next: Proposed Extensions,  Prev: Contributors,  Up: Contributing
19459
19460Projects
19461========
19462
19463_Help build the test suite_
19464     Solicit more code for donation to the test suite: the more
19465     extensive the testsuite, the smaller the risk of breaking things in
19466     the future!  We can keep code private on request.
19467
19468_Bug hunting/squishing_
19469     Find bugs and write more test cases!  Test cases are especially
19470     very welcome, because it allows us to concentrate on fixing bugs
19471     instead of isolating them.  Going through the bugzilla database at
19472     <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there
19473     and add more information (for example, for which version does the
19474     testcase work, for which versions does it fail?)  is also very
19475     helpful.
19476
19477
19478File: gfortran.info,  Node: Proposed Extensions,  Prev: Projects,  Up: Contributing
19479
19480Proposed Extensions
19481===================
19482
19483Here's a list of proposed extensions for the GNU Fortran compiler, in no
19484particular order.  Most of these are necessary to be fully compatible
19485with existing Fortran compilers, but they are not part of the official
19486J3 Fortran 95 standard.
19487
19488Compiler extensions:
19489--------------------
19490
19491   * User-specified alignment rules for structures.
19492
19493   * Automatically extend single precision constants to double.
19494
19495   * Compile code that conserves memory by dynamically allocating common
19496     and module storage either on stack or heap.
19497
19498   * Compile flag to generate code for array conformance checking
19499     (suggest -CC).
19500
19501   * User control of symbol names (underscores, etc).
19502
19503   * Compile setting for maximum size of stack frame size before
19504     spilling parts to static or heap.
19505
19506   * Flag to force local variables into static space.
19507
19508   * Flag to force local variables onto stack.
19509
19510Environment Options
19511-------------------
19512
19513   * Pluggable library modules for random numbers, linear algebra.  LA
19514     should use BLAS calling conventions.
19515
19516   * Environment variables controlling actions on arithmetic exceptions
19517     like overflow, underflow, precision loss--Generate NaN, abort,
19518     default.  action.
19519
19520   * Set precision for fp units that support it (i387).
19521
19522   * Variable for setting fp rounding mode.
19523
19524   * Variable to fill uninitialized variables with a user-defined bit
19525     pattern.
19526
19527   * Environment variable controlling filename that is opened for that
19528     unit number.
19529
19530   * Environment variable to clear/trash memory being freed.
19531
19532   * Environment variable to control tracing of allocations and frees.
19533
19534   * Environment variable to display allocated memory at normal program
19535     end.
19536
19537   * Environment variable for filename for * IO-unit.
19538
19539   * Environment variable for temporary file directory.
19540
19541   * Environment variable forcing standard output to be line buffered
19542     (Unix).
19543
19544
19545File: gfortran.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Contributing,  Up: Top
19546
19547GNU General Public License
19548**************************
19549
19550                        Version 3, 29 June 2007
19551
19552     Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
19553
19554     Everyone is permitted to copy and distribute verbatim copies of this
19555     license document, but changing it is not allowed.
19556
19557Preamble
19558========
19559
19560The GNU General Public License is a free, copyleft license for software
19561and other kinds of works.
19562
19563   The licenses for most software and other practical works are designed
19564to take away your freedom to share and change the works.  By contrast,
19565the GNU General Public License is intended to guarantee your freedom to
19566share and change all versions of a program-to make sure it remains free
19567software for all its users.  We, the Free Software Foundation, use the
19568GNU General Public License for most of our software; it applies also to
19569any other work released this way by its authors.  You can apply it to
19570your programs, too.
19571
19572   When we speak of free software, we are referring to freedom, not
19573price.  Our General Public Licenses are designed to make sure that you
19574have the freedom to distribute copies of free software (and charge for
19575them if you wish), that you receive source code or can get it if you
19576want it, that you can change the software or use pieces of it in new
19577free programs, and that you know you can do these things.
19578
19579   To protect your rights, we need to prevent others from denying you
19580these rights or asking you to surrender the rights.  Therefore, you have
19581certain responsibilities if you distribute copies of the software, or if
19582you modify it: responsibilities to respect the freedom of others.
19583
19584   For example, if you distribute copies of such a program, whether
19585gratis or for a fee, you must pass on to the recipients the same
19586freedoms that you received.  You must make sure that they, too, receive
19587or can get the source code.  And you must show them these terms so they
19588know their rights.
19589
19590   Developers that use the GNU GPL protect your rights with two steps:
19591(1) assert copyright on the software, and (2) offer you this License
19592giving you legal permission to copy, distribute and/or modify it.
19593
19594   For the developers' and authors' protection, the GPL clearly explains
19595that there is no warranty for this free software.  For both users' and
19596authors' sake, the GPL requires that modified versions be marked as
19597changed, so that their problems will not be attributed erroneously to
19598authors of previous versions.
19599
19600   Some devices are designed to deny users access to install or run
19601modified versions of the software inside them, although the manufacturer
19602can do so.  This is fundamentally incompatible with the aim of
19603protecting users' freedom to change the software.  The systematic
19604pattern of such abuse occurs in the area of products for individuals to
19605use, which is precisely where it is most unacceptable.  Therefore, we
19606have designed this version of the GPL to prohibit the practice for those
19607products.  If such problems arise substantially in other domains, we
19608stand ready to extend this provision to those domains in future versions
19609of the GPL, as needed to protect the freedom of users.
19610
19611   Finally, every program is threatened constantly by software patents.
19612States should not allow patents to restrict development and use of
19613software on general-purpose computers, but in those that do, we wish to
19614avoid the special danger that patents applied to a free program could
19615make it effectively proprietary.  To prevent this, the GPL assures that
19616patents cannot be used to render the program non-free.
19617
19618   The precise terms and conditions for copying, distribution and
19619modification follow.
19620
19621TERMS AND CONDITIONS
19622====================
19623
19624  0. Definitions.
19625
19626     "This License" refers to version 3 of the GNU General Public
19627     License.
19628
19629     "Copyright" also means copyright-like laws that apply to other
19630     kinds of works, such as semiconductor masks.
19631
19632     "The Program" refers to any copyrightable work licensed under this
19633     License.  Each licensee is addressed as "you".  "Licensees" and
19634     "recipients" may be individuals or organizations.
19635
19636     To "modify" a work means to copy from or adapt all or part of the
19637     work in a fashion requiring copyright permission, other than the
19638     making of an exact copy.  The resulting work is called a "modified
19639     version" of the earlier work or a work "based on" the earlier work.
19640
19641     A "covered work" means either the unmodified Program or a work
19642     based on the Program.
19643
19644     To "propagate" a work means to do anything with it that, without
19645     permission, would make you directly or secondarily liable for
19646     infringement under applicable copyright law, except executing it on
19647     a computer or modifying a private copy.  Propagation includes
19648     copying, distribution (with or without modification), making
19649     available to the public, and in some countries other activities as
19650     well.
19651
19652     To "convey" a work means any kind of propagation that enables other
19653     parties to make or receive copies.  Mere interaction with a user
19654     through a computer network, with no transfer of a copy, is not
19655     conveying.
19656
19657     An interactive user interface displays "Appropriate Legal Notices"
19658     to the extent that it includes a convenient and prominently visible
19659     feature that (1) displays an appropriate copyright notice, and (2)
19660     tells the user that there is no warranty for the work (except to
19661     the extent that warranties are provided), that licensees may convey
19662     the work under this License, and how to view a copy of this
19663     License.  If the interface presents a list of user commands or
19664     options, such as a menu, a prominent item in the list meets this
19665     criterion.
19666
19667  1. Source Code.
19668
19669     The "source code" for a work means the preferred form of the work
19670     for making modifications to it.  "Object code" means any non-source
19671     form of a work.
19672
19673     A "Standard Interface" means an interface that either is an
19674     official standard defined by a recognized standards body, or, in
19675     the case of interfaces specified for a particular programming
19676     language, one that is widely used among developers working in that
19677     language.
19678
19679     The "System Libraries" of an executable work include anything,
19680     other than the work as a whole, that (a) is included in the normal
19681     form of packaging a Major Component, but which is not part of that
19682     Major Component, and (b) serves only to enable use of the work with
19683     that Major Component, or to implement a Standard Interface for
19684     which an implementation is available to the public in source code
19685     form.  A "Major Component", in this context, means a major
19686     essential component (kernel, window system, and so on) of the
19687     specific operating system (if any) on which the executable work
19688     runs, or a compiler used to produce the work, or an object code
19689     interpreter used to run it.
19690
19691     The "Corresponding Source" for a work in object code form means all
19692     the source code needed to generate, install, and (for an executable
19693     work) run the object code and to modify the work, including scripts
19694     to control those activities.  However, it does not include the
19695     work's System Libraries, or general-purpose tools or generally
19696     available free programs which are used unmodified in performing
19697     those activities but which are not part of the work.  For example,
19698     Corresponding Source includes interface definition files associated
19699     with source files for the work, and the source code for shared
19700     libraries and dynamically linked subprograms that the work is
19701     specifically designed to require, such as by intimate data
19702     communication or control flow between those subprograms and other
19703     parts of the work.
19704
19705     The Corresponding Source need not include anything that users can
19706     regenerate automatically from other parts of the Corresponding
19707     Source.
19708
19709     The Corresponding Source for a work in source code form is that
19710     same work.
19711
19712  2. Basic Permissions.
19713
19714     All rights granted under this License are granted for the term of
19715     copyright on the Program, and are irrevocable provided the stated
19716     conditions are met.  This License explicitly affirms your unlimited
19717     permission to run the unmodified Program.  The output from running
19718     a covered work is covered by this License only if the output, given
19719     its content, constitutes a covered work.  This License acknowledges
19720     your rights of fair use or other equivalent, as provided by
19721     copyright law.
19722
19723     You may make, run and propagate covered works that you do not
19724     convey, without conditions so long as your license otherwise
19725     remains in force.  You may convey covered works to others for the
19726     sole purpose of having them make modifications exclusively for you,
19727     or provide you with facilities for running those works, provided
19728     that you comply with the terms of this License in conveying all
19729     material for which you do not control copyright.  Those thus making
19730     or running the covered works for you must do so exclusively on your
19731     behalf, under your direction and control, on terms that prohibit
19732     them from making any copies of your copyrighted material outside
19733     their relationship with you.
19734
19735     Conveying under any other circumstances is permitted solely under
19736     the conditions stated below.  Sublicensing is not allowed; section
19737     10 makes it unnecessary.
19738
19739  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
19740
19741     No covered work shall be deemed part of an effective technological
19742     measure under any applicable law fulfilling obligations under
19743     article 11 of the WIPO copyright treaty adopted on 20 December
19744     1996, or similar laws prohibiting or restricting circumvention of
19745     such measures.
19746
19747     When you convey a covered work, you waive any legal power to forbid
19748     circumvention of technological measures to the extent such
19749     circumvention is effected by exercising rights under this License
19750     with respect to the covered work, and you disclaim any intention to
19751     limit operation or modification of the work as a means of
19752     enforcing, against the work's users, your or third parties' legal
19753     rights to forbid circumvention of technological measures.
19754
19755  4. Conveying Verbatim Copies.
19756
19757     You may convey verbatim copies of the Program's source code as you
19758     receive it, in any medium, provided that you conspicuously and
19759     appropriately publish on each copy an appropriate copyright notice;
19760     keep intact all notices stating that this License and any
19761     non-permissive terms added in accord with section 7 apply to the
19762     code; keep intact all notices of the absence of any warranty; and
19763     give all recipients a copy of this License along with the Program.
19764
19765     You may charge any price or no price for each copy that you convey,
19766     and you may offer support or warranty protection for a fee.
19767
19768  5. Conveying Modified Source Versions.
19769
19770     You may convey a work based on the Program, or the modifications to
19771     produce it from the Program, in the form of source code under the
19772     terms of section 4, provided that you also meet all of these
19773     conditions:
19774
19775       a. The work must carry prominent notices stating that you
19776          modified it, and giving a relevant date.
19777
19778       b. The work must carry prominent notices stating that it is
19779          released under this License and any conditions added under
19780          section 7.  This requirement modifies the requirement in
19781          section 4 to "keep intact all notices".
19782
19783       c. You must license the entire work, as a whole, under this
19784          License to anyone who comes into possession of a copy.  This
19785          License will therefore apply, along with any applicable
19786          section 7 additional terms, to the whole of the work, and all
19787          its parts, regardless of how they are packaged.  This License
19788          gives no permission to license the work in any other way, but
19789          it does not invalidate such permission if you have separately
19790          received it.
19791
19792       d. If the work has interactive user interfaces, each must display
19793          Appropriate Legal Notices; however, if the Program has
19794          interactive interfaces that do not display Appropriate Legal
19795          Notices, your work need not make them do so.
19796
19797     A compilation of a covered work with other separate and independent
19798     works, which are not by their nature extensions of the covered
19799     work, and which are not combined with it such as to form a larger
19800     program, in or on a volume of a storage or distribution medium, is
19801     called an "aggregate" if the compilation and its resulting
19802     copyright are not used to limit the access or legal rights of the
19803     compilation's users beyond what the individual works permit.
19804     Inclusion of a covered work in an aggregate does not cause this
19805     License to apply to the other parts of the aggregate.
19806
19807  6. Conveying Non-Source Forms.
19808
19809     You may convey a covered work in object code form under the terms
19810     of sections 4 and 5, provided that you also convey the
19811     machine-readable Corresponding Source under the terms of this
19812     License, in one of these ways:
19813
19814       a. Convey the object code in, or embodied in, a physical product
19815          (including a physical distribution medium), accompanied by the
19816          Corresponding Source fixed on a durable physical medium
19817          customarily used for software interchange.
19818
19819       b. Convey the object code in, or embodied in, a physical product
19820          (including a physical distribution medium), accompanied by a
19821          written offer, valid for at least three years and valid for as
19822          long as you offer spare parts or customer support for that
19823          product model, to give anyone who possesses the object code
19824          either (1) a copy of the Corresponding Source for all the
19825          software in the product that is covered by this License, on a
19826          durable physical medium customarily used for software
19827          interchange, for a price no more than your reasonable cost of
19828          physically performing this conveying of source, or (2) access
19829          to copy the Corresponding Source from a network server at no
19830          charge.
19831
19832       c. Convey individual copies of the object code with a copy of the
19833          written offer to provide the Corresponding Source.  This
19834          alternative is allowed only occasionally and noncommercially,
19835          and only if you received the object code with such an offer,
19836          in accord with subsection 6b.
19837
19838       d. Convey the object code by offering access from a designated
19839          place (gratis or for a charge), and offer equivalent access to
19840          the Corresponding Source in the same way through the same
19841          place at no further charge.  You need not require recipients
19842          to copy the Corresponding Source along with the object code.
19843          If the place to copy the object code is a network server, the
19844          Corresponding Source may be on a different server (operated by
19845          you or a third party) that supports equivalent copying
19846          facilities, provided you maintain clear directions next to the
19847          object code saying where to find the Corresponding Source.
19848          Regardless of what server hosts the Corresponding Source, you
19849          remain obligated to ensure that it is available for as long as
19850          needed to satisfy these requirements.
19851
19852       e. Convey the object code using peer-to-peer transmission,
19853          provided you inform other peers where the object code and
19854          Corresponding Source of the work are being offered to the
19855          general public at no charge under subsection 6d.
19856
19857     A separable portion of the object code, whose source code is
19858     excluded from the Corresponding Source as a System Library, need
19859     not be included in conveying the object code work.
19860
19861     A "User Product" is either (1) a "consumer product", which means
19862     any tangible personal property which is normally used for personal,
19863     family, or household purposes, or (2) anything designed or sold for
19864     incorporation into a dwelling.  In determining whether a product is
19865     a consumer product, doubtful cases shall be resolved in favor of
19866     coverage.  For a particular product received by a particular user,
19867     "normally used" refers to a typical or common use of that class of
19868     product, regardless of the status of the particular user or of the
19869     way in which the particular user actually uses, or expects or is
19870     expected to use, the product.  A product is a consumer product
19871     regardless of whether the product has substantial commercial,
19872     industrial or non-consumer uses, unless such uses represent the
19873     only significant mode of use of the product.
19874
19875     "Installation Information" for a User Product means any methods,
19876     procedures, authorization keys, or other information required to
19877     install and execute modified versions of a covered work in that
19878     User Product from a modified version of its Corresponding Source.
19879     The information must suffice to ensure that the continued
19880     functioning of the modified object code is in no case prevented or
19881     interfered with solely because modification has been made.
19882
19883     If you convey an object code work under this section in, or with,
19884     or specifically for use in, a User Product, and the conveying
19885     occurs as part of a transaction in which the right of possession
19886     and use of the User Product is transferred to the recipient in
19887     perpetuity or for a fixed term (regardless of how the transaction
19888     is characterized), the Corresponding Source conveyed under this
19889     section must be accompanied by the Installation Information.  But
19890     this requirement does not apply if neither you nor any third party
19891     retains the ability to install modified object code on the User
19892     Product (for example, the work has been installed in ROM).
19893
19894     The requirement to provide Installation Information does not
19895     include a requirement to continue to provide support service,
19896     warranty, or updates for a work that has been modified or installed
19897     by the recipient, or for the User Product in which it has been
19898     modified or installed.  Access to a network may be denied when the
19899     modification itself materially and adversely affects the operation
19900     of the network or violates the rules and protocols for
19901     communication across the network.
19902
19903     Corresponding Source conveyed, and Installation Information
19904     provided, in accord with this section must be in a format that is
19905     publicly documented (and with an implementation available to the
19906     public in source code form), and must require no special password
19907     or key for unpacking, reading or copying.
19908
19909  7. Additional Terms.
19910
19911     "Additional permissions" are terms that supplement the terms of
19912     this License by making exceptions from one or more of its
19913     conditions.  Additional permissions that are applicable to the
19914     entire Program shall be treated as though they were included in
19915     this License, to the extent that they are valid under applicable
19916     law.  If additional permissions apply only to part of the Program,
19917     that part may be used separately under those permissions, but the
19918     entire Program remains governed by this License without regard to
19919     the additional permissions.
19920
19921     When you convey a copy of a covered work, you may at your option
19922     remove any additional permissions from that copy, or from any part
19923     of it.  (Additional permissions may be written to require their own
19924     removal in certain cases when you modify the work.)  You may place
19925     additional permissions on material, added by you to a covered work,
19926     for which you have or can give appropriate copyright permission.
19927
19928     Notwithstanding any other provision of this License, for material
19929     you add to a covered work, you may (if authorized by the copyright
19930     holders of that material) supplement the terms of this License with
19931     terms:
19932
19933       a. Disclaiming warranty or limiting liability differently from
19934          the terms of sections 15 and 16 of this License; or
19935
19936       b. Requiring preservation of specified reasonable legal notices
19937          or author attributions in that material or in the Appropriate
19938          Legal Notices displayed by works containing it; or
19939
19940       c. Prohibiting misrepresentation of the origin of that material,
19941          or requiring that modified versions of such material be marked
19942          in reasonable ways as different from the original version; or
19943
19944       d. Limiting the use for publicity purposes of names of licensors
19945          or authors of the material; or
19946
19947       e. Declining to grant rights under trademark law for use of some
19948          trade names, trademarks, or service marks; or
19949
19950       f. Requiring indemnification of licensors and authors of that
19951          material by anyone who conveys the material (or modified
19952          versions of it) with contractual assumptions of liability to
19953          the recipient, for any liability that these contractual
19954          assumptions directly impose on those licensors and authors.
19955
19956     All other non-permissive additional terms are considered "further
19957     restrictions" within the meaning of section 10.  If the Program as
19958     you received it, or any part of it, contains a notice stating that
19959     it is governed by this License along with a term that is a further
19960     restriction, you may remove that term.  If a license document
19961     contains a further restriction but permits relicensing or conveying
19962     under this License, you may add to a covered work material governed
19963     by the terms of that license document, provided that the further
19964     restriction does not survive such relicensing or conveying.
19965
19966     If you add terms to a covered work in accord with this section, you
19967     must place, in the relevant source files, a statement of the
19968     additional terms that apply to those files, or a notice indicating
19969     where to find the applicable terms.
19970
19971     Additional terms, permissive or non-permissive, may be stated in
19972     the form of a separately written license, or stated as exceptions;
19973     the above requirements apply either way.
19974
19975  8. Termination.
19976
19977     You may not propagate or modify a covered work except as expressly
19978     provided under this License.  Any attempt otherwise to propagate or
19979     modify it is void, and will automatically terminate your rights
19980     under this License (including any patent licenses granted under the
19981     third paragraph of section 11).
19982
19983     However, if you cease all violation of this License, then your
19984     license from a particular copyright holder is reinstated (a)
19985     provisionally, unless and until the copyright holder explicitly and
19986     finally terminates your license, and (b) permanently, if the
19987     copyright holder fails to notify you of the violation by some
19988     reasonable means prior to 60 days after the cessation.
19989
19990     Moreover, your license from a particular copyright holder is
19991     reinstated permanently if the copyright holder notifies you of the
19992     violation by some reasonable means, this is the first time you have
19993     received notice of violation of this License (for any work) from
19994     that copyright holder, and you cure the violation prior to 30 days
19995     after your receipt of the notice.
19996
19997     Termination of your rights under this section does not terminate
19998     the licenses of parties who have received copies or rights from you
19999     under this License.  If your rights have been terminated and not
20000     permanently reinstated, you do not qualify to receive new licenses
20001     for the same material under section 10.
20002
20003  9. Acceptance Not Required for Having Copies.
20004
20005     You are not required to accept this License in order to receive or
20006     run a copy of the Program.  Ancillary propagation of a covered work
20007     occurring solely as a consequence of using peer-to-peer
20008     transmission to receive a copy likewise does not require
20009     acceptance.  However, nothing other than this License grants you
20010     permission to propagate or modify any covered work.  These actions
20011     infringe copyright if you do not accept this License.  Therefore,
20012     by modifying or propagating a covered work, you indicate your
20013     acceptance of this License to do so.
20014
20015  10. Automatic Licensing of Downstream Recipients.
20016
20017     Each time you convey a covered work, the recipient automatically
20018     receives a license from the original licensors, to run, modify and
20019     propagate that work, subject to this License.  You are not
20020     responsible for enforcing compliance by third parties with this
20021     License.
20022
20023     An "entity transaction" is a transaction transferring control of an
20024     organization, or substantially all assets of one, or subdividing an
20025     organization, or merging organizations.  If propagation of a
20026     covered work results from an entity transaction, each party to that
20027     transaction who receives a copy of the work also receives whatever
20028     licenses to the work the party's predecessor in interest had or
20029     could give under the previous paragraph, plus a right to possession
20030     of the Corresponding Source of the work from the predecessor in
20031     interest, if the predecessor has it or can get it with reasonable
20032     efforts.
20033
20034     You may not impose any further restrictions on the exercise of the
20035     rights granted or affirmed under this License.  For example, you
20036     may not impose a license fee, royalty, or other charge for exercise
20037     of rights granted under this License, and you may not initiate
20038     litigation (including a cross-claim or counterclaim in a lawsuit)
20039     alleging that any patent claim is infringed by making, using,
20040     selling, offering for sale, or importing the Program or any portion
20041     of it.
20042
20043  11. Patents.
20044
20045     A "contributor" is a copyright holder who authorizes use under this
20046     License of the Program or a work on which the Program is based.
20047     The work thus licensed is called the contributor's "contributor
20048     version".
20049
20050     A contributor's "essential patent claims" are all patent claims
20051     owned or controlled by the contributor, whether already acquired or
20052     hereafter acquired, that would be infringed by some manner,
20053     permitted by this License, of making, using, or selling its
20054     contributor version, but do not include claims that would be
20055     infringed only as a consequence of further modification of the
20056     contributor version.  For purposes of this definition, "control"
20057     includes the right to grant patent sublicenses in a manner
20058     consistent with the requirements of this License.
20059
20060     Each contributor grants you a non-exclusive, worldwide,
20061     royalty-free patent license under the contributor's essential
20062     patent claims, to make, use, sell, offer for sale, import and
20063     otherwise run, modify and propagate the contents of its contributor
20064     version.
20065
20066     In the following three paragraphs, a "patent license" is any
20067     express agreement or commitment, however denominated, not to
20068     enforce a patent (such as an express permission to practice a
20069     patent or covenant not to sue for patent infringement).  To "grant"
20070     such a patent license to a party means to make such an agreement or
20071     commitment not to enforce a patent against the party.
20072
20073     If you convey a covered work, knowingly relying on a patent
20074     license, and the Corresponding Source of the work is not available
20075     for anyone to copy, free of charge and under the terms of this
20076     License, through a publicly available network server or other
20077     readily accessible means, then you must either (1) cause the
20078     Corresponding Source to be so available, or (2) arrange to deprive
20079     yourself of the benefit of the patent license for this particular
20080     work, or (3) arrange, in a manner consistent with the requirements
20081     of this License, to extend the patent license to downstream
20082     recipients.  "Knowingly relying" means you have actual knowledge
20083     that, but for the patent license, your conveying the covered work
20084     in a country, or your recipient's use of the covered work in a
20085     country, would infringe one or more identifiable patents in that
20086     country that you have reason to believe are valid.
20087
20088     If, pursuant to or in connection with a single transaction or
20089     arrangement, you convey, or propagate by procuring conveyance of, a
20090     covered work, and grant a patent license to some of the parties
20091     receiving the covered work authorizing them to use, propagate,
20092     modify or convey a specific copy of the covered work, then the
20093     patent license you grant is automatically extended to all
20094     recipients of the covered work and works based on it.
20095
20096     A patent license is "discriminatory" if it does not include within
20097     the scope of its coverage, prohibits the exercise of, or is
20098     conditioned on the non-exercise of one or more of the rights that
20099     are specifically granted under this License.  You may not convey a
20100     covered work if you are a party to an arrangement with a third
20101     party that is in the business of distributing software, under which
20102     you make payment to the third party based on the extent of your
20103     activity of conveying the work, and under which the third party
20104     grants, to any of the parties who would receive the covered work
20105     from you, a discriminatory patent license (a) in connection with
20106     copies of the covered work conveyed by you (or copies made from
20107     those copies), or (b) primarily for and in connection with specific
20108     products or compilations that contain the covered work, unless you
20109     entered into that arrangement, or that patent license was granted,
20110     prior to 28 March 2007.
20111
20112     Nothing in this License shall be construed as excluding or limiting
20113     any implied license or other defenses to infringement that may
20114     otherwise be available to you under applicable patent law.
20115
20116  12. No Surrender of Others' Freedom.
20117
20118     If conditions are imposed on you (whether by court order, agreement
20119     or otherwise) that contradict the conditions of this License, they
20120     do not excuse you from the conditions of this License.  If you
20121     cannot convey a covered work so as to satisfy simultaneously your
20122     obligations under this License and any other pertinent obligations,
20123     then as a consequence you may not convey it at all.  For example,
20124     if you agree to terms that obligate you to collect a royalty for
20125     further conveying from those to whom you convey the Program, the
20126     only way you could satisfy both those terms and this License would
20127     be to refrain entirely from conveying the Program.
20128
20129  13. Use with the GNU Affero General Public License.
20130
20131     Notwithstanding any other provision of this License, you have
20132     permission to link or combine any covered work with a work licensed
20133     under version 3 of the GNU Affero General Public License into a
20134     single combined work, and to convey the resulting work.  The terms
20135     of this License will continue to apply to the part which is the
20136     covered work, but the special requirements of the GNU Affero
20137     General Public License, section 13, concerning interaction through
20138     a network will apply to the combination as such.
20139
20140  14. Revised Versions of this License.
20141
20142     The Free Software Foundation may publish revised and/or new
20143     versions of the GNU General Public License from time to time.  Such
20144     new versions will be similar in spirit to the present version, but
20145     may differ in detail to address new problems or concerns.
20146
20147     Each version is given a distinguishing version number.  If the
20148     Program specifies that a certain numbered version of the GNU
20149     General Public License "or any later version" applies to it, you
20150     have the option of following the terms and conditions either of
20151     that numbered version or of any later version published by the Free
20152     Software Foundation.  If the Program does not specify a version
20153     number of the GNU General Public License, you may choose any
20154     version ever published by the Free Software Foundation.
20155
20156     If the Program specifies that a proxy can decide which future
20157     versions of the GNU General Public License can be used, that
20158     proxy's public statement of acceptance of a version permanently
20159     authorizes you to choose that version for the Program.
20160
20161     Later license versions may give you additional or different
20162     permissions.  However, no additional obligations are imposed on any
20163     author or copyright holder as a result of your choosing to follow a
20164     later version.
20165
20166  15. Disclaimer of Warranty.
20167
20168     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
20169     APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
20170     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
20171     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
20172     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20173     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
20174     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
20175     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
20176     NECESSARY SERVICING, REPAIR OR CORRECTION.
20177
20178  16. Limitation of Liability.
20179
20180     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
20181     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
20182     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
20183     DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
20184     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
20185     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
20186     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
20187     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
20188     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
20189     THE POSSIBILITY OF SUCH DAMAGES.
20190
20191  17. Interpretation of Sections 15 and 16.
20192
20193     If the disclaimer of warranty and limitation of liability provided
20194     above cannot be given local legal effect according to their terms,
20195     reviewing courts shall apply local law that most closely
20196     approximates an absolute waiver of all civil liability in
20197     connection with the Program, unless a warranty or assumption of
20198     liability accompanies a copy of the Program in return for a fee.
20199
20200END OF TERMS AND CONDITIONS
20201===========================
20202
20203How to Apply These Terms to Your New Programs
20204=============================================
20205
20206If you develop a new program, and you want it to be of the greatest
20207possible use to the public, the best way to achieve this is to make it
20208free software which everyone can redistribute and change under these
20209terms.
20210
20211   To do so, attach the following notices to the program.  It is safest
20212to attach them to the start of each source file to most effectively
20213state the exclusion of warranty; and each file should have at least the
20214"copyright" line and a pointer to where the full notice is found.
20215
20216     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
20217     Copyright (C) YEAR NAME OF AUTHOR
20218
20219     This program is free software: you can redistribute it and/or modify
20220     it under the terms of the GNU General Public License as published by
20221     the Free Software Foundation, either version 3 of the License, or (at
20222     your option) any later version.
20223
20224     This program is distributed in the hope that it will be useful, but
20225     WITHOUT ANY WARRANTY; without even the implied warranty of
20226     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20227     General Public License for more details.
20228
20229     You should have received a copy of the GNU General Public License
20230     along with this program.  If not, see <http://www.gnu.org/licenses/>.
20231
20232   Also add information on how to contact you by electronic and paper
20233mail.
20234
20235   If the program does terminal interaction, make it output a short
20236notice like this when it starts in an interactive mode:
20237
20238     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
20239     This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
20240     This is free software, and you are welcome to redistribute it
20241     under certain conditions; type 'show c' for details.
20242
20243   The hypothetical commands 'show w' and 'show c' should show the
20244appropriate parts of the General Public License.  Of course, your
20245program's commands might be different; for a GUI interface, you would
20246use an "about box".
20247
20248   You should also get your employer (if you work as a programmer) or
20249school, if any, to sign a "copyright disclaimer" for the program, if
20250necessary.  For more information on this, and how to apply and follow
20251the GNU GPL, see <http://www.gnu.org/licenses/>.
20252
20253   The GNU General Public License does not permit incorporating your
20254program into proprietary programs.  If your program is a subroutine
20255library, you may consider it more useful to permit linking proprietary
20256applications with the library.  If this is what you want to do, use the
20257GNU Lesser General Public License instead of this License.  But first,
20258please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
20259
20260
20261File: gfortran.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
20262
20263GNU Free Documentation License
20264******************************
20265
20266                     Version 1.3, 3 November 2008
20267
20268     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
20269     <http://fsf.org/>
20270
20271     Everyone is permitted to copy and distribute verbatim copies
20272     of this license document, but changing it is not allowed.
20273
20274  0. PREAMBLE
20275
20276     The purpose of this License is to make a manual, textbook, or other
20277     functional and useful document "free" in the sense of freedom: to
20278     assure everyone the effective freedom to copy and redistribute it,
20279     with or without modifying it, either commercially or
20280     noncommercially.  Secondarily, this License preserves for the
20281     author and publisher a way to get credit for their work, while not
20282     being considered responsible for modifications made by others.
20283
20284     This License is a kind of "copyleft", which means that derivative
20285     works of the document must themselves be free in the same sense.
20286     It complements the GNU General Public License, which is a copyleft
20287     license designed for free software.
20288
20289     We have designed this License in order to use it for manuals for
20290     free software, because free software needs free documentation: a
20291     free program should come with manuals providing the same freedoms
20292     that the software does.  But this License is not limited to
20293     software manuals; it can be used for any textual work, regardless
20294     of subject matter or whether it is published as a printed book.  We
20295     recommend this License principally for works whose purpose is
20296     instruction or reference.
20297
20298  1. APPLICABILITY AND DEFINITIONS
20299
20300     This License applies to any manual or other work, in any medium,
20301     that contains a notice placed by the copyright holder saying it can
20302     be distributed under the terms of this License.  Such a notice
20303     grants a world-wide, royalty-free license, unlimited in duration,
20304     to use that work under the conditions stated herein.  The
20305     "Document", below, refers to any such manual or work.  Any member
20306     of the public is a licensee, and is addressed as "you".  You accept
20307     the license if you copy, modify or distribute the work in a way
20308     requiring permission under copyright law.
20309
20310     A "Modified Version" of the Document means any work containing the
20311     Document or a portion of it, either copied verbatim, or with
20312     modifications and/or translated into another language.
20313
20314     A "Secondary Section" is a named appendix or a front-matter section
20315     of the Document that deals exclusively with the relationship of the
20316     publishers or authors of the Document to the Document's overall
20317     subject (or to related matters) and contains nothing that could
20318     fall directly within that overall subject.  (Thus, if the Document
20319     is in part a textbook of mathematics, a Secondary Section may not
20320     explain any mathematics.)  The relationship could be a matter of
20321     historical connection with the subject or with related matters, or
20322     of legal, commercial, philosophical, ethical or political position
20323     regarding them.
20324
20325     The "Invariant Sections" are certain Secondary Sections whose
20326     titles are designated, as being those of Invariant Sections, in the
20327     notice that says that the Document is released under this License.
20328     If a section does not fit the above definition of Secondary then it
20329     is not allowed to be designated as Invariant.  The Document may
20330     contain zero Invariant Sections.  If the Document does not identify
20331     any Invariant Sections then there are none.
20332
20333     The "Cover Texts" are certain short passages of text that are
20334     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
20335     that says that the Document is released under this License.  A
20336     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
20337     be at most 25 words.
20338
20339     A "Transparent" copy of the Document means a machine-readable copy,
20340     represented in a format whose specification is available to the
20341     general public, that is suitable for revising the document
20342     straightforwardly with generic text editors or (for images composed
20343     of pixels) generic paint programs or (for drawings) some widely
20344     available drawing editor, and that is suitable for input to text
20345     formatters or for automatic translation to a variety of formats
20346     suitable for input to text formatters.  A copy made in an otherwise
20347     Transparent file format whose markup, or absence of markup, has
20348     been arranged to thwart or discourage subsequent modification by
20349     readers is not Transparent.  An image format is not Transparent if
20350     used for any substantial amount of text.  A copy that is not
20351     "Transparent" is called "Opaque".
20352
20353     Examples of suitable formats for Transparent copies include plain
20354     ASCII without markup, Texinfo input format, LaTeX input format,
20355     SGML or XML using a publicly available DTD, and standard-conforming
20356     simple HTML, PostScript or PDF designed for human modification.
20357     Examples of transparent image formats include PNG, XCF and JPG.
20358     Opaque formats include proprietary formats that can be read and
20359     edited only by proprietary word processors, SGML or XML for which
20360     the DTD and/or processing tools are not generally available, and
20361     the machine-generated HTML, PostScript or PDF produced by some word
20362     processors for output purposes only.
20363
20364     The "Title Page" means, for a printed book, the title page itself,
20365     plus such following pages as are needed to hold, legibly, the
20366     material this License requires to appear in the title page.  For
20367     works in formats which do not have any title page as such, "Title
20368     Page" means the text near the most prominent appearance of the
20369     work's title, preceding the beginning of the body of the text.
20370
20371     The "publisher" means any person or entity that distributes copies
20372     of the Document to the public.
20373
20374     A section "Entitled XYZ" means a named subunit of the Document
20375     whose title either is precisely XYZ or contains XYZ in parentheses
20376     following text that translates XYZ in another language.  (Here XYZ
20377     stands for a specific section name mentioned below, such as
20378     "Acknowledgements", "Dedications", "Endorsements", or "History".)
20379     To "Preserve the Title" of such a section when you modify the
20380     Document means that it remains a section "Entitled XYZ" according
20381     to this definition.
20382
20383     The Document may include Warranty Disclaimers next to the notice
20384     which states that this License applies to the Document.  These
20385     Warranty Disclaimers are considered to be included by reference in
20386     this License, but only as regards disclaiming warranties: any other
20387     implication that these Warranty Disclaimers may have is void and
20388     has no effect on the meaning of this License.
20389
20390  2. VERBATIM COPYING
20391
20392     You may copy and distribute the Document in any medium, either
20393     commercially or noncommercially, provided that this License, the
20394     copyright notices, and the license notice saying this License
20395     applies to the Document are reproduced in all copies, and that you
20396     add no other conditions whatsoever to those of this License.  You
20397     may not use technical measures to obstruct or control the reading
20398     or further copying of the copies you make or distribute.  However,
20399     you may accept compensation in exchange for copies.  If you
20400     distribute a large enough number of copies you must also follow the
20401     conditions in section 3.
20402
20403     You may also lend copies, under the same conditions stated above,
20404     and you may publicly display copies.
20405
20406  3. COPYING IN QUANTITY
20407
20408     If you publish printed copies (or copies in media that commonly
20409     have printed covers) of the Document, numbering more than 100, and
20410     the Document's license notice requires Cover Texts, you must
20411     enclose the copies in covers that carry, clearly and legibly, all
20412     these Cover Texts: Front-Cover Texts on the front cover, and
20413     Back-Cover Texts on the back cover.  Both covers must also clearly
20414     and legibly identify you as the publisher of these copies.  The
20415     front cover must present the full title with all words of the title
20416     equally prominent and visible.  You may add other material on the
20417     covers in addition.  Copying with changes limited to the covers, as
20418     long as they preserve the title of the Document and satisfy these
20419     conditions, can be treated as verbatim copying in other respects.
20420
20421     If the required texts for either cover are too voluminous to fit
20422     legibly, you should put the first ones listed (as many as fit
20423     reasonably) on the actual cover, and continue the rest onto
20424     adjacent pages.
20425
20426     If you publish or distribute Opaque copies of the Document
20427     numbering more than 100, you must either include a machine-readable
20428     Transparent copy along with each Opaque copy, or state in or with
20429     each Opaque copy a computer-network location from which the general
20430     network-using public has access to download using public-standard
20431     network protocols a complete Transparent copy of the Document, free
20432     of added material.  If you use the latter option, you must take
20433     reasonably prudent steps, when you begin distribution of Opaque
20434     copies in quantity, to ensure that this Transparent copy will
20435     remain thus accessible at the stated location until at least one
20436     year after the last time you distribute an Opaque copy (directly or
20437     through your agents or retailers) of that edition to the public.
20438
20439     It is requested, but not required, that you contact the authors of
20440     the Document well before redistributing any large number of copies,
20441     to give them a chance to provide you with an updated version of the
20442     Document.
20443
20444  4. MODIFICATIONS
20445
20446     You may copy and distribute a Modified Version of the Document
20447     under the conditions of sections 2 and 3 above, provided that you
20448     release the Modified Version under precisely this License, with the
20449     Modified Version filling the role of the Document, thus licensing
20450     distribution and modification of the Modified Version to whoever
20451     possesses a copy of it.  In addition, you must do these things in
20452     the Modified Version:
20453
20454       A. Use in the Title Page (and on the covers, if any) a title
20455          distinct from that of the Document, and from those of previous
20456          versions (which should, if there were any, be listed in the
20457          History section of the Document).  You may use the same title
20458          as a previous version if the original publisher of that
20459          version gives permission.
20460
20461       B. List on the Title Page, as authors, one or more persons or
20462          entities responsible for authorship of the modifications in
20463          the Modified Version, together with at least five of the
20464          principal authors of the Document (all of its principal
20465          authors, if it has fewer than five), unless they release you
20466          from this requirement.
20467
20468       C. State on the Title page the name of the publisher of the
20469          Modified Version, as the publisher.
20470
20471       D. Preserve all the copyright notices of the Document.
20472
20473       E. Add an appropriate copyright notice for your modifications
20474          adjacent to the other copyright notices.
20475
20476       F. Include, immediately after the copyright notices, a license
20477          notice giving the public permission to use the Modified
20478          Version under the terms of this License, in the form shown in
20479          the Addendum below.
20480
20481       G. Preserve in that license notice the full lists of Invariant
20482          Sections and required Cover Texts given in the Document's
20483          license notice.
20484
20485       H. Include an unaltered copy of this License.
20486
20487       I. Preserve the section Entitled "History", Preserve its Title,
20488          and add to it an item stating at least the title, year, new
20489          authors, and publisher of the Modified Version as given on the
20490          Title Page.  If there is no section Entitled "History" in the
20491          Document, create one stating the title, year, authors, and
20492          publisher of the Document as given on its Title Page, then add
20493          an item describing the Modified Version as stated in the
20494          previous sentence.
20495
20496       J. Preserve the network location, if any, given in the Document
20497          for public access to a Transparent copy of the Document, and
20498          likewise the network locations given in the Document for
20499          previous versions it was based on.  These may be placed in the
20500          "History" section.  You may omit a network location for a work
20501          that was published at least four years before the Document
20502          itself, or if the original publisher of the version it refers
20503          to gives permission.
20504
20505       K. For any section Entitled "Acknowledgements" or "Dedications",
20506          Preserve the Title of the section, and preserve in the section
20507          all the substance and tone of each of the contributor
20508          acknowledgements and/or dedications given therein.
20509
20510       L. Preserve all the Invariant Sections of the Document, unaltered
20511          in their text and in their titles.  Section numbers or the
20512          equivalent are not considered part of the section titles.
20513
20514       M. Delete any section Entitled "Endorsements".  Such a section
20515          may not be included in the Modified Version.
20516
20517       N. Do not retitle any existing section to be Entitled
20518          "Endorsements" or to conflict in title with any Invariant
20519          Section.
20520
20521       O. Preserve any Warranty Disclaimers.
20522
20523     If the Modified Version includes new front-matter sections or
20524     appendices that qualify as Secondary Sections and contain no
20525     material copied from the Document, you may at your option designate
20526     some or all of these sections as invariant.  To do this, add their
20527     titles to the list of Invariant Sections in the Modified Version's
20528     license notice.  These titles must be distinct from any other
20529     section titles.
20530
20531     You may add a section Entitled "Endorsements", provided it contains
20532     nothing but endorsements of your Modified Version by various
20533     parties--for example, statements of peer review or that the text
20534     has been approved by an organization as the authoritative
20535     definition of a standard.
20536
20537     You may add a passage of up to five words as a Front-Cover Text,
20538     and a passage of up to 25 words as a Back-Cover Text, to the end of
20539     the list of Cover Texts in the Modified Version.  Only one passage
20540     of Front-Cover Text and one of Back-Cover Text may be added by (or
20541     through arrangements made by) any one entity.  If the Document
20542     already includes a cover text for the same cover, previously added
20543     by you or by arrangement made by the same entity you are acting on
20544     behalf of, you may not add another; but you may replace the old
20545     one, on explicit permission from the previous publisher that added
20546     the old one.
20547
20548     The author(s) and publisher(s) of the Document do not by this
20549     License give permission to use their names for publicity for or to
20550     assert or imply endorsement of any Modified Version.
20551
20552  5. COMBINING DOCUMENTS
20553
20554     You may combine the Document with other documents released under
20555     this License, under the terms defined in section 4 above for
20556     modified versions, provided that you include in the combination all
20557     of the Invariant Sections of all of the original documents,
20558     unmodified, and list them all as Invariant Sections of your
20559     combined work in its license notice, and that you preserve all
20560     their Warranty Disclaimers.
20561
20562     The combined work need only contain one copy of this License, and
20563     multiple identical Invariant Sections may be replaced with a single
20564     copy.  If there are multiple Invariant Sections with the same name
20565     but different contents, make the title of each such section unique
20566     by adding at the end of it, in parentheses, the name of the
20567     original author or publisher of that section if known, or else a
20568     unique number.  Make the same adjustment to the section titles in
20569     the list of Invariant Sections in the license notice of the
20570     combined work.
20571
20572     In the combination, you must combine any sections Entitled
20573     "History" in the various original documents, forming one section
20574     Entitled "History"; likewise combine any sections Entitled
20575     "Acknowledgements", and any sections Entitled "Dedications".  You
20576     must delete all sections Entitled "Endorsements."
20577
20578  6. COLLECTIONS OF DOCUMENTS
20579
20580     You may make a collection consisting of the Document and other
20581     documents released under this License, and replace the individual
20582     copies of this License in the various documents with a single copy
20583     that is included in the collection, provided that you follow the
20584     rules of this License for verbatim copying of each of the documents
20585     in all other respects.
20586
20587     You may extract a single document from such a collection, and
20588     distribute it individually under this License, provided you insert
20589     a copy of this License into the extracted document, and follow this
20590     License in all other respects regarding verbatim copying of that
20591     document.
20592
20593  7. AGGREGATION WITH INDEPENDENT WORKS
20594
20595     A compilation of the Document or its derivatives with other
20596     separate and independent documents or works, in or on a volume of a
20597     storage or distribution medium, is called an "aggregate" if the
20598     copyright resulting from the compilation is not used to limit the
20599     legal rights of the compilation's users beyond what the individual
20600     works permit.  When the Document is included in an aggregate, this
20601     License does not apply to the other works in the aggregate which
20602     are not themselves derivative works of the Document.
20603
20604     If the Cover Text requirement of section 3 is applicable to these
20605     copies of the Document, then if the Document is less than one half
20606     of the entire aggregate, the Document's Cover Texts may be placed
20607     on covers that bracket the Document within the aggregate, or the
20608     electronic equivalent of covers if the Document is in electronic
20609     form.  Otherwise they must appear on printed covers that bracket
20610     the whole aggregate.
20611
20612  8. TRANSLATION
20613
20614     Translation is considered a kind of modification, so you may
20615     distribute translations of the Document under the terms of section
20616     4.  Replacing Invariant Sections with translations requires special
20617     permission from their copyright holders, but you may include
20618     translations of some or all Invariant Sections in addition to the
20619     original versions of these Invariant Sections.  You may include a
20620     translation of this License, and all the license notices in the
20621     Document, and any Warranty Disclaimers, provided that you also
20622     include the original English version of this License and the
20623     original versions of those notices and disclaimers.  In case of a
20624     disagreement between the translation and the original version of
20625     this License or a notice or disclaimer, the original version will
20626     prevail.
20627
20628     If a section in the Document is Entitled "Acknowledgements",
20629     "Dedications", or "History", the requirement (section 4) to
20630     Preserve its Title (section 1) will typically require changing the
20631     actual title.
20632
20633  9. TERMINATION
20634
20635     You may not copy, modify, sublicense, or distribute the Document
20636     except as expressly provided under this License.  Any attempt
20637     otherwise to copy, modify, sublicense, or distribute it is void,
20638     and will automatically terminate your rights under this License.
20639
20640     However, if you cease all violation of this License, then your
20641     license from a particular copyright holder is reinstated (a)
20642     provisionally, unless and until the copyright holder explicitly and
20643     finally terminates your license, and (b) permanently, if the
20644     copyright holder fails to notify you of the violation by some
20645     reasonable means prior to 60 days after the cessation.
20646
20647     Moreover, your license from a particular copyright holder is
20648     reinstated permanently if the copyright holder notifies you of the
20649     violation by some reasonable means, this is the first time you have
20650     received notice of violation of this License (for any work) from
20651     that copyright holder, and you cure the violation prior to 30 days
20652     after your receipt of the notice.
20653
20654     Termination of your rights under this section does not terminate
20655     the licenses of parties who have received copies or rights from you
20656     under this License.  If your rights have been terminated and not
20657     permanently reinstated, receipt of a copy of some or all of the
20658     same material does not give you any rights to use it.
20659
20660  10. FUTURE REVISIONS OF THIS LICENSE
20661
20662     The Free Software Foundation may publish new, revised versions of
20663     the GNU Free Documentation License from time to time.  Such new
20664     versions will be similar in spirit to the present version, but may
20665     differ in detail to address new problems or concerns.  See
20666     <http://www.gnu.org/copyleft/>.
20667
20668     Each version of the License is given a distinguishing version
20669     number.  If the Document specifies that a particular numbered
20670     version of this License "or any later version" applies to it, you
20671     have the option of following the terms and conditions either of
20672     that specified version or of any later version that has been
20673     published (not as a draft) by the Free Software Foundation.  If the
20674     Document does not specify a version number of this License, you may
20675     choose any version ever published (not as a draft) by the Free
20676     Software Foundation.  If the Document specifies that a proxy can
20677     decide which future versions of this License can be used, that
20678     proxy's public statement of acceptance of a version permanently
20679     authorizes you to choose that version for the Document.
20680
20681  11. RELICENSING
20682
20683     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
20684     World Wide Web server that publishes copyrightable works and also
20685     provides prominent facilities for anybody to edit those works.  A
20686     public wiki that anybody can edit is an example of such a server.
20687     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
20688     site means any set of copyrightable works thus published on the MMC
20689     site.
20690
20691     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
20692     license published by Creative Commons Corporation, a not-for-profit
20693     corporation with a principal place of business in San Francisco,
20694     California, as well as future copyleft versions of that license
20695     published by that same organization.
20696
20697     "Incorporate" means to publish or republish a Document, in whole or
20698     in part, as part of another Document.
20699
20700     An MMC is "eligible for relicensing" if it is licensed under this
20701     License, and if all works that were first published under this
20702     License somewhere other than this MMC, and subsequently
20703     incorporated in whole or in part into the MMC, (1) had no cover
20704     texts or invariant sections, and (2) were thus incorporated prior
20705     to November 1, 2008.
20706
20707     The operator of an MMC Site may republish an MMC contained in the
20708     site under CC-BY-SA on the same site at any time before August 1,
20709     2009, provided the MMC is eligible for relicensing.
20710
20711ADDENDUM: How to use this License for your documents
20712====================================================
20713
20714To use this License in a document you have written, include a copy of
20715the License in the document and put the following copyright and license
20716notices just after the title page:
20717
20718       Copyright (C)  YEAR  YOUR NAME.
20719       Permission is granted to copy, distribute and/or modify this document
20720       under the terms of the GNU Free Documentation License, Version 1.3
20721       or any later version published by the Free Software Foundation;
20722       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
20723       Texts.  A copy of the license is included in the section entitled ``GNU
20724       Free Documentation License''.
20725
20726   If you have Invariant Sections, Front-Cover Texts and Back-Cover
20727Texts, replace the "with...Texts."  line with this:
20728
20729         with the Invariant Sections being LIST THEIR TITLES, with
20730         the Front-Cover Texts being LIST, and with the Back-Cover Texts
20731         being LIST.
20732
20733   If you have Invariant Sections without Cover Texts, or some other
20734combination of the three, merge those two alternatives to suit the
20735situation.
20736
20737   If your document contains nontrivial examples of program code, we
20738recommend releasing these examples in parallel under your choice of free
20739software license, such as the GNU General Public License, to permit
20740their use in free software.
20741
20742
20743File: gfortran.info,  Node: Funding,  Next: Option Index,  Prev: GNU Free Documentation License,  Up: Top
20744
20745Funding Free Software
20746*********************
20747
20748If you want to have more free software a few years from now, it makes
20749sense for you to help encourage people to contribute funds for its
20750development.  The most effective approach known is to encourage
20751commercial redistributors to donate.
20752
20753   Users of free software systems can boost the pace of development by
20754encouraging for-a-fee distributors to donate part of their selling price
20755to free software developers--the Free Software Foundation, and others.
20756
20757   The way to convince distributors to do this is to demand it and
20758expect it from them.  So when you compare distributors, judge them
20759partly by how much they give to free software development.  Show
20760distributors they must compete to be the one who gives the most.
20761
20762   To make this approach work, you must insist on numbers that you can
20763compare, such as, "We will donate ten dollars to the Frobnitz project
20764for each disk sold."  Don't be satisfied with a vague promise, such as
20765"A portion of the profits are donated," since it doesn't give a basis
20766for comparison.
20767
20768   Even a precise fraction "of the profits from this disk" is not very
20769meaningful, since creative accounting and unrelated business decisions
20770can greatly alter what fraction of the sales price counts as profit.  If
20771the price you pay is $50, ten percent of the profit is probably less
20772than a dollar; it might be a few cents, or nothing at all.
20773
20774   Some redistributors do development work themselves.  This is useful
20775too; but to keep everyone honest, you need to inquire how much they do,
20776and what kind.  Some kinds of development make much more long-term
20777difference than others.  For example, maintaining a separate version of
20778a program contributes very little; maintaining the standard version of a
20779program for the whole community contributes much.  Easy new ports
20780contribute little, since someone else would surely do them; difficult
20781ports such as adding a new CPU to the GNU Compiler Collection contribute
20782more; major new features or packages contribute the most.
20783
20784   By establishing the idea that supporting further development is "the
20785proper thing to do" when distributing free software for a fee, we can
20786assure a steady flow of resources into making more free software.
20787
20788     Copyright (C) 1994 Free Software Foundation, Inc.
20789     Verbatim copying and redistribution of this section is permitted
20790     without royalty; alteration is not permitted.
20791
20792
20793File: gfortran.info,  Node: Option Index,  Next: Keyword Index,  Prev: Funding,  Up: Top
20794
20795Option Index
20796************
20797
20798'gfortran''s command line options are indexed here without any initial
20799'-' or '--'.  Where an option has both positive and negative forms (such
20800as -foption and -fno-option), relevant entries in the manual are indexed
20801under the most appropriate form; it may sometimes be useful to look up
20802both forms.
20803
20804�[index�]
20805* Menu:
20806
20807* A-PREDICATE=ANSWER:                    Preprocessing Options.
20808                                                              (line 119)
20809* APREDICATE=ANSWER:                     Preprocessing Options.
20810                                                              (line 113)
20811* backslash:                             Fortran Dialect Options.
20812                                                              (line  74)
20813* C:                                     Preprocessing Options.
20814                                                              (line 122)
20815* c-prototypes:                          Interoperability Options.
20816                                                              (line   7)
20817* CC:                                    Preprocessing Options.
20818                                                              (line 137)
20819* cpp:                                   Preprocessing Options.
20820                                                              (line  12)
20821* dD:                                    Preprocessing Options.
20822                                                              (line  35)
20823* dI:                                    Preprocessing Options.
20824                                                              (line  51)
20825* dM:                                    Preprocessing Options.
20826                                                              (line  26)
20827* dN:                                    Preprocessing Options.
20828                                                              (line  41)
20829* DNAME:                                 Preprocessing Options.
20830                                                              (line 151)
20831* DNAME=DEFINITION:                      Preprocessing Options.
20832                                                              (line 154)
20833* dU:                                    Preprocessing Options.
20834                                                              (line  44)
20835* faggressive-function-elimination:      Code Gen Options.    (line 398)
20836* falign-commons:                        Code Gen Options.    (line 371)
20837* fall-intrinsics:                       Fortran Dialect Options.
20838                                                              (line  17)
20839* fblas-matmul-limit:                    Code Gen Options.    (line 305)
20840* fbounds-check:                         Code Gen Options.    (line 198)
20841* fcheck:                                Code Gen Options.    (line 141)
20842* fcheck-array-temporaries:              Code Gen Options.    (line 232)
20843* fcoarray:                              Code Gen Options.    (line 127)
20844* fconvert=CONVERSION:                   Runtime Options.     (line  10)
20845* fcray-pointer:                         Fortran Dialect Options.
20846                                                              (line 120)
20847* fd-lines-as-code:                      Fortran Dialect Options.
20848                                                              (line  27)
20849* fd-lines-as-comments:                  Fortran Dialect Options.
20850                                                              (line  27)
20851* fdec:                                  Fortran Dialect Options.
20852                                                              (line  34)
20853* fdec-intrinsic-ints:                   Fortran Dialect Options.
20854                                                              (line  54)
20855* fdec-math:                             Fortran Dialect Options.
20856                                                              (line  59)
20857* fdec-static:                           Fortran Dialect Options.
20858                                                              (line  64)
20859* fdec-structure:                        Fortran Dialect Options.
20860                                                              (line  48)
20861* fdefault-double-8:                     Fortran Dialect Options.
20862                                                              (line 185)
20863* fdefault-integer-8:                    Fortran Dialect Options.
20864                                                              (line 155)
20865* fdefault-real-10:                      Fortran Dialect Options.
20866                                                              (line 169)
20867* fdefault-real-16:                      Fortran Dialect Options.
20868                                                              (line 177)
20869* fdefault-real-8:                       Fortran Dialect Options.
20870                                                              (line 161)
20871* fdollar-ok:                            Fortran Dialect Options.
20872                                                              (line  68)
20873* fdump-fortran-optimized:               Debugging Options.   (line  18)
20874* fdump-fortran-original:                Debugging Options.   (line  10)
20875* fdump-parse-tree:                      Debugging Options.   (line  25)
20876* fexternal-blas:                        Code Gen Options.    (line 297)
20877* ff2c:                                  Code Gen Options.    (line  25)
20878* ffixed-form:                           Fortran Dialect Options.
20879                                                              (line  11)
20880* ffixed-line-length-N:                  Fortran Dialect Options.
20881                                                              (line  91)
20882* ffpe-summary=LIST:                     Debugging Options.   (line  59)
20883* ffpe-trap=LIST:                        Debugging Options.   (line  33)
20884* ffree-form:                            Fortran Dialect Options.
20885                                                              (line  11)
20886* ffree-line-length-N:                   Fortran Dialect Options.
20887                                                              (line 104)
20888* fimplicit-none:                        Fortran Dialect Options.
20889                                                              (line 115)
20890* finit-character:                       Code Gen Options.    (line 340)
20891* finit-derived:                         Code Gen Options.    (line 340)
20892* finit-integer:                         Code Gen Options.    (line 340)
20893* finit-local-zero:                      Code Gen Options.    (line 340)
20894* finit-logical:                         Code Gen Options.    (line 340)
20895* finit-real:                            Code Gen Options.    (line 340)
20896* finline-matmul-limit:                  Code Gen Options.    (line 316)
20897* finteger-4-integer-8:                  Fortran Dialect Options.
20898                                                              (line 194)
20899* fintrinsic-modules-path DIR:           Directory Options.   (line  36)
20900* fmax-array-constructor:                Code Gen Options.    (line 235)
20901* fmax-errors=N:                         Error and Warning Options.
20902                                                              (line  27)
20903* fmax-identifier-length=N:              Fortran Dialect Options.
20904                                                              (line 111)
20905* fmax-stack-var-size:                   Code Gen Options.    (line 253)
20906* fmax-subrecord-length=LENGTH:          Runtime Options.     (line  29)
20907* fmodule-private:                       Fortran Dialect Options.
20908                                                              (line  86)
20909* fno-automatic:                         Code Gen Options.    (line  15)
20910* fno-backtrace:                         Debugging Options.   (line  69)
20911* fno-protect-parens:                    Code Gen Options.    (line 383)
20912* fno-underscoring:                      Code Gen Options.    (line  54)
20913* fopenacc:                              Fortran Dialect Options.
20914                                                              (line 124)
20915* fopenmp:                               Fortran Dialect Options.
20916                                                              (line 135)
20917* fpack-derived:                         Code Gen Options.    (line 275)
20918* fpp:                                   Preprocessing Options.
20919                                                              (line  12)
20920* frange-check:                          Fortran Dialect Options.
20921                                                              (line 143)
20922* freal-4-real-10:                       Fortran Dialect Options.
20923                                                              (line 209)
20924* freal-4-real-16:                       Fortran Dialect Options.
20925                                                              (line 209)
20926* freal-4-real-8:                        Fortran Dialect Options.
20927                                                              (line 209)
20928* freal-8-real-10:                       Fortran Dialect Options.
20929                                                              (line 209)
20930* freal-8-real-16:                       Fortran Dialect Options.
20931                                                              (line 209)
20932* freal-8-real-4:                        Fortran Dialect Options.
20933                                                              (line 209)
20934* frealloc-lhs:                          Code Gen Options.    (line 392)
20935* frecord-marker=LENGTH:                 Runtime Options.     (line  21)
20936* frecursive:                            Code Gen Options.    (line 330)
20937* frepack-arrays:                        Code Gen Options.    (line 281)
20938* frontend-loop-interchange:             Code Gen Options.    (line 415)
20939* frontend-optimize:                     Code Gen Options.    (line 406)
20940* fsecond-underscore:                    Code Gen Options.    (line 110)
20941* fshort-enums:                          Code Gen Options.    (line 291)
20942* fshort-enums <1>:                      Fortran 2003 status. (line  93)
20943* fsign-zero:                            Runtime Options.     (line  34)
20944* fstack-arrays:                         Code Gen Options.    (line 267)
20945* fsyntax-only:                          Error and Warning Options.
20946                                                              (line  33)
20947* ftest-forall-temp:                     Fortran Dialect Options.
20948                                                              (line 239)
20949* fworking-directory:                    Preprocessing Options.
20950                                                              (line  55)
20951* H:                                     Preprocessing Options.
20952                                                              (line 174)
20953* IDIR:                                  Directory Options.   (line  14)
20954* idirafter DIR:                         Preprocessing Options.
20955                                                              (line  69)
20956* imultilib DIR:                         Preprocessing Options.
20957                                                              (line  76)
20958* iprefix PREFIX:                        Preprocessing Options.
20959                                                              (line  80)
20960* iquote DIR:                            Preprocessing Options.
20961                                                              (line  89)
20962* isysroot DIR:                          Preprocessing Options.
20963                                                              (line  85)
20964* isystem DIR:                           Preprocessing Options.
20965                                                              (line  96)
20966* JDIR:                                  Directory Options.   (line  29)
20967* MDIR:                                  Directory Options.   (line  29)
20968* nostdinc:                              Preprocessing Options.
20969                                                              (line 104)
20970* P:                                     Preprocessing Options.
20971                                                              (line 179)
20972* pedantic:                              Error and Warning Options.
20973                                                              (line  39)
20974* pedantic-errors:                       Error and Warning Options.
20975                                                              (line  58)
20976* static-libgfortran:                    Link Options.        (line  11)
20977* std=STD option:                        Fortran Dialect Options.
20978                                                              (line 220)
20979* tail-call-workaround:                  Code Gen Options.    (line 202)
20980* UNAME:                                 Preprocessing Options.
20981                                                              (line 185)
20982* undef:                                 Preprocessing Options.
20983                                                              (line 109)
20984* Waliasing:                             Error and Warning Options.
20985                                                              (line  71)
20986* Walign-commons:                        Error and Warning Options.
20987                                                              (line 226)
20988* Wall:                                  Error and Warning Options.
20989                                                              (line  62)
20990* Wampersand:                            Error and Warning Options.
20991                                                              (line  88)
20992* Wargument-mismatch:                    Error and Warning Options.
20993                                                              (line  96)
20994* Warray-temporaries:                    Error and Warning Options.
20995                                                              (line 101)
20996* Wc-binding-type:                       Error and Warning Options.
20997                                                              (line 106)
20998* Wcharacter-truncation:                 Error and Warning Options.
20999                                                              (line 113)
21000* Wcompare-reals:                        Error and Warning Options.
21001                                                              (line 253)
21002* Wconversion:                           Error and Warning Options.
21003                                                              (line 122)
21004* Wconversion-extra:                     Error and Warning Options.
21005                                                              (line 126)
21006* Wdo-subscript:                         Error and Warning Options.
21007                                                              (line 265)
21008* Werror:                                Error and Warning Options.
21009                                                              (line 277)
21010* Wextra:                                Error and Warning Options.
21011                                                              (line 130)
21012* Wfrontend-loop-interchange:            Error and Warning Options.
21013                                                              (line 135)
21014* Wfunction-elimination:                 Error and Warning Options.
21015                                                              (line 232)
21016* Wimplicit-interface:                   Error and Warning Options.
21017                                                              (line 139)
21018* Wimplicit-procedure:                   Error and Warning Options.
21019                                                              (line 145)
21020* Winteger-division:                     Error and Warning Options.
21021                                                              (line 149)
21022* Wintrinsic-shadow:                     Error and Warning Options.
21023                                                              (line 204)
21024* Wintrinsics-std:                       Error and Warning Options.
21025                                                              (line 153)
21026* Wline-truncation:                      Error and Warning Options.
21027                                                              (line 116)
21028* Wpedantic:                             Error and Warning Options.
21029                                                              (line  39)
21030* Wreal-q-constant:                      Error and Warning Options.
21031                                                              (line 160)
21032* Wrealloc-lhs:                          Error and Warning Options.
21033                                                              (line 236)
21034* Wrealloc-lhs-all:                      Error and Warning Options.
21035                                                              (line 248)
21036* Wsurprising:                           Error and Warning Options.
21037                                                              (line 164)
21038* Wtabs:                                 Error and Warning Options.
21039                                                              (line 186)
21040* Wtargt-lifetime:                       Error and Warning Options.
21041                                                              (line 257)
21042* Wundefined-do-loop:                    Error and Warning Options.
21043                                                              (line 194)
21044* Wunderflow:                            Error and Warning Options.
21045                                                              (line 199)
21046* Wunused-dummy-argument:                Error and Warning Options.
21047                                                              (line 215)
21048* Wunused-parameter:                     Error and Warning Options.
21049                                                              (line 219)
21050* Wuse-without-only:                     Error and Warning Options.
21051                                                              (line 211)
21052* Wzerotrip:                             Error and Warning Options.
21053                                                              (line 261)
21054
21055
21056File: gfortran.info,  Node: Keyword Index,  Prev: Option Index,  Up: Top
21057
21058Keyword Index
21059*************
21060
21061�[index�]
21062* Menu:
21063
21064* $:                                     Fortran Dialect Options.
21065                                                              (line  68)
21066* %LOC:                                  Argument list functions.
21067                                                              (line   6)
21068* %REF:                                  Argument list functions.
21069                                                              (line   6)
21070* %VAL:                                  Argument list functions.
21071                                                              (line   6)
21072* &:                                     Error and Warning Options.
21073                                                              (line  88)
21074* [...]:                                 Fortran 2003 status. (line  78)
21075* _gfortran_set_args:                    _gfortran_set_args.  (line   6)
21076* _gfortran_set_convert:                 _gfortran_set_convert.
21077                                                              (line   6)
21078* _gfortran_set_fpe:                     _gfortran_set_fpe.   (line   6)
21079* _gfortran_set_max_subrecord_length:    _gfortran_set_max_subrecord_length.
21080                                                              (line   6)
21081* _gfortran_set_options:                 _gfortran_set_options.
21082                                                              (line   6)
21083* _gfortran_set_record_marker:           _gfortran_set_record_marker.
21084                                                              (line   6)
21085* ABORT:                                 ABORT.               (line   6)
21086* ABS:                                   ABS.                 (line   6)
21087* absolute value:                        ABS.                 (line   6)
21088* ACCESS:                                ACCESS.              (line   6)
21089* ACCESS='STREAM' I/O:                   Fortran 2003 status. (line 103)
21090* ACHAR:                                 ACHAR.               (line   6)
21091* ACOS:                                  ACOS.                (line   6)
21092* ACOSD:                                 ACOSD.               (line   6)
21093* ACOSH:                                 ACOSH.               (line   6)
21094* adjust string:                         ADJUSTL.             (line   6)
21095* adjust string <1>:                     ADJUSTR.             (line   6)
21096* ADJUSTL:                               ADJUSTL.             (line   6)
21097* ADJUSTR:                               ADJUSTR.             (line   6)
21098* AIMAG:                                 AIMAG.               (line   6)
21099* AINT:                                  AINT.                (line   6)
21100* ALARM:                                 ALARM.               (line   6)
21101* ALGAMA:                                LOG_GAMMA.           (line   6)
21102* aliasing:                              Error and Warning Options.
21103                                                              (line  71)
21104* alignment of COMMON blocks:            Error and Warning Options.
21105                                                              (line 226)
21106* alignment of COMMON blocks <1>:        Code Gen Options.    (line 371)
21107* ALL:                                   ALL.                 (line   6)
21108* all warnings:                          Error and Warning Options.
21109                                                              (line  62)
21110* ALLOCATABLE components of derived types: Fortran 2003 status.
21111                                                              (line 101)
21112* ALLOCATABLE dummy arguments:           Fortran 2003 status. (line  99)
21113* ALLOCATABLE function results:          Fortran 2003 status. (line 100)
21114* ALLOCATED:                             ALLOCATED.           (line   6)
21115* allocation, moving:                    MOVE_ALLOC.          (line   6)
21116* allocation, status:                    ALLOCATED.           (line   6)
21117* ALOG:                                  LOG.                 (line   6)
21118* ALOG10:                                LOG10.               (line   6)
21119* AMAX0:                                 MAX.                 (line   6)
21120* AMAX1:                                 MAX.                 (line   6)
21121* AMIN0:                                 MIN.                 (line   6)
21122* AMIN1:                                 MIN.                 (line   6)
21123* AMOD:                                  MOD.                 (line   6)
21124* AND:                                   AND.                 (line   6)
21125* ANINT:                                 ANINT.               (line   6)
21126* ANY:                                   ANY.                 (line   6)
21127* area hyperbolic cosine:                ACOSH.               (line   6)
21128* area hyperbolic sine:                  ASINH.               (line   6)
21129* area hyperbolic tangent:               ATANH.               (line   6)
21130* argument list functions:               Argument list functions.
21131                                                              (line   6)
21132* arguments, to program:                 COMMAND_ARGUMENT_COUNT.
21133                                                              (line   6)
21134* arguments, to program <1>:             GETARG.              (line   6)
21135* arguments, to program <2>:             GET_COMMAND.         (line   6)
21136* arguments, to program <3>:             GET_COMMAND_ARGUMENT.
21137                                                              (line   6)
21138* arguments, to program <4>:             IARGC.               (line   6)
21139* array, add elements:                   SUM.                 (line   6)
21140* array, AND:                            IALL.                (line   6)
21141* array, apply condition:                ALL.                 (line   6)
21142* array, apply condition <1>:            ANY.                 (line   6)
21143* array, bounds checking:                Code Gen Options.    (line 141)
21144* array, change dimensions:              RESHAPE.             (line   6)
21145* array, combine arrays:                 MERGE.               (line   6)
21146* array, condition testing:              ALL.                 (line   6)
21147* array, condition testing <1>:          ANY.                 (line   6)
21148* array, conditionally add elements:     SUM.                 (line   6)
21149* array, conditionally count elements:   COUNT.               (line   6)
21150* array, conditionally multiply elements: PRODUCT.            (line   6)
21151* array, constructors:                   Fortran 2003 status. (line  78)
21152* array, count elements:                 SIZE.                (line   6)
21153* array, duplicate dimensions:           SPREAD.              (line   6)
21154* array, duplicate elements:             SPREAD.              (line   6)
21155* array, element counting:               COUNT.               (line   6)
21156* array, gather elements:                PACK.                (line   6)
21157* array, increase dimension:             SPREAD.              (line   6)
21158* array, increase dimension <1>:         UNPACK.              (line   6)
21159* array, indices of type real:           Real array indices.  (line   6)
21160* array, location of maximum element:    MAXLOC.              (line   6)
21161* array, location of minimum element:    MINLOC.              (line   6)
21162* array, lower bound:                    LBOUND.              (line   6)
21163* array, maximum value:                  MAXVAL.              (line   6)
21164* array, merge arrays:                   MERGE.               (line   6)
21165* array, minimum value:                  MINVAL.              (line   6)
21166* array, multiply elements:              PRODUCT.             (line   6)
21167* array, number of elements:             COUNT.               (line   6)
21168* array, number of elements <1>:         SIZE.                (line   6)
21169* array, OR:                             IANY.                (line   6)
21170* array, packing:                        PACK.                (line   6)
21171* array, parity:                         IPARITY.             (line   6)
21172* array, permutation:                    CSHIFT.              (line   6)
21173* array, product:                        PRODUCT.             (line   6)
21174* array, reduce dimension:               PACK.                (line   6)
21175* array, rotate:                         CSHIFT.              (line   6)
21176* array, scatter elements:               UNPACK.              (line   6)
21177* array, shape:                          SHAPE.               (line   6)
21178* array, shift:                          EOSHIFT.             (line   6)
21179* array, shift circularly:               CSHIFT.              (line   6)
21180* array, size:                           SIZE.                (line   6)
21181* array, sum:                            SUM.                 (line   6)
21182* array, transmogrify:                   RESHAPE.             (line   6)
21183* array, transpose:                      TRANSPOSE.           (line   6)
21184* array, unpacking:                      UNPACK.              (line   6)
21185* array, upper bound:                    UBOUND.              (line   6)
21186* array, XOR:                            IPARITY.             (line   6)
21187* ASCII collating sequence:              ACHAR.               (line   6)
21188* ASCII collating sequence <1>:          IACHAR.              (line   6)
21189* ASIN:                                  ASIN.                (line   6)
21190* ASIND:                                 ASIND.               (line   6)
21191* ASINH:                                 ASINH.               (line   6)
21192* ASSOCIATED:                            ASSOCIATED.          (line   6)
21193* association status:                    ASSOCIATED.          (line   6)
21194* association status, C pointer:         C_ASSOCIATED.        (line   6)
21195* ATAN:                                  ATAN.                (line   6)
21196* ATAN2:                                 ATAN2.               (line   6)
21197* ATAN2D:                                ATAN2D.              (line   6)
21198* ATAND:                                 ATAND.               (line   6)
21199* ATANH:                                 ATANH.               (line   6)
21200* Atomic subroutine, add:                ATOMIC_ADD.          (line   6)
21201* Atomic subroutine, ADD with fetch:     ATOMIC_FETCH_ADD.    (line   6)
21202* Atomic subroutine, AND:                ATOMIC_AND.          (line   6)
21203* Atomic subroutine, AND with fetch:     ATOMIC_FETCH_AND.    (line   6)
21204* Atomic subroutine, compare and swap:   ATOMIC_CAS.          (line   6)
21205* Atomic subroutine, define:             ATOMIC_DEFINE.       (line   6)
21206* Atomic subroutine, OR:                 ATOMIC_OR.           (line   6)
21207* Atomic subroutine, OR with fetch:      ATOMIC_FETCH_OR.     (line   6)
21208* Atomic subroutine, reference:          ATOMIC_REF.          (line   6)
21209* Atomic subroutine, XOR:                ATOMIC_XOR.          (line   6)
21210* Atomic subroutine, XOR with fetch:     ATOMIC_FETCH_XOR.    (line   6)
21211* ATOMIC_ADD:                            ATOMIC_ADD.          (line   6)
21212* ATOMIC_AND:                            ATOMIC_AND.          (line   6)
21213* ATOMIC_DEFINE:                         ATOMIC_CAS.          (line   6)
21214* ATOMIC_DEFINE <1>:                     ATOMIC_DEFINE.       (line   6)
21215* ATOMIC_FETCH_ADD:                      ATOMIC_FETCH_ADD.    (line   6)
21216* ATOMIC_FETCH_AND:                      ATOMIC_FETCH_AND.    (line   6)
21217* ATOMIC_FETCH_OR:                       ATOMIC_FETCH_OR.     (line   6)
21218* ATOMIC_FETCH_XOR:                      ATOMIC_FETCH_XOR.    (line   6)
21219* ATOMIC_OR:                             ATOMIC_OR.           (line   6)
21220* ATOMIC_REF:                            ATOMIC_REF.          (line   6)
21221* ATOMIC_XOR:                            ATOMIC_XOR.          (line   6)
21222* Authors:                               Contributors.        (line   6)
21223* AUTOMATIC:                             AUTOMATIC and STATIC attributes.
21224                                                              (line   6)
21225* BABS:                                  ABS.                 (line   6)
21226* backslash:                             Fortran Dialect Options.
21227                                                              (line  74)
21228* BACKSPACE:                             Read/Write after EOF marker.
21229                                                              (line   6)
21230* BACKTRACE:                             BACKTRACE.           (line   6)
21231* backtrace:                             Debugging Options.   (line  69)
21232* backtrace <1>:                         BACKTRACE.           (line   6)
21233* base 10 logarithm function:            LOG10.               (line   6)
21234* BBCLR:                                 IBCLR.               (line   6)
21235* BBITS:                                 IBITS.               (line   6)
21236* BBSET:                                 IBSET.               (line   6)
21237* BBTEST:                                BTEST.               (line   6)
21238* BESJ0:                                 BESSEL_J0.           (line   6)
21239* BESJ1:                                 BESSEL_J1.           (line   6)
21240* BESJN:                                 BESSEL_JN.           (line   6)
21241* Bessel function, first kind:           BESSEL_J0.           (line   6)
21242* Bessel function, first kind <1>:       BESSEL_J1.           (line   6)
21243* Bessel function, first kind <2>:       BESSEL_JN.           (line   6)
21244* Bessel function, second kind:          BESSEL_Y0.           (line   6)
21245* Bessel function, second kind <1>:      BESSEL_Y1.           (line   6)
21246* Bessel function, second kind <2>:      BESSEL_YN.           (line   6)
21247* BESSEL_J0:                             BESSEL_J0.           (line   6)
21248* BESSEL_J1:                             BESSEL_J1.           (line   6)
21249* BESSEL_JN:                             BESSEL_JN.           (line   6)
21250* BESSEL_Y0:                             BESSEL_Y0.           (line   6)
21251* BESSEL_Y1:                             BESSEL_Y1.           (line   6)
21252* BESSEL_YN:                             BESSEL_YN.           (line   6)
21253* BESY0:                                 BESSEL_Y0.           (line   6)
21254* BESY1:                                 BESSEL_Y1.           (line   6)
21255* BESYN:                                 BESSEL_YN.           (line   6)
21256* BGE:                                   BGE.                 (line   6)
21257* BGT:                                   BGT.                 (line   6)
21258* BIAND:                                 IAND.                (line   6)
21259* BIEOR:                                 IEOR.                (line   6)
21260* binary representation:                 POPCNT.              (line   6)
21261* binary representation <1>:             POPPAR.              (line   6)
21262* BIOR:                                  IOR.                 (line   6)
21263* BITEST:                                BTEST.               (line   6)
21264* bits set:                              POPCNT.              (line   6)
21265* bits, AND of array elements:           IALL.                (line   6)
21266* bits, clear:                           IBCLR.               (line   6)
21267* bits, extract:                         IBITS.               (line   6)
21268* bits, get:                             IBITS.               (line   6)
21269* bits, merge:                           MERGE_BITS.          (line   6)
21270* bits, move:                            MVBITS.              (line   6)
21271* bits, move <1>:                        TRANSFER.            (line   6)
21272* bits, negate:                          NOT.                 (line   6)
21273* bits, number of:                       BIT_SIZE.            (line   6)
21274* bits, OR of array elements:            IANY.                (line   6)
21275* bits, set:                             IBSET.               (line   6)
21276* bits, shift:                           ISHFT.               (line   6)
21277* bits, shift circular:                  ISHFTC.              (line   6)
21278* bits, shift left:                      LSHIFT.              (line   6)
21279* bits, shift left <1>:                  SHIFTL.              (line   6)
21280* bits, shift right:                     RSHIFT.              (line   6)
21281* bits, shift right <1>:                 SHIFTA.              (line   6)
21282* bits, shift right <2>:                 SHIFTR.              (line   6)
21283* bits, testing:                         BTEST.               (line   6)
21284* bits, unset:                           IBCLR.               (line   6)
21285* bits, XOR of array elements:           IPARITY.             (line   6)
21286* bitwise comparison:                    BGE.                 (line   6)
21287* bitwise comparison <1>:                BGT.                 (line   6)
21288* bitwise comparison <2>:                BLE.                 (line   6)
21289* bitwise comparison <3>:                BLT.                 (line   6)
21290* bitwise logical and:                   AND.                 (line   6)
21291* bitwise logical and <1>:               IAND.                (line   6)
21292* bitwise logical exclusive or:          IEOR.                (line   6)
21293* bitwise logical exclusive or <1>:      XOR.                 (line   6)
21294* bitwise logical not:                   NOT.                 (line   6)
21295* bitwise logical or:                    IOR.                 (line   6)
21296* bitwise logical or <1>:                OR.                  (line   6)
21297* BIT_SIZE:                              BIT_SIZE.            (line   6)
21298* BJTEST:                                BTEST.               (line   6)
21299* BKTEST:                                BTEST.               (line   6)
21300* BLE:                                   BLE.                 (line   6)
21301* BLT:                                   BLT.                 (line   6)
21302* BMOD:                                  MOD.                 (line   6)
21303* BMVBITS:                               MVBITS.              (line   6)
21304* BNOT:                                  NOT.                 (line   6)
21305* bounds checking:                       Code Gen Options.    (line 141)
21306* BOZ literal constants:                 BOZ literal constants.
21307                                                              (line   6)
21308* BSHFT:                                 ISHFT.               (line   6)
21309* BSHFTC:                                ISHFTC.              (line   6)
21310* BTEST:                                 BTEST.               (line   6)
21311* CABS:                                  ABS.                 (line   6)
21312* calling convention:                    Code Gen Options.    (line  25)
21313* CARRIAGECONTROL:                       Extended I/O specifiers.
21314                                                              (line   6)
21315* CCOS:                                  COS.                 (line   6)
21316* CCOSD:                                 COSD.                (line   6)
21317* CDABS:                                 ABS.                 (line   6)
21318* CDCOS:                                 COS.                 (line   6)
21319* CDCOSD:                                COSD.                (line   6)
21320* CDEXP:                                 EXP.                 (line   6)
21321* CDLOG:                                 LOG.                 (line   6)
21322* CDSIN:                                 SIN.                 (line   6)
21323* CDSIND:                                SIND.                (line   6)
21324* CDSQRT:                                SQRT.                (line   6)
21325* CEILING:                               CEILING.             (line   6)
21326* ceiling:                               ANINT.               (line   6)
21327* ceiling <1>:                           CEILING.             (line   6)
21328* CEXP:                                  EXP.                 (line   6)
21329* CHAR:                                  CHAR.                (line   6)
21330* character kind:                        SELECTED_CHAR_KIND.  (line   6)
21331* character set:                         Fortran Dialect Options.
21332                                                              (line  68)
21333* CHDIR:                                 CHDIR.               (line   6)
21334* checking array temporaries:            Code Gen Options.    (line 141)
21335* checking subscripts:                   Code Gen Options.    (line 141)
21336* CHMOD:                                 CHMOD.               (line   6)
21337* clock ticks:                           MCLOCK.              (line   6)
21338* clock ticks <1>:                       MCLOCK8.             (line   6)
21339* clock ticks <2>:                       SYSTEM_CLOCK.        (line   6)
21340* CLOG:                                  LOG.                 (line   6)
21341* CMPLX:                                 CMPLX.               (line   6)
21342* coarray, IMAGE_INDEX:                  IMAGE_INDEX.         (line   6)
21343* coarray, lower bound:                  LCOBOUND.            (line   6)
21344* coarray, NUM_IMAGES:                   NUM_IMAGES.          (line   6)
21345* coarray, THIS_IMAGE:                   THIS_IMAGE.          (line   6)
21346* coarray, upper bound:                  UCOBOUND.            (line   6)
21347* Coarray, _gfortran_caf_atomic_cas:     _gfortran_caf_atomic_cas.
21348                                                              (line   6)
21349* Coarray, _gfortran_caf_atomic_define:  _gfortran_caf_atomic_define.
21350                                                              (line   6)
21351* Coarray, _gfortran_caf_atomic_op:      _gfortran_caf_atomic_op.
21352                                                              (line   6)
21353* Coarray, _gfortran_caf_atomic_ref:     _gfortran_caf_atomic_ref.
21354                                                              (line   6)
21355* Coarray, _gfortran_caf_co_broadcast:   _gfortran_caf_co_broadcast.
21356                                                              (line   6)
21357* Coarray, _gfortran_caf_co_max:         _gfortran_caf_co_max.
21358                                                              (line   6)
21359* Coarray, _gfortran_caf_co_min:         _gfortran_caf_co_min.
21360                                                              (line   6)
21361* Coarray, _gfortran_caf_co_reduce:      _gfortran_caf_co_reduce.
21362                                                              (line   6)
21363* Coarray, _gfortran_caf_co_sum:         _gfortran_caf_co_sum.
21364                                                              (line   6)
21365* Coarray, _gfortran_caf_deregister:     _gfortran_caf_deregister.
21366                                                              (line   6)
21367* Coarray, _gfortran_caf_error_stop:     _gfortran_caf_error_stop.
21368                                                              (line   6)
21369* Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
21370                                                              (line   6)
21371* Coarray, _gfortran_caf_event_post:     _gfortran_caf_event_post.
21372                                                              (line   6)
21373* Coarray, _gfortran_caf_event_query:    _gfortran_caf_event_query.
21374                                                              (line   6)
21375* Coarray, _gfortran_caf_event_wait:     _gfortran_caf_event_wait.
21376                                                              (line   6)
21377* Coarray, _gfortran_caf_failed_images:  _gfortran_caf_failed_images.
21378                                                              (line   6)
21379* Coarray, _gfortran_caf_fail_image:     _gfortran_caf_fail_image.
21380                                                              (line   6)
21381* Coarray, _gfortran_caf_finish:         _gfortran_caf_finish.
21382                                                              (line   6)
21383* Coarray, _gfortran_caf_get:            _gfortran_caf_get.   (line   6)
21384* Coarray, _gfortran_caf_get_by_ref:     _gfortran_caf_get_by_ref.
21385                                                              (line   6)
21386* Coarray, _gfortran_caf_image_status:   _gfortran_caf_image_status.
21387                                                              (line   6)
21388* Coarray, _gfortran_caf_init:           _gfortran_caf_init.  (line   6)
21389* Coarray, _gfortran_caf_is_present:     _gfortran_caf_is_present.
21390                                                              (line   6)
21391* Coarray, _gfortran_caf_lock:           _gfortran_caf_lock.  (line   6)
21392* Coarray, _gfortran_caf_num_images:     _gfortran_caf_num_images.
21393                                                              (line   6)
21394* Coarray, _gfortran_caf_register:       _gfortran_caf_register.
21395                                                              (line   6)
21396* Coarray, _gfortran_caf_send:           _gfortran_caf_send.  (line   6)
21397* Coarray, _gfortran_caf_sendget:        _gfortran_caf_sendget.
21398                                                              (line   6)
21399* Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref.
21400                                                              (line   6)
21401* Coarray, _gfortran_caf_send_by_ref:    _gfortran_caf_send_by_ref.
21402                                                              (line   6)
21403* Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images.
21404                                                              (line   6)
21405* Coarray, _gfortran_caf_sync_all:       _gfortran_caf_sync_all.
21406                                                              (line   6)
21407* Coarray, _gfortran_caf_sync_images:    _gfortran_caf_sync_images.
21408                                                              (line   6)
21409* Coarray, _gfortran_caf_sync_memory:    _gfortran_caf_sync_memory.
21410                                                              (line   6)
21411* Coarray, _gfortran_caf_this_image:     _gfortran_caf_this_image.
21412                                                              (line   6)
21413* Coarray, _gfortran_caf_unlock:         _gfortran_caf_unlock.
21414                                                              (line   6)
21415* coarrays:                              Code Gen Options.    (line 127)
21416* Coarrays:                              Coarray Programming. (line   6)
21417* code generation, conventions:          Code Gen Options.    (line   6)
21418* collating sequence, ASCII:             ACHAR.               (line   6)
21419* collating sequence, ASCII <1>:         IACHAR.              (line   6)
21420* Collectives, generic reduction:        CO_REDUCE.           (line   6)
21421* Collectives, maximal value:            CO_MAX.              (line   6)
21422* Collectives, minimal value:            CO_MIN.              (line   6)
21423* Collectives, sum of values:            CO_SUM.              (line   6)
21424* Collectives, value broadcasting:       CO_BROADCAST.        (line   6)
21425* command line:                          EXECUTE_COMMAND_LINE.
21426                                                              (line   6)
21427* command options:                       Invoking GNU Fortran.
21428                                                              (line   6)
21429* command-line arguments:                COMMAND_ARGUMENT_COUNT.
21430                                                              (line   6)
21431* command-line arguments <1>:            GETARG.              (line   6)
21432* command-line arguments <2>:            GET_COMMAND.         (line   6)
21433* command-line arguments <3>:            GET_COMMAND_ARGUMENT.
21434                                                              (line   6)
21435* command-line arguments <4>:            IARGC.               (line   6)
21436* command-line arguments, number of:     COMMAND_ARGUMENT_COUNT.
21437                                                              (line   6)
21438* command-line arguments, number of <1>: IARGC.               (line   6)
21439* COMMAND_ARGUMENT_COUNT:                COMMAND_ARGUMENT_COUNT.
21440                                                              (line   6)
21441* COMMON:                                Volatile COMMON blocks.
21442                                                              (line   6)
21443* compiler flags inquiry function:       COMPILER_OPTIONS.    (line   6)
21444* compiler, name and version:            COMPILER_VERSION.    (line   6)
21445* COMPILER_OPTIONS:                      COMPILER_OPTIONS.    (line   6)
21446* COMPILER_VERSION:                      COMPILER_VERSION.    (line   6)
21447* COMPLEX:                               COMPLEX.             (line   6)
21448* complex conjugate:                     CONJG.               (line   6)
21449* Complex function:                      Alternate complex function syntax.
21450                                                              (line   6)
21451* complex numbers, conversion to:        CMPLX.               (line   6)
21452* complex numbers, conversion to <1>:    COMPLEX.             (line   6)
21453* complex numbers, conversion to <2>:    DCMPLX.              (line   6)
21454* complex numbers, imaginary part:       AIMAG.               (line   6)
21455* complex numbers, real part:            DREAL.               (line   6)
21456* complex numbers, real part <1>:        REAL.                (line   6)
21457* Conditional compilation:               Preprocessing and conditional compilation.
21458                                                              (line   6)
21459* CONJG:                                 CONJG.               (line   6)
21460* consistency, durability:               Data consistency and durability.
21461                                                              (line   6)
21462* Contributing:                          Contributing.        (line   6)
21463* Contributors:                          Contributors.        (line   6)
21464* conversion:                            Error and Warning Options.
21465                                                              (line 122)
21466* conversion <1>:                        Error and Warning Options.
21467                                                              (line 126)
21468* conversion, to character:              CHAR.                (line   6)
21469* conversion, to complex:                CMPLX.               (line   6)
21470* conversion, to complex <1>:            COMPLEX.             (line   6)
21471* conversion, to complex <2>:            DCMPLX.              (line   6)
21472* conversion, to integer:                Implicitly convert LOGICAL and INTEGER values.
21473                                                              (line   6)
21474* conversion, to integer <1>:            IACHAR.              (line   6)
21475* conversion, to integer <2>:            ICHAR.               (line   6)
21476* conversion, to integer <3>:            INT.                 (line   6)
21477* conversion, to integer <4>:            INT2.                (line   6)
21478* conversion, to integer <5>:            INT8.                (line   6)
21479* conversion, to integer <6>:            LONG.                (line   6)
21480* conversion, to logical:                Implicitly convert LOGICAL and INTEGER values.
21481                                                              (line   6)
21482* conversion, to logical <1>:            LOGICAL.             (line   6)
21483* conversion, to real:                   DBLE.                (line   6)
21484* conversion, to real <1>:               REAL.                (line   6)
21485* conversion, to string:                 CTIME.               (line   6)
21486* CONVERT specifier:                     CONVERT specifier.   (line   6)
21487* core, dump:                            ABORT.               (line   6)
21488* COS:                                   COS.                 (line   6)
21489* COSD:                                  COSD.                (line   6)
21490* COSH:                                  COSH.                (line   6)
21491* cosine:                                COS.                 (line   6)
21492* cosine, degrees:                       COSD.                (line   6)
21493* cosine, hyperbolic:                    COSH.                (line   6)
21494* cosine, hyperbolic, inverse:           ACOSH.               (line   6)
21495* cosine, inverse:                       ACOS.                (line   6)
21496* cosine, inverse, degrees:              ACOSD.               (line   6)
21497* COTAN:                                 COTAN.               (line   6)
21498* COTAND:                                COTAND.              (line   6)
21499* cotangent:                             COTAN.               (line   6)
21500* cotangent, degrees:                    COTAND.              (line   6)
21501* COUNT:                                 COUNT.               (line   6)
21502* CO_BROADCAST:                          CO_BROADCAST.        (line   6)
21503* CO_MAX:                                CO_MAX.              (line   6)
21504* CO_MIN:                                CO_MIN.              (line   6)
21505* CO_REDUCE:                             CO_REDUCE.           (line   6)
21506* CO_SUM:                                CO_SUM.              (line   6)
21507* CPP:                                   Preprocessing and conditional compilation.
21508                                                              (line   6)
21509* CPP <1>:                               Preprocessing Options.
21510                                                              (line   6)
21511* CPU_TIME:                              CPU_TIME.            (line   6)
21512* Credits:                               Contributors.        (line   6)
21513* CSHIFT:                                CSHIFT.              (line   6)
21514* CSIN:                                  SIN.                 (line   6)
21515* CSIND:                                 SIND.                (line   6)
21516* CSQRT:                                 SQRT.                (line   6)
21517* CTIME:                                 CTIME.               (line   6)
21518* current date:                          DATE_AND_TIME.       (line   6)
21519* current date <1>:                      FDATE.               (line   6)
21520* current date <2>:                      IDATE.               (line   6)
21521* current time:                          DATE_AND_TIME.       (line   6)
21522* current time <1>:                      FDATE.               (line   6)
21523* current time <2>:                      ITIME.               (line   6)
21524* current time <3>:                      TIME.                (line   6)
21525* current time <4>:                      TIME8.               (line   6)
21526* C_ASSOCIATED:                          C_ASSOCIATED.        (line   6)
21527* C_FUNLOC:                              C_FUNLOC.            (line   6)
21528* C_F_POINTER:                           C_F_POINTER.         (line   6)
21529* C_F_PROCPOINTER:                       C_F_PROCPOINTER.     (line   6)
21530* C_LOC:                                 C_LOC.               (line   6)
21531* C_SIZEOF:                              C_SIZEOF.            (line   6)
21532* DABS:                                  ABS.                 (line   6)
21533* DACOS:                                 ACOS.                (line   6)
21534* DACOSD:                                ACOSD.               (line   6)
21535* DACOSH:                                ACOSH.               (line   6)
21536* DASIN:                                 ASIN.                (line   6)
21537* DASIND:                                ASIND.               (line   6)
21538* DASINH:                                ASINH.               (line   6)
21539* DATAN:                                 ATAN.                (line   6)
21540* DATAN2:                                ATAN2.               (line   6)
21541* DATAN2D:                               ATAN2D.              (line   6)
21542* DATAND:                                ATAND.               (line   6)
21543* DATANH:                                ATANH.               (line   6)
21544* date, current:                         DATE_AND_TIME.       (line   6)
21545* date, current <1>:                     FDATE.               (line   6)
21546* date, current <2>:                     IDATE.               (line   6)
21547* DATE_AND_TIME:                         DATE_AND_TIME.       (line   6)
21548* DBESJ0:                                BESSEL_J0.           (line   6)
21549* DBESJ1:                                BESSEL_J1.           (line   6)
21550* DBESJN:                                BESSEL_JN.           (line   6)
21551* DBESY0:                                BESSEL_Y0.           (line   6)
21552* DBESY1:                                BESSEL_Y1.           (line   6)
21553* DBESYN:                                BESSEL_YN.           (line   6)
21554* DBLE:                                  DBLE.                (line   6)
21555* DCMPLX:                                DCMPLX.              (line   6)
21556* DCONJG:                                CONJG.               (line   6)
21557* DCOS:                                  COS.                 (line   6)
21558* DCOSD:                                 COSD.                (line   6)
21559* DCOSH:                                 COSH.                (line   6)
21560* DCOTAN:                                COTAN.               (line   6)
21561* DCOTAND:                               COTAND.              (line   6)
21562* DDIM:                                  DIM.                 (line   6)
21563* debugging information options:         Debugging Options.   (line   6)
21564* debugging, preprocessor:               Preprocessing Options.
21565                                                              (line  26)
21566* debugging, preprocessor <1>:           Preprocessing Options.
21567                                                              (line  35)
21568* debugging, preprocessor <2>:           Preprocessing Options.
21569                                                              (line  41)
21570* debugging, preprocessor <3>:           Preprocessing Options.
21571                                                              (line  44)
21572* debugging, preprocessor <4>:           Preprocessing Options.
21573                                                              (line  51)
21574* DECODE:                                ENCODE and DECODE statements.
21575                                                              (line   6)
21576* delayed execution:                     ALARM.               (line   6)
21577* delayed execution <1>:                 SLEEP.               (line   6)
21578* DEXP:                                  EXP.                 (line   6)
21579* DFLOAT:                                REAL.                (line   6)
21580* DGAMMA:                                GAMMA.               (line   6)
21581* dialect options:                       Fortran Dialect Options.
21582                                                              (line   6)
21583* DIGITS:                                DIGITS.              (line   6)
21584* DIM:                                   DIM.                 (line   6)
21585* DIMAG:                                 AIMAG.               (line   6)
21586* DINT:                                  AINT.                (line   6)
21587* directive, INCLUDE:                    Directory Options.   (line   6)
21588* directory, options:                    Directory Options.   (line   6)
21589* directory, search paths for inclusion: Directory Options.   (line  14)
21590* division, modulo:                      MODULO.              (line   6)
21591* division, remainder:                   MOD.                 (line   6)
21592* DLGAMA:                                LOG_GAMMA.           (line   6)
21593* DLOG:                                  LOG.                 (line   6)
21594* DLOG10:                                LOG10.               (line   6)
21595* DMAX1:                                 MAX.                 (line   6)
21596* DMIN1:                                 MIN.                 (line   6)
21597* DMOD:                                  MOD.                 (line   6)
21598* DNINT:                                 ANINT.               (line   6)
21599* dot product:                           DOT_PRODUCT.         (line   6)
21600* DOT_PRODUCT:                           DOT_PRODUCT.         (line   6)
21601* DPROD:                                 DPROD.               (line   6)
21602* DREAL:                                 DREAL.               (line   6)
21603* DSHIFTL:                               DSHIFTL.             (line   6)
21604* DSHIFTR:                               DSHIFTR.             (line   6)
21605* DSIGN:                                 SIGN.                (line   6)
21606* DSIN:                                  SIN.                 (line   6)
21607* DSIND:                                 SIND.                (line   6)
21608* DSINH:                                 SINH.                (line   6)
21609* DSQRT:                                 SQRT.                (line   6)
21610* DTAN:                                  TAN.                 (line   6)
21611* DTAND:                                 TAND.                (line   6)
21612* DTANH:                                 TANH.                (line   6)
21613* DTIME:                                 DTIME.               (line   6)
21614* dummy argument, unused:                Error and Warning Options.
21615                                                              (line 215)
21616* elapsed time:                          DTIME.               (line   6)
21617* elapsed time <1>:                      SECNDS.              (line   6)
21618* elapsed time <2>:                      SECOND.              (line   6)
21619* Elimination of functions with identical argument lists: Code Gen Options.
21620                                                              (line 398)
21621* ENCODE:                                ENCODE and DECODE statements.
21622                                                              (line   6)
21623* ENUM statement:                        Fortran 2003 status. (line  93)
21624* ENUMERATOR statement:                  Fortran 2003 status. (line  93)
21625* environment variable:                  Environment Variables.
21626                                                              (line   6)
21627* environment variable <1>:              Runtime.             (line   6)
21628* environment variable <2>:              GETENV.              (line   6)
21629* environment variable <3>:              GET_ENVIRONMENT_VARIABLE.
21630                                                              (line   6)
21631* EOF:                                   Read/Write after EOF marker.
21632                                                              (line   6)
21633* EOSHIFT:                               EOSHIFT.             (line   6)
21634* EPSILON:                               EPSILON.             (line   6)
21635* ERF:                                   ERF.                 (line   6)
21636* ERFC:                                  ERFC.                (line   6)
21637* ERFC_SCALED:                           ERFC_SCALED.         (line   6)
21638* error function:                        ERF.                 (line   6)
21639* error function, complementary:         ERFC.                (line   6)
21640* error function, complementary, exponentially-scaled: ERFC_SCALED.
21641                                                              (line   6)
21642* errors, limiting:                      Error and Warning Options.
21643                                                              (line  27)
21644* escape characters:                     Fortran Dialect Options.
21645                                                              (line  74)
21646* ETIME:                                 ETIME.               (line   6)
21647* Euclidean distance:                    HYPOT.               (line   6)
21648* Euclidean vector norm:                 NORM2.               (line   6)
21649* Events, EVENT_QUERY:                   EVENT_QUERY.         (line   6)
21650* EVENT_QUERY:                           EVENT_QUERY.         (line   6)
21651* EXECUTE_COMMAND_LINE:                  EXECUTE_COMMAND_LINE.
21652                                                              (line   6)
21653* EXIT:                                  EXIT.                (line   6)
21654* EXP:                                   EXP.                 (line   6)
21655* EXPONENT:                              EXPONENT.            (line   6)
21656* exponent:                              Default exponents.   (line   6)
21657* exponential function:                  EXP.                 (line   6)
21658* exponential function, inverse:         LOG.                 (line   6)
21659* exponential function, inverse <1>:     LOG10.               (line   6)
21660* expression size:                       C_SIZEOF.            (line   6)
21661* expression size <1>:                   SIZEOF.              (line   6)
21662* EXTENDS_TYPE_OF:                       EXTENDS_TYPE_OF.     (line   6)
21663* extensions:                            Extensions.          (line   6)
21664* extensions, implemented:               Extensions implemented in GNU Fortran.
21665                                                              (line   6)
21666* extensions, not implemented:           Extensions not implemented in GNU Fortran.
21667                                                              (line   6)
21668* extra warnings:                        Error and Warning Options.
21669                                                              (line 130)
21670* f2c calling convention:                Code Gen Options.    (line  25)
21671* f2c calling convention <1>:            Code Gen Options.    (line 110)
21672* Factorial function:                    GAMMA.               (line   6)
21673* FDATE:                                 FDATE.               (line   6)
21674* FDL, GNU Free Documentation License:   GNU Free Documentation License.
21675                                                              (line   6)
21676* FGET:                                  FGET.                (line   6)
21677* FGETC:                                 FGETC.               (line   6)
21678* file format, fixed:                    Fortran Dialect Options.
21679                                                              (line  11)
21680* file format, fixed <1>:                Fortran Dialect Options.
21681                                                              (line  91)
21682* file format, free:                     Fortran Dialect Options.
21683                                                              (line  11)
21684* file format, free <1>:                 Fortran Dialect Options.
21685                                                              (line 104)
21686* file operation, file number:           FNUM.                (line   6)
21687* file operation, flush:                 FLUSH.               (line   6)
21688* file operation, position:              FSEEK.               (line   6)
21689* file operation, position <1>:          FTELL.               (line   6)
21690* file operation, read character:        FGET.                (line   6)
21691* file operation, read character <1>:    FGETC.               (line   6)
21692* file operation, seek:                  FSEEK.               (line   6)
21693* file operation, write character:       FPUT.                (line   6)
21694* file operation, write character <1>:   FPUTC.               (line   6)
21695* file system, access mode:              ACCESS.              (line   6)
21696* file system, change access mode:       CHMOD.               (line   6)
21697* file system, create link:              LINK.                (line   6)
21698* file system, create link <1>:          SYMLNK.              (line   6)
21699* file system, file creation mask:       UMASK.               (line   6)
21700* file system, file status:              FSTAT.               (line   6)
21701* file system, file status <1>:          LSTAT.               (line   6)
21702* file system, file status <2>:          STAT.                (line   6)
21703* file system, hard link:                LINK.                (line   6)
21704* file system, remove file:              UNLINK.              (line   6)
21705* file system, rename file:              RENAME.              (line   6)
21706* file system, soft link:                SYMLNK.              (line   6)
21707* file, symbolic link:                   File operations on symbolic links.
21708                                                              (line   6)
21709* file, unformatted sequential:          File format of unformatted sequential files.
21710                                                              (line   6)
21711* flags inquiry function:                COMPILER_OPTIONS.    (line   6)
21712* FLOAT:                                 REAL.                (line   6)
21713* FLOATI:                                REAL.                (line   6)
21714* floating point, exponent:              EXPONENT.            (line   6)
21715* floating point, fraction:              FRACTION.            (line   6)
21716* floating point, nearest different:     NEAREST.             (line   6)
21717* floating point, relative spacing:      RRSPACING.           (line   6)
21718* floating point, relative spacing <1>:  SPACING.             (line   6)
21719* floating point, scale:                 SCALE.               (line   6)
21720* floating point, set exponent:          SET_EXPONENT.        (line   6)
21721* FLOATJ:                                REAL.                (line   6)
21722* FLOATK:                                REAL.                (line   6)
21723* FLOOR:                                 FLOOR.               (line   6)
21724* floor:                                 AINT.                (line   6)
21725* floor <1>:                             FLOOR.               (line   6)
21726* FLUSH:                                 FLUSH.               (line   6)
21727* FLUSH statement:                       Fortran 2003 status. (line  89)
21728* FNUM:                                  FNUM.                (line   6)
21729* form feed whitespace:                  Form feed as whitespace.
21730                                                              (line   6)
21731* FORMAT:                                Variable FORMAT expressions.
21732                                                              (line   6)
21733* Fortran 77:                            GNU Fortran and G77. (line   6)
21734* FPP:                                   Preprocessing and conditional compilation.
21735                                                              (line   6)
21736* FPUT:                                  FPUT.                (line   6)
21737* FPUTC:                                 FPUTC.               (line   6)
21738* FRACTION:                              FRACTION.            (line   6)
21739* FREE:                                  FREE.                (line   6)
21740* Front-end optimization:                Code Gen Options.    (line 406)
21741* FSEEK:                                 FSEEK.               (line   6)
21742* FSTAT:                                 FSTAT.               (line   6)
21743* FTELL:                                 FTELL.               (line   6)
21744* function elimination:                  Error and Warning Options.
21745                                                              (line 232)
21746* g77:                                   GNU Fortran and G77. (line   6)
21747* g77 calling convention:                Code Gen Options.    (line  25)
21748* g77 calling convention <1>:            Code Gen Options.    (line 110)
21749* GAMMA:                                 GAMMA.               (line   6)
21750* Gamma function:                        GAMMA.               (line   6)
21751* Gamma function, logarithm of:          LOG_GAMMA.           (line   6)
21752* GCC:                                   GNU Fortran and GCC. (line   6)
21753* Generating C prototypes from Fortran source code: Interoperability Options.
21754                                                              (line   7)
21755* GERROR:                                GERROR.              (line   6)
21756* GETARG:                                GETARG.              (line   6)
21757* GETCWD:                                GETCWD.              (line   6)
21758* GETENV:                                GETENV.              (line   6)
21759* GETGID:                                GETGID.              (line   6)
21760* GETLOG:                                GETLOG.              (line   6)
21761* GETPID:                                GETPID.              (line   6)
21762* GETUID:                                GETUID.              (line   6)
21763* GET_COMMAND:                           GET_COMMAND.         (line   6)
21764* GET_COMMAND_ARGUMENT:                  GET_COMMAND_ARGUMENT.
21765                                                              (line   6)
21766* GET_ENVIRONMENT_VARIABLE:              GET_ENVIRONMENT_VARIABLE.
21767                                                              (line   6)
21768* GMTIME:                                GMTIME.              (line   6)
21769* GNU Compiler Collection:               GNU Fortran and GCC. (line   6)
21770* GNU Fortran command options:           Invoking GNU Fortran.
21771                                                              (line   6)
21772* Hollerith constants:                   Hollerith constants support.
21773                                                              (line   6)
21774* HOSTNM:                                HOSTNM.              (line   6)
21775* HUGE:                                  HUGE.                (line   6)
21776* hyperbolic cosine:                     COSH.                (line   6)
21777* hyperbolic function, cosine:           COSH.                (line   6)
21778* hyperbolic function, cosine, inverse:  ACOSH.               (line   6)
21779* hyperbolic function, sine:             SINH.                (line   6)
21780* hyperbolic function, sine, inverse:    ASINH.               (line   6)
21781* hyperbolic function, tangent:          TANH.                (line   6)
21782* hyperbolic function, tangent, inverse: ATANH.               (line   6)
21783* hyperbolic sine:                       SINH.                (line   6)
21784* hyperbolic tangent:                    TANH.                (line   6)
21785* HYPOT:                                 HYPOT.               (line   6)
21786* I/O item lists:                        I/O item lists.      (line   6)
21787* I/O specifiers:                        Extended I/O specifiers.
21788                                                              (line   6)
21789* IABS:                                  ABS.                 (line   6)
21790* IACHAR:                                IACHAR.              (line   6)
21791* IALL:                                  IALL.                (line   6)
21792* IAND:                                  IAND.                (line   6)
21793* IANY:                                  IANY.                (line   6)
21794* IARGC:                                 IARGC.               (line   6)
21795* IBCLR:                                 IBCLR.               (line   6)
21796* IBITS:                                 IBITS.               (line   6)
21797* IBSET:                                 IBSET.               (line   6)
21798* ICHAR:                                 ICHAR.               (line   6)
21799* IDATE:                                 IDATE.               (line   6)
21800* IDIM:                                  DIM.                 (line   6)
21801* IDINT:                                 INT.                 (line   6)
21802* IDNINT:                                NINT.                (line   6)
21803* IEEE, ISNAN:                           ISNAN.               (line   6)
21804* IEOR:                                  IEOR.                (line   6)
21805* IERRNO:                                IERRNO.              (line   6)
21806* IFIX:                                  INT.                 (line   6)
21807* IIABS:                                 ABS.                 (line   6)
21808* IIAND:                                 IAND.                (line   6)
21809* IIBCLR:                                IBCLR.               (line   6)
21810* IIBITS:                                IBITS.               (line   6)
21811* IIBSET:                                IBSET.               (line   6)
21812* IIEOR:                                 IEOR.                (line   6)
21813* IIOR:                                  IOR.                 (line   6)
21814* IISHFT:                                ISHFT.               (line   6)
21815* IISHFTC:                               ISHFTC.              (line   6)
21816* IMAG:                                  AIMAG.               (line   6)
21817* images, cosubscript to image index conversion: IMAGE_INDEX. (line   6)
21818* images, index of this image:           THIS_IMAGE.          (line   6)
21819* images, number of:                     NUM_IMAGES.          (line   6)
21820* IMAGE_INDEX:                           IMAGE_INDEX.         (line   6)
21821* IMAGPART:                              AIMAG.               (line   6)
21822* IMOD:                                  MOD.                 (line   6)
21823* IMPORT statement:                      Fortran 2003 status. (line 120)
21824* IMVBITS:                               MVBITS.              (line   6)
21825* INCLUDE directive:                     Directory Options.   (line   6)
21826* inclusion, directory search paths for: Directory Options.   (line  14)
21827* INDEX:                                 INDEX intrinsic.     (line   6)
21828* INOT:                                  NOT.                 (line   6)
21829* INT:                                   INT.                 (line   6)
21830* INT2:                                  INT2.                (line   6)
21831* INT8:                                  INT8.                (line   6)
21832* integer kind:                          SELECTED_INT_KIND.   (line   6)
21833* Interoperability:                      Mixed-Language Programming.
21834                                                              (line   6)
21835* intrinsic:                             Error and Warning Options.
21836                                                              (line 204)
21837* intrinsic <1>:                         Error and Warning Options.
21838                                                              (line 211)
21839* intrinsic Modules:                     Intrinsic Modules.   (line   6)
21840* intrinsic procedures:                  Intrinsic Procedures.
21841                                                              (line   6)
21842* intrinsics, integer:                   Type variants for integer intrinsics.
21843                                                              (line   6)
21844* intrinsics, math:                      Extended math intrinsics.
21845                                                              (line   6)
21846* intrinsics, trigonometric functions:   Extended math intrinsics.
21847                                                              (line   6)
21848* Introduction:                          Top.                 (line   6)
21849* inverse hyperbolic cosine:             ACOSH.               (line   6)
21850* inverse hyperbolic sine:               ASINH.               (line   6)
21851* inverse hyperbolic tangent:            ATANH.               (line   6)
21852* IOMSG= specifier:                      Fortran 2003 status. (line  91)
21853* IOR:                                   IOR.                 (line   6)
21854* IOSTAT, end of file:                   IS_IOSTAT_END.       (line   6)
21855* IOSTAT, end of record:                 IS_IOSTAT_EOR.       (line   6)
21856* IPARITY:                               IPARITY.             (line   6)
21857* IRAND:                                 IRAND.               (line   6)
21858* ISATTY:                                ISATTY.              (line   6)
21859* ISHFT:                                 ISHFT.               (line   6)
21860* ISHFTC:                                ISHFTC.              (line   6)
21861* ISIGN:                                 SIGN.                (line   6)
21862* ISNAN:                                 ISNAN.               (line   6)
21863* ISO_FORTRAN_ENV statement:             Fortran 2003 status. (line 128)
21864* IS_IOSTAT_END:                         IS_IOSTAT_END.       (line   6)
21865* IS_IOSTAT_EOR:                         IS_IOSTAT_EOR.       (line   6)
21866* ITIME:                                 ITIME.               (line   6)
21867* JIABS:                                 ABS.                 (line   6)
21868* JIAND:                                 IAND.                (line   6)
21869* JIBCLR:                                IBCLR.               (line   6)
21870* JIBITS:                                IBITS.               (line   6)
21871* JIBSET:                                IBSET.               (line   6)
21872* JIEOR:                                 IEOR.                (line   6)
21873* JIOR:                                  IOR.                 (line   6)
21874* JISHFT:                                ISHFT.               (line   6)
21875* JISHFTC:                               ISHFTC.              (line   6)
21876* JMOD:                                  MOD.                 (line   6)
21877* JMVBITS:                               MVBITS.              (line   6)
21878* JNOT:                                  NOT.                 (line   6)
21879* KIABS:                                 ABS.                 (line   6)
21880* KIAND:                                 IAND.                (line   6)
21881* KIBCLR:                                IBCLR.               (line   6)
21882* KIBITS:                                IBITS.               (line   6)
21883* KIBSET:                                IBSET.               (line   6)
21884* KIEOR:                                 IEOR.                (line   6)
21885* KILL:                                  KILL.                (line   6)
21886* kind:                                  KIND Type Parameters.
21887                                                              (line   6)
21888* KIND:                                  KIND.                (line   6)
21889* kind <1>:                              KIND.                (line   6)
21890* kind, character:                       SELECTED_CHAR_KIND.  (line   6)
21891* kind, integer:                         SELECTED_INT_KIND.   (line   6)
21892* kind, old-style:                       Old-style kind specifications.
21893                                                              (line   6)
21894* kind, real:                            SELECTED_REAL_KIND.  (line   6)
21895* KIOR:                                  IOR.                 (line   6)
21896* KISHFT:                                ISHFT.               (line   6)
21897* KISHFTC:                               ISHFTC.              (line   6)
21898* KMOD:                                  MOD.                 (line   6)
21899* KMVBITS:                               MVBITS.              (line   6)
21900* KNOT:                                  NOT.                 (line   6)
21901* L2 vector norm:                        NORM2.               (line   6)
21902* language, dialect options:             Fortran Dialect Options.
21903                                                              (line   6)
21904* LBOUND:                                LBOUND.              (line   6)
21905* LCOBOUND:                              LCOBOUND.            (line   6)
21906* LEADZ:                                 LEADZ.               (line   6)
21907* left shift, combined:                  DSHIFTL.             (line   6)
21908* LEN:                                   LEN.                 (line   6)
21909* LEN_TRIM:                              LEN_TRIM.            (line   6)
21910* lexical comparison of strings:         LGE.                 (line   6)
21911* lexical comparison of strings <1>:     LGT.                 (line   6)
21912* lexical comparison of strings <2>:     LLE.                 (line   6)
21913* lexical comparison of strings <3>:     LLT.                 (line   6)
21914* LGAMMA:                                LOG_GAMMA.           (line   6)
21915* LGE:                                   LGE.                 (line   6)
21916* LGT:                                   LGT.                 (line   6)
21917* libf2c calling convention:             Code Gen Options.    (line  25)
21918* libf2c calling convention <1>:         Code Gen Options.    (line 110)
21919* libgfortran initialization, set_args:  _gfortran_set_args.  (line   6)
21920* libgfortran initialization, set_convert: _gfortran_set_convert.
21921                                                              (line   6)
21922* libgfortran initialization, set_fpe:   _gfortran_set_fpe.   (line   6)
21923* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
21924                                                              (line   6)
21925* libgfortran initialization, set_options: _gfortran_set_options.
21926                                                              (line   6)
21927* libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
21928                                                              (line   6)
21929* limits, largest number:                HUGE.                (line   6)
21930* limits, smallest number:               TINY.                (line   6)
21931* LINK:                                  LINK.                (line   6)
21932* linking, static:                       Link Options.        (line   6)
21933* LLE:                                   LLE.                 (line   6)
21934* LLT:                                   LLT.                 (line   6)
21935* LNBLNK:                                LNBLNK.              (line   6)
21936* LOC:                                   %LOC as an rvalue.   (line   6)
21937* LOC <1>:                               LOC.                 (line   6)
21938* location of a variable in memory:      LOC.                 (line   6)
21939* LOG:                                   LOG.                 (line   6)
21940* LOG10:                                 LOG10.               (line   6)
21941* logarithm function:                    LOG.                 (line   6)
21942* logarithm function with base 10:       LOG10.               (line   6)
21943* logarithm function, inverse:           EXP.                 (line   6)
21944* LOGICAL:                               LOGICAL.             (line   6)
21945* logical and, bitwise:                  AND.                 (line   6)
21946* logical and, bitwise <1>:              IAND.                (line   6)
21947* logical exclusive or, bitwise:         IEOR.                (line   6)
21948* logical exclusive or, bitwise <1>:     XOR.                 (line   6)
21949* logical not, bitwise:                  NOT.                 (line   6)
21950* logical or, bitwise:                   IOR.                 (line   6)
21951* logical or, bitwise <1>:               OR.                  (line   6)
21952* logical, bitwise:                      Bitwise logical operators.
21953                                                              (line   6)
21954* logical, variable representation:      Internal representation of LOGICAL variables.
21955                                                              (line   6)
21956* login name:                            GETLOG.              (line   6)
21957* LOG_GAMMA:                             LOG_GAMMA.           (line   6)
21958* LONG:                                  LONG.                (line   6)
21959* loop interchange, Fortran:             Code Gen Options.    (line 415)
21960* loop interchange, warning:             Error and Warning Options.
21961                                                              (line 135)
21962* LSHIFT:                                LSHIFT.              (line   6)
21963* LSTAT:                                 LSTAT.               (line   6)
21964* LTIME:                                 LTIME.               (line   6)
21965* MALLOC:                                MALLOC.              (line   6)
21966* MAP:                                   UNION and MAP.       (line   6)
21967* mask, left justified:                  MASKL.               (line   6)
21968* mask, right justified:                 MASKR.               (line   6)
21969* MASKL:                                 MASKL.               (line   6)
21970* MASKR:                                 MASKR.               (line   6)
21971* MATMUL:                                MATMUL.              (line   6)
21972* matrix multiplication:                 MATMUL.              (line   6)
21973* matrix, transpose:                     TRANSPOSE.           (line   6)
21974* MAX:                                   MAX.                 (line   6)
21975* MAX0:                                  MAX.                 (line   6)
21976* MAX1:                                  MAX.                 (line   6)
21977* MAXEXPONENT:                           MAXEXPONENT.         (line   6)
21978* maximum value:                         MAX.                 (line   6)
21979* maximum value <1>:                     MAXVAL.              (line   6)
21980* MAXLOC:                                MAXLOC.              (line   6)
21981* MAXVAL:                                MAXVAL.              (line   6)
21982* MCLOCK:                                MCLOCK.              (line   6)
21983* MCLOCK8:                               MCLOCK8.             (line   6)
21984* memory checking:                       Code Gen Options.    (line 141)
21985* MERGE:                                 MERGE.               (line   6)
21986* MERGE_BITS:                            MERGE_BITS.          (line   6)
21987* messages, error:                       Error and Warning Options.
21988                                                              (line   6)
21989* messages, warning:                     Error and Warning Options.
21990                                                              (line   6)
21991* MIN:                                   MIN.                 (line   6)
21992* MIN0:                                  MIN.                 (line   6)
21993* MIN1:                                  MIN.                 (line   6)
21994* MINEXPONENT:                           MINEXPONENT.         (line   6)
21995* minimum value:                         MIN.                 (line   6)
21996* minimum value <1>:                     MINVAL.              (line   6)
21997* MINLOC:                                MINLOC.              (line   6)
21998* MINVAL:                                MINVAL.              (line   6)
21999* Mixed-language programming:            Mixed-Language Programming.
22000                                                              (line   6)
22001* MOD:                                   MOD.                 (line   6)
22002* model representation, base:            RADIX.               (line   6)
22003* model representation, epsilon:         EPSILON.             (line   6)
22004* model representation, largest number:  HUGE.                (line   6)
22005* model representation, maximum exponent: MAXEXPONENT.        (line   6)
22006* model representation, minimum exponent: MINEXPONENT.        (line   6)
22007* model representation, precision:       PRECISION.           (line   6)
22008* model representation, radix:           RADIX.               (line   6)
22009* model representation, range:           RANGE.               (line   6)
22010* model representation, significant digits: DIGITS.           (line   6)
22011* model representation, smallest number: TINY.                (line   6)
22012* module entities:                       Fortran Dialect Options.
22013                                                              (line  86)
22014* module search path:                    Directory Options.   (line  14)
22015* module search path <1>:                Directory Options.   (line  29)
22016* module search path <2>:                Directory Options.   (line  36)
22017* MODULO:                                MODULO.              (line   6)
22018* modulo:                                MODULO.              (line   6)
22019* MOVE_ALLOC:                            MOVE_ALLOC.          (line   6)
22020* moving allocation:                     MOVE_ALLOC.          (line   6)
22021* multiply array elements:               PRODUCT.             (line   6)
22022* MVBITS:                                MVBITS.              (line   6)
22023* NAM:                                   OPEN( ... NAME=).    (line   6)
22024* Namelist:                              Extensions to namelist.
22025                                                              (line   6)
22026* natural logarithm function:            LOG.                 (line   6)
22027* NEAREST:                               NEAREST.             (line   6)
22028* newline:                               NEW_LINE.            (line   6)
22029* NEW_LINE:                              NEW_LINE.            (line   6)
22030* NINT:                                  NINT.                (line   6)
22031* norm, Euclidean:                       NORM2.               (line   6)
22032* NORM2:                                 NORM2.               (line   6)
22033* NOSHARED:                              Extended I/O specifiers.
22034                                                              (line   6)
22035* NOT:                                   NOT.                 (line   6)
22036* NULL:                                  NULL.                (line   6)
22037* NUM_IMAGES:                            NUM_IMAGES.          (line   6)
22038* open, action:                          Files opened without an explicit ACTION= specifier.
22039                                                              (line   6)
22040* OpenACC:                               Fortran Dialect Options.
22041                                                              (line 124)
22042* OpenACC <1>:                           OpenACC.             (line   6)
22043* OpenMP:                                Fortran Dialect Options.
22044                                                              (line 135)
22045* OpenMP <1>:                            OpenMP.              (line   6)
22046* operators, unary:                      Unary operators.     (line   6)
22047* operators, xor:                        .XOR. operator.      (line   6)
22048* options inquiry function:              COMPILER_OPTIONS.    (line   6)
22049* options, code generation:              Code Gen Options.    (line   6)
22050* options, debugging:                    Debugging Options.   (line   6)
22051* options, dialect:                      Fortran Dialect Options.
22052                                                              (line   6)
22053* options, directory search:             Directory Options.   (line   6)
22054* options, errors:                       Error and Warning Options.
22055                                                              (line   6)
22056* options, Fortran dialect:              Fortran Dialect Options.
22057                                                              (line  11)
22058* options, gfortran command:             Invoking GNU Fortran.
22059                                                              (line   6)
22060* options, linking:                      Link Options.        (line   6)
22061* options, negative forms:               Invoking GNU Fortran.
22062                                                              (line  13)
22063* options, preprocessor:                 Preprocessing Options.
22064                                                              (line   6)
22065* options, real kind type promotion:     Fortran Dialect Options.
22066                                                              (line 209)
22067* options, run-time:                     Code Gen Options.    (line   6)
22068* options, runtime:                      Runtime Options.     (line   6)
22069* options, warnings:                     Error and Warning Options.
22070                                                              (line   6)
22071* OR:                                    OR.                  (line   6)
22072* output, newline:                       NEW_LINE.            (line   6)
22073* PACK:                                  PACK.                (line   6)
22074* PARAMETER:                             Legacy PARAMETER statements.
22075                                                              (line   6)
22076* PARITY:                                PARITY.              (line   6)
22077* Parity:                                PARITY.              (line   6)
22078* parity:                                POPPAR.              (line   6)
22079* paths, search:                         Directory Options.   (line  14)
22080* paths, search <1>:                     Directory Options.   (line  29)
22081* paths, search <2>:                     Directory Options.   (line  36)
22082* PERROR:                                PERROR.              (line   6)
22083* pointer checking:                      Code Gen Options.    (line 141)
22084* pointer, C address of pointers:        C_F_PROCPOINTER.     (line   6)
22085* pointer, C address of procedures:      C_FUNLOC.            (line   6)
22086* pointer, C association status:         C_ASSOCIATED.        (line   6)
22087* pointer, convert C to Fortran:         C_F_POINTER.         (line   6)
22088* pointer, Cray:                         Cray pointers.       (line   6)
22089* pointer, cray:                         FREE.                (line   6)
22090* pointer, cray <1>:                     MALLOC.              (line   6)
22091* pointer, disassociated:                NULL.                (line   6)
22092* pointer, status:                       ASSOCIATED.          (line   6)
22093* pointer, status <1>:                   NULL.                (line   6)
22094* POPCNT:                                POPCNT.              (line   6)
22095* POPPAR:                                POPPAR.              (line   6)
22096* positive difference:                   DIM.                 (line   6)
22097* PRECISION:                             PRECISION.           (line   6)
22098* Preprocessing:                         Preprocessing and conditional compilation.
22099                                                              (line   6)
22100* preprocessing, assertion:              Preprocessing Options.
22101                                                              (line 113)
22102* preprocessing, assertion <1>:          Preprocessing Options.
22103                                                              (line 119)
22104* preprocessing, define macros:          Preprocessing Options.
22105                                                              (line 151)
22106* preprocessing, define macros <1>:      Preprocessing Options.
22107                                                              (line 154)
22108* preprocessing, include path:           Preprocessing Options.
22109                                                              (line  69)
22110* preprocessing, include path <1>:       Preprocessing Options.
22111                                                              (line  76)
22112* preprocessing, include path <2>:       Preprocessing Options.
22113                                                              (line  80)
22114* preprocessing, include path <3>:       Preprocessing Options.
22115                                                              (line  85)
22116* preprocessing, include path <4>:       Preprocessing Options.
22117                                                              (line  89)
22118* preprocessing, include path <5>:       Preprocessing Options.
22119                                                              (line  96)
22120* preprocessing, keep comments:          Preprocessing Options.
22121                                                              (line 122)
22122* preprocessing, keep comments <1>:      Preprocessing Options.
22123                                                              (line 137)
22124* preprocessing, no linemarkers:         Preprocessing Options.
22125                                                              (line 179)
22126* preprocessing, undefine macros:        Preprocessing Options.
22127                                                              (line 185)
22128* preprocessor:                          Preprocessing Options.
22129                                                              (line   6)
22130* preprocessor, debugging:               Preprocessing Options.
22131                                                              (line  26)
22132* preprocessor, debugging <1>:           Preprocessing Options.
22133                                                              (line  35)
22134* preprocessor, debugging <2>:           Preprocessing Options.
22135                                                              (line  41)
22136* preprocessor, debugging <3>:           Preprocessing Options.
22137                                                              (line  44)
22138* preprocessor, debugging <4>:           Preprocessing Options.
22139                                                              (line  51)
22140* preprocessor, disable:                 Preprocessing Options.
22141                                                              (line  12)
22142* preprocessor, enable:                  Preprocessing Options.
22143                                                              (line  12)
22144* preprocessor, include file handling:   Preprocessing and conditional compilation.
22145                                                              (line   6)
22146* preprocessor, working directory:       Preprocessing Options.
22147                                                              (line  55)
22148* PRESENT:                               PRESENT.             (line   6)
22149* private:                               Fortran Dialect Options.
22150                                                              (line  86)
22151* procedure pointer, convert C to Fortran: C_LOC.             (line   6)
22152* process ID:                            GETPID.              (line   6)
22153* PRODUCT:                               PRODUCT.             (line   6)
22154* product, double-precision:             DPROD.               (line   6)
22155* product, matrix:                       MATMUL.              (line   6)
22156* product, vector:                       DOT_PRODUCT.         (line   6)
22157* program termination:                   EXIT.                (line   6)
22158* program termination, with core dump:   ABORT.               (line   6)
22159* PROTECTED statement:                   Fortran 2003 status. (line 114)
22160* Q exponent-letter:                     Q exponent-letter.   (line   6)
22161* RADIX:                                 RADIX.               (line   6)
22162* radix, real:                           SELECTED_REAL_KIND.  (line   6)
22163* RAN:                                   RAN.                 (line   6)
22164* RAND:                                  RAND.                (line   6)
22165* random number generation:              IRAND.               (line   6)
22166* random number generation <1>:          RAN.                 (line   6)
22167* random number generation <2>:          RAND.                (line   6)
22168* random number generation <3>:          RANDOM_NUMBER.       (line   6)
22169* random number generation, seeding:     RANDOM_SEED.         (line   6)
22170* random number generation, seeding <1>: SRAND.               (line   6)
22171* RANDOM_NUMBER:                         RANDOM_NUMBER.       (line   6)
22172* RANDOM_SEED:                           RANDOM_SEED.         (line   6)
22173* RANGE:                                 RANGE.               (line   6)
22174* range checking:                        Code Gen Options.    (line 141)
22175* RANK:                                  RANK.                (line   6)
22176* rank:                                  RANK.                (line   6)
22177* re-association of parenthesized expressions: Code Gen Options.
22178                                                              (line 383)
22179* read character, stream mode:           FGET.                (line   6)
22180* read character, stream mode <1>:       FGETC.               (line   6)
22181* READONLY:                              Extended I/O specifiers.
22182                                                              (line   6)
22183* REAL:                                  REAL.                (line   6)
22184* real kind:                             SELECTED_REAL_KIND.  (line   6)
22185* real number, exponent:                 EXPONENT.            (line   6)
22186* real number, fraction:                 FRACTION.            (line   6)
22187* real number, nearest different:        NEAREST.             (line   6)
22188* real number, relative spacing:         RRSPACING.           (line   6)
22189* real number, relative spacing <1>:     SPACING.             (line   6)
22190* real number, scale:                    SCALE.               (line   6)
22191* real number, set exponent:             SET_EXPONENT.        (line   6)
22192* Reallocate the LHS in assignments:     Code Gen Options.    (line 392)
22193* Reallocate the LHS in assignments, notification: Error and Warning Options.
22194                                                              (line 236)
22195* REALPART:                              REAL.                (line   6)
22196* RECORD:                                STRUCTURE and RECORD.
22197                                                              (line   6)
22198* record marker:                         File format of unformatted sequential files.
22199                                                              (line   6)
22200* Reduction, XOR:                        PARITY.              (line   6)
22201* remainder:                             MOD.                 (line   6)
22202* RENAME:                                RENAME.              (line   6)
22203* repacking arrays:                      Code Gen Options.    (line 281)
22204* REPEAT:                                REPEAT.              (line   6)
22205* RESHAPE:                               RESHAPE.             (line   6)
22206* REWIND:                                Read/Write after EOF marker.
22207                                                              (line   6)
22208* right shift, combined:                 DSHIFTR.             (line   6)
22209* root:                                  SQRT.                (line   6)
22210* rounding, ceiling:                     ANINT.               (line   6)
22211* rounding, ceiling <1>:                 CEILING.             (line   6)
22212* rounding, floor:                       AINT.                (line   6)
22213* rounding, floor <1>:                   FLOOR.               (line   6)
22214* rounding, nearest whole number:        NINT.                (line   6)
22215* RRSPACING:                             RRSPACING.           (line   6)
22216* RSHIFT:                                RSHIFT.              (line   6)
22217* run-time checking:                     Code Gen Options.    (line 141)
22218* SAME_TYPE_AS:                          SAME_TYPE_AS.        (line   6)
22219* SAVE statement:                        Code Gen Options.    (line  15)
22220* SCALE:                                 SCALE.               (line   6)
22221* SCAN:                                  SCAN.                (line   6)
22222* search path:                           Directory Options.   (line   6)
22223* search paths, for included files:      Directory Options.   (line  14)
22224* SECNDS:                                SECNDS.              (line   6)
22225* SECOND:                                SECOND.              (line   6)
22226* seeding a random number generator:     RANDOM_SEED.         (line   6)
22227* seeding a random number generator <1>: SRAND.               (line   6)
22228* SELECTED_CHAR_KIND:                    SELECTED_CHAR_KIND.  (line   6)
22229* SELECTED_INT_KIND:                     SELECTED_INT_KIND.   (line   6)
22230* SELECTED_REAL_KIND:                    SELECTED_REAL_KIND.  (line   6)
22231* sequential, unformatted:               File format of unformatted sequential files.
22232                                                              (line   6)
22233* SET_EXPONENT:                          SET_EXPONENT.        (line   6)
22234* SHAPE:                                 SHAPE.               (line   6)
22235* SHARE:                                 Extended I/O specifiers.
22236                                                              (line   6)
22237* SHARED:                                Extended I/O specifiers.
22238                                                              (line   6)
22239* shift, left:                           DSHIFTL.             (line   6)
22240* shift, left <1>:                       SHIFTL.              (line   6)
22241* shift, right:                          DSHIFTR.             (line   6)
22242* shift, right <1>:                      SHIFTR.              (line   6)
22243* shift, right with fill:                SHIFTA.              (line   6)
22244* SHIFTA:                                SHIFTA.              (line   6)
22245* SHIFTL:                                SHIFTL.              (line   6)
22246* SHIFTR:                                SHIFTR.              (line   6)
22247* SHORT:                                 INT2.                (line   6)
22248* SIGN:                                  SIGN.                (line   6)
22249* sign copying:                          SIGN.                (line   6)
22250* SIGNAL:                                SIGNAL.              (line   6)
22251* SIN:                                   SIN.                 (line   6)
22252* SIND:                                  SIND.                (line   6)
22253* sine:                                  SIN.                 (line   6)
22254* sine, degrees:                         SIND.                (line   6)
22255* sine, hyperbolic:                      SINH.                (line   6)
22256* sine, hyperbolic, inverse:             ASINH.               (line   6)
22257* sine, inverse:                         ASIN.                (line   6)
22258* sine, inverse, degrees:                ASIND.               (line   6)
22259* SINH:                                  SINH.                (line   6)
22260* SIZE:                                  SIZE.                (line   6)
22261* size of a variable, in bits:           BIT_SIZE.            (line   6)
22262* size of an expression:                 C_SIZEOF.            (line   6)
22263* size of an expression <1>:             SIZEOF.              (line   6)
22264* SIZEOF:                                SIZEOF.              (line   6)
22265* SLEEP:                                 SLEEP.               (line   6)
22266* SNGL:                                  REAL.                (line   6)
22267* SPACING:                               SPACING.             (line   6)
22268* SPREAD:                                SPREAD.              (line   6)
22269* SQRT:                                  SQRT.                (line   6)
22270* square-root:                           SQRT.                (line   6)
22271* SRAND:                                 SRAND.               (line   6)
22272* Standards:                             Standards.           (line   6)
22273* STAT:                                  STAT.                (line   6)
22274* statement, ENUM:                       Fortran 2003 status. (line  93)
22275* statement, ENUMERATOR:                 Fortran 2003 status. (line  93)
22276* statement, FLUSH:                      Fortran 2003 status. (line  89)
22277* statement, IMPORT:                     Fortran 2003 status. (line 120)
22278* statement, ISO_FORTRAN_ENV:            Fortran 2003 status. (line 128)
22279* statement, PROTECTED:                  Fortran 2003 status. (line 114)
22280* statement, SAVE:                       Code Gen Options.    (line  15)
22281* statement, USE, INTRINSIC:             Fortran 2003 status. (line 128)
22282* statement, VALUE:                      Fortran 2003 status. (line 116)
22283* statement, VOLATILE:                   Fortran 2003 status. (line 118)
22284* STATIC:                                AUTOMATIC and STATIC attributes.
22285                                                              (line   6)
22286* storage size:                          STORAGE_SIZE.        (line   6)
22287* STORAGE_SIZE:                          STORAGE_SIZE.        (line   6)
22288* STREAM I/O:                            Fortran 2003 status. (line 103)
22289* stream mode, read character:           FGET.                (line   6)
22290* stream mode, read character <1>:       FGETC.               (line   6)
22291* stream mode, write character:          FPUT.                (line   6)
22292* stream mode, write character <1>:      FPUTC.               (line   6)
22293* string, adjust left:                   ADJUSTL.             (line   6)
22294* string, adjust right:                  ADJUSTR.             (line   6)
22295* string, comparison:                    LGE.                 (line   6)
22296* string, comparison <1>:                LGT.                 (line   6)
22297* string, comparison <2>:                LLE.                 (line   6)
22298* string, comparison <3>:                LLT.                 (line   6)
22299* string, concatenate:                   REPEAT.              (line   6)
22300* string, find missing set:              VERIFY.              (line   6)
22301* string, find non-blank character:      LNBLNK.              (line   6)
22302* string, find subset:                   SCAN.                (line   6)
22303* string, find substring:                INDEX intrinsic.     (line   6)
22304* string, length:                        LEN.                 (line   6)
22305* string, length, without trailing whitespace: LEN_TRIM.      (line   6)
22306* string, remove trailing whitespace:    TRIM.                (line   6)
22307* string, repeat:                        REPEAT.              (line   6)
22308* strings, varying length:               Varying Length Character Strings.
22309                                                              (line   6)
22310* STRUCTURE:                             STRUCTURE and RECORD.
22311                                                              (line   6)
22312* structure packing:                     Code Gen Options.    (line 275)
22313* subrecord:                             File format of unformatted sequential files.
22314                                                              (line   6)
22315* subscript checking:                    Code Gen Options.    (line 141)
22316* substring position:                    INDEX intrinsic.     (line   6)
22317* SUM:                                   SUM.                 (line   6)
22318* sum array elements:                    SUM.                 (line   6)
22319* suppressing warnings:                  Error and Warning Options.
22320                                                              (line   6)
22321* symbol names:                          Fortran Dialect Options.
22322                                                              (line  68)
22323* symbol names, transforming:            Code Gen Options.    (line  54)
22324* symbol names, transforming <1>:        Code Gen Options.    (line 110)
22325* symbol names, underscores:             Code Gen Options.    (line  54)
22326* symbol names, underscores <1>:         Code Gen Options.    (line 110)
22327* SYMLNK:                                SYMLNK.              (line   6)
22328* syntax checking:                       Error and Warning Options.
22329                                                              (line  33)
22330* SYSTEM:                                SYSTEM.              (line   6)
22331* system, error handling:                GERROR.              (line   6)
22332* system, error handling <1>:            IERRNO.              (line   6)
22333* system, error handling <2>:            PERROR.              (line   6)
22334* system, group ID:                      GETGID.              (line   6)
22335* system, host name:                     HOSTNM.              (line   6)
22336* system, login name:                    GETLOG.              (line   6)
22337* system, process ID:                    GETPID.              (line   6)
22338* system, signal handling:               SIGNAL.              (line   6)
22339* system, system call:                   EXECUTE_COMMAND_LINE.
22340                                                              (line   6)
22341* system, system call <1>:               SYSTEM.              (line   6)
22342* system, terminal:                      ISATTY.              (line   6)
22343* system, terminal <1>:                  TTYNAM.              (line   6)
22344* system, user ID:                       GETUID.              (line   6)
22345* system, working directory:             CHDIR.               (line   6)
22346* system, working directory <1>:         GETCWD.              (line   6)
22347* SYSTEM_CLOCK:                          SYSTEM_CLOCK.        (line   6)
22348* tabulators:                            Error and Warning Options.
22349                                                              (line 186)
22350* TAN:                                   TAN.                 (line   6)
22351* TAND:                                  TAND.                (line   6)
22352* tangent:                               TAN.                 (line   6)
22353* tangent, degrees:                      TAND.                (line   6)
22354* tangent, hyperbolic:                   TANH.                (line   6)
22355* tangent, hyperbolic, inverse:          ATANH.               (line   6)
22356* tangent, inverse:                      ATAN.                (line   6)
22357* tangent, inverse <1>:                  ATAN2.               (line   6)
22358* tangent, inverse, degrees:             ATAND.               (line   6)
22359* tangent, inverse, degrees <1>:         ATAN2D.              (line   6)
22360* TANH:                                  TANH.                (line   6)
22361* terminate program:                     EXIT.                (line   6)
22362* terminate program, with core dump:     ABORT.               (line   6)
22363* THIS_IMAGE:                            THIS_IMAGE.          (line   6)
22364* thread-safety, threads:                Thread-safety of the runtime library.
22365                                                              (line   6)
22366* TIME:                                  TIME.                (line   6)
22367* time, clock ticks:                     MCLOCK.              (line   6)
22368* time, clock ticks <1>:                 MCLOCK8.             (line   6)
22369* time, clock ticks <2>:                 SYSTEM_CLOCK.        (line   6)
22370* time, conversion to GMT info:          GMTIME.              (line   6)
22371* time, conversion to local time info:   LTIME.               (line   6)
22372* time, conversion to string:            CTIME.               (line   6)
22373* time, current:                         DATE_AND_TIME.       (line   6)
22374* time, current <1>:                     FDATE.               (line   6)
22375* time, current <2>:                     ITIME.               (line   6)
22376* time, current <3>:                     TIME.                (line   6)
22377* time, current <4>:                     TIME8.               (line   6)
22378* time, elapsed:                         CPU_TIME.            (line   6)
22379* time, elapsed <1>:                     DTIME.               (line   6)
22380* time, elapsed <2>:                     ETIME.               (line   6)
22381* time, elapsed <3>:                     SECNDS.              (line   6)
22382* time, elapsed <4>:                     SECOND.              (line   6)
22383* TIME8:                                 TIME8.               (line   6)
22384* TINY:                                  TINY.                (line   6)
22385* TR 15581:                              Fortran 2003 status. (line  98)
22386* trace:                                 Debugging Options.   (line  69)
22387* TRAILZ:                                TRAILZ.              (line   6)
22388* TRANSFER:                              TRANSFER.            (line   6)
22389* transforming symbol names:             Code Gen Options.    (line  54)
22390* transforming symbol names <1>:         Code Gen Options.    (line 110)
22391* TRANSPOSE:                             TRANSPOSE.           (line   6)
22392* transpose:                             TRANSPOSE.           (line   6)
22393* trigonometric function, cosine:        COS.                 (line   6)
22394* trigonometric function, cosine, degrees: COSD.              (line   6)
22395* trigonometric function, cosine, inverse: ACOS.              (line   6)
22396* trigonometric function, cosine, inverse, degrees: ACOSD.    (line   6)
22397* trigonometric function, cotangent:     COTAN.               (line   6)
22398* trigonometric function, cotangent, degrees: COTAND.         (line   6)
22399* trigonometric function, sine:          SIN.                 (line   6)
22400* trigonometric function, sine, degrees: SIND.                (line   6)
22401* trigonometric function, sine, inverse: ASIN.                (line   6)
22402* trigonometric function, sine, inverse, degrees: ASIND.      (line   6)
22403* trigonometric function, tangent:       TAN.                 (line   6)
22404* trigonometric function, tangent, degrees: TAND.             (line   6)
22405* trigonometric function, tangent, inverse: ATAN.             (line   6)
22406* trigonometric function, tangent, inverse <1>: ATAN2.        (line   6)
22407* trigonometric function, tangent, inverse, degrees: ATAND.   (line   6)
22408* trigonometric function, tangent, inverse, degrees <1>: ATAN2D.
22409                                                              (line   6)
22410* TRIM:                                  TRIM.                (line   6)
22411* TTYNAM:                                TTYNAM.              (line   6)
22412* type alias print:                      TYPE as an alias for PRINT.
22413                                                              (line   6)
22414* type cast:                             TRANSFER.            (line   6)
22415* UBOUND:                                UBOUND.              (line   6)
22416* UCOBOUND:                              UCOBOUND.            (line   6)
22417* UMASK:                                 UMASK.               (line   6)
22418* underflow:                             Error and Warning Options.
22419                                                              (line 199)
22420* underscore:                            Code Gen Options.    (line  54)
22421* underscore <1>:                        Code Gen Options.    (line 110)
22422* unformatted sequential:                File format of unformatted sequential files.
22423                                                              (line   6)
22424* UNION:                                 UNION and MAP.       (line   6)
22425* UNLINK:                                UNLINK.              (line   6)
22426* UNPACK:                                UNPACK.              (line   6)
22427* unused dummy argument:                 Error and Warning Options.
22428                                                              (line 215)
22429* unused parameter:                      Error and Warning Options.
22430                                                              (line 219)
22431* USE, INTRINSIC statement:              Fortran 2003 status. (line 128)
22432* user id:                               GETUID.              (line   6)
22433* VALUE statement:                       Fortran 2003 status. (line 116)
22434* variable attributes:                   AUTOMATIC and STATIC attributes.
22435                                                              (line   6)
22436* Varying length character strings:      Varying Length Character Strings.
22437                                                              (line   6)
22438* Varying length strings:                Varying Length Character Strings.
22439                                                              (line   6)
22440* vector product:                        DOT_PRODUCT.         (line   6)
22441* VERIFY:                                VERIFY.              (line   6)
22442* version of the compiler:               COMPILER_VERSION.    (line   6)
22443* VOLATILE:                              Volatile COMMON blocks.
22444                                                              (line   6)
22445* VOLATILE statement:                    Fortran 2003 status. (line 118)
22446* warning, C binding type:               Error and Warning Options.
22447                                                              (line 106)
22448* warnings, aliasing:                    Error and Warning Options.
22449                                                              (line  71)
22450* warnings, alignment of COMMON blocks:  Error and Warning Options.
22451                                                              (line 226)
22452* warnings, all:                         Error and Warning Options.
22453                                                              (line  62)
22454* warnings, ampersand:                   Error and Warning Options.
22455                                                              (line  88)
22456* warnings, argument mismatch:           Error and Warning Options.
22457                                                              (line  96)
22458* warnings, array temporaries:           Error and Warning Options.
22459                                                              (line 101)
22460* warnings, character truncation:        Error and Warning Options.
22461                                                              (line 113)
22462* warnings, conversion:                  Error and Warning Options.
22463                                                              (line 122)
22464* warnings, conversion <1>:              Error and Warning Options.
22465                                                              (line 126)
22466* warnings, division of integers:        Error and Warning Options.
22467                                                              (line 149)
22468* warnings, extra:                       Error and Warning Options.
22469                                                              (line 130)
22470* warnings, function elimination:        Error and Warning Options.
22471                                                              (line 232)
22472* warnings, implicit interface:          Error and Warning Options.
22473                                                              (line 139)
22474* warnings, implicit procedure:          Error and Warning Options.
22475                                                              (line 145)
22476* warnings, integer division:            Error and Warning Options.
22477                                                              (line 149)
22478* warnings, interface mismatch:          Error and Warning Options.
22479                                                              (line  96)
22480* warnings, intrinsic:                   Error and Warning Options.
22481                                                              (line 204)
22482* warnings, intrinsics of other standards: Error and Warning Options.
22483                                                              (line 153)
22484* warnings, line truncation:             Error and Warning Options.
22485                                                              (line 116)
22486* warnings, loop interchange:            Error and Warning Options.
22487                                                              (line 135)
22488* warnings, non-standard intrinsics:     Error and Warning Options.
22489                                                              (line 153)
22490* warnings, parameter mismatch:          Error and Warning Options.
22491                                                              (line  96)
22492* warnings, q exponent-letter:           Error and Warning Options.
22493                                                              (line 160)
22494* warnings, suppressing:                 Error and Warning Options.
22495                                                              (line   6)
22496* warnings, suspicious code:             Error and Warning Options.
22497                                                              (line 164)
22498* warnings, tabs:                        Error and Warning Options.
22499                                                              (line 186)
22500* warnings, to errors:                   Error and Warning Options.
22501                                                              (line 277)
22502* warnings, undefined do loop:           Error and Warning Options.
22503                                                              (line 194)
22504* warnings, underflow:                   Error and Warning Options.
22505                                                              (line 199)
22506* warnings, unused dummy argument:       Error and Warning Options.
22507                                                              (line 215)
22508* warnings, unused parameter:            Error and Warning Options.
22509                                                              (line 219)
22510* warnings, use statements:              Error and Warning Options.
22511                                                              (line 211)
22512* write character, stream mode:          FPUT.                (line   6)
22513* write character, stream mode <1>:      FPUTC.               (line   6)
22514* XOR:                                   XOR.                 (line   6)
22515* XOR reduction:                         PARITY.              (line   6)
22516* ZABS:                                  ABS.                 (line   6)
22517* ZCOS:                                  COS.                 (line   6)
22518* ZCOSD:                                 COSD.                (line   6)
22519* zero bits:                             LEADZ.               (line   6)
22520* zero bits <1>:                         TRAILZ.              (line   6)
22521* ZEXP:                                  EXP.                 (line   6)
22522* ZLOG:                                  LOG.                 (line   6)
22523* ZSIN:                                  SIN.                 (line   6)
22524* ZSIND:                                 SIND.                (line   6)
22525* ZSQRT:                                 SQRT.                (line   6)
22526
22527
22528
22529Tag Table:
22530Node: Top1950
22531Node: Introduction3367
22532Node: About GNU Fortran4116
22533Node: GNU Fortran and GCC8117
22534Node: Preprocessing and conditional compilation10231
22535Node: GNU Fortran and G7711876
22536Node: Project Status12449
22537Node: Standards15191
22538Node: Varying Length Character Strings16578
22539Node: Invoking GNU Fortran17330
22540Node: Option Summary19164
22541Node: Fortran Dialect Options23102
22542Node: Preprocessing Options34668
22543Node: Error and Warning Options42909
22544Node: Debugging Options54658
22545Node: Directory Options58687
22546Node: Link Options60122
22547Node: Runtime Options60748
22548Node: Code Gen Options62655
22549Node: Interoperability Options81967
22550Node: Environment Variables83007
22551Node: Runtime83620
22552Node: TMPDIR84654
22553Node: GFORTRAN_STDIN_UNIT85324
22554Node: GFORTRAN_STDOUT_UNIT85706
22555Node: GFORTRAN_STDERR_UNIT86107
22556Node: GFORTRAN_UNBUFFERED_ALL86509
22557Node: GFORTRAN_UNBUFFERED_PRECONNECTED87040
22558Node: GFORTRAN_SHOW_LOCUS87684
22559Node: GFORTRAN_OPTIONAL_PLUS88180
22560Node: GFORTRAN_LIST_SEPARATOR88658
22561Node: GFORTRAN_CONVERT_UNIT89266
22562Node: GFORTRAN_ERROR_BACKTRACE92121
22563Node: Fortran standards status92678
22564Node: Fortran 2003 status92970
22565Node: Fortran 2008 status98209
22566Node: TS 29113 status103583
22567Node: TS 18508 status104582
22568Node: Fortran 2018 status105397
22569Node: Compiler Characteristics106016
22570Node: KIND Type Parameters106689
22571Node: Internal representation of LOGICAL variables108117
22572Node: Thread-safety of the runtime library108977
22573Node: Data consistency and durability111380
22574Node: Files opened without an explicit ACTION= specifier114493
22575Node: File operations on symbolic links115184
22576Node: File format of unformatted sequential files116304
22577Node: Extensions118651
22578Node: Extensions implemented in GNU Fortran119256
22579Node: Old-style kind specifications121152
22580Node: Old-style variable initialization122254
22581Node: Extensions to namelist123566
22582Node: X format descriptor without count field125869
22583Node: Commas in FORMAT specifications126396
22584Node: Missing period in FORMAT specifications126913
22585Node: I/O item lists127475
22586Node: Q exponent-letter127860
22587Node: BOZ literal constants128458
22588Node: Real array indices131037
22589Node: Unary operators131336
22590Node: Implicitly convert LOGICAL and INTEGER values131750
22591Node: Hollerith constants support132709
22592Node: Cray pointers134481
22593Node: CONVERT specifier139928
22594Node: OpenMP141923
22595Node: OpenACC144181
22596Node: Argument list functions145490
22597Node: Read/Write after EOF marker147133
22598Node: STRUCTURE and RECORD147736
22599Node: UNION and MAP152823
22600Node: Type variants for integer intrinsics155791
22601Node: AUTOMATIC and STATIC attributes157686
22602Node: Extended math intrinsics159220
22603Node: Form feed as whitespace161016
22604Node: TYPE as an alias for PRINT161562
22605Node: %LOC as an rvalue162027
22606Node: .XOR. operator162674
22607Node: Bitwise logical operators163074
22608Node: Extended I/O specifiers164575
22609Node: Legacy PARAMETER statements168295
22610Node: Default exponents168900
22611Node: Extensions not implemented in GNU Fortran169252
22612Node: ENCODE and DECODE statements170197
22613Node: Variable FORMAT expressions171528
22614Node: Alternate complex function syntax172633
22615Node: Volatile COMMON blocks173183
22616Node: OPEN( ... NAME=)173685
22617Node: Mixed-Language Programming174087
22618Node: Interoperability with C174667
22619Node: Intrinsic Types176001
22620Node: Derived Types and struct176997
22621Node: Interoperable Global Variables178355
22622Node: Interoperable Subroutines and Functions179630
22623Node: Working with Pointers183424
22624Node: Further Interoperability of Fortran with C187900
22625Node: GNU Fortran Compiler Directives191254
22626Node: ATTRIBUTES directive191544
22627Node: UNROLL directive194732
22628Node: Non-Fortran Main Program195239
22629Node: _gfortran_set_args197427
22630Node: _gfortran_set_options198365
22631Node: _gfortran_set_convert201972
22632Node: _gfortran_set_record_marker202840
22633Node: _gfortran_set_fpe203650
22634Node: _gfortran_set_max_subrecord_length204848
22635Node: Naming and argument-passing conventions205771
22636Node: Naming conventions206490
22637Node: Argument passing conventions207962
22638Node: Coarray Programming213267
22639Node: Type and enum ABI Documentation213514
22640Node: caf_token_t213812
22641Node: caf_register_t214048
22642Node: caf_deregister_t215259
22643Node: caf_reference_t215761
22644Node: caf_team_t220085
22645Node: Function ABI Documentation220384
22646Node: _gfortran_caf_init222834
22647Node: _gfortran_caf_finish224260
22648Node: _gfortran_caf_this_image225199
22649Node: _gfortran_caf_num_images225954
22650Node: _gfortran_caf_image_status227065
22651Node: _gfortran_caf_failed_images228185
22652Node: _gfortran_caf_stopped_images229355
22653Node: _gfortran_caf_register230528
22654Node: _gfortran_caf_deregister234710
22655Node: _gfortran_caf_is_present236316
22656Node: _gfortran_caf_send237395
22657Node: _gfortran_caf_get240585
22658Node: _gfortran_caf_sendget243666
22659Node: _gfortran_caf_send_by_ref247577
22660Node: _gfortran_caf_get_by_ref251186
22661Node: _gfortran_caf_sendget_by_ref254705
22662Node: _gfortran_caf_lock259001
22663Node: _gfortran_caf_unlock260787
22664Node: _gfortran_caf_event_post262268
22665Node: _gfortran_caf_event_wait263717
22666Node: _gfortran_caf_event_query265824
22667Node: _gfortran_caf_sync_all267155
22668Node: _gfortran_caf_sync_images268083
22669Node: _gfortran_caf_sync_memory269618
22670Node: _gfortran_caf_error_stop270610
22671Node: _gfortran_caf_error_stop_str271214
22672Node: _gfortran_caf_fail_image271919
22673Node: _gfortran_caf_atomic_define272455
22674Node: _gfortran_caf_atomic_ref273770
22675Node: _gfortran_caf_atomic_cas275074
22676Node: _gfortran_caf_atomic_op276835
22677Node: _gfortran_caf_co_broadcast278937
22678Node: _gfortran_caf_co_max280042
22679Node: _gfortran_caf_co_min281668
22680Node: _gfortran_caf_co_sum283288
22681Node: _gfortran_caf_co_reduce284828
22682Node: Intrinsic Procedures287472
22683Node: Introduction to Intrinsics304528
22684Node: ABORT306878
22685Node: ABS307623
22686Node: ACCESS309573
22687Node: ACHAR311503
22688Node: ACOS312707
22689Node: ACOSD313993
22690Node: ACOSH315305
22691Node: ADJUSTL316301
22692Node: ADJUSTR317243
22693Node: AIMAG318193
22694Node: AINT319565
22695Node: ALARM321171
22696Node: ALL322803
22697Node: ALLOCATED324727
22698Node: AND325866
22699Node: ANINT327165
22700Node: ANY328662
22701Node: ASIN330588
22702Node: ASIND331863
22703Node: ASINH333161
22704Node: ASSOCIATED334167
22705Node: ATAN337178
22706Node: ATAND338628
22707Node: ATAN2340098
22708Node: ATAN2D341961
22709Node: ATANH343935
22710Node: ATOMIC_ADD344941
22711Node: ATOMIC_AND346473
22712Node: ATOMIC_CAS348061
22713Node: ATOMIC_DEFINE349920
22714Node: ATOMIC_FETCH_ADD351639
22715Node: ATOMIC_FETCH_AND353439
22716Node: ATOMIC_FETCH_OR355229
22717Node: ATOMIC_FETCH_XOR357006
22718Node: ATOMIC_OR358789
22719Node: ATOMIC_REF360374
22720Node: ATOMIC_XOR362270
22721Node: BACKTRACE363855
22722Node: BESSEL_J0364435
22723Node: BESSEL_J1365451
22724Node: BESSEL_JN366468
22725Node: BESSEL_Y0368293
22726Node: BESSEL_Y1369248
22727Node: BESSEL_YN370203
22728Node: BGE372034
22729Node: BGT372726
22730Node: BIT_SIZE373376
22731Node: BLE374198
22732Node: BLT374880
22733Node: BTEST375518
22734Node: C_ASSOCIATED376975
22735Node: C_F_POINTER378186
22736Node: C_F_PROCPOINTER379621
22737Node: C_FUNLOC381128
22738Node: C_LOC382499
22739Node: C_SIZEOF383778
22740Node: CEILING385191
22741Node: CHAR386199
22742Node: CHDIR387411
22743Node: CHMOD388585
22744Node: CMPLX390500
22745Node: CO_BROADCAST391943
22746Node: CO_MAX393716
22747Node: CO_MIN395596
22748Node: CO_REDUCE397462
22749Node: CO_SUM400965
22750Node: COMMAND_ARGUMENT_COUNT402872
22751Node: COMPILER_OPTIONS403789
22752Node: COMPILER_VERSION404815
22753Node: COMPLEX405779
22754Node: CONJG406918
22755Node: COS407974
22756Node: COSD409429
22757Node: COSH410878
22758Node: COTAN412061
22759Node: COTAND413200
22760Node: COUNT414379
22761Node: CPU_TIME416404
22762Node: CSHIFT417761
22763Node: CTIME419421
22764Node: DATE_AND_TIME420929
22765Node: DBLE423409
22766Node: DCMPLX424204
22767Node: DIGITS425386
22768Node: DIM426353
22769Node: DOT_PRODUCT427634
22770Node: DPROD429277
22771Node: DREAL430204
22772Node: DSHIFTL430870
22773Node: DSHIFTR432203
22774Node: DTIME433537
22775Node: EOSHIFT436352
22776Node: EPSILON438425
22777Node: ERF439152
22778Node: ERFC439933
22779Node: ERFC_SCALED440743
22780Node: ETIME441436
22781Node: EVENT_QUERY443675
22782Node: EXECUTE_COMMAND_LINE445264
22783Node: EXIT447859
22784Node: EXP448737
22785Node: EXPONENT449990
22786Node: EXTENDS_TYPE_OF450754
22787Node: FDATE451612
22788Node: FGET453098
22789Node: FGETC454925
22790Node: FLOOR456733
22791Node: FLUSH457722
22792Node: FNUM459601
22793Node: FPUT460326
22794Node: FPUTC461960
22795Node: FRACTION463741
22796Node: FREE464645
22797Node: FSEEK465488
22798Node: FSTAT467794
22799Node: FTELL468881
22800Node: GAMMA469863
22801Node: GERROR470917
22802Node: GETARG471639
22803Node: GET_COMMAND473412
22804Node: GET_COMMAND_ARGUMENT474786
22805Node: GETCWD476834
22806Node: GETENV477814
22807Node: GET_ENVIRONMENT_VARIABLE479246
22808Node: GETGID481409
22809Node: GETLOG481946
22810Node: GETPID482808
22811Node: GETUID483538
22812Node: GMTIME484054
22813Node: HOSTNM485814
22814Node: HUGE486735
22815Node: HYPOT487457
22816Node: IACHAR488283
22817Node: IALL489451
22818Node: IAND490936
22819Node: IANY492509
22820Node: IARGC494003
22821Node: IBCLR495024
22822Node: IBITS496272
22823Node: IBSET497776
22824Node: ICHAR499019
22825Node: IDATE501189
22826Node: IEOR502489
22827Node: IERRNO503955
22828Node: IMAGE_INDEX504504
22829Node: INDEX intrinsic505532
22830Node: INT507058
22831Node: INT2508817
22832Node: INT8509585
22833Node: IOR510300
22834Node: IPARITY511742
22835Node: IRAND513274
22836Node: IS_IOSTAT_END514633
22837Node: IS_IOSTAT_EOR515732
22838Node: ISATTY516861
22839Node: ISHFT517644
22840Node: ISHFTC519213
22841Node: ISNAN521020
22842Node: ITIME521787
22843Node: KILL523085
22844Node: KIND524170
22845Node: LBOUND525016
22846Node: LCOBOUND526354
22847Node: LEADZ527489
22848Node: LEN528350
22849Node: LEN_TRIM529646
22850Node: LGE530634
22851Node: LGT532147
22852Node: LINK533625
22853Node: LLE534664
22854Node: LLT536164
22855Node: LNBLNK537635
22856Node: LOC538413
22857Node: LOG539145
22858Node: LOG10540490
22859Node: LOG_GAMMA541480
22860Node: LOGICAL542582
22861Node: LONG543394
22862Node: LSHIFT544152
22863Node: LSTAT545238
22864Node: LTIME546438
22865Node: MALLOC548120
22866Node: MASKL549582
22867Node: MASKR550349
22868Node: MATMUL551119
22869Node: MAX552292
22870Node: MAXEXPONENT553827
22871Node: MAXLOC554644
22872Node: MAXVAL556985
22873Node: MCLOCK558625
22874Node: MCLOCK8559648
22875Node: MERGE560878
22876Node: MERGE_BITS561630
22877Node: MIN562495
22878Node: MINEXPONENT564033
22879Node: MINLOC564664
22880Node: MINVAL567036
22881Node: MOD568689
22882Node: MODULO570853
22883Node: MOVE_ALLOC572156
22884Node: MVBITS573189
22885Node: NEAREST574841
22886Node: NEW_LINE575941
22887Node: NINT576714
22888Node: NORM2578135
22889Node: NOT579277
22890Node: NULL580447
22891Node: NUM_IMAGES581355
22892Node: OR583056
22893Node: PACK584342
22894Node: PARITY586350
22895Node: PERROR587571
22896Node: POPCNT588196
22897Node: POPPAR589068
22898Node: PRECISION590122
22899Node: PRESENT591009
22900Node: PRODUCT592121
22901Node: RADIX593655
22902Node: RAN594467
22903Node: RAND594923
22904Node: RANDOM_NUMBER596258
22905Node: RANDOM_SEED597472
22906Node: RANGE599921
22907Node: RANK600602
22908Node: REAL601383
22909Node: RENAME603372
22910Node: REPEAT604394
22911Node: RESHAPE605122
22912Node: RRSPACING606589
22913Node: RSHIFT607282
22914Node: SAME_TYPE_AS608422
22915Node: SCALE609254
22916Node: SCAN610035
22917Node: SECNDS611593
22918Node: SECOND612685
22919Node: SELECTED_CHAR_KIND613561
22920Node: SELECTED_INT_KIND615156
22921Node: SELECTED_REAL_KIND616333
22922Node: SET_EXPONENT619010
22923Node: SHAPE620007
22924Node: SHIFTA621431
22925Node: SHIFTL622395
22926Node: SHIFTR623232
22927Node: SIGN624070
22928Node: SIGNAL625296
22929Node: SIN626802
22930Node: SIND627893
22931Node: SINH629222
22932Node: SIZE630235
22933Node: SIZEOF631554
22934Node: SLEEP633209
22935Node: SPACING633770
22936Node: SPREAD634784
22937Node: SQRT635935
22938Node: SRAND637267
22939Node: STAT638501
22940Node: STORAGE_SIZE641669
22941Node: SUM642548
22942Node: SYMLNK644040
22943Node: SYSTEM645175
22944Node: SYSTEM_CLOCK646430
22945Node: TAN649260
22946Node: TAND650331
22947Node: TANH651415
22948Node: THIS_IMAGE652590
22949Node: TIME654890
22950Node: TIME8656061
22951Node: TINY657260
22952Node: TRAILZ657861
22953Node: TRANSFER658679
22954Node: TRANSPOSE660715
22955Node: TRIM661405
22956Node: TTYNAM662263
22957Node: UBOUND663181
22958Node: UCOBOUND664571
22959Node: UMASK665708
22960Node: UNLINK666390
22961Node: UNPACK667370
22962Node: VERIFY668665
22963Node: XOR670394
22964Node: Intrinsic Modules671767
22965Node: ISO_FORTRAN_ENV672056
22966Node: ISO_C_BINDING676459
22967Node: IEEE modules680165
22968Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS681308
22969Node: OpenACC Module OPENACC683091
22970Node: Contributing684018
22971Node: Contributors684872
22972Node: Projects686503
22973Node: Proposed Extensions687310
22974Node: Copying689320
22975Node: GNU Free Documentation License726866
22976Node: Funding751990
22977Node: Option Index754516
22978Node: Keyword Index772318
22979
22980End Tag Table
22981