1This is gfortran.info, produced by makeinfo version 5.1 from
2gfortran.texi.
3
4Copyright (C) 1999-2020 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-2020 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.
251The macros '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be
252used to determine the version of the compiler.  See *note Overview:
253(cpp)Top. for details.
254
255   GNU Fortran supports a number of 'INTEGER' and 'REAL' kind types in
256additional to the kind types required by the Fortran standard.  The
257availability of any given kind type is architecture dependent.  The
258following pre-defined preprocessor macros can be used to conditionally
259include code for these additional kind types: '__GFC_INT_1__',
260'__GFC_INT_2__', '__GFC_INT_8__', '__GFC_INT_16__', '__GFC_REAL_10__',
261and '__GFC_REAL_16__'.
262
263   While CPP is the de-facto standard for preprocessing Fortran code,
264Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
265Conditional Compilation, which is not widely used and not directly
266supported by the GNU Fortran compiler.  You can use the program coco to
267preprocess such files (<http://www.daniellnagle.com/coco.html>).
268
269
270File: gfortran.info,  Node: GNU Fortran and G77,  Next: Project Status,  Prev: Preprocessing and conditional compilation,  Up: Introduction
271
2721.4 GNU Fortran and G77
273=======================
274
275The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front
276end included in GCC prior to version 4.  It is an entirely new program
277that has been designed to provide Fortran 95 support and extensibility
278for future Fortran language standards, as well as providing backwards
279compatibility for Fortran 77 and nearly all of the GNU language
280extensions supported by 'g77'.
281
282
283File: gfortran.info,  Node: Project Status,  Next: Standards,  Prev: GNU Fortran and G77,  Up: Introduction
284
2851.5 Project Status
286==================
287
288     As soon as 'gfortran' can parse all of the statements correctly, it
289     will be in the "larva" state.  When we generate code, the "puppa"
290     state.  When 'gfortran' is done, we'll see if it will be a
291     beautiful butterfly, or just a big bug....
292
293     -Andy Vaught, April 2000
294
295   The start of the GNU Fortran 95 project was announced on the GCC
296homepage in March 18, 2000 (even though Andy had already been working on
297it for a while, of course).
298
299   The GNU Fortran compiler is able to compile nearly all
300standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
301including a number of standard and non-standard extensions, and can be
302used on real-world programs.  In particular, the supported extensions
303include OpenMP, Cray-style pointers, some old vendor extensions, and
304several Fortran 2003 and Fortran 2008 features, including TR 15581.
305However, it is still under development and has a few remaining rough
306edges.  There also is initial support for OpenACC.
307
308   At present, the GNU Fortran compiler passes the NIST Fortran 77 Test
309Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and
310produces acceptable results on the LAPACK Test Suite
311(http://www.netlib.org/lapack/faq.html#1.21).  It also provides
312respectable performance on the Polyhedron Fortran compiler benchmarks
313(http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite)
314and the Livermore Fortran Kernels test
315(http://www.netlib.org/benchmark/livermore).  It has been used to
316compile a number of large real-world programs, including the HARMONIE
317and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto
318quantum chemistry package
319(http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page);
320see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list.
321
322   Among other things, the GNU Fortran compiler is intended as a
323replacement for G77.  At this point, nearly all programs that could be
324compiled with G77 can be compiled with GNU Fortran, although there are a
325few minor known regressions.
326
327   The primary work remaining to be done on GNU Fortran falls into three
328categories: bug fixing (primarily regarding the treatment of invalid
329code and providing useful error messages), improving the compiler
330optimizations and the performance of compiled code, and extending the
331compiler to support future standards--in particular, Fortran 2003,
332Fortran 2008 and Fortran 2018.
333
334
335File: gfortran.info,  Node: Standards,  Prev: Project Status,  Up: Introduction
336
3371.6 Standards
338=============
339
340* Menu:
341
342* Varying Length Character Strings::
343
344The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95).  As
345such, it can also compile essentially all standard-compliant Fortran 90
346and Fortran 77 programs.  It also supports the ISO/IEC TR-15581
347enhancements to allocatable arrays.
348
349   GNU Fortran also have a partial support for ISO/IEC 1539-1:2004
350(Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical
351Specification 'Further Interoperability of Fortran with C' (ISO/IEC TS
35229113:2012).  Full support of those standards and future Fortran
353standards is planned.  The current status of the support is can be found
354in the *note Fortran 2003 status::, *note Fortran 2008 status:: and
355*note Fortran 2018 status:: sections of the documentation.
356
357   Additionally, the GNU Fortran compilers supports the OpenMP
358specification (version 4.0 and most of the features of the 4.5 version,
359<http://openmp.org/wp/openmp-specifications/>).  There also is support
360for the OpenACC specification (targeting version 2.6,
361<http://www.openacc.org/>).  See <https://gcc.gnu.org/wiki/OpenACC> for
362more information.
363
364
365File: gfortran.info,  Node: Varying Length Character Strings,  Up: Standards
366
3671.6.1 Varying Length Character Strings
368--------------------------------------
369
370The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
371varying length character strings.  While GNU Fortran currently does not
372support such strings directly, there exist two Fortran implementations
373for them, which work with GNU Fortran.  They can be found at
374<http://www.fortran.com/iso_varying_string.f95> and at
375<ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>.
376
377   Deferred-length character strings of Fortran 2003 supports part of
378the features of 'ISO_VARYING_STRING' and should be considered as
379replacement.  (Namely, allocatable or pointers of the type
380'character(len=:)'.)
381
382
383File: gfortran.info,  Node: Invoking GNU Fortran,  Next: Runtime,  Prev: Introduction,  Up: Top
384
3852 GNU Fortran Command Options
386*****************************
387
388The 'gfortran' command supports all the options supported by the 'gcc'
389command.  Only options specific to GNU Fortran are documented here.
390
391   *Note GCC Command Options: (gcc)Invoking GCC, for information on the
392non-Fortran-specific aspects of the 'gcc' command (and, therefore, the
393'gfortran' command).
394
395   All GCC and GNU Fortran options are accepted both by 'gfortran' and
396by 'gcc' (as well as any other drivers built at the same time, such as
397'g++'), since adding GNU Fortran to the GCC distribution enables
398acceptance of GNU Fortran options by all of the relevant drivers.
399
400   In some cases, options have positive and negative forms; the negative
401form of '-ffoo' would be '-fno-foo'.  This manual documents only one of
402these two forms, whichever one is not the default.
403
404* Menu:
405
406* Option Summary::      Brief list of all 'gfortran' options,
407                        without explanations.
408* Fortran Dialect Options::  Controlling the variant of Fortran language
409                             compiled.
410* Preprocessing Options::  Enable and customize preprocessing.
411* Error and Warning Options::     How picky should the compiler be?
412* Debugging Options::   Symbol tables, measurements, and debugging dumps.
413* Directory Options::   Where to find module files
414* Link Options ::       Influencing the linking step
415* Runtime Options::     Influencing runtime behavior
416* Code Gen Options::    Specifying conventions for function calls, data layout
417                        and register usage.
418* Interoperability Options::  Options for interoperability with other
419                              languages.
420* Environment Variables:: Environment variables that affect 'gfortran'.
421
422
423File: gfortran.info,  Node: Option Summary,  Next: Fortran Dialect Options,  Up: Invoking GNU Fortran
424
4252.1 Option summary
426==================
427
428Here is a summary of all the options specific to GNU Fortran, grouped by
429type.  Explanations are in the following sections.
430
431_Fortran Language Options_
432     *Note Options controlling Fortran dialect: Fortran Dialect Options.
433          -fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz
434          -fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments
435          -fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints
436          -fdec-static -fdec-math -fdec-include -fdec-format-defaults
437          -fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8
438          -fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok
439          -ffixed-line-length-N -ffixed-line-length-none -fpad-source
440          -ffree-form -ffree-line-length-N -ffree-line-length-none
441          -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length
442          -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp
443          -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10
444          -freal-8-real-16 -freal-8-real-4 -std=STD -ftest-forall-temp
445
446_Preprocessing Options_
447     *Note Enable and customize preprocessing: Preprocessing Options.
448          -A-QUESTION[=ANSWER]
449          -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
450          -H -P
451          -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
452          -imultilib DIR
453          -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
454          -nostdinc
455          -undef
456
457_Error and Warning Options_
458     *Note Options to request or suppress errors and warnings: Error and
459     Warning Options.
460          -Waliasing -Wall -Wampersand -Warray-bounds
461          -Wc-binding-type -Wcharacter-truncation -Wconversion
462          -Wdo-subscript -Wfunction-elimination -Wimplicit-interface
463          -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only
464          -Wintrinsics-std -Wline-truncation -Wno-align-commons
465          -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising
466          -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all
467          -Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=N
468          -fsyntax-only -pedantic
469          -pedantic-errors
470
471_Debugging Options_
472     *Note Options for debugging your program or GNU Fortran: Debugging
473     Options.
474          -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
475          -fdump-fortran-global -fdump-parse-tree -ffpe-trap=LIST
476          -ffpe-summary=LIST
477
478_Directory Options_
479     *Note Options for directory search: Directory Options.
480          -IDIR  -JDIR -fintrinsic-modules-path DIR
481
482_Link Options_
483     *Note Options for influencing the linking step: Link Options.
484          -static-libgfortran
485
486_Runtime Options_
487     *Note Options for influencing runtime behavior: Runtime Options.
488          -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
489          -frecord-marker=LENGTH -fsign-zero
490
491_Interoperability Options_
492     *Note Options for interoperability: Interoperability Options.
493          -fc-prototypes -fc-prototypes-external
494
495_Code Generation Options_
496     *Note Options for code generation conventions: Code Gen Options.
497          -faggressive-function-elimination -fblas-matmul-limit=N
498          -fbounds-check -ftail-call-workaround -ftail-call-workaround=N
499          -fcheck-array-temporaries
500          -fcheck=<ALL|ARRAY-TEMPS|BITS|BOUNDS|DO|MEM|POINTER|RECURSION>
501          -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
502          -ffrontend-loop-interchange -ffrontend-optimize
503          -finit-character=N -finit-integer=N -finit-local-zero
504          -finit-derived -finit-logical=<TRUE|FALSE>
505          -finit-real=<ZERO|INF|-INF|NAN|SNAN>
506          -finline-matmul-limit=N
507          -finline-arg-packing -fmax-array-constructor=N
508          -fmax-stack-var-size=N -fno-align-commons -fno-automatic
509          -fno-protect-parens -fno-underscoring -fsecond-underscore
510          -fpack-derived -frealloc-lhs -frecursive -frepack-arrays
511          -fshort-enums -fstack-arrays
512
513
514File: gfortran.info,  Node: Fortran Dialect Options,  Next: Preprocessing Options,  Prev: Option Summary,  Up: Invoking GNU Fortran
515
5162.2 Options controlling Fortran dialect
517=======================================
518
519The following options control the details of the Fortran dialect
520accepted by the compiler:
521
522'-ffree-form'
523'-ffixed-form'
524     Specify the layout used by the source file.  The free form layout
525     was introduced in Fortran 90.  Fixed form was traditionally used in
526     older Fortran programs.  When neither option is specified, the
527     source form is determined by the file extension.
528
529'-fall-intrinsics'
530     This option causes all intrinsic procedures (including the
531     GNU-specific extensions) to be accepted.  This can be useful with
532     '-std=f95' to force standard-compliance but get access to the full
533     range of intrinsics available with 'gfortran'.  As a consequence,
534     '-Wintrinsics-std' will be ignored and no user-defined procedure
535     with the same name as any intrinsic will be called except when it
536     is explicitly declared 'EXTERNAL'.
537
538'-fallow-argument-mismatch'
539     Some code contains calls to external procedures whith mismatches
540     between the calls and the procedure definition, or with mismatches
541     between different calls.  Such code is non-conforming, and will
542     usually be flagged wi1th an error.  This options degrades the error
543     to a warning, which can only be disabled by disabling all warnings
544     vial '-w'.  Only a single occurrence per argument is flagged by
545     this warning.  '-fallow-argument-mismatch' is implied by
546     '-std=legacy'.
547
548     Using this option is _strongly_ discouraged.  It is possible to
549     provide standard-conforming code which allows different types of
550     arguments by using an explicit interface and 'TYPE(*)'.
551
552'-fallow-invalid-boz'
553     A BOZ literal constant can occur in a limited number of contexts in
554     standard conforming Fortran.  This option degrades an error
555     condition to a warning, and allows a BOZ literal constant to appear
556     where the Fortran standard would otherwise prohibit its use.
557
558'-fd-lines-as-code'
559'-fd-lines-as-comments'
560     Enable special treatment for lines beginning with 'd' or 'D' in
561     fixed form sources.  If the '-fd-lines-as-code' option is given
562     they are treated as if the first column contained a blank.  If the
563     '-fd-lines-as-comments' option is given, they are treated as
564     comment lines.
565
566'-fdec'
567     DEC compatibility mode.  Enables extensions and other features that
568     mimic the default behavior of older compilers (such as DEC). These
569     features are non-standard and should be avoided at all costs.  For
570     details on GNU Fortran's implementation of these extensions see the
571     full documentation.
572
573     Other flags enabled by this switch are: '-fdollar-ok'
574     '-fcray-pointer' '-fdec-char-conversions' '-fdec-structure'
575     '-fdec-intrinsic-ints' '-fdec-static' '-fdec-math' '-fdec-include'
576     '-fdec-blank-format-item' '-fdec-format-defaults'
577
578     If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then
579     '-fdec' also sets '-fd-lines-as-comments'.
580
581'-fdec-char-conversions'
582     Enable the use of character literals in assignments and 'DATA'
583     statements for non-character variables.
584
585'-fdec-structure'
586     Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and
587     dot ('.')  as a member separator (in addition to '%').  This is
588     provided for compatibility only; Fortran 90 derived types should be
589     used instead where possible.
590
591'-fdec-intrinsic-ints'
592     Enable B/I/J/K kind variants of existing integer functions (e.g.
593     BIAND, IIAND, JIAND, etc...).  For a complete list of intrinsics
594     see the full documentation.
595
596'-fdec-math'
597     Enable legacy math intrinsics such as COTAN and degree-valued
598     trigonometric functions (e.g.  TAND, ATAND, etc...)  for
599     compatability with older code.
600
601'-fdec-static'
602     Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
603     specify the storage of variables and other objects.
604
605'-fdec-include'
606     Enable parsing of INCLUDE as a statement in addition to parsing it
607     as INCLUDE line.  When parsed as INCLUDE statement, INCLUDE does
608     not have to be on a single line and can use line continuations.
609
610'-fdec-format-defaults'
611     Enable format specifiers F, G and I to be used without width
612     specifiers, default widths will be used instead.
613
614'-fdec-blank-format-item'
615     Enable a blank format item at the end of a format specification
616     i.e.  nothing following the final comma.
617
618'-fdollar-ok'
619     Allow '$' as a valid non-first character in a symbol name.  Symbols
620     that start with '$' are rejected since it is unclear which rules to
621     apply to implicit typing as different vendors implement different
622     rules.  Using '$' in 'IMPLICIT' statements is also rejected.
623
624'-fbackslash'
625     Change the interpretation of backslashes in string literals from a
626     single backslash character to "C-style" escape characters.  The
627     following combinations are expanded '\a', '\b', '\f', '\n', '\r',
628     '\t', '\v', '\\', and '\0' to the ASCII characters alert,
629     backspace, form feed, newline, carriage return, horizontal tab,
630     vertical tab, backslash, and NUL, respectively.  Additionally,
631     '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal
632     digit) are translated into the Unicode characters corresponding to
633     the specified code points.  All other combinations of a character
634     preceded by \ are unexpanded.
635
636'-fmodule-private'
637     Set the default accessibility of module entities to 'PRIVATE'.
638     Use-associated entities will not be accessible unless they are
639     explicitly declared as 'PUBLIC'.
640
641'-ffixed-line-length-N'
642     Set column after which characters are ignored in typical fixed-form
643     lines in the source file, and, unless '-fno-pad-source', through
644     which spaces are assumed (as if padded to that length) after the
645     ends of short fixed-form lines.
646
647     Popular values for N include 72 (the standard and the default), 80
648     (card image), and 132 (corresponding to "extended-source" options
649     in some popular compilers).  N may also be 'none', meaning that the
650     entire line is meaningful and that continued character constants
651     never have implicit spaces appended to them to fill out the line.
652     '-ffixed-line-length-0' means the same thing as
653     '-ffixed-line-length-none'.
654
655'-fno-pad-source'
656     By default fixed-form lines have spaces assumed (as if padded to
657     that length) after the ends of short fixed-form lines.  This is not
658     done either if '-ffixed-line-length-0', '-ffixed-line-length-none'
659     or if '-fno-pad-source' option is used.  With any of those options
660     continued character constants never have implicit spaces appended
661     to them to fill out the line.
662
663'-ffree-line-length-N'
664     Set column after which characters are ignored in typical free-form
665     lines in the source file.  The default value is 132.  N may be
666     'none', meaning that the entire line is meaningful.
667     '-ffree-line-length-0' means the same thing as
668     '-ffree-line-length-none'.
669
670'-fmax-identifier-length=N'
671     Specify the maximum allowed identifier length.  Typical values are
672     31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
673
674'-fimplicit-none'
675     Specify that no implicit typing is allowed, unless overridden by
676     explicit 'IMPLICIT' statements.  This is the equivalent of adding
677     'implicit none' to the start of every procedure.
678
679'-fcray-pointer'
680     Enable the Cray pointer extension, which provides C-like pointer
681     functionality.
682
683'-fopenacc'
684     Enable the OpenACC extensions.  This includes OpenACC '!$acc'
685     directives in free form and 'c$acc', '*$acc' and '!$acc' directives
686     in fixed form, '!$' conditional compilation sentinels in free form
687     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
688     arranges for the OpenACC runtime library to be linked in.
689
690'-fopenmp'
691     Enable the OpenMP extensions.  This includes OpenMP '!$omp'
692     directives in free form and 'c$omp', '*$omp' and '!$omp' directives
693     in fixed form, '!$' conditional compilation sentinels in free form
694     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
695     arranges for the OpenMP runtime library to be linked in.  The
696     option '-fopenmp' implies '-frecursive'.
697
698'-fno-range-check'
699     Disable range checking on results of simplification of constant
700     expressions during compilation.  For example, GNU Fortran will give
701     an error at compile time when simplifying 'a = 1. / 0'.  With this
702     option, no error will be given and 'a' will be assigned the value
703     '+Infinity'.  If an expression evaluates to a value outside of the
704     relevant range of ['-HUGE()':'HUGE()'], then the expression will be
705     replaced by '-Inf' or '+Inf' as appropriate.  Similarly, 'DATA
706     i/Z'FFFFFFFF'/' will result in an integer overflow on most systems,
707     but with '-fno-range-check' the value will "wrap around" and 'i'
708     will be initialized to -1 instead.
709
710'-fdefault-integer-8'
711     Set the default integer and logical types to an 8 byte wide type.
712     This option also affects the kind of integer constants like '42'.
713     Unlike '-finteger-4-integer-8', it does not promote variables with
714     explicit kind declaration.
715
716'-fdefault-real-8'
717     Set the default real type to an 8 byte wide type.  This option also
718     affects the kind of non-double real constants like '1.0'.  This
719     option promotes the default width of 'DOUBLE PRECISION' and double
720     real constants like '1.d0' to 16 bytes if possible.  If
721     '-fdefault-double-8' is given along with 'fdefault-real-8', 'DOUBLE
722     PRECISION' and double real constants are not promoted.  Unlike
723     '-freal-4-real-8', 'fdefault-real-8' does not promote variables
724     with explicit kind declarations.
725
726'-fdefault-real-10'
727     Set the default real type to an 10 byte wide type.  This option
728     also affects the kind of non-double real constants like '1.0'.
729     This option promotes the default width of 'DOUBLE PRECISION' and
730     double real constants like '1.d0' to 16 bytes if possible.  If
731     '-fdefault-double-8' is given along with 'fdefault-real-10',
732     'DOUBLE PRECISION' and double real constants are not promoted.
733     Unlike '-freal-4-real-10', 'fdefault-real-10' does not promote
734     variables with explicit kind declarations.
735
736'-fdefault-real-16'
737     Set the default real type to an 16 byte wide type.  This option
738     also affects the kind of non-double real constants like '1.0'.
739     This option promotes the default width of 'DOUBLE PRECISION' and
740     double real constants like '1.d0' to 16 bytes if possible.  If
741     '-fdefault-double-8' is given along with 'fdefault-real-16',
742     'DOUBLE PRECISION' and double real constants are not promoted.
743     Unlike '-freal-4-real-16', 'fdefault-real-16' does not promote
744     variables with explicit kind declarations.
745
746'-fdefault-double-8'
747     Set the 'DOUBLE PRECISION' type and double real constants like
748     '1.d0' to an 8 byte wide type.  Do nothing if this is already the
749     default.  This option prevents '-fdefault-real-8',
750     '-fdefault-real-10', and '-fdefault-real-16', from promoting
751     'DOUBLE PRECISION' and double real constants like '1.d0' to 16
752     bytes.
753
754'-finteger-4-integer-8'
755     Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)'
756     entities.  If 'KIND=8' is unavailable, then an error will be
757     issued.  This option should be used with care and may not be
758     suitable for your codes.  Areas of possible concern include calls
759     to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON',
760     generic interfaces, BOZ literal constant conversion, and I/O.
761     Inspection of the intermediate representation of the translated
762     Fortran code, produced by '-fdump-tree-original', is suggested.
763
764'-freal-4-real-8'
765'-freal-4-real-10'
766'-freal-4-real-16'
767'-freal-8-real-4'
768'-freal-8-real-10'
769'-freal-8-real-16'
770     Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities.  If
771     'REAL(KIND=N)' is unavailable, then an error will be issued.  All
772     other real kind types are unaffected by this option.  These options
773     should be used with care and may not be suitable for your codes.
774     Areas of possible concern include calls to external procedures,
775     alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ
776     literal constant conversion, and I/O. Inspection of the
777     intermediate representation of the translated Fortran code,
778     produced by '-fdump-tree-original', is suggested.
779
780'-std=STD'
781     Specify the standard to which the program is expected to conform,
782     which may be one of 'f95', 'f2003', 'f2008', 'f2018', 'gnu', or
783     'legacy'.  The default value for STD is 'gnu', which specifies a
784     superset of the latest Fortran standard that includes all of the
785     extensions supported by GNU Fortran, although warnings will be
786     given for obsolete extensions not recommended for use in new code.
787     The 'legacy' value is equivalent but without the warnings for
788     obsolete extensions, and may be useful for old non-standard
789     programs.  The 'f95', 'f2003', 'f2008', and 'f2018' values specify
790     strict conformance to the Fortran 95, Fortran 2003, Fortran 2008
791     and Fortran 2018 standards, respectively; errors are given for all
792     extensions beyond the relevant language standard, and warnings are
793     given for the Fortran 77 features that are permitted but
794     obsolescent in later standards.  The deprecated option
795     '-std=f2008ts' acts as an alias for '-std=f2018'.  It is only
796     present for backwards compatibility with earlier gfortran versions
797     and should not be used any more.
798
799'-ftest-forall-temp'
800     Enhance test coverage by forcing most forall assignments to use
801     temporary.
802
803
804File: gfortran.info,  Node: Preprocessing Options,  Next: Error and Warning Options,  Prev: Fortran Dialect Options,  Up: Invoking GNU Fortran
805
8062.3 Enable and customize preprocessing
807======================================
808
809Preprocessor related options.  See section *note Preprocessing and
810conditional compilation:: for more detailed information on preprocessing
811in 'gfortran'.
812
813'-cpp'
814'-nocpp'
815     Enable preprocessing.  The preprocessor is automatically invoked if
816     the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90',
817     '.F95', '.F03' or '.F08'.  Use this option to manually enable
818     preprocessing of any kind of Fortran file.
819
820     To disable preprocessing of files with any of the above listed
821     extensions, use the negative form: '-nocpp'.
822
823     The preprocessor is run in traditional mode.  Any restrictions of
824     the file-format, especially the limits on line length, apply for
825     preprocessed output as well, so it might be advisable to use the
826     '-ffree-line-length-none' or '-ffixed-line-length-none' options.
827
828'-dM'
829     Instead of the normal output, generate a list of ''#define''
830     directives for all the macros defined during the execution of the
831     preprocessor, including predefined macros.  This gives you a way of
832     finding out what is predefined in your version of the preprocessor.
833     Assuming you have no file 'foo.f90', the command
834            touch foo.f90; gfortran -cpp -E -dM foo.f90
835     will show all the predefined macros.
836
837'-dD'
838     Like '-dM' except in two respects: it does not include the
839     predefined macros, and it outputs both the '#define' directives and
840     the result of preprocessing.  Both kinds of output go to the
841     standard output file.
842
843'-dN'
844     Like '-dD', but emit only the macro names, not their expansions.
845
846'-dU'
847     Like 'dD' except that only macros that are expanded, or whose
848     definedness is tested in preprocessor directives, are output; the
849     output is delayed until the use or test of the macro; and
850     ''#undef'' directives are also output for macros tested but
851     undefined at the time.
852
853'-dI'
854     Output ''#include'' directives in addition to the result of
855     preprocessing.
856
857'-fworking-directory'
858     Enable generation of linemarkers in the preprocessor output that
859     will let the compiler know the current working directory at the
860     time of preprocessing.  When this option is enabled, the
861     preprocessor will emit, after the initial linemarker, a second
862     linemarker with the current working directory followed by two
863     slashes.  GCC will use this directory, when it is present in the
864     preprocessed input, as the directory emitted as the current working
865     directory in some debugging information formats.  This option is
866     implicitly enabled if debugging information is enabled, but this
867     can be inhibited with the negated form '-fno-working-directory'.
868     If the '-P' flag is present in the command line, this option has no
869     effect, since no '#line' directives are emitted whatsoever.
870
871'-idirafter DIR'
872     Search DIR for include files, but do it after all directories
873     specified with '-I' and the standard system directories have been
874     exhausted.  DIR is treated as a system include directory.  If dir
875     begins with '=', then the '=' will be replaced by the sysroot
876     prefix; see '--sysroot' and '-isysroot'.
877
878'-imultilib DIR'
879     Use DIR as a subdirectory of the directory containing
880     target-specific C++ headers.
881
882'-iprefix PREFIX'
883     Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
884     If the PREFIX represents a directory, you should include the final
885     ''/''.
886
887'-isysroot DIR'
888     This option is like the '--sysroot' option, but applies only to
889     header files.  See the '--sysroot' option for more information.
890
891'-iquote DIR'
892     Search DIR only for header files requested with '#include "file"';
893     they are not searched for '#include <file>', before all directories
894     specified by '-I' and before the standard system directories.  If
895     DIR begins with '=', then the '=' will be replaced by the sysroot
896     prefix; see '--sysroot' and '-isysroot'.
897
898'-isystem DIR'
899     Search DIR for header files, after all directories specified by
900     '-I' but before the standard system directories.  Mark it as a
901     system directory, so that it gets the same special treatment as is
902     applied to the standard system directories.  If DIR begins with
903     '=', then the '=' will be replaced by the sysroot prefix; see
904     '--sysroot' and '-isysroot'.
905
906'-nostdinc'
907     Do not search the standard system directories for header files.
908     Only the directories you have specified with '-I' options (and the
909     directory of the current file, if appropriate) are searched.
910
911'-undef'
912     Do not predefine any system-specific or GCC-specific macros.  The
913     standard predefined macros remain defined.
914
915'-APREDICATE=ANSWER'
916     Make an assertion with the predicate PREDICATE and answer ANSWER.
917     This form is preferred to the older form -A predicate(answer),
918     which is still supported, because it does not use shell special
919     characters.
920
921'-A-PREDICATE=ANSWER'
922     Cancel an assertion with the predicate PREDICATE and answer ANSWER.
923
924'-C'
925     Do not discard comments.  All comments are passed through to the
926     output file, except for comments in processed directives, which are
927     deleted along with the directive.
928
929     You should be prepared for side effects when using '-C'; it causes
930     the preprocessor to treat comments as tokens in their own right.
931     For example, comments appearing at the start of what would be a
932     directive line have the effect of turning that line into an
933     ordinary source line, since the first token on the line is no
934     longer a ''#''.
935
936     Warning: this currently handles C-Style comments only.  The
937     preprocessor does not yet recognize Fortran-style comments.
938
939'-CC'
940     Do not discard comments, including during macro expansion.  This is
941     like '-C', except that comments contained within macros are also
942     passed through to the output file where the macro is expanded.
943
944     In addition to the side-effects of the '-C' option, the '-CC'
945     option causes all C++-style comments inside a macro to be converted
946     to C-style comments.  This is to prevent later use of that macro
947     from inadvertently commenting out the remainder of the source line.
948     The '-CC' option is generally used to support lint comments.
949
950     Warning: this currently handles C- and C++-Style comments only.
951     The preprocessor does not yet recognize Fortran-style comments.
952
953'-DNAME'
954     Predefine name as a macro, with definition '1'.
955
956'-DNAME=DEFINITION'
957     The contents of DEFINITION are tokenized and processed as if they
958     appeared during translation phase three in a ''#define'' directive.
959     In particular, the definition will be truncated by embedded newline
960     characters.
961
962     If you are invoking the preprocessor from a shell or shell-like
963     program you may need to use the shell's quoting syntax to protect
964     characters such as spaces that have a meaning in the shell syntax.
965
966     If you wish to define a function-like macro on the command line,
967     write its argument list with surrounding parentheses before the
968     equals sign (if any).  Parentheses are meaningful to most shells,
969     so you will need to quote the option.  With sh and csh,
970     '-D'name(args...)=definition'' works.
971
972     '-D' and '-U' options are processed in the order they are given on
973     the command line.  All -imacros file and -include file options are
974     processed after all -D and -U options.
975
976'-H'
977     Print the name of each header file used, in addition to other
978     normal activities.  Each name is indented to show how deep in the
979     ''#include'' stack it is.
980
981'-P'
982     Inhibit generation of linemarkers in the output from the
983     preprocessor.  This might be useful when running the preprocessor
984     on something that is not C code, and will be sent to a program
985     which might be confused by the linemarkers.
986
987'-UNAME'
988     Cancel any previous definition of NAME, either built in or provided
989     with a '-D' option.
990
991
992File: gfortran.info,  Node: Error and Warning Options,  Next: Debugging Options,  Prev: Preprocessing Options,  Up: Invoking GNU Fortran
993
9942.4 Options to request or suppress errors and warnings
995======================================================
996
997Errors are diagnostic messages that report that the GNU Fortran compiler
998cannot compile the relevant piece of source code.  The compiler will
999continue to process the program in an attempt to report further errors
1000to aid in debugging, but will not produce any compiled output.
1001
1002   Warnings are diagnostic messages that report constructions which are
1003not inherently erroneous but which are risky or suggest there is likely
1004to be a bug in the program.  Unless '-Werror' is specified, they do not
1005prevent compilation of the program.
1006
1007   You can request many specific warnings with options beginning '-W',
1008for example '-Wimplicit' to request warnings on implicit declarations.
1009Each of these specific warning options also has a negative form
1010beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'.
1011This manual lists only one of the two forms, whichever is not the
1012default.
1013
1014   These options control the amount and kinds of errors and warnings
1015produced by GNU Fortran:
1016
1017'-fmax-errors=N'
1018     Limits the maximum number of error messages to N, at which point
1019     GNU Fortran bails out rather than attempting to continue processing
1020     the source code.  If N is 0, there is no limit on the number of
1021     error messages produced.
1022
1023'-fsyntax-only'
1024     Check the code for syntax errors, but do not actually compile it.
1025     This will generate module files for each module present in the
1026     code, but no other output file.
1027
1028'-Wpedantic'
1029'-pedantic'
1030     Issue warnings for uses of extensions to Fortran.  '-pedantic' also
1031     applies to C-language constructs where they occur in GNU Fortran
1032     source files, such as use of '\e' in a character constant within a
1033     directive like '#include'.
1034
1035     Valid Fortran programs should compile properly with or without this
1036     option.  However, without this option, certain GNU extensions and
1037     traditional Fortran features are supported as well.  With this
1038     option, many of them are rejected.
1039
1040     Some users try to use '-pedantic' to check programs for
1041     conformance.  They soon find that it does not do quite what they
1042     want--it finds some nonstandard practices, but not all.  However,
1043     improvements to GNU Fortran in this area are welcome.
1044
1045     This should be used in conjunction with '-std=f95', '-std=f2003',
1046     '-std=f2008' or '-std=f2018'.
1047
1048'-pedantic-errors'
1049     Like '-pedantic', except that errors are produced rather than
1050     warnings.
1051
1052'-Wall'
1053     Enables commonly used warning options pertaining to usage that we
1054     recommend avoiding and that we believe are easy to avoid.  This
1055     currently includes '-Waliasing', '-Wampersand', '-Wconversion',
1056     '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs',
1057     '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime',
1058     '-Winteger-division', '-Wreal-q-constant', '-Wunused' and
1059     '-Wundefined-do-loop'.
1060
1061'-Waliasing'
1062     Warn about possible aliasing of dummy arguments.  Specifically, it
1063     warns if the same actual argument is associated with a dummy
1064     argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)'
1065     in a call with an explicit interface.
1066
1067     The following example will trigger the warning.
1068            interface
1069              subroutine bar(a,b)
1070                integer, intent(in) :: a
1071                integer, intent(out) :: b
1072              end subroutine
1073            end interface
1074            integer :: a
1075
1076            call bar(a,a)
1077
1078'-Wampersand'
1079     Warn about missing ampersand in continued character constants.  The
1080     warning is given with '-Wampersand', '-pedantic', '-std=f95',
1081     '-std=f2003', '-std=f2008' and '-std=f2018'.  Note: With no
1082     ampersand given in a continued character constant, GNU Fortran
1083     assumes continuation at the first non-comment, non-whitespace
1084     character after the ampersand that initiated the continuation.
1085
1086'-Warray-temporaries'
1087     Warn about array temporaries generated by the compiler.  The
1088     information generated by this warning is sometimes useful in
1089     optimization, in order to avoid such temporaries.
1090
1091'-Wc-binding-type'
1092     Warn if the a variable might not be C interoperable.  In
1093     particular, warn if the variable has been declared using an
1094     intrinsic type with default kind instead of using a kind parameter
1095     defined for C interoperability in the intrinsic 'ISO_C_Binding'
1096     module.  This option is implied by '-Wall'.
1097
1098'-Wcharacter-truncation'
1099     Warn when a character assignment will truncate the assigned string.
1100
1101'-Wline-truncation'
1102     Warn when a source code line will be truncated.  This option is
1103     implied by '-Wall'.  For free-form source code, the default is
1104     '-Werror=line-truncation' such that truncations are reported as
1105     error.
1106
1107'-Wconversion'
1108     Warn about implicit conversions that are likely to change the value
1109     of the expression after conversion.  Implied by '-Wall'.
1110
1111'-Wconversion-extra'
1112     Warn about implicit conversions between different types and kinds.
1113     This option does _not_ imply '-Wconversion'.
1114
1115'-Wextra'
1116     Enables some warning options for usages of language features which
1117     may be problematic.  This currently includes '-Wcompare-reals',
1118     '-Wunused-parameter' and '-Wdo-subscript'.
1119
1120'-Wfrontend-loop-interchange'
1121     Warn when using '-ffrontend-loop-interchange' for performing loop
1122     interchanges.
1123
1124'-Wimplicit-interface'
1125     Warn if a procedure is called without an explicit interface.  Note
1126     this only checks that an explicit interface is present.  It does
1127     not check that the declared interfaces are consistent across
1128     program units.
1129
1130'-Wimplicit-procedure'
1131     Warn if a procedure is called that has neither an explicit
1132     interface nor has been declared as 'EXTERNAL'.
1133
1134'-Winteger-division'
1135     Warn if a constant integer division truncates its result.  As an
1136     example, 3/5 evaluates to 0.
1137
1138'-Wintrinsics-std'
1139     Warn if 'gfortran' finds a procedure named like an intrinsic not
1140     available in the currently selected standard (with '-std') and
1141     treats it as 'EXTERNAL' procedure because of this.
1142     '-fall-intrinsics' can be used to never trigger this behavior and
1143     always link to the intrinsic regardless of the selected standard.
1144
1145'-Wno-overwrite-recursive'
1146     Do not warn when '-fno-automatic' is used with '-frecursive'.
1147     Recursion will be broken if the relevant local variables do not
1148     have the attribute 'AUTOMATIC' explicitly declared.  This option
1149     can be used to suppress the warning when it is known that recursion
1150     is not broken.  Useful for build environments that use '-Werror'.
1151
1152'-Wreal-q-constant'
1153     Produce a warning if a real-literal-constant contains a 'q'
1154     exponent-letter.
1155
1156'-Wsurprising'
1157     Produce a warning when "suspicious" code constructs are
1158     encountered.  While technically legal these usually indicate that
1159     an error has been made.
1160
1161     This currently produces a warning under the following
1162     circumstances:
1163
1164        * An INTEGER SELECT construct has a CASE that can never be
1165          matched as its lower value is greater than its upper value.
1166
1167        * A LOGICAL SELECT construct has three CASE statements.
1168
1169        * A TRANSFER specifies a source that is shorter than the
1170          destination.
1171
1172        * The type of a function result is declared more than once with
1173          the same type.  If '-pedantic' or standard-conforming mode is
1174          enabled, this is an error.
1175
1176        * A 'CHARACTER' variable is declared with negative length.
1177
1178'-Wtabs'
1179     By default, tabs are accepted as whitespace, but tabs are not
1180     members of the Fortran Character Set.  For continuation lines, a
1181     tab followed by a digit between 1 and 9 is supported.  '-Wtabs'
1182     will cause a warning to be issued if a tab is encountered.  Note,
1183     '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003',
1184     '-std=f2008', '-std=f2018' and '-Wall'.
1185
1186'-Wundefined-do-loop'
1187     Warn if a DO loop with step either 1 or -1 yields an underflow or
1188     an overflow during iteration of an induction variable of the loop.
1189     This option is implied by '-Wall'.
1190
1191'-Wunderflow'
1192     Produce a warning when numerical constant expressions are
1193     encountered, which yield an UNDERFLOW during compilation.  Enabled
1194     by default.
1195
1196'-Wintrinsic-shadow'
1197     Warn if a user-defined procedure or module procedure has the same
1198     name as an intrinsic; in this case, an explicit interface or
1199     'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls
1200     later resolved to the desired intrinsic/procedure.  This option is
1201     implied by '-Wall'.
1202
1203'-Wuse-without-only'
1204     Warn if a 'USE' statement has no 'ONLY' qualifier and thus
1205     implicitly imports all public entities of the used module.
1206
1207'-Wunused-dummy-argument'
1208     Warn about unused dummy arguments.  This option is implied by
1209     '-Wall'.
1210
1211'-Wunused-parameter'
1212     Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s
1213     implementation of this option does not warn about unused dummy
1214     arguments (see '-Wunused-dummy-argument'), but about unused
1215     'PARAMETER' values.  '-Wunused-parameter' is implied by '-Wextra'
1216     if also '-Wunused' or '-Wall' is used.
1217
1218'-Walign-commons'
1219     By default, 'gfortran' warns about any occasion of variables being
1220     padded for proper alignment inside a 'COMMON' block.  This warning
1221     can be turned off via '-Wno-align-commons'.  See also
1222     '-falign-commons'.
1223
1224'-Wfunction-elimination'
1225     Warn if any calls to impure functions are eliminated by the
1226     optimizations enabled by the '-ffrontend-optimize' option.  This
1227     option is implied by '-Wextra'.
1228
1229'-Wrealloc-lhs'
1230     Warn when the compiler might insert code to for allocation or
1231     reallocation of an allocatable array variable of intrinsic type in
1232     intrinsic assignments.  In hot loops, the Fortran 2003 reallocation
1233     feature may reduce the performance.  If the array is already
1234     allocated with the correct shape, consider using a whole-array
1235     array-spec (e.g.  '(:,:,:)') for the variable on the left-hand side
1236     to prevent the reallocation check.  Note that in some cases the
1237     warning is shown, even if the compiler will optimize reallocation
1238     checks away.  For instance, when the right-hand side contains the
1239     same variable multiplied by a scalar.  See also '-frealloc-lhs'.
1240
1241'-Wrealloc-lhs-all'
1242     Warn when the compiler inserts code to for allocation or
1243     reallocation of an allocatable variable; this includes scalars and
1244     derived types.
1245
1246'-Wcompare-reals'
1247     Warn when comparing real or complex types for equality or
1248     inequality.  This option is implied by '-Wextra'.
1249
1250'-Wtarget-lifetime'
1251     Warn if the pointer in a pointer assignment might be longer than
1252     the its target.  This option is implied by '-Wall'.
1253
1254'-Wzerotrip'
1255     Warn if a 'DO' loop is known to execute zero times at compile time.
1256     This option is implied by '-Wall'.
1257
1258'-Wdo-subscript'
1259     Warn if an array subscript inside a DO loop could lead to an
1260     out-of-bounds access even if the compiler cannot prove that the
1261     statement is actually executed, in cases like
1262            real a(3)
1263            do i=1,4
1264              if (condition(i)) then
1265                a(i) = 1.2
1266              end if
1267            end do
1268     This option is implied by '-Wextra'.
1269
1270'-Werror'
1271     Turns all warnings into errors.
1272
1273   *Note Options to Request or Suppress Errors and Warnings:
1274(gcc)Warning Options, for information on more options offered by the GBE
1275shared by 'gfortran', 'gcc' and other GNU compilers.
1276
1277   Some of these have no effect when compiling programs written in
1278Fortran.
1279
1280
1281File: gfortran.info,  Node: Debugging Options,  Next: Directory Options,  Prev: Error and Warning Options,  Up: Invoking GNU Fortran
1282
12832.5 Options for debugging your program or GNU Fortran
1284=====================================================
1285
1286GNU Fortran has various special options that are used for debugging
1287either your program or the GNU Fortran compiler.
1288
1289'-fdump-fortran-original'
1290     Output the internal parse tree after translating the source program
1291     into internal representation.  This option is mostly useful for
1292     debugging the GNU Fortran compiler itself.  The output generated by
1293     this option might change between releases.  This option may also
1294     generate internal compiler errors for features which have only
1295     recently been added.
1296
1297'-fdump-fortran-optimized'
1298     Output the parse tree after front-end optimization.  Mostly useful
1299     for debugging the GNU Fortran compiler itself.  The output
1300     generated by this option might change between releases.  This
1301     option may also generate internal compiler errors for features
1302     which have only recently been added.
1303
1304'-fdump-parse-tree'
1305     Output the internal parse tree after translating the source program
1306     into internal representation.  Mostly useful for debugging the GNU
1307     Fortran compiler itself.  The output generated by this option might
1308     change between releases.  This option may also generate internal
1309     compiler errors for features which have only recently been added.
1310     This option is deprecated; use '-fdump-fortran-original' instead.
1311
1312'-fdump-fortran-global'
1313     Output a list of the global identifiers after translating into
1314     middle-end representation.  Mostly useful for debugging the GNU
1315     Fortran compiler itself.  The output generated by this option might
1316     change between releases.  This option may also generate internal
1317     compiler errors for features which have only recently been added.
1318
1319'-ffpe-trap=LIST'
1320     Specify a list of floating point exception traps to enable.  On
1321     most systems, if a floating point exception occurs and the trap for
1322     that exception is enabled, a SIGFPE signal will be sent and the
1323     program being aborted, producing a core file useful for debugging.
1324     LIST is a (possibly empty) comma-separated list of the following
1325     exceptions: 'invalid' (invalid floating point operation, such as
1326     'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a
1327     floating point operation), 'underflow' (underflow in a floating
1328     point operation), 'inexact' (loss of precision during operation),
1329     and 'denormal' (operation performed on a denormal value).  The
1330     first five exceptions correspond to the five IEEE 754 exceptions,
1331     whereas the last one ('denormal') is not part of the IEEE 754
1332     standard but is available on some common architectures such as x86.
1333
1334     The first three exceptions ('invalid', 'zero', and 'overflow')
1335     often indicate serious errors, and unless the program has
1336     provisions for dealing with these exceptions, enabling traps for
1337     these three exceptions is probably a good idea.
1338
1339     If the option is used more than once in the command line, the lists
1340     will be joined: ''ffpe-trap='LIST1 'ffpe-trap='LIST2' is equivalent
1341     to 'ffpe-trap='LIST1,LIST2.
1342
1343     Note that once enabled an exception cannot be disabled (no negative
1344     form).
1345
1346     Many, if not most, floating point operations incur loss of
1347     precision due to rounding, and hence the 'ffpe-trap=inexact' is
1348     likely to be uninteresting in practice.
1349
1350     By default no exception traps are enabled.
1351
1352'-ffpe-summary=LIST'
1353     Specify a list of floating-point exceptions, whose flag status is
1354     printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'.
1355     LIST can be either 'none', 'all' or a comma-separated list of the
1356     following exceptions: 'invalid', 'zero', 'overflow', 'underflow',
1357     'inexact' and 'denormal'.  (See '-ffpe-trap' for a description of
1358     the exceptions.)
1359
1360     If the option is used more than once in the command line, only the
1361     last one will be used.
1362
1363     By default, a summary for all exceptions but 'inexact' is shown.
1364
1365'-fno-backtrace'
1366     When a serious runtime error is encountered or a deadly signal is
1367     emitted (segmentation fault, illegal instruction, bus error,
1368     floating-point exception, and the other POSIX signals that have the
1369     action 'core'), the Fortran runtime library tries to output a
1370     backtrace of the error.  '-fno-backtrace' disables the backtrace
1371     generation.  This option only has influence for compilation of the
1372     Fortran main program.
1373
1374   *Note Options for Debugging Your Program or GCC: (gcc)Debugging
1375Options, for more information on debugging options.
1376
1377
1378File: gfortran.info,  Node: Directory Options,  Next: Link Options,  Prev: Debugging Options,  Up: Invoking GNU Fortran
1379
13802.6 Options for directory search
1381================================
1382
1383These options affect how GNU Fortran searches for files specified by the
1384'INCLUDE' directive and where it searches for previously compiled
1385modules.
1386
1387   It also affects the search paths used by 'cpp' when used to
1388preprocess Fortran source.
1389
1390'-IDIR'
1391     These affect interpretation of the 'INCLUDE' directive (as well as
1392     of the '#include' directive of the 'cpp' preprocessor).
1393
1394     Also note that the general behavior of '-I' and 'INCLUDE' is pretty
1395     much the same as of '-I' with '#include' in the 'cpp' preprocessor,
1396     with regard to looking for 'header.gcc' files and other such
1397     things.
1398
1399     This path is also used to search for '.mod' files when previously
1400     compiled modules are required by a 'USE' statement.
1401
1402     *Note Options for Directory Search: (gcc)Directory Options, for
1403     information on the '-I' option.
1404
1405'-JDIR'
1406     This option specifies where to put '.mod' files for compiled
1407     modules.  It is also added to the list of directories to searched
1408     by an 'USE' statement.
1409
1410     The default is the current directory.
1411
1412'-fintrinsic-modules-path DIR'
1413     This option specifies the location of pre-compiled intrinsic
1414     modules, if they are not in the default location expected by the
1415     compiler.
1416
1417
1418File: gfortran.info,  Node: Link Options,  Next: Runtime Options,  Prev: Directory Options,  Up: Invoking GNU Fortran
1419
14202.7 Influencing the linking step
1421================================
1422
1423These options come into play when the compiler links object files into
1424an executable output file.  They are meaningless if the compiler is not
1425doing a link step.
1426
1427'-static-libgfortran'
1428     On systems that provide 'libgfortran' as a shared and a static
1429     library, this option forces the use of the static version.  If no
1430     shared version of 'libgfortran' was built when the compiler was
1431     configured, this option has no effect.
1432
1433
1434File: gfortran.info,  Node: Runtime Options,  Next: Code Gen Options,  Prev: Link Options,  Up: Invoking GNU Fortran
1435
14362.8 Influencing runtime behavior
1437================================
1438
1439These options affect the runtime behavior of programs compiled with GNU
1440Fortran.
1441
1442'-fconvert=CONVERSION'
1443     Specify the representation of data for unformatted files.  Valid
1444     values for conversion are: 'native', the default; 'swap', swap
1445     between big- and little-endian; 'big-endian', use big-endian
1446     representation for unformatted files; 'little-endian', use
1447     little-endian representation for unformatted files.
1448
1449     _This option has an effect only when used in the main program.  The
1450     'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
1451     variable override the default specified by '-fconvert'._
1452
1453'-frecord-marker=LENGTH'
1454     Specify the length of record markers for unformatted files.  Valid
1455     values for LENGTH are 4 and 8.  Default is 4.  _This is different
1456     from previous versions of 'gfortran'_, which specified a default
1457     record marker length of 8 on most systems.  If you want to read or
1458     write files compatible with earlier versions of 'gfortran', use
1459     '-frecord-marker=8'.
1460
1461'-fmax-subrecord-length=LENGTH'
1462     Specify the maximum length for a subrecord.  The maximum permitted
1463     value for length is 2147483639, which is also the default.  Only
1464     really useful for use by the gfortran testsuite.
1465
1466'-fsign-zero'
1467     When enabled, floating point numbers of value zero with the sign
1468     bit set are written as negative number in formatted output and
1469     treated as negative in the 'SIGN' intrinsic.  '-fno-sign-zero' does
1470     not print the negative sign of zero values (or values rounded to
1471     zero for I/O) and regards zero as positive number in the 'SIGN'
1472     intrinsic for compatibility with Fortran 77.  The default is
1473     '-fsign-zero'.
1474
1475
1476File: gfortran.info,  Node: Code Gen Options,  Next: Interoperability Options,  Prev: Runtime Options,  Up: Invoking GNU Fortran
1477
14782.9 Options for code generation conventions
1479===========================================
1480
1481These machine-independent options control the interface conventions used
1482in code generation.
1483
1484   Most of them have both positive and negative forms; the negative form
1485of '-ffoo' would be '-fno-foo'.  In the table below, only one of the
1486forms is listed--the one which is not the default.  You can figure out
1487the other form by either removing 'no-' or adding it.
1488
1489'-fno-automatic'
1490     Treat each program unit (except those marked as RECURSIVE) as if
1491     the 'SAVE' statement were specified for every local variable and
1492     array referenced in it.  Does not affect common blocks.  (Some
1493     Fortran compilers provide this option under the name '-static' or
1494     '-save'.)  The default, which is '-fautomatic', uses the stack for
1495     local variables smaller than the value given by
1496     '-fmax-stack-var-size'.  Use the option '-frecursive' to use no
1497     static memory.
1498
1499     Local variables or arrays having an explicit 'SAVE' attribute are
1500     silently ignored unless the '-pedantic' option is added.
1501
1502'-ff2c'
1503     Generate code designed to be compatible with code generated by
1504     'g77' and 'f2c'.
1505
1506     The calling conventions used by 'g77' (originally implemented in
1507     'f2c') require functions that return type default 'REAL' to
1508     actually return the C type 'double', and functions that return type
1509     'COMPLEX' to return the values via an extra argument in the calling
1510     sequence that points to where to store the return value.  Under the
1511     default GNU calling conventions, such functions simply return their
1512     results as they would in GNU C--default 'REAL' functions return the
1513     C type 'float', and 'COMPLEX' functions return the GNU C type
1514     'complex'.  Additionally, this option implies the
1515     '-fsecond-underscore' option, unless '-fno-second-underscore' is
1516     explicitly requested.
1517
1518     This does not affect the generation of code that interfaces with
1519     the 'libgfortran' library.
1520
1521     _Caution:_ It is not a good idea to mix Fortran code compiled with
1522     '-ff2c' with code compiled with the default '-fno-f2c' calling
1523     conventions as, calling 'COMPLEX' or default 'REAL' functions
1524     between program parts which were compiled with different calling
1525     conventions will break at execution time.
1526
1527     _Caution:_ This will break code which passes intrinsic functions of
1528     type default 'REAL' or 'COMPLEX' as actual arguments, as the
1529     library implementations use the '-fno-f2c' calling conventions.
1530
1531'-fno-underscoring'
1532     Do not transform names of entities specified in the Fortran source
1533     file by appending underscores to them.
1534
1535     With '-funderscoring' in effect, GNU Fortran appends one underscore
1536     to external names with no underscores.  This is done to ensure
1537     compatibility with code produced by many UNIX Fortran compilers.
1538
1539     _Caution_: The default behavior of GNU Fortran is incompatible with
1540     'f2c' and 'g77', please use the '-ff2c' option if you want object
1541     files compiled with GNU Fortran to be compatible with object code
1542     created with these tools.
1543
1544     Use of '-fno-underscoring' is not recommended unless you are
1545     experimenting with issues such as integration of GNU Fortran into
1546     existing system environments (vis-a`-vis existing libraries, tools,
1547     and so on).
1548
1549     For example, with '-funderscoring', and assuming that 'j()' and
1550     'max_count()' are external functions while 'my_var' and 'lvar' are
1551     local variables, a statement like
1552          I = J() + MAX_COUNT (MY_VAR, LVAR)
1553     is implemented as something akin to:
1554          i = j_() + max_count__(&my_var__, &lvar);
1555
1556     With '-fno-underscoring', the same statement is implemented as:
1557
1558          i = j() + max_count(&my_var, &lvar);
1559
1560     Use of '-fno-underscoring' allows direct specification of
1561     user-defined names while debugging and when interfacing GNU Fortran
1562     code with other languages.
1563
1564     Note that just because the names match does _not_ mean that the
1565     interface implemented by GNU Fortran for an external name matches
1566     the interface implemented by some other language for that same
1567     name.  That is, getting code produced by GNU Fortran to link to
1568     code produced by some other compiler using this or any other method
1569     can be only a small part of the overall solution--getting the code
1570     generated by both compilers to agree on issues other than naming
1571     can require significant effort, and, unlike naming disagreements,
1572     linkers normally cannot detect disagreements in these other areas.
1573
1574     Also, note that with '-fno-underscoring', the lack of appended
1575     underscores introduces the very real possibility that a
1576     user-defined external name will conflict with a name in a system
1577     library, which could make finding unresolved-reference bugs quite
1578     difficult in some cases--they might occur at program run time, and
1579     show up only as buggy behavior at run time.
1580
1581     In future versions of GNU Fortran we hope to improve naming and
1582     linking issues so that debugging always involves using the names as
1583     they appear in the source, even if the names as seen by the linker
1584     are mangled to prevent accidental linking between procedures with
1585     incompatible interfaces.
1586
1587'-fsecond-underscore'
1588     By default, GNU Fortran appends an underscore to external names.
1589     If this option is used GNU Fortran appends two underscores to names
1590     with underscores and one underscore to external names with no
1591     underscores.  GNU Fortran also appends two underscores to internal
1592     names with underscores to avoid naming collisions with external
1593     names.
1594
1595     This option has no effect if '-fno-underscoring' is in effect.  It
1596     is implied by the '-ff2c' option.
1597
1598     Otherwise, with this option, an external name such as 'MAX_COUNT'
1599     is implemented as a reference to the link-time external symbol
1600     'max_count__', instead of 'max_count_'.  This is required for
1601     compatibility with 'g77' and 'f2c', and is implied by use of the
1602     '-ff2c' option.
1603
1604'-fcoarray=<KEYWORD>'
1605
1606     'none'
1607          Disable coarray support; using coarray declarations and
1608          image-control statements will produce a compile-time error.
1609          (Default)
1610
1611     'single'
1612          Single-image mode, i.e.  'num_images()' is always one.
1613
1614     'lib'
1615          Library-based coarray parallelization; a suitable GNU Fortran
1616          coarray library needs to be linked.
1617
1618'-fcheck=<KEYWORD>'
1619
1620     Enable the generation of run-time checks; the argument shall be a
1621     comma-delimited list of the following keywords.  Prefixing a check
1622     with 'no-' disables it if it was activated by a previous
1623     specification.
1624
1625     'all'
1626          Enable all run-time test of '-fcheck'.
1627
1628     'array-temps'
1629          Warns at run time when for passing an actual argument a
1630          temporary array had to be generated.  The information
1631          generated by this warning is sometimes useful in optimization,
1632          in order to avoid such temporaries.
1633
1634          Note: The warning is only printed once per location.
1635
1636     'bits'
1637          Enable generation of run-time checks for invalid arguments to
1638          the bit manipulation intrinsics.
1639
1640     'bounds'
1641          Enable generation of run-time checks for array subscripts and
1642          against the declared minimum and maximum values.  It also
1643          checks array indices for assumed and deferred shape arrays
1644          against the actual allocated bounds and ensures that all
1645          string lengths are equal for character array constructors
1646          without an explicit typespec.
1647
1648          Some checks require that '-fcheck=bounds' is set for the
1649          compilation of the main program.
1650
1651          Note: In the future this may also include other forms of
1652          checking, e.g., checking substring references.
1653
1654     'do'
1655          Enable generation of run-time checks for invalid modification
1656          of loop iteration variables.
1657
1658     'mem'
1659          Enable generation of run-time checks for memory allocation.
1660          Note: This option does not affect explicit allocations using
1661          the 'ALLOCATE' statement, which will be always checked.
1662
1663     'pointer'
1664          Enable generation of run-time checks for pointers and
1665          allocatables.
1666
1667     'recursion'
1668          Enable generation of run-time checks for recursively called
1669          subroutines and functions which are not marked as recursive.
1670          See also '-frecursive'.  Note: This check does not work for
1671          OpenMP programs and is disabled if used together with
1672          '-frecursive' and '-fopenmp'.
1673
1674     Example: Assuming you have a file 'foo.f90', the command
1675            gfortran -fcheck=all,no-array-temps foo.f90
1676     will compile the file with all checks enabled as specified above
1677     except warnings for generated array temporaries.
1678
1679'-fbounds-check'
1680     Deprecated alias for '-fcheck=bounds'.
1681
1682'-ftail-call-workaround'
1683'-ftail-call-workaround=N'
1684     Some C interfaces to Fortran codes violate the gfortran ABI by
1685     omitting the hidden character length arguments as described in
1686     *Note Argument passing conventions::.  This can lead to crashes
1687     because pushing arguments for tail calls can overflow the stack.
1688
1689     To provide a workaround for existing binary packages, this option
1690     disables tail call optimization for gfortran procedures with
1691     character arguments.  With '-ftail-call-workaround=2' tail call
1692     optimization is disabled in all gfortran procedures with character
1693     arguments, with '-ftail-call-workaround=1' or equivalent
1694     '-ftail-call-workaround' only in gfortran procedures with character
1695     arguments that call implicitly prototyped procedures.
1696
1697     Using this option can lead to problems including crashes due to
1698     insufficient stack space.
1699
1700     It is _very strongly_ recommended to fix the code in question.  The
1701     '-fc-prototypes-external' option can be used to generate prototypes
1702     which conform to gfortran's ABI, for inclusion in the source code.
1703
1704     Support for this option will likely be withdrawn in a future
1705     release of gfortran.
1706
1707     The negative form, '-fno-tail-call-workaround' or equivalent
1708     '-ftail-call-workaround=0', can be used to disable this option.
1709
1710     Default is currently '-ftail-call-workaround', this will change in
1711     future releases.
1712
1713'-fcheck-array-temporaries'
1714     Deprecated alias for '-fcheck=array-temps'.
1715
1716'-fmax-array-constructor=N'
1717     This option can be used to increase the upper limit permitted in
1718     array constructors.  The code below requires this option to expand
1719     the array at compile time.
1720
1721          program test
1722          implicit none
1723          integer j
1724          integer, parameter :: n = 100000
1725          integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
1726          print '(10(I0,1X))', i
1727          end program test
1728
1729     _Caution: This option can lead to long compile times and
1730     excessively large object files._
1731
1732     The default value for N is 65535.
1733
1734'-fmax-stack-var-size=N'
1735     This option specifies the size in bytes of the largest array that
1736     will be put on the stack; if the size is exceeded static memory is
1737     used (except in procedures marked as RECURSIVE). Use the option
1738     '-frecursive' to allow for recursive procedures which do not have a
1739     RECURSIVE attribute or for parallel programs.  Use '-fno-automatic'
1740     to never use the stack.
1741
1742     This option currently only affects local arrays declared with
1743     constant bounds, and may not apply to all character variables.
1744     Future versions of GNU Fortran may improve this behavior.
1745
1746     The default value for N is 65536.
1747
1748'-fstack-arrays'
1749     Adding this option will make the Fortran compiler put all arrays of
1750     unknown size and array temporaries onto stack memory.  If your
1751     program uses very large local arrays it is possible that you will
1752     have to extend your runtime limits for stack memory on some
1753     operating systems.  This flag is enabled by default at optimization
1754     level '-Ofast' unless '-fmax-stack-var-size' is specified.
1755
1756'-fpack-derived'
1757     This option tells GNU Fortran to pack derived type members as
1758     closely as possible.  Code compiled with this option is likely to
1759     be incompatible with code compiled without this option, and may
1760     execute slower.
1761
1762'-frepack-arrays'
1763     In some circumstances GNU Fortran may pass assumed shape array
1764     sections via a descriptor describing a noncontiguous area of
1765     memory.  This option adds code to the function prologue to repack
1766     the data into a contiguous block at runtime.
1767
1768     This should result in faster accesses to the array.  However it can
1769     introduce significant overhead to the function call, especially
1770     when the passed data is noncontiguous.
1771
1772'-fshort-enums'
1773     This option is provided for interoperability with C code that was
1774     compiled with the '-fshort-enums' option.  It will make GNU Fortran
1775     choose the smallest 'INTEGER' kind a given enumerator set will fit
1776     in, and give all its enumerators this kind.
1777
1778'-finline-arg-packing'
1779     When passing an assumed-shape argument of a procedure as actual
1780     argument to an assumed-size or explicit size or as argument to a
1781     procedure that does not have an explicit interface, the argument
1782     may have to be packed, that is put into contiguous memory.  An
1783     example is the call to 'foo' in
1784            subroutine foo(a)
1785               real, dimension(*) :: a
1786            end subroutine foo
1787            subroutine bar(b)
1788               real, dimension(:) :: b
1789               call foo(b)
1790            end subroutine bar
1791
1792     When '-finline-arg-packing' is in effect, this packing will be
1793     performed by inline code.  This allows for more optimization while
1794     increasing code size.
1795
1796     '-finline-arg-packing' is implied by any of the '-O' options except
1797     when optimizing for size via '-Os'.  If the code contains a very
1798     large number of argument that have to be packed, code size and also
1799     compilation time may become excessive.  If that is the case, it may
1800     be better to disable this option.  Instances of packing can be
1801     found by using by using '-Warray-temporaries'.
1802
1803'-fexternal-blas'
1804     This option will make 'gfortran' generate calls to BLAS functions
1805     for some matrix operations like 'MATMUL', instead of using our own
1806     algorithms, if the size of the matrices involved is larger than a
1807     given limit (see '-fblas-matmul-limit').  This may be profitable if
1808     an optimized vendor BLAS library is available.  The BLAS library
1809     will have to be specified at link time.
1810
1811'-fblas-matmul-limit=N'
1812     Only significant when '-fexternal-blas' is in effect.  Matrix
1813     multiplication of matrices with size larger than (or equal to) N
1814     will be performed by calls to BLAS functions, while others will be
1815     handled by 'gfortran' internal algorithms.  If the matrices
1816     involved are not square, the size comparison is performed using the
1817     geometric mean of the dimensions of the argument and result
1818     matrices.
1819
1820     The default value for N is 30.
1821
1822'-finline-matmul-limit=N'
1823     When front-end optimiztion is active, some calls to the 'MATMUL'
1824     intrinsic function will be inlined.  This may result in code size
1825     increase if the size of the matrix cannot be determined at compile
1826     time, as code for both cases is generated.  Setting
1827     '-finline-matmul-limit=0' will disable inlining in all cases.
1828     Setting this option with a value of N will produce inline code for
1829     matrices with size up to N.  If the matrices involved are not
1830     square, the size comparison is performed using the geometric mean
1831     of the dimensions of the argument and result matrices.
1832
1833     The default value for N is 30.  The '-fblas-matmul-limit' can be
1834     used to change this value.
1835
1836'-frecursive'
1837     Allow indirect recursion by forcing all local arrays to be
1838     allocated on the stack.  This flag cannot be used together with
1839     '-fmax-stack-var-size=' or '-fno-automatic'.
1840
1841'-finit-local-zero'
1842'-finit-derived'
1843'-finit-integer=N'
1844'-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
1845'-finit-logical=<TRUE|FALSE>'
1846'-finit-character=N'
1847     The '-finit-local-zero' option instructs the compiler to initialize
1848     local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL'
1849     variables to false, and 'CHARACTER' variables to a string of null
1850     bytes.  Finer-grained initialization options are provided by the
1851     '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which
1852     also initializes the real and imaginary parts of local 'COMPLEX'
1853     variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N'
1854     (where N is an ASCII character value) options.
1855
1856     With '-finit-derived', components of derived type variables will be
1857     initialized according to these flags.  Components whose type is not
1858     covered by an explicit '-finit-*' flag will be treated as described
1859     above with '-finit-local-zero'.
1860
1861     These options do not initialize
1862        * objects with the POINTER attribute
1863        * allocatable arrays
1864        * variables that appear in an 'EQUIVALENCE' statement.
1865     (These limitations may be removed in future releases).
1866
1867     Note that the '-finit-real=nan' option initializes 'REAL' and
1868     'COMPLEX' variables with a quiet NaN. For a signalling NaN use
1869     '-finit-real=snan'; note, however, that compile-time optimizations
1870     may convert them into quiet NaN and that trapping needs to be
1871     enabled (e.g.  via '-ffpe-trap').
1872
1873     The '-finit-integer' option will parse the value into an integer of
1874     type 'INTEGER(kind=C_LONG)' on the host.  Said value is then
1875     assigned to the integer variables in the Fortran code, which might
1876     result in wraparound if the value is too large for the kind.
1877
1878     Finally, note that enabling any of the '-finit-*' options will
1879     silence warnings that would have been emitted by '-Wuninitialized'
1880     for the affected local variables.
1881
1882'-falign-commons'
1883     By default, 'gfortran' enforces proper alignment of all variables
1884     in a 'COMMON' block by padding them as needed.  On certain
1885     platforms this is mandatory, on others it increases performance.
1886     If a 'COMMON' block is not declared with consistent data types
1887     everywhere, this padding can cause trouble, and
1888     '-fno-align-commons' can be used to disable automatic alignment.
1889     The same form of this option should be used for all files that
1890     share a 'COMMON' block.  To avoid potential alignment issues in
1891     'COMMON' blocks, it is recommended to order objects from largest to
1892     smallest.
1893
1894'-fno-protect-parens'
1895     By default the parentheses in expression are honored for all
1896     optimization levels such that the compiler does not do any
1897     re-association.  Using '-fno-protect-parens' allows the compiler to
1898     reorder 'REAL' and 'COMPLEX' expressions to produce faster code.
1899     Note that for the re-association optimization '-fno-signed-zeros'
1900     and '-fno-trapping-math' need to be in effect.  The parentheses
1901     protection is enabled by default, unless '-Ofast' is given.
1902
1903'-frealloc-lhs'
1904     An allocatable left-hand side of an intrinsic assignment is
1905     automatically (re)allocated if it is either unallocated or has a
1906     different shape.  The option is enabled by default except when
1907     '-std=f95' is given.  See also '-Wrealloc-lhs'.
1908
1909'-faggressive-function-elimination'
1910     Functions with identical argument lists are eliminated within
1911     statements, regardless of whether these functions are marked 'PURE'
1912     or not.  For example, in
1913            a = f(b,c) + f(b,c)
1914     there will only be a single call to 'f'.  This option only works if
1915     '-ffrontend-optimize' is in effect.
1916
1917'-ffrontend-optimize'
1918     This option performs front-end optimization, based on manipulating
1919     parts the Fortran parse tree.  Enabled by default by any '-O'
1920     option except '-O0' and '-Og'.  Optimizations enabled by this
1921     option include:
1922        * inlining calls to 'MATMUL',
1923        * elimination of identical function calls within expressions,
1924        * removing unnecessary calls to 'TRIM' in comparisons and
1925          assignments,
1926        * replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))' and
1927        * short-circuiting of logical operators ('.AND.' and '.OR.').
1928     It can be deselected by specifying '-fno-frontend-optimize'.
1929
1930'-ffrontend-loop-interchange'
1931     Attempt to interchange loops in the Fortran front end where
1932     profitable.  Enabled by default by any '-O' option.  At the moment,
1933     this option only affects 'FORALL' and 'DO CONCURRENT' statements
1934     with several forall triplets.
1935
1936   *Note Options for Code Generation Conventions: (gcc)Code Gen Options,
1937for information on more options offered by the GBE shared by 'gfortran',
1938'gcc', and other GNU compilers.
1939
1940
1941File: gfortran.info,  Node: Interoperability Options,  Next: Environment Variables,  Prev: Code Gen Options,  Up: Invoking GNU Fortran
1942
19432.10 Options for interoperability with other languages
1944======================================================
1945
1946-fc-prototypes
1947     This option will generate C prototypes from 'BIND(C)' variable
1948     declarations, types and procedure interfaces and writes them to
1949     standard output.  'ENUM' is not yet supported.
1950
1951     The generated prototypes may need inclusion of an appropriate
1952     header, such as '<stdint.h>' or '<stdlib.h>'.  For types which are
1953     not specified using the appropriate kind from the 'iso_c_binding'
1954     module, a warning is added as a comment to the code.
1955
1956     For function pointers, a pointer to a function returning 'int'
1957     without an explicit argument list is generated.
1958
1959     Example of use:
1960          $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h
1961     where the C code intended for interoperating with the Fortran code
1962     then uses '#include "foo.h"'.
1963
1964-fc-prototypes-external
1965     This option will generate C prototypes from external functions and
1966     subroutines and write them to standard output.  This may be useful
1967     for making sure that C bindings to Fortran code are correct.  This
1968     option does not generate prototypes for 'BIND(C)' procedures, use
1969     '-fc-prototypes' for that.
1970
1971     The generated prototypes may need inclusion of an appropriate
1972     header, such as as '<stdint.h>' or '<stdlib.h>'.
1973
1974     This is primarily meant for legacy code to ensure that existing C
1975     bindings match what 'gfortran' emits.  The generated C prototypes
1976     should be correct for the current version of the compiler, but may
1977     not match what other compilers or earlier versions of 'gfortran'
1978     need.  For new developments, use of the 'BIND(C)' features is
1979     recommended.
1980
1981     Example of use:
1982          $ gfortran -fc-prototypes-external -fsyntax-only foo.f > foo.h
1983     where the C code intended for interoperating with the Fortran code
1984     then uses '#include "foo.h"'.
1985
1986
1987File: gfortran.info,  Node: Environment Variables,  Prev: Interoperability Options,  Up: Invoking GNU Fortran
1988
19892.11 Environment variables affecting 'gfortran'
1990===============================================
1991
1992The 'gfortran' compiler currently does not make use of any environment
1993variables to control its operation above and beyond those that affect
1994the operation of 'gcc'.
1995
1996   *Note Environment Variables Affecting GCC: (gcc)Environment
1997Variables, for information on environment variables.
1998
1999   *Note Runtime::, for environment variables that affect the run-time
2000behavior of programs compiled with GNU Fortran.
2001
2002
2003File: gfortran.info,  Node: Runtime,  Next: Fortran standards status,  Prev: Invoking GNU Fortran,  Up: Top
2004
20053 Runtime: Influencing runtime behavior with environment variables
2006******************************************************************
2007
2008The behavior of the 'gfortran' can be influenced by environment
2009variables.
2010
2011   Malformed environment variables are silently ignored.
2012
2013* Menu:
2014
2015* TMPDIR:: Directory for scratch files
2016* GFORTRAN_STDIN_UNIT:: Unit number for standard input
2017* GFORTRAN_STDOUT_UNIT:: Unit number for standard output
2018* GFORTRAN_STDERR_UNIT:: Unit number for standard error
2019* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units
2020* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
2021* GFORTRAN_SHOW_LOCUS::  Show location for runtime errors
2022* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
2023* GFORTRAN_LIST_SEPARATOR::  Separator for list output
2024* GFORTRAN_CONVERT_UNIT::  Set endianness for unformatted I/O
2025* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
2026* GFORTRAN_FORMATTED_BUFFER_SIZE:: Buffer size for formatted files
2027* GFORTRAN_UNFORMATTED_BUFFER_SIZE:: Buffer size for unformatted files
2028
2029
2030File: gfortran.info,  Node: TMPDIR,  Next: GFORTRAN_STDIN_UNIT,  Up: Runtime
2031
20323.1 'TMPDIR'--Directory for scratch files
2033=========================================
2034
2035When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create
2036the file in one of the potential directories by testing each directory
2037in the order below.
2038
2039  1. The environment variable 'TMPDIR', if it exists.
2040
2041  2. On the MinGW target, the directory returned by the 'GetTempPath'
2042     function.  Alternatively, on the Cygwin target, the 'TMP' and
2043     'TEMP' environment variables, if they exist, in that order.
2044
2045  3. The 'P_tmpdir' macro if it is defined, otherwise the directory
2046     '/tmp'.
2047
2048
2049File: gfortran.info,  Node: GFORTRAN_STDIN_UNIT,  Next: GFORTRAN_STDOUT_UNIT,  Prev: TMPDIR,  Up: Runtime
2050
20513.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input
2052=========================================================
2053
2054This environment variable can be used to select the unit number
2055preconnected to standard input.  This must be a positive integer.  The
2056default value is 5.
2057
2058
2059File: gfortran.info,  Node: GFORTRAN_STDOUT_UNIT,  Next: GFORTRAN_STDERR_UNIT,  Prev: GFORTRAN_STDIN_UNIT,  Up: Runtime
2060
20613.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output
2062===========================================================
2063
2064This environment variable can be used to select the unit number
2065preconnected to standard output.  This must be a positive integer.  The
2066default value is 6.
2067
2068
2069File: gfortran.info,  Node: GFORTRAN_STDERR_UNIT,  Next: GFORTRAN_UNBUFFERED_ALL,  Prev: GFORTRAN_STDOUT_UNIT,  Up: Runtime
2070
20713.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error
2072==========================================================
2073
2074This environment variable can be used to select the unit number
2075preconnected to standard error.  This must be a positive integer.  The
2076default value is 0.
2077
2078
2079File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_ALL,  Next: GFORTRAN_UNBUFFERED_PRECONNECTED,  Prev: GFORTRAN_STDERR_UNIT,  Up: Runtime
2080
20813.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
2082=============================================================
2083
2084This environment variable controls whether all I/O is unbuffered.  If
2085the first letter is 'y', 'Y' or '1', all I/O is unbuffered.  This will
2086slow down small sequential reads and writes.  If the first letter is
2087'n', 'N' or '0', I/O is buffered.  This is the default.
2088
2089
2090File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_PRECONNECTED,  Next: GFORTRAN_SHOW_LOCUS,  Prev: GFORTRAN_UNBUFFERED_ALL,  Up: Runtime
2091
20923.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
2093===============================================================================
2094
2095The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED'
2096controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
2097unbuffered.  If the first letter is 'y', 'Y' or '1', I/O is unbuffered.
2098This will slow down small sequential reads and writes.  If the first
2099letter is 'n', 'N' or '0', I/O is buffered.  This is the default.
2100
2101
2102File: gfortran.info,  Node: GFORTRAN_SHOW_LOCUS,  Next: GFORTRAN_OPTIONAL_PLUS,  Prev: GFORTRAN_UNBUFFERED_PRECONNECTED,  Up: Runtime
2103
21043.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
2105===========================================================
2106
2107If the first letter is 'y', 'Y' or '1', filename and line numbers for
2108runtime errors are printed.  If the first letter is 'n', 'N' or '0', do
2109not print filename and line numbers for runtime errors.  The default is
2110to print the location.
2111
2112
2113File: gfortran.info,  Node: GFORTRAN_OPTIONAL_PLUS,  Next: GFORTRAN_LIST_SEPARATOR,  Prev: GFORTRAN_SHOW_LOCUS,  Up: Runtime
2114
21153.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
2116=============================================================
2117
2118If the first letter is 'y', 'Y' or '1', a plus sign is printed where
2119permitted by the Fortran standard.  If the first letter is 'n', 'N' or
2120'0', a plus sign is not printed in most cases.  Default is not to print
2121plus signs.
2122
2123
2124File: gfortran.info,  Node: GFORTRAN_LIST_SEPARATOR,  Next: GFORTRAN_CONVERT_UNIT,  Prev: GFORTRAN_OPTIONAL_PLUS,  Up: Runtime
2125
21263.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output
2127========================================================
2128
2129This environment variable specifies the separator when writing
2130list-directed output.  It may contain any number of spaces and at most
2131one comma.  If you specify this on the command line, be sure to quote
2132spaces, as in
2133     $ GFORTRAN_LIST_SEPARATOR='  ,  ' ./a.out
2134   when 'a.out' is the compiled Fortran program that you want to run.
2135Default is a single space.
2136
2137
2138File: gfortran.info,  Node: GFORTRAN_CONVERT_UNIT,  Next: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_LIST_SEPARATOR,  Up: Runtime
2139
21403.10 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
2141================================================================
2142
2143By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to
2144change the representation of data for unformatted files.  The syntax for
2145the 'GFORTRAN_CONVERT_UNIT' variable is:
2146     GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
2147     mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
2148     exception: mode ':' unit_list | unit_list ;
2149     unit_list: unit_spec | unit_list unit_spec ;
2150     unit_spec: INTEGER | INTEGER '-' INTEGER ;
2151   The variable consists of an optional default mode, followed by a list
2152of optional exceptions, which are separated by semicolons from the
2153preceding default and each other.  Each exception consists of a format
2154and a comma-separated list of units.  Valid values for the modes are the
2155same as for the 'CONVERT' specifier:
2156
2157     'NATIVE' Use the native format.  This is the default.
2158     'SWAP' Swap between little- and big-endian.
2159     'LITTLE_ENDIAN' Use the little-endian format for unformatted files.
2160     'BIG_ENDIAN' Use the big-endian format for unformatted files.
2161   A missing mode for an exception is taken to mean 'BIG_ENDIAN'.
2162Examples of values for 'GFORTRAN_CONVERT_UNIT' are:
2163     ''big_endian'' Do all unformatted I/O in big_endian mode.
2164     ''little_endian;native:10-20,25'' Do all unformatted I/O in
2165     little_endian mode, except for units 10 to 20 and 25, which are in
2166     native format.
2167     ''10-20'' Units 10 to 20 are big-endian, the rest is native.
2168
2169   Setting the environment variables should be done on the command line
2170or via the 'export' command for 'sh'-compatible shells and via 'setenv'
2171for 'csh'-compatible shells.
2172
2173   Example for 'sh':
2174     $ gfortran foo.f90
2175     $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
2176
2177   Example code for 'csh':
2178     % gfortran foo.f90
2179     % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
2180     % ./a.out
2181
2182   Using anything but the native representation for unformatted data
2183carries a significant speed overhead.  If speed in this area matters to
2184you, it is best if you use this only for data that needs to be portable.
2185
2186   *Note CONVERT specifier::, for an alternative way to specify the data
2187representation for unformatted files.  *Note Runtime Options::, for
2188setting a default data representation for the whole program.  The
2189'CONVERT' specifier overrides the '-fconvert' compile options.
2190
2191   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
2192environment variable will override the CONVERT specifier in the open
2193statement_.  This is to give control over data formats to users who do
2194not have the source code of their program available.
2195
2196
2197File: gfortran.info,  Node: GFORTRAN_ERROR_BACKTRACE,  Next: GFORTRAN_FORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_CONVERT_UNIT,  Up: Runtime
2198
21993.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
2200==================================================================
2201
2202If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1'
2203(only the first letter is relevant) then a backtrace is printed when a
2204serious run-time error occurs.  To disable the backtracing, set the
2205variable to 'n', 'N', '0'.  Default is to print a backtrace unless the
2206'-fno-backtrace' compile option was used.
2207
2208
2209File: gfortran.info,  Node: GFORTRAN_FORMATTED_BUFFER_SIZE,  Next: GFORTRAN_UNFORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_ERROR_BACKTRACE,  Up: Runtime
2210
22113.12 'GFORTRAN_FORMATTED_BUFFER_SIZE'--Set buffer size for formatted I/O
2212========================================================================
2213
2214The 'GFORTRAN_FORMATTED_BUFFER_SIZE' environment variable specifies
2215buffer size in bytes to be used for formatted output.  The default value
2216is 8192.
2217
2218
2219File: gfortran.info,  Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_FORMATTED_BUFFER_SIZE,  Up: Runtime
2220
22213.13 'GFORTRAN_UNFORMATTED_BUFFER_SIZE'--Set buffer size for unformatted I/O
2222============================================================================
2223
2224The 'GFORTRAN_UNFORMATTED_BUFFER_SIZE' environment variable specifies
2225buffer size in bytes to be used for unformatted output.  The default
2226value is 131072.
2227
2228
2229File: gfortran.info,  Node: Fortran standards status,  Next: Compiler Characteristics,  Prev: Runtime,  Up: Top
2230
22314 Fortran standards status
2232**************************
2233
2234* Menu:
2235
2236* Fortran 2003 status::
2237* Fortran 2008 status::
2238* Fortran 2018 status::
2239
2240
2241File: gfortran.info,  Node: Fortran 2003 status,  Next: Fortran 2008 status,  Up: Fortran standards status
2242
22434.1 Fortran 2003 status
2244=======================
2245
2246GNU Fortran supports several Fortran 2003 features; an incomplete list
2247can be found below.  See also the wiki page
2248(https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
2249
2250   * Procedure pointers including procedure-pointer components with
2251     'PASS' attribute.
2252
2253   * Procedures which are bound to a derived type (type-bound
2254     procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and
2255     operators bound to a type.
2256
2257   * Abstract interfaces and type extension with the possibility to
2258     override type-bound procedures or to have deferred binding.
2259
2260   * Polymorphic entities ("'CLASS'") for derived types and unlimited
2261     polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS',
2262     'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and
2263     finalization.
2264
2265   * Generic interface names, which have the same name as derived types,
2266     are now supported.  This allows one to write constructor functions.
2267     Note that Fortran does not support static constructor functions.
2268     For static variables, only default initialization or
2269     structure-constructor initialization are available.
2270
2271   * The 'ASSOCIATE' construct.
2272
2273   * Interoperability with C including enumerations,
2274
2275   * In structure constructors the components with default values may be
2276     omitted.
2277
2278   * Extensions to the 'ALLOCATE' statement, allowing for a
2279     type-specification with type parameter and for allocation and
2280     initialization from a 'SOURCE=' expression; 'ALLOCATE' and
2281     'DEALLOCATE' optionally return an error message string via
2282     'ERRMSG='.
2283
2284   * Reallocation on assignment: If an intrinsic assignment is used, an
2285     allocatable variable on the left-hand side is automatically
2286     allocated (if unallocated) or reallocated (if the shape is
2287     different).  Currently, scalar deferred character length left-hand
2288     sides are correctly handled but arrays are not yet fully
2289     implemented.
2290
2291   * Deferred-length character variables and scalar deferred-length
2292     character components of derived types are supported.  (Note that
2293     array-valued compoents are not yet implemented.)
2294
2295   * Transferring of allocations via 'MOVE_ALLOC'.
2296
2297   * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to
2298     derived-type components.
2299
2300   * In pointer assignments, the lower bound may be specified and the
2301     remapping of elements is supported.
2302
2303   * For pointers an 'INTENT' may be specified which affect the
2304     association status not the value of the pointer target.
2305
2306   * Intrinsics 'command_argument_count', 'get_command',
2307     'get_command_argument', and 'get_environment_variable'.
2308
2309   * Support for Unicode characters (ISO 10646) and UTF-8, including the
2310     'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions.
2311
2312   * Support for binary, octal and hexadecimal (BOZ) constants in the
2313     intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'.
2314
2315   * Support for namelist variables with allocatable and pointer
2316     attribute and nonconstant length type parameter.
2317
2318   * Array constructors using square brackets.  That is, '[...]' rather
2319     than '(/.../)'.  Type-specification for array constructors like '(/
2320     some-type :: ... /)'.
2321
2322   * Extensions to the specification and initialization expressions,
2323     including the support for intrinsics with real and complex
2324     arguments.
2325
2326   * Support for the asynchronous input/output.
2327
2328   * 'FLUSH' statement.
2329
2330   * 'IOMSG=' specifier for I/O statements.
2331
2332   * Support for the declaration of enumeration constants via the 'ENUM'
2333     and 'ENUMERATOR' statements.  Interoperability with 'gcc' is
2334     guaranteed also for the case where the '-fshort-enums' command line
2335     option is given.
2336
2337   * TR 15581:
2338        * 'ALLOCATABLE' dummy arguments.
2339        * 'ALLOCATABLE' function results
2340        * 'ALLOCATABLE' components of derived types
2341
2342   * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier,
2343     allowing I/O without any record structure.
2344
2345   * Namelist input/output for internal files.
2346
2347   * Minor I/O features: Rounding during formatted output, using of a
2348     decimal comma instead of a decimal point, setting whether a plus
2349     sign should appear for positive numbers.  On systems where 'strtod'
2350     honours the rounding mode, the rounding mode is also supported for
2351     input.
2352
2353   * The 'PROTECTED' statement and attribute.
2354
2355   * The 'VALUE' statement and attribute.
2356
2357   * The 'VOLATILE' statement and attribute.
2358
2359   * The 'IMPORT' statement, allowing to import host-associated derived
2360     types.
2361
2362   * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which
2363     contains parameters of the I/O units, storage sizes.  Additionally,
2364     procedures for C interoperability are available in the
2365     'ISO_C_BINDING' module.
2366
2367   * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute;
2368     supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING',
2369     'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'.
2370
2371   * Renaming of operators in the 'USE' statement.
2372
2373
2374File: gfortran.info,  Node: Fortran 2008 status,  Next: Fortran 2018 status,  Prev: Fortran 2003 status,  Up: Fortran standards status
2375
23764.2 Fortran 2008 status
2377=======================
2378
2379The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
2380informally known as Fortran 2008.  The official version is available
2381from International Organization for Standardization (ISO) or its
2382national member organizations.  The the final draft (FDIS) can be
2383downloaded free of charge from
2384<http://www.nag.co.uk/sc22wg5/links.html>.  Fortran is developed by the
2385Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
2386of the International Organization for Standardization and the
2387International Electrotechnical Commission (IEC). This group is known as
2388WG5 (http://www.nag.co.uk/sc22wg5/).
2389
2390   The GNU Fortran compiler supports several of the new features of
2391Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
2392some information about the current Fortran 2008 implementation status.
2393In particular, the following is implemented.
2394
2395   * The '-std=f2008' option and support for the file extensions '.f08'
2396     and '.F08'.
2397
2398   * The 'OPEN' statement now supports the 'NEWUNIT=' option, which
2399     returns a unique file unit, thus preventing inadvertent use of the
2400     same unit in different parts of the program.
2401
2402   * The 'g0' format descriptor and unlimited format items.
2403
2404   * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF',
2405     'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1',
2406     'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT',
2407     'NORM2', and 'ERFC_SCALED'.
2408
2409   * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN',
2410     'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for
2411     'ATAN2'(Y,X).
2412
2413   * Support of the 'PARITY' intrinsic functions.
2414
2415   * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the
2416     number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for
2417     counting the number of one bits and returning the parity; 'BGE',
2418     'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and
2419     'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR'
2420     for simple left and right justified masks, 'MERGE_BITS' for a
2421     bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for
2422     shift operations, and the transformational bit intrinsics 'IALL',
2423     'IANY' and 'IPARITY'.
2424
2425   * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine.
2426
2427   * Support for the 'STORAGE_SIZE' intrinsic inquiry function.
2428
2429   * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and
2430     the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS',
2431     'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module
2432     'ISO_FORTRAN_ENV'.
2433
2434   * The module procedures 'C_SIZEOF' of the intrinsic module
2435     'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of
2436     'ISO_FORTRAN_ENV'.
2437
2438   * Coarray support for serial programs with '-fcoarray=single' flag
2439     and experimental support for multiple images with the
2440     '-fcoarray=lib' flag.
2441
2442   * Submodules are supported.  It should noted that 'MODULEs' do not
2443     produce the smod file needed by the descendent 'SUBMODULEs' unless
2444     they contain at least one 'MODULE PROCEDURE' interface.  The reason
2445     for this is that 'SUBMODULEs' are useless without 'MODULE
2446     PROCEDUREs'.  See http://j3-fortran.org/doc/meeting/207/15-209.txt
2447     for a discussion and a draft interpretation.  Adopting this
2448     interpretation has the advantage that code that does not use
2449     submodules does not generate smod files.
2450
2451   * The 'DO CONCURRENT' construct is supported.
2452
2453   * The 'BLOCK' construct is supported.
2454
2455   * The 'STOP' and the new 'ERROR STOP' statements now support all
2456     constant expressions.  Both show the signals which were signaling
2457     at termination.
2458
2459   * Support for the 'CONTIGUOUS' attribute.
2460
2461   * Support for 'ALLOCATE' with 'MOLD'.
2462
2463   * Support for the 'IMPURE' attribute for procedures, which allows for
2464     'ELEMENTAL' procedures without the restrictions of 'PURE'.
2465
2466   * Null pointers (including 'NULL()') and not-allocated variables can
2467     be used as actual argument to optional non-pointer, non-allocatable
2468     dummy arguments, denoting an absent argument.
2469
2470   * Non-pointer variables with 'TARGET' attribute can be used as actual
2471     argument to 'POINTER' dummies with 'INTENT(IN)'.
2472
2473   * Pointers including procedure pointers and those in a derived type
2474     (pointer components) can now be initialized by a target instead of
2475     only by 'NULL'.
2476
2477   * The 'EXIT' statement (with construct-name) can be now be used to
2478     leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF',
2479     'SELECT CASE' and 'SELECT TYPE' constructs.
2480
2481   * Internal procedures can now be used as actual argument.
2482
2483   * Minor features: obsolesce diagnostics for 'ENTRY' with
2484     '-std=f2008'; a line may start with a semicolon; for internal and
2485     module procedures 'END' can be used instead of 'END SUBROUTINE' and
2486     'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX'
2487     argument; intrinsic types are supported for
2488     'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
2489     declared in a single 'PROCEDURE' statement; implied-shape arrays
2490     are supported for named constants ('PARAMETER').
2491
2492
2493File: gfortran.info,  Node: Fortran 2018 status,  Prev: Fortran 2008 status,  Up: Fortran standards status
2494
24954.3 Status of Fortran 2018 support
2496==================================
2497
2498   * ERROR STOP in a PURE procedure An 'ERROR STOP' statement is
2499     permitted in a 'PURE' procedure.
2500
2501   * IMPLICIT NONE with a spec-list Support the 'IMPLICIT NONE'
2502     statement with an 'implicit-none-spec-list'.
2503
2504   * Behavior of INQUIRE with the RECL= specifier
2505
2506     The behavior of the 'INQUIRE' statement with the 'RECL=' specifier
2507     now conforms to Fortran 2018.
2508
25094.3.1 TS 29113 Status (Further Interoperability with C)
2510-------------------------------------------------------
2511
2512GNU Fortran supports some of the new features of the Technical
2513Specification (TS) 29113 on Further Interoperability of Fortran with C.
2514The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
2515about the current TS 29113 implementation status.  In particular, the
2516following is implemented.
2517
2518   See also *note Further Interoperability of Fortran with C::.
2519
2520   * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C)
2521     procedures.'
2522
2523   * The 'RANK' intrinsic is supported.
2524
2525   * GNU Fortran's implementation for variables with 'ASYNCHRONOUS'
2526     attribute is compatible with TS 29113.
2527
2528   * Assumed types ('TYPE(*)').
2529
2530   * Assumed-rank ('DIMENSION(..)').
2531
2532   * ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such
2533     that conversion of the array descriptor for assumed type or assumed
2534     rank arrays is done in the library.  The include file
2535     ISO_Fortran_binding.h is can be found in
2536     '~prefix/lib/gcc/$target/$version'.
2537
25384.3.2 TS 18508 Status (Additional Parallel Features)
2539----------------------------------------------------
2540
2541GNU Fortran supports the following new features of the Technical
2542Specification 18508 on Additional Parallel Features in Fortran:
2543
2544   * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR
2545     intrinsics.
2546
2547   * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics.  And the
2548     'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not
2549     support polymorphic types or types with allocatable, pointer or
2550     polymorphic components.
2551
2552   * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY')
2553
2554   * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES',
2555     'STOPPED_IMAGES')
2556
2557
2558File: gfortran.info,  Node: Compiler Characteristics,  Next: Extensions,  Prev: Fortran standards status,  Up: Top
2559
25605 Compiler Characteristics
2561**************************
2562
2563This chapter describes certain characteristics of the GNU Fortran
2564compiler, that are not specified by the Fortran standard, but which
2565might in some way or another become visible to the programmer.
2566
2567* Menu:
2568
2569* KIND Type Parameters::
2570* Internal representation of LOGICAL variables::
2571* Evaluation of logical expressions::
2572* MAX and MIN intrinsics with REAL NaN arguments::
2573* Thread-safety of the runtime library::
2574* Data consistency and durability::
2575* Files opened without an explicit ACTION= specifier::
2576* File operations on symbolic links::
2577* File format of unformatted sequential files::
2578* Asynchronous I/O::
2579
2580
2581File: gfortran.info,  Node: KIND Type Parameters,  Next: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2582
25835.1 KIND Type Parameters
2584========================
2585
2586The 'KIND' type parameters supported by GNU Fortran for the primitive
2587data types are:
2588
2589'INTEGER'
2590     1, 2, 4, 8*, 16*, default: 4**
2591
2592'LOGICAL'
2593     1, 2, 4, 8*, 16*, default: 4**
2594
2595'REAL'
2596     4, 8, 10*, 16*, default: 4***
2597
2598'COMPLEX'
2599     4, 8, 10*, 16*, default: 4***
2600
2601'DOUBLE PRECISION'
2602     4, 8, 10*, 16*, default: 8***
2603
2604'CHARACTER'
2605     1, 4, default: 1
2606
2607* not available on all systems
2608** unless '-fdefault-integer-8' is used
2609*** unless '-fdefault-real-8' is used (see *note Fortran Dialect
2610Options::)
2611
2612The 'KIND' value matches the storage size in bytes, except for 'COMPLEX'
2613where the storage size is twice as much (or both real and imaginary part
2614are a real value of the given size).  It is recommended to use the *note
2615SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note
2616SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32',
2617'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the
2618'ISO_FORTRAN_ENV' module instead of the concrete values.  The available
2619kind parameters can be found in the constant arrays 'CHARACTER_KINDS',
2620'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note
2621ISO_FORTRAN_ENV:: module.  For C interoperability, the kind parameters
2622of the *note ISO_C_BINDING:: module should be used.
2623
2624
2625File: gfortran.info,  Node: Internal representation of LOGICAL variables,  Next: Evaluation of logical expressions,  Prev: KIND Type Parameters,  Up: Compiler Characteristics
2626
26275.2 Internal representation of LOGICAL variables
2628================================================
2629
2630The Fortran standard does not specify how variables of 'LOGICAL' type
2631are represented, beyond requiring that 'LOGICAL' variables of default
2632kind have the same storage size as default 'INTEGER' and 'REAL'
2633variables.  The GNU Fortran internal representation is as follows.
2634
2635   A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)'
2636variable, however, with only two permissible values: '1' for '.TRUE.'
2637and '0' for '.FALSE.'.  Any other integer value results in undefined
2638behavior.
2639
2640   See also *note Argument passing conventions:: and *note
2641Interoperability with C::.
2642
2643
2644File: gfortran.info,  Node: Evaluation of logical expressions,  Next: MAX and MIN intrinsics with REAL NaN arguments,  Prev: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2645
26465.3 Evaluation of logical expressions
2647=====================================
2648
2649The Fortran standard does not require the compiler to evaluate all parts
2650of an expression, if they do not contribute to the final result.  For
2651logical expressions with '.AND.' or '.OR.' operators, in particular, GNU
2652Fortran will optimize out function calls (even to impure functions) if
2653the result of the expression can be established without them.  However,
2654since not all compilers do that, and such an optimization can
2655potentially modify the program flow and subsequent results, GNU Fortran
2656throws warnings for such situations with the '-Wfunction-elimination'
2657flag.
2658
2659
2660File: gfortran.info,  Node: MAX and MIN intrinsics with REAL NaN arguments,  Next: Thread-safety of the runtime library,  Prev: Evaluation of logical expressions,  Up: Compiler Characteristics
2661
26625.4 MAX and MIN intrinsics with REAL NaN arguments
2663==================================================
2664
2665The Fortran standard does not specify what the result of the 'MAX' and
2666'MIN' intrinsics are if one of the arguments is a 'NaN'.  Accordingly,
2667the GNU Fortran compiler does not specify that either, as this allows
2668for faster and more compact code to be generated.  If the programmer
2669wishes to take some specific action in case one of the arguments is a
2670'NaN', it is necessary to explicitly test the arguments before calling
2671'MAX' or 'MIN', e.g.  with the 'IEEE_IS_NAN' function from the intrinsic
2672module 'IEEE_ARITHMETIC'.
2673
2674
2675File: gfortran.info,  Node: Thread-safety of the runtime library,  Next: Data consistency and durability,  Prev: MAX and MIN intrinsics with REAL NaN arguments,  Up: Compiler Characteristics
2676
26775.5 Thread-safety of the runtime library
2678========================================
2679
2680GNU Fortran can be used in programs with multiple threads, e.g. by using
2681OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING'
2682facility, or by GNU Fortran compiled library code being called from a
2683multi-threaded program.
2684
2685   The GNU Fortran runtime library, ('libgfortran'), supports being
2686called concurrently from multiple threads with the following exceptions.
2687
2688   During library initialization, the C 'getenv' function is used, which
2689need not be thread-safe.  Similarly, the 'getenv' function is used to
2690implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics.  It is
2691the responsibility of the user to ensure that the environment is not
2692being updated concurrently when any of these actions are taking place.
2693
2694   The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented
2695with the 'system' function, which need not be thread-safe.  It is the
2696responsibility of the user to ensure that 'system' is not called
2697concurrently.
2698
2699   For platforms not supporting thread-safe POSIX functions, further
2700functionality might not be thread-safe.  For details, please consult the
2701documentation for your operating system.
2702
2703   The GNU Fortran runtime library uses various C library functions that
2704depend on the locale, such as 'strtod' and 'snprintf'.  In order to work
2705correctly in locale-aware programs that set the locale using
2706'setlocale', the locale is reset to the default "C" locale while
2707executing a formatted 'READ' or 'WRITE' statement.  On targets
2708supporting the POSIX 2008 per-thread locale functions (e.g.
2709'newlocale', 'uselocale', 'freelocale'), these are used and thus the
2710global locale set using 'setlocale' or the per-thread locales in other
2711threads are not affected.  However, on targets lacking this
2712functionality, the global LC_NUMERIC locale is set to "C" during the
2713formatted I/O. Thus, on such targets it's not safe to call 'setlocale'
2714concurrently from another thread while a Fortran formatted I/O operation
2715is in progress.  Also, other threads doing something dependent on the
2716LC_NUMERIC locale might not work correctly if a formatted I/O operation
2717is in progress in another thread.
2718
2719
2720File: 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
2721
27225.6 Data consistency and durability
2723===================================
2724
2725This section contains a brief overview of data and metadata consistency
2726and durability issues when doing I/O.
2727
2728   With respect to durability, GNU Fortran makes no effort to ensure
2729that data is committed to stable storage.  If this is required, the GNU
2730Fortran programmer can use the intrinsic 'FNUM' to retrieve the low
2731level file descriptor corresponding to an open Fortran unit.  Then,
2732using e.g.  the 'ISO_C_BINDING' feature, one can call the underlying
2733system call to flush dirty data to stable storage, such as 'fsync' on
2734POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
2735The following example shows how to call fsync:
2736
2737       ! Declare the interface for POSIX fsync function
2738       interface
2739         function fsync (fd) bind(c,name="fsync")
2740         use iso_c_binding, only: c_int
2741           integer(c_int), value :: fd
2742           integer(c_int) :: fsync
2743         end function fsync
2744       end interface
2745
2746       ! Variable declaration
2747       integer :: ret
2748
2749       ! Opening unit 10
2750       open (10,file="foo")
2751
2752       ! ...
2753       ! Perform I/O on unit 10
2754       ! ...
2755
2756       ! Flush and sync
2757       flush(10)
2758       ret = fsync(fnum(10))
2759
2760       ! Handle possible error
2761       if (ret /= 0) stop "Error calling FSYNC"
2762
2763   With respect to consistency, for regular files GNU Fortran uses
2764buffered I/O in order to improve performance.  This buffer is flushed
2765automatically when full and in some other situations, e.g.  when closing
2766a unit.  It can also be explicitly flushed with the 'FLUSH' statement.
2767Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL'
2768and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables.  Special
2769files, such as terminals and pipes, are always unbuffered.  Sometimes,
2770however, further things may need to be done in order to allow other
2771processes to see data that GNU Fortran has written, as follows.
2772
2773   The Windows platform supports a relaxed metadata consistency model,
2774where file metadata is written to the directory lazily.  This means
2775that, for instance, the 'dir' command can show a stale size for a file.
2776One can force a directory metadata update by closing the unit, or by
2777calling '_commit' on the file descriptor.  Note, though, that '_commit'
2778will force all dirty data to stable storage, which is often a very slow
2779operation.
2780
2781   The Network File System (NFS) implements a relaxed consistency model
2782called open-to-close consistency.  Closing a file forces dirty data and
2783metadata to be flushed to the server, and opening a file forces the
2784client to contact the server in order to revalidate cached data.
2785'fsync' will also force a flush of dirty data and metadata to the
2786server.  Similar to 'open' and 'close', acquiring and releasing 'fcntl'
2787file locks, if the server supports them, will also force cache
2788validation and flushing dirty data and metadata.
2789
2790
2791File: gfortran.info,  Node: Files opened without an explicit ACTION= specifier,  Next: File operations on symbolic links,  Prev: Data consistency and durability,  Up: Compiler Characteristics
2792
27935.7 Files opened without an explicit ACTION= specifier
2794======================================================
2795
2796The Fortran standard says that if an 'OPEN' statement is executed
2797without an explicit 'ACTION=' specifier, the default value is processor
2798dependent.  GNU Fortran behaves as follows:
2799
2800  1. Attempt to open the file with 'ACTION='READWRITE''
2801  2. If that fails, try to open with 'ACTION='READ''
2802  3. If that fails, try to open with 'ACTION='WRITE''
2803  4. If that fails, generate an error
2804
2805
2806File: 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
2807
28085.8 File operations on symbolic links
2809=====================================
2810
2811This section documents the behavior of GNU Fortran for file operations
2812on symbolic links, on systems that support them.
2813
2814   * Results of INQUIRE statements of the "inquire by file" form will
2815     relate to the target of the symbolic link.  For example,
2816     'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a
2817     symbolic link pointing to an existing file, and .FALSE. if FOO
2818     points to an non-existing file ("dangling" symbolic link).
2819
2820   * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a
2821     symbolic link will result in an error condition, whether the
2822     symbolic link points to an existing target or is dangling.
2823
2824   * If a symbolic link was connected, using the 'CLOSE' statement with
2825     a 'STATUS="DELETE"' specifier will cause the symbolic link itself
2826     to be deleted, not its target.
2827
2828
2829File: gfortran.info,  Node: File format of unformatted sequential files,  Next: Asynchronous I/O,  Prev: File operations on symbolic links,  Up: Compiler Characteristics
2830
28315.9 File format of unformatted sequential files
2832===============================================
2833
2834Unformatted sequential files are stored as logical records using record
2835markers.  Each logical record consists of one of more subrecords.
2836
2837   Each subrecord consists of a leading record marker, the data written
2838by the user program, and a trailing record marker.  The record markers
2839are four-byte integers by default, and eight-byte integers if the
2840'-fmax-subrecord-length=8' option (which exists for backwards
2841compability only) is in effect.
2842
2843   The representation of the record markers is that of unformatted files
2844given with the '-fconvert' option, the *note CONVERT specifier:: in an
2845open statement or the *note GFORTRAN_CONVERT_UNIT:: environment
2846variable.
2847
2848   The maximum number of bytes of user data in a subrecord is 2147483639
2849(2 GiB - 9) for a four-byte record marker.  This limit can be lowered
2850with the '-fmax-subrecord-length' option, altough this is rarely useful.
2851If the length of a logical record exceeds this limit, the data is
2852distributed among several subrecords.
2853
2854   The absolute of the number stored in the record markers is the number
2855of bytes of user data in the corresponding subrecord.  If the leading
2856record marker of a subrecord contains a negative number, another
2857subrecord follows the current one.  If the trailing record marker
2858contains a negative number, then there is a preceding subrecord.
2859
2860   In the most simple case, with only one subrecord per logical record,
2861both record markers contain the number of bytes of user data in the
2862record.
2863
2864   The format for unformatted sequential data can be duplicated using
2865unformatted stream, as shown in the example program for an unformatted
2866record containing a single subrecord:
2867
2868     program main
2869       use iso_fortran_env, only: int32
2870       implicit none
2871       integer(int32) :: i
2872       real, dimension(10) :: a, b
2873       call random_number(a)
2874       open (10,file='test.dat',form='unformatted',access='stream')
2875       inquire (iolength=i) a
2876       write (10) i, a, i
2877       close (10)
2878       open (10,file='test.dat',form='unformatted')
2879       read (10) b
2880       if (all (a == b)) print *,'success!'
2881     end program main
2882
2883
2884File: gfortran.info,  Node: Asynchronous I/O,  Prev: File format of unformatted sequential files,  Up: Compiler Characteristics
2885
28865.10 Asynchronous I/O
2887=====================
2888
2889Asynchronous I/O is supported if the program is linked against the POSIX
2890thread library.  If that is not the case, all I/O is performed as
2891synchronous.  On systems which do not support pthread condition
2892variables, such as AIX, I/O is also performed as synchronous.
2893
2894   On some systems, such as Darwin or Solaris, the POSIX thread library
2895is always linked in, so asynchronous I/O is always performed.  On other
2896sytems, such as Linux, it is necessary to specify '-pthread',
2897'-lpthread' or '-fopenmp' during the linking step.
2898
2899
2900File: gfortran.info,  Node: Extensions,  Next: Mixed-Language Programming,  Prev: Compiler Characteristics,  Up: Top
2901
29026 Extensions
2903************
2904
2905The two sections below detail the extensions to standard Fortran that
2906are implemented in GNU Fortran, as well as some of the popular or
2907historically important extensions that are not (or not yet) implemented.
2908For the latter case, we explain the alternatives available to GNU
2909Fortran users, including replacement by standard-conforming code or GNU
2910extensions.
2911
2912* Menu:
2913
2914* Extensions implemented in GNU Fortran::
2915* Extensions not implemented in GNU Fortran::
2916
2917
2918File: gfortran.info,  Node: Extensions implemented in GNU Fortran,  Next: Extensions not implemented in GNU Fortran,  Up: Extensions
2919
29206.1 Extensions implemented in GNU Fortran
2921=========================================
2922
2923GNU Fortran implements a number of extensions over standard Fortran.
2924This chapter contains information on their syntax and meaning.  There
2925are currently two categories of GNU Fortran extensions, those that
2926provide functionality beyond that provided by any standard, and those
2927that are supported by GNU Fortran purely for backward compatibility with
2928legacy compilers.  By default, '-std=gnu' allows the compiler to accept
2929both types of extensions, but to warn about the use of the latter.
2930Specifying either '-std=f95', '-std=f2003', '-std=f2008', or
2931'-std=f2018' disables both types of extensions, and '-std=legacy' allows
2932both without warning.  The special compile flag '-fdec' enables
2933additional compatibility extensions along with those enabled by
2934'-std=legacy'.
2935
2936* Menu:
2937
2938* Old-style kind specifications::
2939* Old-style variable initialization::
2940* Extensions to namelist::
2941* X format descriptor without count field::
2942* Commas in FORMAT specifications::
2943* Missing period in FORMAT specifications::
2944* Default widths for F, G and I format descriptors::
2945* I/O item lists::
2946* 'Q' exponent-letter::
2947* BOZ literal constants::
2948* Real array indices::
2949* Unary operators::
2950* Implicitly convert LOGICAL and INTEGER values::
2951* Hollerith constants support::
2952* Character conversion::
2953* Cray pointers::
2954* CONVERT specifier::
2955* OpenMP::
2956* OpenACC::
2957* Argument list functions::
2958* Read/Write after EOF marker::
2959* STRUCTURE and RECORD::
2960* UNION and MAP::
2961* Type variants for integer intrinsics::
2962* AUTOMATIC and STATIC attributes::
2963* Extended math intrinsics::
2964* Form feed as whitespace::
2965* TYPE as an alias for PRINT::
2966* %LOC as an rvalue::
2967* .XOR. operator::
2968* Bitwise logical operators::
2969* Extended I/O specifiers::
2970* Legacy PARAMETER statements::
2971* Default exponents::
2972
2973
2974File: gfortran.info,  Node: Old-style kind specifications,  Next: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2975
29766.1.1 Old-style kind specifications
2977-----------------------------------
2978
2979GNU Fortran allows old-style kind specifications in declarations.  These
2980look like:
2981           TYPESPEC*size x,y,z
2982where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where
2983'size' is a byte count corresponding to the storage size of a valid kind
2984for that type.  (For 'COMPLEX' variables, 'size' is the total size of
2985the real and imaginary parts.)  The statement then declares 'x', 'y' and
2986'z' to be of type 'TYPESPEC' with the appropriate kind.  This is
2987equivalent to the standard-conforming declaration
2988           TYPESPEC(k) x,y,z
2989where 'k' is the kind parameter suitable for the intended precision.  As
2990kind parameters are implementation-dependent, use the 'KIND',
2991'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the
2992correct value, for instance 'REAL*8 x' can be replaced by:
2993     INTEGER, PARAMETER :: dbl = KIND(1.0d0)
2994     REAL(KIND=dbl) :: x
2995
2996
2997File: gfortran.info,  Node: Old-style variable initialization,  Next: Extensions to namelist,  Prev: Old-style kind specifications,  Up: Extensions implemented in GNU Fortran
2998
29996.1.2 Old-style variable initialization
3000---------------------------------------
3001
3002GNU Fortran allows old-style initialization of variables of the form:
3003           INTEGER i/1/,j/2/
3004           REAL x(2,2) /3*0.,1./
3005   The syntax for the initializers is as for the 'DATA' statement, but
3006unlike in a 'DATA' statement, an initializer only applies to the
3007variable immediately preceding the initialization.  In other words,
3008something like 'INTEGER I,J/2,3/' is not valid.  This style of
3009initialization is only allowed in declarations without double colons
3010('::'); the double colons were introduced in Fortran 90, which also
3011introduced a standard syntax for initializing variables in type
3012declarations.
3013
3014   Examples of standard-conforming code equivalent to the above example
3015are:
3016     ! Fortran 90
3017           INTEGER :: i = 1, j = 2
3018           REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
3019     ! Fortran 77
3020           INTEGER i, j
3021           REAL x(2,2)
3022           DATA i/1/, j/2/, x/3*0.,1./
3023
3024   Note that variables which are explicitly initialized in declarations
3025or in 'DATA' statements automatically acquire the 'SAVE' attribute.
3026
3027
3028File: gfortran.info,  Node: Extensions to namelist,  Next: X format descriptor without count field,  Prev: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
3029
30306.1.3 Extensions to namelist
3031----------------------------
3032
3033GNU Fortran fully supports the Fortran 95 standard for namelist I/O
3034including array qualifiers, substrings and fully qualified derived
3035types.  The output from a namelist write is compatible with namelist
3036read.  The output has all names in upper case and indentation to column
30371 after the namelist name.  Two extensions are permitted:
3038
3039   Old-style use of '$' instead of '&'
3040     $MYNML
3041      X(:)%Y(2) = 1.0 2.0 3.0
3042      CH(1:4) = "abcd"
3043     $END
3044
3045   It should be noted that the default terminator is '/' rather than
3046'&END'.
3047
3048   Querying of the namelist when inputting from stdin.  After at least
3049one space, entering '?' sends to stdout the namelist name and the names
3050of the variables in the namelist:
3051      ?
3052
3053     &mynml
3054      x
3055      x%y
3056      ch
3057     &end
3058
3059   Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML =
3060mynml)' had been called:
3061     =?
3062
3063     &MYNML
3064      X(1)%Y=  0.000000    ,  1.000000    ,  0.000000    ,
3065      X(2)%Y=  0.000000    ,  2.000000    ,  0.000000    ,
3066      X(3)%Y=  0.000000    ,  3.000000    ,  0.000000    ,
3067      CH=abcd,  /
3068
3069   To aid this dialog, when input is from stdin, errors send their
3070messages to stderr and execution continues, even if 'IOSTAT' is set.
3071
3072   'PRINT' namelist is permitted.  This causes an error if '-std=f95' is
3073used.
3074     PROGRAM test_print
3075       REAL, dimension (4)  ::  x = (/1.0, 2.0, 3.0, 4.0/)
3076       NAMELIST /mynml/ x
3077       PRINT mynml
3078     END PROGRAM test_print
3079
3080   Expanded namelist reads are permitted.  This causes an error if
3081'-std=f95' is used.  In the following example, the first element of the
3082array will be given the value 0.00 and the two succeeding elements will
3083be given the values 1.00 and 2.00.
3084     &MYNML
3085       X(1,1) = 0.00 , 1.00 , 2.00
3086     /
3087
3088   When writing a namelist, if no 'DELIM=' is specified, by default a
3089double quote is used to delimit character strings.  If -std=F95, F2003,
3090or F2008, etc, the delim status is set to 'none'.  Defaulting to quotes
3091ensures that namelists with character strings can be subsequently read
3092back in accurately.
3093
3094
3095File: gfortran.info,  Node: X format descriptor without count field,  Next: Commas in FORMAT specifications,  Prev: Extensions to namelist,  Up: Extensions implemented in GNU Fortran
3096
30976.1.4 'X' format descriptor without count field
3098-----------------------------------------------
3099
3100To support legacy codes, GNU Fortran permits the count field of the 'X'
3101edit descriptor in 'FORMAT' statements to be omitted.  When omitted, the
3102count is implicitly assumed to be one.
3103
3104            PRINT 10, 2, 3
3105     10     FORMAT (I1, X, I1)
3106
3107
3108File: 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
3109
31106.1.5 Commas in 'FORMAT' specifications
3111---------------------------------------
3112
3113To support legacy codes, GNU Fortran allows the comma separator to be
3114omitted immediately before and after character string edit descriptors
3115in 'FORMAT' statements.  A comma with no following format decriptor is
3116permited if the '-fdec-blank-format-item' is given on the command line.
3117This is considered non-conforming code and is discouraged.
3118
3119            PRINT 10, 2, 3
3120     10     FORMAT ('FOO='I1' BAR='I2)
3121            print 20, 5, 6
3122     20     FORMAT (I3, I3,)
3123
3124
3125File: gfortran.info,  Node: Missing period in FORMAT specifications,  Next: Default widths for F, G and I format descriptors,  Prev: Commas in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
3126
31276.1.6 Missing period in 'FORMAT' specifications
3128-----------------------------------------------
3129
3130To support legacy codes, GNU Fortran allows missing periods in format
3131specifications if and only if '-std=legacy' is given on the command
3132line.  This is considered non-conforming code and is discouraged.
3133
3134            REAL :: value
3135            READ(*,10) value
3136     10     FORMAT ('F4')
3137
3138
3139File: gfortran.info,  Node: Default widths for F, G and I format descriptors,  Next: I/O item lists,  Prev: Missing period in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
3140
31416.1.7 Default widths for 'F', 'G' and 'I' format descriptors
3142------------------------------------------------------------
3143
3144To support legacy codes, GNU Fortran allows width to be omitted from
3145format specifications if and only if '-fdec-format-defaults' is given on
3146the command line.  Default widths will be used.  This is considered
3147non-conforming code and is discouraged.
3148
3149            REAL :: value1
3150            INTEGER :: value2
3151            WRITE(*,10) value1, value1, value2
3152     10     FORMAT ('F, G, I')
3153
3154
3155File: gfortran.info,  Node: I/O item lists,  Next: 'Q' exponent-letter,  Prev: Default widths for F, G and I format descriptors,  Up: Extensions implemented in GNU Fortran
3156
31576.1.8 I/O item lists
3158--------------------
3159
3160To support legacy codes, GNU Fortran allows the input item list of the
3161'READ' statement, and the output item lists of the 'WRITE' and 'PRINT'
3162statements, to start with a comma.
3163
3164
3165File: gfortran.info,  Node: 'Q' exponent-letter,  Next: BOZ literal constants,  Prev: I/O item lists,  Up: Extensions implemented in GNU Fortran
3166
31676.1.9 'Q' exponent-letter
3168-------------------------
3169
3170GNU Fortran accepts real literal constants with an exponent-letter of
3171'Q', for example, '1.23Q45'.  The constant is interpreted as a
3172'REAL(16)' entity on targets that support this type.  If the target does
3173not support 'REAL(16)' but has a 'REAL(10)' type, then the
3174real-literal-constant will be interpreted as a 'REAL(10)' entity.  In
3175the absence of 'REAL(16)' and 'REAL(10)', an error will occur.
3176
3177
3178File: gfortran.info,  Node: BOZ literal constants,  Next: Real array indices,  Prev: 'Q' exponent-letter,  Up: Extensions implemented in GNU Fortran
3179
31806.1.10 BOZ literal constants
3181----------------------------
3182
3183Besides decimal constants, Fortran also supports binary ('b'), octal
3184('o') and hexadecimal ('z') integer constants.  The syntax is: 'prefix
3185quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is
3186either ''' or '"' and the digits are '0' or '1' for binary, between '0'
3187and '7' for octal, and between '0' and 'F' for hexadecimal.  (Example:
3188'b'01011101''.)
3189
3190   Up to Fortran 95, BOZ literal constants were only allowed to
3191initialize integer variables in DATA statements.  Since Fortran 2003 BOZ
3192literal constants are also allowed as actual arguments to the 'REAL',
3193'DBLE', 'INT' and 'CMPLX' intrinsic functions.  The BOZ literal constant
3194is simply a string of bits, which is padded or truncated as needed,
3195during conversion to a numeric type.  The Fortran standard states that
3196the treatment of the sign bit is processor dependent.  Gfortran
3197interprets the sign bit as a user would expect.
3198
3199   As a deprecated extension, GNU Fortran allows hexadecimal BOZ literal
3200constants to be specified using the 'X' prefix.  That the BOZ literal
3201constant can also be specified by adding a suffix to the string, for
3202example, 'Z'ABC'' and ''ABC'X' are equivalent.  Additionally, as
3203extension, BOZ literals are permitted in some contexts outside of 'DATA'
3204and the intrinsic functions listed in the Fortran standard.  Use
3205'-fallow-invalid-boz' to enable the extension.
3206
3207
3208File: gfortran.info,  Node: Real array indices,  Next: Unary operators,  Prev: BOZ literal constants,  Up: Extensions implemented in GNU Fortran
3209
32106.1.11 Real array indices
3211-------------------------
3212
3213As an extension, GNU Fortran allows the use of 'REAL' expressions or
3214variables as array indices.
3215
3216
3217File: gfortran.info,  Node: Unary operators,  Next: Implicitly convert LOGICAL and INTEGER values,  Prev: Real array indices,  Up: Extensions implemented in GNU Fortran
3218
32196.1.12 Unary operators
3220----------------------
3221
3222As an extension, GNU Fortran allows unary plus and unary minus operators
3223to appear as the second operand of binary arithmetic operators without
3224the need for parenthesis.
3225
3226            X = Y * -Z
3227
3228
3229File: gfortran.info,  Node: Implicitly convert LOGICAL and INTEGER values,  Next: Hollerith constants support,  Prev: Unary operators,  Up: Extensions implemented in GNU Fortran
3230
32316.1.13 Implicitly convert 'LOGICAL' and 'INTEGER' values
3232--------------------------------------------------------
3233
3234As an extension for backwards compatibility with other compilers, GNU
3235Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER'
3236values and vice versa.  When converting from a 'LOGICAL' to an
3237'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted
3238as one.  When converting from 'INTEGER' to 'LOGICAL', the value zero is
3239interpreted as '.FALSE.' and any nonzero value is interpreted as
3240'.TRUE.'.
3241
3242             LOGICAL :: l
3243             l = 1
3244             INTEGER :: i
3245             i = .TRUE.
3246
3247   However, there is no implicit conversion of 'INTEGER' values in
3248'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations.
3249
3250
3251File: gfortran.info,  Node: Hollerith constants support,  Next: Character conversion,  Prev: Implicitly convert LOGICAL and INTEGER values,  Up: Extensions implemented in GNU Fortran
3252
32536.1.14 Hollerith constants support
3254----------------------------------
3255
3256GNU Fortran supports Hollerith constants in assignments, 'DATA'
3257statements, function and subroutine arguments.  A Hollerith constant is
3258written as a string of characters preceded by an integer constant
3259indicating the character count, and the letter 'H' or 'h', and stored in
3260bytewise fashion in a numeric ('INTEGER', 'REAL', or 'COMPLEX'),
3261'LOGICAL' or 'CHARACTER' variable.  The constant will be padded with
3262spaces or truncated to fit the size of the variable in which it is
3263stored.
3264
3265   Examples of valid uses of Hollerith constants:
3266           complex*16 x(2)
3267           data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
3268           x(1) = 16HABCDEFGHIJKLMNOP
3269           call foo (4h abc)
3270
3271   Examples of Hollerith constants:
3272           integer*4 a
3273           a = 0H         ! Invalid, at least one character is needed.
3274           a = 4HAB12     ! Valid
3275           a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
3276           a = 3Hxyz      ! Valid, but the Hollerith constant will be padded.
3277
3278   In general, Hollerith constants were used to provide a rudimentary
3279facility for handling character strings in early Fortran compilers,
3280prior to the introduction of 'CHARACTER' variables in Fortran 77; in
3281those cases, the standard-compliant equivalent is to convert the program
3282to use proper character strings.  On occasion, there may be a case where
3283the intent is specifically to initialize a numeric variable with a given
3284byte sequence.  In these cases, the same result can be obtained by using
3285the 'TRANSFER' statement, as in this example.
3286           integer(kind=4) :: a
3287           a = transfer ("abcd", a)     ! equivalent to: a = 4Habcd
3288
3289   The use of the '-fdec' option extends support of Hollerith constants
3290to comparisons:
3291           integer*4 a
3292           a = 4hABCD
3293           if (a .ne. 4habcd) then
3294             write(*,*) "no match"
3295           end if
3296
3297   Supported types are numeric ('INTEGER', 'REAL', or 'COMPLEX'), and
3298'CHARACTER'.
3299
3300
3301File: gfortran.info,  Node: Character conversion,  Next: Cray pointers,  Prev: Hollerith constants support,  Up: Extensions implemented in GNU Fortran
3302
33036.1.15 Character conversion
3304---------------------------
3305
3306Allowing character literals to be used in a similar way to Hollerith
3307constants is a non-standard extension.  This feature is enabled using
3308-fdec-char-conversions and only applies to character literals of
3309'kind=1'.
3310
3311   Character literals can be used in 'DATA' statements and assignments
3312with numeric ('INTEGER', 'REAL', or 'COMPLEX') or 'LOGICAL' variables.
3313Like Hollerith constants they are copied byte-wise fashion.  The
3314constant will be padded with spaces or truncated to fit the size of the
3315variable in which it is stored.
3316
3317   Examples:
3318           integer*4 x
3319           data x / 'abcd' /
3320
3321           x = 'A'       ! Will be padded.
3322           x = 'ab1234'  ! Will be truncated.
3323
3324
3325File: gfortran.info,  Node: Cray pointers,  Next: CONVERT specifier,  Prev: Character conversion,  Up: Extensions implemented in GNU Fortran
3326
33276.1.16 Cray pointers
3328--------------------
3329
3330Cray pointers are part of a non-standard extension that provides a
3331C-like pointer in Fortran.  This is accomplished through a pair of
3332variables: an integer "pointer" that holds a memory address, and a
3333"pointee" that is used to dereference the pointer.
3334
3335   Pointer/pointee pairs are declared in statements of the form:
3336             pointer ( <pointer> , <pointee> )
3337   or,
3338             pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
3339   The pointer is an integer that is intended to hold a memory address.
3340The pointee may be an array or scalar.  If an assumed-size array is
3341permitted within the scoping unit, a pointee can be an assumed-size
3342array.  That is, the last dimension may be left unspecified by using a
3343'*' in place of a value.  A pointee cannot be an assumed shape array.
3344No space is allocated for the pointee.
3345
3346   The pointee may have its type declared before or after the pointer
3347statement, and its array specification (if any) may be declared before,
3348during, or after the pointer statement.  The pointer may be declared as
3349an integer prior to the pointer statement.  However, some machines have
3350default integer sizes that are different than the size of a pointer, and
3351so the following code is not portable:
3352             integer ipt
3353             pointer (ipt, iarr)
3354   If a pointer is declared with a kind that is too small, the compiler
3355will issue a warning; the resulting binary will probably not work
3356correctly, because the memory addresses stored in the pointers may be
3357truncated.  It is safer to omit the first line of the above example; if
3358explicit declaration of ipt's type is omitted, then the compiler will
3359ensure that ipt is an integer variable large enough to hold a pointer.
3360
3361   Pointer arithmetic is valid with Cray pointers, but it is not the
3362same as C pointer arithmetic.  Cray pointers are just ordinary integers,
3363so the user is responsible for determining how many bytes to add to a
3364pointer in order to increment it.  Consider the following example:
3365             real target(10)
3366             real pointee(10)
3367             pointer (ipt, pointee)
3368             ipt = loc (target)
3369             ipt = ipt + 1
3370   The last statement does not set 'ipt' to the address of 'target(1)',
3371as it would in C pointer arithmetic.  Adding '1' to 'ipt' just adds one
3372byte to the address stored in 'ipt'.
3373
3374   Any expression involving the pointee will be translated to use the
3375value stored in the pointer as the base address.
3376
3377   To get the address of elements, this extension provides an intrinsic
3378function 'LOC()'.  The 'LOC()' function is equivalent to the '&'
3379operator in C, except the address is cast to an integer type:
3380             real ar(10)
3381             pointer(ipt, arpte(10))
3382             real arpte
3383             ipt = loc(ar)  ! Makes arpte is an alias for ar
3384             arpte(1) = 1.0 ! Sets ar(1) to 1.0
3385   The pointer can also be set by a call to the 'MALLOC' intrinsic (see
3386*note MALLOC::).
3387
3388   Cray pointees often are used to alias an existing variable.  For
3389example:
3390             integer target(10)
3391             integer iarr(10)
3392             pointer (ipt, iarr)
3393             ipt = loc(target)
3394   As long as 'ipt' remains unchanged, 'iarr' is now an alias for
3395'target'.  The optimizer, however, will not detect this aliasing, so it
3396is unsafe to use 'iarr' and 'target' simultaneously.  Using a pointee in
3397any way that violates the Fortran aliasing rules or assumptions is
3398illegal.  It is the user's responsibility to avoid doing this; the
3399compiler works under the assumption that no such aliasing occurs.
3400
3401   Cray pointers will work correctly when there is no aliasing (i.e.,
3402when they are used to access a dynamically allocated block of memory),
3403and also in any routine where a pointee is used, but any variable with
3404which it shares storage is not used.  Code that violates these rules may
3405not run as the user intends.  This is not a bug in the optimizer; any
3406code that violates the aliasing rules is illegal.  (Note that this is
3407not unique to GNU Fortran; any Fortran compiler that supports Cray
3408pointers will "incorrectly" optimize code with illegal aliasing.)
3409
3410   There are a number of restrictions on the attributes that can be
3411applied to Cray pointers and pointees.  Pointees may not have the
3412'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or
3413'POINTER' attributes.  Pointers may not have the 'DIMENSION', 'POINTER',
3414'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may
3415they be function results.  Pointees may not occur in more than one
3416pointer statement.  A pointee cannot be a pointer.  Pointees cannot
3417occur in equivalence, common, or data statements.
3418
3419   A Cray pointer may also point to a function or a subroutine.  For
3420example, the following excerpt is valid:
3421       implicit none
3422       external sub
3423       pointer (subptr,subpte)
3424       external subpte
3425       subptr = loc(sub)
3426       call subpte()
3427       [...]
3428       subroutine sub
3429       [...]
3430       end subroutine sub
3431
3432   A pointer may be modified during the course of a program, and this
3433will change the location to which the pointee refers.  However, when
3434pointees are passed as arguments, they are treated as ordinary variables
3435in the invoked function.  Subsequent changes to the pointer will not
3436change the base address of the array that was passed.
3437
3438
3439File: gfortran.info,  Node: CONVERT specifier,  Next: OpenMP,  Prev: Cray pointers,  Up: Extensions implemented in GNU Fortran
3440
34416.1.17 'CONVERT' specifier
3442--------------------------
3443
3444GNU Fortran allows the conversion of unformatted data between little-
3445and big-endian representation to facilitate moving of data between
3446different systems.  The conversion can be indicated with the 'CONVERT'
3447specifier on the 'OPEN' statement.  *Note GFORTRAN_CONVERT_UNIT::, for
3448an alternative way of specifying the data format via an environment
3449variable.
3450
3451   Valid values for 'CONVERT' are:
3452     'CONVERT='NATIVE'' Use the native format.  This is the default.
3453     'CONVERT='SWAP'' Swap between little- and big-endian.
3454     'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
3455     unformatted files.
3456     'CONVERT='BIG_ENDIAN'' Use the big-endian representation for
3457     unformatted files.
3458
3459   Using the option could look like this:
3460       open(file='big.dat',form='unformatted',access='sequential', &
3461            convert='big_endian')
3462
3463   The value of the conversion can be queried by using
3464'INQUIRE(CONVERT=ch)'.  The values returned are ''BIG_ENDIAN'' and
3465''LITTLE_ENDIAN''.
3466
3467   'CONVERT' works between big- and little-endian for 'INTEGER' values
3468of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8.
3469Conversion between different "extended double" types on different
3470architectures such as m68k and x86_64, which GNU Fortran supports as
3471'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work.
3472
3473   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
3474environment variable will override the CONVERT specifier in the open
3475statement_.  This is to give control over data formats to users who do
3476not have the source code of their program available.
3477
3478   Using anything but the native representation for unformatted data
3479carries a significant speed overhead.  If speed in this area matters to
3480you, it is best if you use this only for data that needs to be portable.
3481
3482
3483File: gfortran.info,  Node: OpenMP,  Next: OpenACC,  Prev: CONVERT specifier,  Up: Extensions implemented in GNU Fortran
3484
34856.1.18 OpenMP
3486-------------
3487
3488OpenMP (Open Multi-Processing) is an application programming interface
3489(API) that supports multi-platform shared memory multiprocessing
3490programming in C/C++ and Fortran on many architectures, including Unix
3491and Microsoft Windows platforms.  It consists of a set of compiler
3492directives, library routines, and environment variables that influence
3493run-time behavior.
3494
3495   GNU Fortran strives to be compatible to the OpenMP Application
3496Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/).
3497
3498   To enable the processing of the OpenMP directive '!$omp' in free-form
3499source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form;
3500the '!$' conditional compilation sentinels in free form; and the 'c$',
3501'*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked
3502with the '-fopenmp'.  This also arranges for automatic linking of the
3503GNU Offloading and Multi Processing Runtime Library *note libgomp:
3504(libgomp)Top.
3505
3506   The OpenMP Fortran runtime library routines are provided both in a
3507form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran
3508'include' file named 'omp_lib.h'.
3509
3510   An example of a parallelized loop taken from Appendix A.1 of the
3511OpenMP Application Program Interface v2.5:
3512     SUBROUTINE A1(N, A, B)
3513       INTEGER I, N
3514       REAL B(N), A(N)
3515     !$OMP PARALLEL DO !I is private by default
3516       DO I=2,N
3517         B(I) = (A(I) + A(I-1)) / 2.0
3518       ENDDO
3519     !$OMP END PARALLEL DO
3520     END SUBROUTINE A1
3521
3522   Please note:
3523   * '-fopenmp' implies '-frecursive', i.e., all local arrays will be
3524     allocated on the stack.  When porting existing code to OpenMP, this
3525     may lead to surprising results, especially to segmentation faults
3526     if the stacksize is limited.
3527
3528   * On glibc-based systems, OpenMP enabled applications cannot be
3529     statically linked due to limitations of the underlying
3530     pthreads-implementation.  It might be possible to get a working
3531     solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
3532     is added to the command line.  However, this is not supported by
3533     'gcc' and thus not recommended.
3534
3535
3536File: gfortran.info,  Node: OpenACC,  Next: Argument list functions,  Prev: OpenMP,  Up: Extensions implemented in GNU Fortran
3537
35386.1.19 OpenACC
3539--------------
3540
3541OpenACC is an application programming interface (API) that supports
3542offloading of code to accelerator devices.  It consists of a set of
3543compiler directives, library routines, and environment variables that
3544influence run-time behavior.
3545
3546   GNU Fortran strives to be compatible to the OpenACC Application
3547Programming Interface v2.6 (http://www.openacc.org/).
3548
3549   To enable the processing of the OpenACC directive '!$acc' in
3550free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in
3551fixed form; the '!$' conditional compilation sentinels in free form; and
3552the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be
3553invoked with the '-fopenacc'.  This also arranges for automatic linking
3554of the GNU Offloading and Multi Processing Runtime Library *note
3555libgomp: (libgomp)Top.
3556
3557   The OpenACC Fortran runtime library routines are provided both in a
3558form of a Fortran 90 module named 'openacc' and in a form of a Fortran
3559'include' file named 'openacc_lib.h'.
3560
3561
3562File: gfortran.info,  Node: Argument list functions,  Next: Read/Write after EOF marker,  Prev: OpenACC,  Up: Extensions implemented in GNU Fortran
3563
35646.1.20 Argument list functions '%VAL', '%REF' and '%LOC'
3565--------------------------------------------------------
3566
3567GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC'
3568statements, for backward compatibility with g77.  It is recommended that
3569these should be used only for code that is accessing facilities outside
3570of GNU Fortran, such as operating system or windowing facilities.  It is
3571best to constrain such uses to isolated portions of a program-portions
3572that deal specifically and exclusively with low-level, system-dependent
3573facilities.  Such portions might well provide a portable interface for
3574use by the program as a whole, but are themselves not portable, and
3575should be thoroughly tested each time they are rebuilt using a new
3576compiler or version of a compiler.
3577
3578   '%VAL' passes a scalar argument by value, '%REF' passes it by
3579reference and '%LOC' passes its memory location.  Since gfortran already
3580passes scalar arguments by reference, '%REF' is in effect a do-nothing.
3581'%LOC' has the same effect as a Fortran pointer.
3582
3583   An example of passing an argument by value to a C subroutine foo.:
3584     C
3585     C prototype      void foo_ (float x);
3586     C
3587           external foo
3588           real*4 x
3589           x = 3.14159
3590           call foo (%VAL (x))
3591           end
3592
3593   For details refer to the g77 manual
3594<https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>.
3595
3596   Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran
3597testsuite are worth a look.
3598
3599
3600File: gfortran.info,  Node: Read/Write after EOF marker,  Next: STRUCTURE and RECORD,  Prev: Argument list functions,  Up: Extensions implemented in GNU Fortran
3601
36026.1.21 Read/Write after EOF marker
3603----------------------------------
3604
3605Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file
3606marker in order to find the end of a file.  GNU Fortran normally rejects
3607these codes with a run-time error message and suggests the user consider
3608'BACKSPACE' or 'REWIND' to properly position the file before the EOF
3609marker.  As an extension, the run-time error may be disabled using
3610-std=legacy.
3611
3612
3613File: gfortran.info,  Node: STRUCTURE and RECORD,  Next: UNION and MAP,  Prev: Read/Write after EOF marker,  Up: Extensions implemented in GNU Fortran
3614
36156.1.22 'STRUCTURE' and 'RECORD'
3616-------------------------------
3617
3618Record structures are a pre-Fortran-90 vendor extension to create
3619user-defined aggregate data types.  Support for record structures in GNU
3620Fortran can be enabled with the '-fdec-structure' compile flag.  If you
3621have a choice, you should instead use Fortran 90's "derived types",
3622which have a different syntax.
3623
3624   In many cases, record structures can easily be converted to derived
3625types.  To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE'
3626TYPE-NAME.  Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by
3627'TYPE('TYPE-NAME')'.  Finally, in the component access, replace the
3628period ('.') by the percent sign ('%').
3629
3630   Here is an example of code using the non portable record structure
3631syntax:
3632
3633     ! Declaring a structure named ``item'' and containing three fields:
3634     ! an integer ID, an description string and a floating-point price.
3635     STRUCTURE /item/
3636       INTEGER id
3637       CHARACTER(LEN=200) description
3638       REAL price
3639     END STRUCTURE
3640
3641     ! Define two variables, an single record of type ``item''
3642     ! named ``pear'', and an array of items named ``store_catalog''
3643     RECORD /item/ pear, store_catalog(100)
3644
3645     ! We can directly access the fields of both variables
3646     pear.id = 92316
3647     pear.description = "juicy D'Anjou pear"
3648     pear.price = 0.15
3649     store_catalog(7).id = 7831
3650     store_catalog(7).description = "milk bottle"
3651     store_catalog(7).price = 1.2
3652
3653     ! We can also manipulate the whole structure
3654     store_catalog(12) = pear
3655     print *, store_catalog(12)
3656
3657This code can easily be rewritten in the Fortran 90 syntax as following:
3658
3659     ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
3660     ! ``TYPE name ... END TYPE''
3661     TYPE item
3662       INTEGER id
3663       CHARACTER(LEN=200) description
3664       REAL price
3665     END TYPE
3666
3667     ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
3668     TYPE(item) pear, store_catalog(100)
3669
3670     ! Instead of using a dot (.) to access fields of a record, the
3671     ! standard syntax uses a percent sign (%)
3672     pear%id = 92316
3673     pear%description = "juicy D'Anjou pear"
3674     pear%price = 0.15
3675     store_catalog(7)%id = 7831
3676     store_catalog(7)%description = "milk bottle"
3677     store_catalog(7)%price = 1.2
3678
3679     ! Assignments of a whole variable do not change
3680     store_catalog(12) = pear
3681     print *, store_catalog(12)
3682
3683GNU Fortran implements STRUCTURES like derived types with the following
3684rules and exceptions:
3685
3686   * Structures act like derived types with the 'SEQUENCE' attribute.
3687     Otherwise they may contain no specifiers.
3688
3689   * Structures may contain a special field with the name '%FILL'.  This
3690     will create an anonymous component which cannot be accessed but
3691     occupies space just as if a component of the same type was declared
3692     in its place, useful for alignment purposes.  As an example, the
3693     following structure will consist of at least sixteen bytes:
3694
3695          structure /padded/
3696            character(4) start
3697            character(8) %FILL
3698            character(4) end
3699          end structure
3700
3701   * Structures may share names with other symbols.  For example, the
3702     following is invalid for derived types, but valid for structures:
3703
3704          structure /header/
3705            ! ...
3706          end structure
3707          record /header/ header
3708
3709   * Structure types may be declared nested within another parent
3710     structure.  The syntax is:
3711          structure /type-name/
3712              ...
3713              structure [/<type-name>/] <field-list>
3714          ...
3715
3716     The type name may be ommitted, in which case the structure type
3717     itself is anonymous, and other structures of the same type cannot
3718     be instantiated.  The following shows some examples:
3719
3720          structure /appointment/
3721            ! nested structure definition: app_time is an array of two 'time'
3722            structure /time/ app_time (2)
3723              integer(1) hour, minute
3724            end structure
3725            character(10) memo
3726          end structure
3727
3728          ! The 'time' structure is still usable
3729          record /time/ now
3730          now = time(5, 30)
3731
3732          ...
3733
3734          structure /appointment/
3735            ! anonymous nested structure definition
3736            structure start, end
3737              integer(1) hour, minute
3738            end structure
3739            character(10) memo
3740          end structure
3741
3742   * Structures may contain 'UNION' blocks.  For more detail see the
3743     section on *note UNION and MAP::.
3744
3745   * Structures support old-style initialization of components, like
3746     those described in *note Old-style variable initialization::.  For
3747     array initializers, an initializer may contain a repeat
3748     specification of the form '<literal-integer> *
3749     <constant-initializer>'.  The value of the integer indicates the
3750     number of times to repeat the constant initializer when expanding
3751     the initializer list.
3752
3753
3754File: gfortran.info,  Node: UNION and MAP,  Next: Type variants for integer intrinsics,  Prev: STRUCTURE and RECORD,  Up: Extensions implemented in GNU Fortran
3755
37566.1.23 'UNION' and 'MAP'
3757------------------------
3758
3759Unions are an old vendor extension which were commonly used with the
3760non-standard *note STRUCTURE and RECORD:: extensions.  Use of 'UNION'
3761and 'MAP' is automatically enabled with '-fdec-structure'.
3762
3763   A 'UNION' declaration occurs within a structure; within the
3764definition of each union is a number of 'MAP' blocks.  Each 'MAP' shares
3765storage with its sibling maps (in the same union), and the size of the
3766union is the size of the largest map within it, just as with unions in
3767C. The major difference is that component references do not indicate
3768which union or map the component is in (the compiler gets to figure that
3769out).
3770
3771   Here is a small example:
3772     structure /myunion/
3773     union
3774       map
3775         character(2) w0, w1, w2
3776       end map
3777       map
3778         character(6) long
3779       end map
3780     end union
3781     end structure
3782
3783     record /myunion/ rec
3784     ! After this assignment...
3785     rec.long = 'hello!'
3786
3787     ! The following is true:
3788     ! rec.w0 === 'he'
3789     ! rec.w1 === 'll'
3790     ! rec.w2 === 'o!'
3791
3792   The two maps share memory, and the size of the union is ultimately
3793six bytes:
3794
3795     0    1    2    3    4   5   6     Byte offset
3796     -------------------------------
3797     |    |    |    |    |    |    |
3798     -------------------------------
3799
3800     ^    W0   ^    W1   ^    W2   ^
3801      \-------/ \-------/ \-------/
3802
3803     ^             LONG            ^
3804      \---------------------------/
3805
3806   Following is an example mirroring the layout of an Intel x86_64
3807register:
3808
3809     structure /reg/
3810       union ! U0                ! rax
3811         map
3812           character(16) rx
3813         end map
3814         map
3815           character(8) rh         ! rah
3816           union ! U1
3817             map
3818               character(8) rl     ! ral
3819             end map
3820             map
3821               character(8) ex     ! eax
3822             end map
3823             map
3824               character(4) eh     ! eah
3825               union ! U2
3826                 map
3827                   character(4) el ! eal
3828                 end map
3829                 map
3830                   character(4) x  ! ax
3831                 end map
3832                 map
3833                   character(2) h  ! ah
3834                   character(2) l  ! al
3835                 end map
3836               end union
3837             end map
3838           end union
3839         end map
3840       end union
3841     end structure
3842     record /reg/ a
3843
3844     ! After this assignment...
3845     a.rx     =     'AAAAAAAA.BBB.C.D'
3846
3847     ! The following is true:
3848     a.rx === 'AAAAAAAA.BBB.C.D'
3849     a.rh === 'AAAAAAAA'
3850     a.rl ===         '.BBB.C.D'
3851     a.ex ===         '.BBB.C.D'
3852     a.eh ===         '.BBB'
3853     a.el ===             '.C.D'
3854     a.x  ===             '.C.D'
3855     a.h  ===             '.C'
3856     a.l  ===               '.D'
3857
3858
3859File: gfortran.info,  Node: Type variants for integer intrinsics,  Next: AUTOMATIC and STATIC attributes,  Prev: UNION and MAP,  Up: Extensions implemented in GNU Fortran
3860
38616.1.24 Type variants for integer intrinsics
3862-------------------------------------------
3863
3864Similar to the D/C prefixes to real functions to specify the
3865input/output types, GNU Fortran offers B/I/J/K prefixes to integer
3866functions for compatibility with DEC programs.  The types implied by
3867each are:
3868
3869     B - INTEGER(kind=1)
3870     I - INTEGER(kind=2)
3871     J - INTEGER(kind=4)
3872     K - INTEGER(kind=8)
3873
3874   GNU Fortran supports these with the flag '-fdec-intrinsic-ints'.
3875Intrinsics for which prefixed versions are available and in what form
3876are noted in *note Intrinsic Procedures::.  The complete list of
3877supported intrinsics is here:
3878
3879Intrinsic      B              I              J              K
3880
3881---------------------------------------------------------------------------
3882'*note         'BABS'         'IIABS'        'JIABS'        'KIABS'
3883ABS::'
3884'*note         'BBTEST'       'BITEST'       'BJTEST'       'BKTEST'
3885BTEST::'
3886'*note         'BIAND'        'IIAND'        'JIAND'        'KIAND'
3887IAND::'
3888'*note         'BBCLR'        'IIBCLR'       'JIBCLR'       'KIBCLR'
3889IBCLR::'
3890'*note         'BBITS'        'IIBITS'       'JIBITS'       'KIBITS'
3891IBITS::'
3892'*note         'BBSET'        'IIBSET'       'JIBSET'       'KIBSET'
3893IBSET::'
3894'*note         'BIEOR'        'IIEOR'        'JIEOR'        'KIEOR'
3895IEOR::'
3896'*note         'BIOR'         'IIOR'         'JIOR'         'KIOR'
3897IOR::'
3898'*note         'BSHFT'        'IISHFT'       'JISHFT'       'KISHFT'
3899ISHFT::'
3900'*note         'BSHFTC'       'IISHFTC'      'JISHFTC'      'KISHFTC'
3901ISHFTC::'
3902'*note         'BMOD'         'IMOD'         'JMOD'         'KMOD'
3903MOD::'
3904'*note         'BNOT'         'INOT'         'JNOT'         'KNOT'
3905NOT::'
3906'*note         '--'           'FLOATI'       'FLOATJ'       'FLOATK'
3907REAL::'
3908
3909
3910File: gfortran.info,  Node: AUTOMATIC and STATIC attributes,  Next: Extended math intrinsics,  Prev: Type variants for integer intrinsics,  Up: Extensions implemented in GNU Fortran
3911
39126.1.25 'AUTOMATIC' and 'STATIC' attributes
3913------------------------------------------
3914
3915With '-fdec-static' GNU Fortran supports the DEC extended attributes
3916'STATIC' and 'AUTOMATIC' to provide explicit specification of entity
3917storage.  These follow the syntax of the Fortran standard 'SAVE'
3918attribute.
3919
3920   'STATIC' is exactly equivalent to 'SAVE', and specifies that an
3921entity should be allocated in static memory.  As an example, 'STATIC'
3922local variables will retain their values across multiple calls to a
3923function.
3924
3925   Entities marked 'AUTOMATIC' will be stack automatic whenever
3926possible.  'AUTOMATIC' is the default for local variables smaller than
3927'-fmax-stack-var-size', unless '-fno-automatic' is given.  This
3928attribute overrides '-fno-automatic', '-fmax-stack-var-size', and
3929blanket 'SAVE' statements.
3930
3931   Examples:
3932
3933     subroutine f
3934       integer, automatic :: i  ! automatic variable
3935       integer x, y             ! static variables
3936       save
3937       ...
3938     endsubroutine
3939     subroutine f
3940       integer a, b, c, x, y, z
3941       static :: x
3942       save y
3943       automatic z, c
3944       ! a, b, c, and z are automatic
3945       ! x and y are static
3946     endsubroutine
3947     ! Compiled with -fno-automatic
3948     subroutine f
3949       integer a, b, c, d
3950       automatic :: a
3951       ! a is automatic; b, c, and d are static
3952     endsubroutine
3953
3954
3955File: gfortran.info,  Node: Extended math intrinsics,  Next: Form feed as whitespace,  Prev: AUTOMATIC and STATIC attributes,  Up: Extensions implemented in GNU Fortran
3956
39576.1.26 Extended math intrinsics
3958-------------------------------
3959
3960GNU Fortran supports an extended list of mathematical intrinsics with
3961the compile flag '-fdec-math' for compatability with legacy code.  These
3962intrinsics are described fully in *note Intrinsic Procedures:: where it
3963is noted that they are extensions and should be avoided whenever
3964possible.
3965
3966   Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and
3967trigonometric intrinsics which accept or produce values in degrees
3968instead of radians.  Here is a summary of the new intrinsics:
3969
3970Radians                              Degrees
3971--------------------------------------------------------------------------
3972'*note ACOS::'                       '*note ACOSD::'*
3973'*note ASIN::'                       '*note ASIND::'*
3974'*note ATAN::'                       '*note ATAND::'*
3975'*note ATAN2::'                      '*note ATAN2D::'*
3976'*note COS::'                        '*note COSD::'*
3977'*note COTAN::'*                     '*note COTAND::'*
3978'*note SIN::'                        '*note SIND::'*
3979'*note TAN::'                        '*note TAND::'*
3980
3981   * Enabled with '-fdec-math'.
3982
3983   For advanced users, it may be important to know the implementation of
3984these functions.  They are simply wrappers around the standard radian
3985functions, which have more accurate builtin versions.  These functions
3986convert their arguments (or results) to degrees (or radians) by taking
3987the value modulus 360 (or 2*pi) and then multiplying it by a constant
3988radian-to-degree (or degree-to-radian) factor, as appropriate.  The
3989factor is computed at compile-time as 180/pi (or pi/180).
3990
3991
3992File: gfortran.info,  Node: Form feed as whitespace,  Next: TYPE as an alias for PRINT,  Prev: Extended math intrinsics,  Up: Extensions implemented in GNU Fortran
3993
39946.1.27 Form feed as whitespace
3995------------------------------
3996
3997Historically, legacy compilers allowed insertion of form feed characters
3998('\f', ASCII 0xC) at the beginning of lines for formatted output to line
3999printers, though the Fortran standard does not mention this.  GNU
4000Fortran supports the interpretation of form feed characters in source as
4001whitespace for compatibility.
4002
4003
4004File: 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
4005
40066.1.28 TYPE as an alias for PRINT
4007---------------------------------
4008
4009For compatibility, GNU Fortran will interpret 'TYPE' statements as
4010'PRINT' statements with the flag '-fdec'.  With this flag asserted, the
4011following two examples are equivalent:
4012
4013     TYPE *, 'hello world'
4014
4015     PRINT *, 'hello world'
4016
4017
4018File: gfortran.info,  Node: %LOC as an rvalue,  Next: .XOR. operator,  Prev: TYPE as an alias for PRINT,  Up: Extensions implemented in GNU Fortran
4019
40206.1.29 %LOC as an rvalue
4021------------------------
4022
4023Normally '%LOC' is allowed only in parameter lists.  However the
4024intrinsic function 'LOC' does the same thing, and is usable as the
4025right-hand-side of assignments.  For compatibility, GNU Fortran supports
4026the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'.
4027With this feature enabled the following two examples are equivalent:
4028
4029     integer :: i, l
4030     l = %loc(i)
4031     call sub(l)
4032
4033     integer :: i
4034     call sub(%loc(i))
4035
4036
4037File: gfortran.info,  Node: .XOR. operator,  Next: Bitwise logical operators,  Prev: %LOC as an rvalue,  Up: Extensions implemented in GNU Fortran
4038
40396.1.30 .XOR. operator
4040---------------------
4041
4042GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy'
4043for compatibility with legacy code.  '.XOR.' is equivalent to '.NEQV.'.
4044That is, the output is true if and only if the inputs differ.
4045
4046
4047File: gfortran.info,  Node: Bitwise logical operators,  Next: Extended I/O specifiers,  Prev: .XOR. operator,  Up: Extensions implemented in GNU Fortran
4048
40496.1.31 Bitwise logical operators
4050--------------------------------
4051
4052With '-fdec', GNU Fortran relaxes the type constraints on logical
4053operators to allow integer operands, and performs the corresponding
4054bitwise operation instead.  This flag is for compatibility only, and
4055should be avoided in new code.  Consider:
4056
4057       INTEGER :: i, j
4058       i = z'33'
4059       j = z'cc'
4060       print *, i .AND. j
4061
4062   In this example, compiled with '-fdec', GNU Fortran will replace the
4063'.AND.' operation with a call to the intrinsic '*note IAND::' function,
4064yielding the bitwise-and of 'i' and 'j'.
4065
4066   Note that this conversion will occur if at least one operand is of
4067integral type.  As a result, a logical operand will be converted to an
4068integer when the other operand is an integer in a logical operation.  In
4069this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'.
4070
4071   Here is the mapping of logical operator to bitwise intrinsic used
4072with '-fdec':
4073
4074Operator           Intrinsic          Bitwise operation
4075---------------------------------------------------------------------------
4076'.NOT.'            '*note NOT::'      complement
4077'.AND.'            '*note IAND::'     intersection
4078'.OR.'             '*note IOR::'      union
4079'.NEQV.'           '*note IEOR::'     exclusive or
4080'.EQV.'            '*note             complement of exclusive or
4081                   NOT::(*note
4082                   IEOR::)'
4083
4084
4085File: gfortran.info,  Node: Extended I/O specifiers,  Next: Legacy PARAMETER statements,  Prev: Bitwise logical operators,  Up: Extensions implemented in GNU Fortran
4086
40876.1.32 Extended I/O specifiers
4088------------------------------
4089
4090GNU Fortran supports the additional legacy I/O specifiers
4091'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag
4092'-fdec', for compatibility.
4093
4094'CARRIAGECONTROL'
4095     The 'CARRIAGECONTROL' specifier allows a user to control line
4096     termination settings between output records for an I/O unit.  The
4097     specifier has no meaning for readonly files.  When
4098     'CARRAIGECONTROL' is specified upon opening a unit for formatted
4099     writing, the exact 'CARRIAGECONTROL' setting determines what
4100     characters to write between output records.  The syntax is:
4101
4102          OPEN(..., CARRIAGECONTROL=cc)
4103
4104     Where _cc_ is a character expression that evaluates to one of the
4105     following values:
4106
4107     ''LIST''       One line feed between records (default)
4108     ''FORTRAN''    Legacy interpretation of the first character (see below)
4109     ''NONE''       No separator between records
4110
4111     With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the
4112     first character of the input record is not written, and instead
4113     determines the output record separator as follows:
4114
4115     Leading character      Meaning                Output separating
4116                                                   character(s)
4117     ----------------------------------------------------------------------------
4118     ''+''                  Overprinting           Carriage return only
4119     ''-''                  New line               Line feed and carriage
4120                                                   return
4121     ''0''                  Skip line              Two line feeds and carriage
4122                                                   return
4123     ''1''                  New page               Form feed and carriage
4124                                                   return
4125     ''$''                  Prompting              Line feed (no carriage
4126                                                   return)
4127     'CHAR(0)'              Overprinting (no       None
4128                            advance)
4129
4130'READONLY'
4131     The 'READONLY' specifier may be given upon opening a unit, and is
4132     equivalent to specifying 'ACTION='READ'', except that the file may
4133     not be deleted on close (i.e.  'CLOSE' with 'STATUS="DELETE"').
4134     The syntax is:
4135
4136          OPEN(..., READONLY)
4137
4138'SHARE'
4139     The 'SHARE' specifier allows system-level locking on a unit upon
4140     opening it for controlled access from multiple processes/threads.
4141     The 'SHARE' specifier has several forms:
4142
4143          OPEN(..., SHARE=sh)
4144          OPEN(..., SHARED)
4145          OPEN(..., NOSHARED)
4146
4147     Where _sh_ in the first form is a character expression that
4148     evaluates to a value as seen in the table below.  The latter two
4149     forms are aliases for particular values of _sh_:
4150
4151     Explicit form          Short form             Meaning
4152     ----------------------------------------------------------------------------
4153     'SHARE='DENYRW''       'NOSHARED'             Exclusive (write) lock
4154     'SHARE='DENYNONE''     'SHARED'               Shared (read) lock
4155
4156     In general only one process may hold an exclusive (write) lock for
4157     a given file at a time, whereas many processes may hold shared
4158     (read) locks for the same file.
4159
4160     The behavior of locking may vary with your operating system.  On
4161     POSIX systems, locking is implemented with 'fcntl'.  Consult your
4162     corresponding operating system's manual pages for further details.
4163     Locking via 'SHARE=' is not supported on other systems.
4164
4165
4166File: gfortran.info,  Node: Legacy PARAMETER statements,  Next: Default exponents,  Prev: Extended I/O specifiers,  Up: Extensions implemented in GNU Fortran
4167
41686.1.33 Legacy PARAMETER statements
4169----------------------------------
4170
4171For compatibility, GNU Fortran supports legacy PARAMETER statements
4172without parentheses with '-std=legacy'.  A warning is emitted if used
4173with '-std=gnu', and an error is acknowledged with a real Fortran
4174standard flag ('-std=f95', etc...).  These statements take the following
4175form:
4176
4177     implicit real (E)
4178     parameter e = 2.718282
4179     real c
4180     parameter c = 3.0e8
4181
4182
4183File: gfortran.info,  Node: Default exponents,  Prev: Legacy PARAMETER statements,  Up: Extensions implemented in GNU Fortran
4184
41856.1.34 Default exponents
4186------------------------
4187
4188For compatibility, GNU Fortran supports a default exponent of zero in
4189real constants with '-fdec'.  For example, '9e' would be interpreted as
4190'9e0', rather than an error.
4191
4192
4193File: gfortran.info,  Node: Extensions not implemented in GNU Fortran,  Prev: Extensions implemented in GNU Fortran,  Up: Extensions
4194
41956.2 Extensions not implemented in GNU Fortran
4196=============================================
4197
4198The long history of the Fortran language, its wide use and broad
4199userbase, the large number of different compiler vendors and the lack of
4200some features crucial to users in the first standards have lead to the
4201existence of a number of important extensions to the language.  While
4202some of the most useful or popular extensions are supported by the GNU
4203Fortran compiler, not all existing extensions are supported.  This
4204section aims at listing these extensions and offering advice on how best
4205make code that uses them running with the GNU Fortran compiler.
4206
4207* Menu:
4208
4209* ENCODE and DECODE statements::
4210* Variable FORMAT expressions::
4211* Alternate complex function syntax::
4212* Volatile COMMON blocks::
4213* OPEN( ... NAME=)::
4214* Q edit descriptor::
4215
4216
4217File: gfortran.info,  Node: ENCODE and DECODE statements,  Next: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
4218
42196.2.1 'ENCODE' and 'DECODE' statements
4220--------------------------------------
4221
4222GNU Fortran does not support the 'ENCODE' and 'DECODE' statements.
4223These statements are best replaced by 'READ' and 'WRITE' statements
4224involving internal files ('CHARACTER' variables and arrays), which have
4225been part of the Fortran standard since Fortran 77.  For example,
4226replace a code fragment like
4227
4228           INTEGER*1 LINE(80)
4229           REAL A, B, C
4230     c     ... Code that sets LINE
4231           DECODE (80, 9000, LINE) A, B, C
4232      9000 FORMAT (1X, 3(F10.5))
4233
4234with the following:
4235
4236           CHARACTER(LEN=80) LINE
4237           REAL A, B, C
4238     c     ... Code that sets LINE
4239           READ (UNIT=LINE, FMT=9000) A, B, C
4240      9000 FORMAT (1X, 3(F10.5))
4241
4242   Similarly, replace a code fragment like
4243
4244           INTEGER*1 LINE(80)
4245           REAL A, B, C
4246     c     ... Code that sets A, B and C
4247           ENCODE (80, 9000, LINE) A, B, C
4248      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
4249
4250with the following:
4251
4252           CHARACTER(LEN=80) LINE
4253           REAL A, B, C
4254     c     ... Code that sets A, B and C
4255           WRITE (UNIT=LINE, FMT=9000) A, B, C
4256      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
4257
4258
4259File: gfortran.info,  Node: Variable FORMAT expressions,  Next: Alternate complex function syntax,  Prev: ENCODE and DECODE statements,  Up: Extensions not implemented in GNU Fortran
4260
42616.2.2 Variable 'FORMAT' expressions
4262-----------------------------------
4263
4264A variable 'FORMAT' expression is format statement which includes angle
4265brackets enclosing a Fortran expression: 'FORMAT(I<N>)'.  GNU Fortran
4266does not support this legacy extension.  The effect of variable format
4267expressions can be reproduced by using the more powerful (and standard)
4268combination of internal output and string formats.  For example, replace
4269a code fragment like this:
4270
4271           WRITE(6,20) INT1
4272      20   FORMAT(I<N+1>)
4273
4274with the following:
4275
4276     c     Variable declaration
4277           CHARACTER(LEN=20) FMT
4278     c
4279     c     Other code here...
4280     c
4281           WRITE(FMT,'("(I", I0, ")")') N+1
4282           WRITE(6,FMT) INT1
4283
4284or with:
4285
4286     c     Variable declaration
4287           CHARACTER(LEN=20) FMT
4288     c
4289     c     Other code here...
4290     c
4291           WRITE(FMT,*) N+1
4292           WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
4293
4294
4295File: gfortran.info,  Node: Alternate complex function syntax,  Next: Volatile COMMON blocks,  Prev: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
4296
42976.2.3 Alternate complex function syntax
4298---------------------------------------
4299
4300Some Fortran compilers, including 'g77', let the user declare complex
4301functions with the syntax 'COMPLEX FUNCTION name*16()', as well as
4302'COMPLEX*16 FUNCTION name()'.  Both are non-standard, legacy extensions.
4303'gfortran' accepts the latter form, which is more common, but not the
4304former.
4305
4306
4307File: gfortran.info,  Node: Volatile COMMON blocks,  Next: OPEN( ... NAME=),  Prev: Alternate complex function syntax,  Up: Extensions not implemented in GNU Fortran
4308
43096.2.4 Volatile 'COMMON' blocks
4310------------------------------
4311
4312Some Fortran compilers, including 'g77', let the user declare 'COMMON'
4313with the 'VOLATILE' attribute.  This is invalid standard Fortran syntax
4314and is not supported by 'gfortran'.  Note that 'gfortran' accepts
4315'VOLATILE' variables in 'COMMON' blocks since revision 4.3.
4316
4317
4318File: gfortran.info,  Node: OPEN( ... NAME=),  Next: Q edit descriptor,  Prev: Volatile COMMON blocks,  Up: Extensions not implemented in GNU Fortran
4319
43206.2.5 'OPEN( ... NAME=)'
4321------------------------
4322
4323Some Fortran compilers, including 'g77', let the user declare 'OPEN( ...
4324NAME=)'.  This is invalid standard Fortran syntax and is not supported
4325by 'gfortran'.  'OPEN( ... NAME=)' should be replaced with 'OPEN( ...
4326FILE=)'.
4327
4328
4329File: gfortran.info,  Node: Q edit descriptor,  Prev: OPEN( ... NAME=),  Up: Extensions not implemented in GNU Fortran
4330
43316.2.6 'Q' edit descriptor
4332-------------------------
4333
4334Some Fortran compilers provide the 'Q' edit descriptor, which transfers
4335the number of characters left within an input record into an integer
4336variable.
4337
4338   A direct replacement of the 'Q' edit descriptor is not available in
4339'gfortran'.  How to replicate its functionality using
4340standard-conforming code depends on what the intent of the original code
4341is.
4342
4343   Options to replace 'Q' may be to read the whole line into a character
4344variable and then counting the number of non-blank characters left using
4345'LEN_TRIM'.  Another method may be to use formatted stream, read the
4346data up to the position where the 'Q' descriptor occurred, use 'INQUIRE'
4347to get the file position, count the characters up to the next 'NEW_LINE'
4348and then start reading from the position marked previously.
4349
4350
4351File: gfortran.info,  Node: Mixed-Language Programming,  Next: Coarray Programming,  Prev: Extensions,  Up: Top
4352
43537 Mixed-Language Programming
4354****************************
4355
4356* Menu:
4357
4358* Interoperability with C::
4359* GNU Fortran Compiler Directives::
4360* Non-Fortran Main Program::
4361* Naming and argument-passing conventions::
4362
4363This chapter is about mixed-language interoperability, but also applies
4364if one links Fortran code compiled by different compilers.  In most
4365cases, use of the C Binding features of the Fortran 2003 standard is
4366sufficient, and their use is highly recommended.
4367
4368
4369File: gfortran.info,  Node: Interoperability with C,  Next: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4370
43717.1 Interoperability with C
4372===========================
4373
4374* Menu:
4375
4376* Intrinsic Types::
4377* Derived Types and struct::
4378* Interoperable Global Variables::
4379* Interoperable Subroutines and Functions::
4380* Working with Pointers::
4381* Further Interoperability of Fortran with C::
4382
4383Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way
4384to generate procedure and derived-type declarations and global variables
4385which are interoperable with C (ISO/IEC 9899:1999).  The 'bind(C)'
4386attribute has been added to inform the compiler that a symbol shall be
4387interoperable with C; also, some constraints are added.  Note, however,
4388that not all C features have a Fortran equivalent or vice versa.  For
4389instance, neither C's unsigned integers nor C's functions with variable
4390number of arguments have an equivalent in Fortran.
4391
4392   Note that array dimensions are reversely ordered in C and that arrays
4393in C always start with index 0 while in Fortran they start by default
4394with 1.  Thus, an array declaration 'A(n,m)' in Fortran matches
4395'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'.
4396The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in
4397memory is 'A(i+1,j)' (C: 'A[j-1][i]').
4398
4399
4400File: gfortran.info,  Node: Intrinsic Types,  Next: Derived Types and struct,  Up: Interoperability with C
4401
44027.1.1 Intrinsic Types
4403---------------------
4404
4405In order to ensure that exactly the same variable type and kind is used
4406in C and Fortran, the named constants shall be used which are defined in
4407the 'ISO_C_BINDING' intrinsic module.  That module contains named
4408constants for kind parameters and character named constants for the
4409escape sequences in C. For a list of the constants, see *note
4410ISO_C_BINDING::.
4411
4412   For logical types, please note that the Fortran standard only
4413guarantees interoperability between C99's '_Bool' and Fortran's
4414'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and
4415'false' the value 0.  Using any other integer value with GNU Fortran's
4416'LOGICAL' (with any kind parameter) gives an undefined result.  (Passing
4417other integer values than 0 and 1 to GCC's '_Bool' is also undefined,
4418unless the integer is explicitly or implicitly casted to '_Bool'.)
4419
4420
4421File: gfortran.info,  Node: Derived Types and struct,  Next: Interoperable Global Variables,  Prev: Intrinsic Types,  Up: Interoperability with C
4422
44237.1.2 Derived Types and struct
4424------------------------------
4425
4426For compatibility of derived types with 'struct', one needs to use the
4427'BIND(C)' attribute in the type declaration.  For instance, the
4428following type declaration
4429
4430      USE ISO_C_BINDING
4431      TYPE, BIND(C) :: myType
4432        INTEGER(C_INT) :: i1, i2
4433        INTEGER(C_SIGNED_CHAR) :: i3
4434        REAL(C_DOUBLE) :: d1
4435        COMPLEX(C_FLOAT_COMPLEX) :: c1
4436        CHARACTER(KIND=C_CHAR) :: str(5)
4437      END TYPE
4438
4439   matches the following 'struct' declaration in C
4440
4441      struct {
4442        int i1, i2;
4443        /* Note: "char" might be signed or unsigned.  */
4444        signed char i3;
4445        double d1;
4446        float _Complex c1;
4447        char str[5];
4448      } myType;
4449
4450   Derived types with the C binding attribute shall not have the
4451'sequence' attribute, type parameters, the 'extends' attribute, nor
4452type-bound procedures.  Every component must be of interoperable type
4453and kind and may not have the 'pointer' or 'allocatable' attribute.  The
4454names of the components are irrelevant for interoperability.
4455
4456   As there exist no direct Fortran equivalents, neither unions nor
4457structs with bit field or variable-length array members are
4458interoperable.
4459
4460
4461File: gfortran.info,  Node: Interoperable Global Variables,  Next: Interoperable Subroutines and Functions,  Prev: Derived Types and struct,  Up: Interoperability with C
4462
44637.1.3 Interoperable Global Variables
4464------------------------------------
4465
4466Variables can be made accessible from C using the C binding attribute,
4467optionally together with specifying a binding name.  Those variables
4468have to be declared in the declaration part of a 'MODULE', be of
4469interoperable type, and have neither the 'pointer' nor the 'allocatable'
4470attribute.
4471
4472       MODULE m
4473         USE myType_module
4474         USE ISO_C_BINDING
4475         integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
4476         type(myType), bind(C) :: tp
4477       END MODULE
4478
4479   Here, '_MyProject_flags' is the case-sensitive name of the variable
4480as seen from C programs while 'global_flag' is the case-insensitive name
4481as seen from Fortran.  If no binding name is specified, as for TP, the C
4482binding name is the (lowercase) Fortran binding name.  If a binding name
4483is specified, only a single variable may be after the double colon.
4484Note of warning: You cannot use a global variable to access ERRNO of the
4485C library as the C standard allows it to be a macro.  Use the 'IERRNO'
4486intrinsic (GNU extension) instead.
4487
4488
4489File: gfortran.info,  Node: Interoperable Subroutines and Functions,  Next: Working with Pointers,  Prev: Interoperable Global Variables,  Up: Interoperability with C
4490
44917.1.4 Interoperable Subroutines and Functions
4492---------------------------------------------
4493
4494Subroutines and functions have to have the 'BIND(C)' attribute to be
4495compatible with C. The dummy argument declaration is relatively
4496straightforward.  However, one needs to be careful because C uses
4497call-by-value by default while Fortran behaves usually similar to
4498call-by-reference.  Furthermore, strings and pointers are handled
4499differently.  Note that in Fortran 2003 and 2008 only explicit size and
4500assumed-size arrays are supported but not assumed-shape or
4501deferred-shape (i.e.  allocatable or pointer) arrays.  However, those
4502are allowed since the Technical Specification 29113, see *note Further
4503Interoperability of Fortran with C::
4504
4505   To pass a variable by value, use the 'VALUE' attribute.  Thus, the
4506following C prototype
4507
4508     int func(int i, int *j)
4509
4510   matches the Fortran declaration
4511
4512       integer(c_int) function func(i,j)
4513         use iso_c_binding, only: c_int
4514         integer(c_int), VALUE :: i
4515         integer(c_int) :: j
4516
4517   Note that pointer arguments also frequently need the 'VALUE'
4518attribute, see *note Working with Pointers::.
4519
4520   Strings are handled quite differently in C and Fortran.  In C a
4521string is a 'NUL'-terminated array of characters while in Fortran each
4522string has a length associated with it and is thus not terminated (by
4523e.g.  'NUL').  For example, if one wants to use the following C
4524function,
4525
4526       #include <stdio.h>
4527       void print_C(char *string) /* equivalent: char string[]  */
4528       {
4529          printf("%s\n", string);
4530       }
4531
4532   to print "Hello World" from Fortran, one can call it using
4533
4534       use iso_c_binding, only: C_CHAR, C_NULL_CHAR
4535       interface
4536         subroutine print_c(string) bind(C, name="print_C")
4537           use iso_c_binding, only: c_char
4538           character(kind=c_char) :: string(*)
4539         end subroutine print_c
4540       end interface
4541       call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
4542
4543   As the example shows, one needs to ensure that the string is 'NUL'
4544terminated.  Additionally, the dummy argument STRING of 'print_C' is a
4545length-one assumed-size array; using 'character(len=*)' is not allowed.
4546The example above uses 'c_char_"Hello World"' to ensure the string
4547literal has the right type; typically the default character kind and
4548'c_char' are the same and thus '"Hello World"' is equivalent.  However,
4549the standard does not guarantee this.
4550
4551   The use of strings is now further illustrated using the C library
4552function 'strncpy', whose prototype is
4553
4554       char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
4555
4556   The function 'strncpy' copies at most N characters from string S2 to
4557S1 and returns S1.  In the following example, we ignore the return
4558value:
4559
4560       use iso_c_binding
4561       implicit none
4562       character(len=30) :: str,str2
4563       interface
4564         ! Ignore the return value of strncpy -> subroutine
4565         ! "restrict" is always assumed if we do not pass a pointer
4566         subroutine strncpy(dest, src, n) bind(C)
4567           import
4568           character(kind=c_char),  intent(out) :: dest(*)
4569           character(kind=c_char),  intent(in)  :: src(*)
4570           integer(c_size_t), value, intent(in) :: n
4571         end subroutine strncpy
4572       end interface
4573       str = repeat('X',30) ! Initialize whole string with 'X'
4574       call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
4575                    len(c_char_"Hello World",kind=c_size_t))
4576       print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
4577       end
4578
4579   The intrinsic procedures are described in *note Intrinsic
4580Procedures::.
4581
4582
4583File: gfortran.info,  Node: Working with Pointers,  Next: Further Interoperability of Fortran with C,  Prev: Interoperable Subroutines and Functions,  Up: Interoperability with C
4584
45857.1.5 Working with Pointers
4586---------------------------
4587
4588C pointers are represented in Fortran via the special opaque derived
4589type 'type(c_ptr)' (with private components).  Thus one needs to use
4590intrinsic conversion procedures to convert from or to C pointers.
4591
4592   For some applications, using an assumed type ('TYPE(*)') can be an
4593alternative to a C pointer; see *note Further Interoperability of
4594Fortran with C::.
4595
4596   For example,
4597
4598       use iso_c_binding
4599       type(c_ptr) :: cptr1, cptr2
4600       integer, target :: array(7), scalar
4601       integer, pointer :: pa(:), ps
4602       cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
4603                               ! array is contiguous if required by the C
4604                               ! procedure
4605       cptr2 = c_loc(scalar)
4606       call c_f_pointer(cptr2, ps)
4607       call c_f_pointer(cptr2, pa, shape=[7])
4608
4609   When converting C to Fortran arrays, the one-dimensional 'SHAPE'
4610argument has to be passed.
4611
4612   If a pointer is a dummy-argument of an interoperable procedure, it
4613usually has to be declared using the 'VALUE' attribute.  'void*' matches
4614'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'.
4615
4616   Procedure pointers are handled analogously to pointers; the C type is
4617'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
4618'C_F_PROCPOINTER' and 'C_FUNLOC'.
4619
4620   Let us consider two examples of actually passing a procedure pointer
4621from C to Fortran and vice versa.  Note that these examples are also
4622very similar to passing ordinary pointers between both languages.
4623First, consider this code in C:
4624
4625     /* Procedure implemented in Fortran.  */
4626     void get_values (void (*)(double));
4627
4628     /* Call-back routine we want called from Fortran.  */
4629     void
4630     print_it (double x)
4631     {
4632       printf ("Number is %f.\n", x);
4633     }
4634
4635     /* Call Fortran routine and pass call-back to it.  */
4636     void
4637     foobar ()
4638     {
4639       get_values (&print_it);
4640     }
4641
4642   A matching implementation for 'get_values' in Fortran, that correctly
4643receives the procedure pointer from C and is able to call it, is given
4644in the following 'MODULE':
4645
4646     MODULE m
4647       IMPLICIT NONE
4648
4649       ! Define interface of call-back routine.
4650       ABSTRACT INTERFACE
4651         SUBROUTINE callback (x)
4652           USE, INTRINSIC :: ISO_C_BINDING
4653           REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
4654         END SUBROUTINE callback
4655       END INTERFACE
4656
4657     CONTAINS
4658
4659       ! Define C-bound procedure.
4660       SUBROUTINE get_values (cproc) BIND(C)
4661         USE, INTRINSIC :: ISO_C_BINDING
4662         TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
4663
4664         PROCEDURE(callback), POINTER :: proc
4665
4666         ! Convert C to Fortran procedure pointer.
4667         CALL C_F_PROCPOINTER (cproc, proc)
4668
4669         ! Call it.
4670         CALL proc (1.0_C_DOUBLE)
4671         CALL proc (-42.0_C_DOUBLE)
4672         CALL proc (18.12_C_DOUBLE)
4673       END SUBROUTINE get_values
4674
4675     END MODULE m
4676
4677   Next, we want to call a C routine that expects a procedure pointer
4678argument and pass it a Fortran procedure (which clearly must be
4679interoperable!).  Again, the C function may be:
4680
4681     int
4682     call_it (int (*func)(int), int arg)
4683     {
4684       return func (arg);
4685     }
4686
4687   It can be used as in the following Fortran code:
4688
4689     MODULE m
4690       USE, INTRINSIC :: ISO_C_BINDING
4691       IMPLICIT NONE
4692
4693       ! Define interface of C function.
4694       INTERFACE
4695         INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
4696           USE, INTRINSIC :: ISO_C_BINDING
4697           TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
4698           INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4699         END FUNCTION call_it
4700       END INTERFACE
4701
4702     CONTAINS
4703
4704       ! Define procedure passed to C function.
4705       ! It must be interoperable!
4706       INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
4707         INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4708         double_it = arg + arg
4709       END FUNCTION double_it
4710
4711       ! Call C function.
4712       SUBROUTINE foobar ()
4713         TYPE(C_FUNPTR) :: cproc
4714         INTEGER(KIND=C_INT) :: i
4715
4716         ! Get C procedure pointer.
4717         cproc = C_FUNLOC (double_it)
4718
4719         ! Use it.
4720         DO i = 1_C_INT, 10_C_INT
4721           PRINT *, call_it (cproc, i)
4722         END DO
4723       END SUBROUTINE foobar
4724
4725     END MODULE m
4726
4727
4728File: gfortran.info,  Node: Further Interoperability of Fortran with C,  Prev: Working with Pointers,  Up: Interoperability with C
4729
47307.1.6 Further Interoperability of Fortran with C
4731------------------------------------------------
4732
4733The Technical Specification ISO/IEC TS 29113:2012 on further
4734interoperability of Fortran with C extends the interoperability support
4735of Fortran 2003 and Fortran 2008.  Besides removing some restrictions
4736and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank
4737('dimension') variables and allows for interoperability of
4738assumed-shape, assumed-rank and deferred-shape arrays, including
4739allocatables and pointers.
4740
4741   Note: Currently, GNU Fortran does not use internally the array
4742descriptor (dope vector) as specified in the Technical Specification,
4743but uses an array descriptor with different fields.  Assumed type and
4744assumed rank formal arguments are converted in the library to the
4745specified form.  The ISO_Fortran_binding API functions (also Fortran
47462018 18.4) are implemented in libgfortran.  Alternatively, the Chasm
4747Language Interoperability Tools,
4748<http://chasm-interop.sourceforge.net/>, provide an interface to GNU
4749Fortran's array descriptor.
4750
4751   The Technical Specification adds the following new features, which
4752are supported by GNU Fortran:
4753
4754   * The 'ASYNCHRONOUS' attribute has been clarified and extended to
4755     allow its use with asynchronous communication in user-provided
4756     libraries such as in implementations of the Message Passing
4757     Interface specification.
4758
4759   * Many constraints have been relaxed, in particular for the 'C_LOC'
4760     and 'C_F_POINTER' intrinsics.
4761
4762   * The 'OPTIONAL' attribute is now allowed for dummy arguments; an
4763     absent argument matches a 'NULL' pointer.
4764
4765   * Assumed types ('TYPE(*)') have been added, which may only be used
4766     for dummy arguments.  They are unlimited polymorphic but contrary
4767     to 'CLASS(*)' they do not contain any type information, similar to
4768     C's 'void *' pointers.  Expressions of any type and kind can be
4769     passed; thus, it can be used as replacement for 'TYPE(C_PTR)',
4770     avoiding the use of 'C_LOC' in the caller.
4771
4772     Note, however, that 'TYPE(*)' only accepts scalar arguments, unless
4773     the 'DIMENSION' is explicitly specified.  As 'DIMENSION(*)' only
4774     supports array (including array elements) but no scalars, it is not
4775     a full replacement for 'C_LOC'.  On the other hand, assumed-type
4776     assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for
4777     both scalars and arrays, but require special code on the callee
4778     side to handle the array descriptor.
4779
4780   * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that
4781     scalars and arrays of any rank can be passed as actual argument.
4782     As the Technical Specification does not provide for direct means to
4783     operate with them, they have to be used either from the C side or
4784     be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays
4785     of a specific rank.  The rank can be determined using the 'RANK'
4786     intrinisic.
4787
4788   Currently unimplemented:
4789
4790   * GNU Fortran always uses an array descriptor, which does not match
4791     the one of the Technical Specification.  The
4792     'ISO_Fortran_binding.h' header file and the C functions it
4793     specifies are not available.
4794
4795   * Using assumed-shape, assumed-rank and deferred-shape arrays in
4796     'BIND(C)' procedures is not fully supported.  In particular, C
4797     interoperable strings of other length than one are not supported as
4798     this requires the new array descriptor.
4799
4800
4801File: gfortran.info,  Node: GNU Fortran Compiler Directives,  Next: Non-Fortran Main Program,  Prev: Interoperability with C,  Up: Mixed-Language Programming
4802
48037.2 GNU Fortran Compiler Directives
4804===================================
4805
4806* Menu:
4807
4808* ATTRIBUTES directive::
4809* UNROLL directive::
4810* BUILTIN directive::
4811* IVDEP directive::
4812* VECTOR directive::
4813* NOVECTOR directive::
4814
4815
4816File: gfortran.info,  Node: ATTRIBUTES directive,  Next: UNROLL directive,  Up: GNU Fortran Compiler Directives
4817
48187.2.1 ATTRIBUTES directive
4819--------------------------
4820
4821The Fortran standard describes how a conforming program shall behave;
4822however, the exact implementation is not standardized.  In order to
4823allow the user to choose specific implementation details, compiler
4824directives can be used to set attributes of variables and procedures
4825which are not part of the standard.  Whether a given attribute is
4826supported and its exact effects depend on both the operating system and
4827on the processor; see *note C Extensions: (gcc)Top. for details.
4828
4829   For procedures and procedure pointers, the following attributes can
4830be used to change the calling convention:
4831
4832   * 'CDECL' - standard C calling convention
4833   * 'STDCALL' - convention where the called procedure pops the stack
4834   * 'FASTCALL' - part of the arguments are passed via registers instead
4835     using the stack
4836
4837   Besides changing the calling convention, the attributes also
4838influence the decoration of the symbol name, e.g., by a leading
4839underscore or by a trailing at-sign followed by the number of bytes on
4840the stack.  When assigning a procedure to a procedure pointer, both
4841should use the same calling convention.
4842
4843   On some systems, procedures and global variables (module variables
4844and 'COMMON' blocks) need special handling to be accessible when they
4845are in a shared library.  The following attributes are available:
4846
4847   * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL
4848   * 'DLLIMPORT' - reference the function or variable using a global
4849     pointer
4850
4851   For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in
4852other compilers, it is also known as 'IGNORE_TKR'.  For dummy arguments
4853with this attribute actual arguments of any type and kind (similar to
4854'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
4855standard) are accepted.  As with 'TYPE(*)', the argument is unlimited
4856polymorphic and no type information is available.  Additionally, the
4857argument may only be passed to dummy arguments with the 'NO_ARG_CHECK'
4858attribute and as argument to the 'PRESENT' intrinsic function and to
4859'C_LOC' of the 'ISO_C_BINDING' module.
4860
4861   Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type
4862('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or
4863'COMPLEX'.  They shall not have the 'ALLOCATE', 'CODIMENSION',
4864'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall
4865be either scalar or of assumed-size ('dimension(*)').  As 'TYPE(*)', the
4866'NO_ARG_CHECK' attribute requires an explicit interface.
4867
4868   * 'NO_ARG_CHECK' - disable the type, kind and rank checking
4869
4870   The attributes are specified using the syntax
4871
4872   '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST
4873
4874   where in free-form source code only whitespace is allowed before
4875'!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall
4876start in the first column.
4877
4878   For procedures, the compiler directives shall be placed into the body
4879of the procedure; for variables and procedure pointers, they shall be in
4880the same declaration part as the variable or procedure pointer.
4881
4882
4883File: gfortran.info,  Node: UNROLL directive,  Next: BUILTIN directive,  Prev: ATTRIBUTES directive,  Up: GNU Fortran Compiler Directives
4884
48857.2.2 UNROLL directive
4886----------------------
4887
4888The syntax of the directive is
4889
4890   '!GCC$ unroll N'
4891
4892   You can use this directive to control how many times a loop should be
4893unrolled.  It must be placed immediately before a 'DO' loop and applies
4894only to the loop that follows.  N is an integer constant specifying the
4895unrolling factor.  The values of 0 and 1 block any unrolling of the
4896loop.
4897
4898
4899File: gfortran.info,  Node: BUILTIN directive,  Next: IVDEP directive,  Prev: UNROLL directive,  Up: GNU Fortran Compiler Directives
4900
49017.2.3 BUILTIN directive
4902-----------------------
4903
4904The syntax of the directive is
4905
4906   '!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')'
4907
4908   You can use this directive to define which middle-end built-ins
4909provide vector implementations.  'B' is name of the middle-end built-in.
4910'FLAGS' are optional and must be either "(inbranch)" or "(notinbranch)".
4911'IF' statement is optional and is used to filter multilib ABIs for the
4912built-in that should be vectorized.  Example usage:
4913
4914     !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64')
4915
4916   The purpose of the directive is to provide an API among the GCC
4917compiler and the GNU C Library which would define vector implementations
4918of math routines.
4919
4920
4921File: gfortran.info,  Node: IVDEP directive,  Next: VECTOR directive,  Prev: BUILTIN directive,  Up: GNU Fortran Compiler Directives
4922
49237.2.4 IVDEP directive
4924---------------------
4925
4926The syntax of the directive is
4927
4928   '!GCC$ ivdep'
4929
4930   This directive tells the compiler to ignore vector dependencies in
4931the following loop.  It must be placed immediately before a 'DO' loop
4932and applies only to the loop that follows.
4933
4934   Sometimes the compiler may not have sufficient information to decide
4935whether a particular loop is vectorizable due to potential dependencies
4936between iterations.  The purpose of the directive is to tell the
4937compiler that vectorization is safe.
4938
4939   This directive is intended for annotation of existing code.  For new
4940code it is recommended to consider OpenMP SIMD directives as potential
4941alternative.
4942
4943
4944File: gfortran.info,  Node: VECTOR directive,  Next: NOVECTOR directive,  Prev: IVDEP directive,  Up: GNU Fortran Compiler Directives
4945
49467.2.5 VECTOR directive
4947----------------------
4948
4949The syntax of the directive is
4950
4951   '!GCC$ vector'
4952
4953   This directive tells the compiler to vectorize the following loop.
4954It must be placed immediately before a 'DO' loop and applies only to the
4955loop that follows.
4956
4957
4958File: gfortran.info,  Node: NOVECTOR directive,  Prev: VECTOR directive,  Up: GNU Fortran Compiler Directives
4959
49607.2.6 NOVECTOR directive
4961------------------------
4962
4963The syntax of the directive is
4964
4965   '!GCC$ novector'
4966
4967   This directive tells the compiler to not vectorize the following
4968loop.  It must be placed immediately before a 'DO' loop and applies only
4969to the loop that follows.
4970
4971
4972File: gfortran.info,  Node: Non-Fortran Main Program,  Next: Naming and argument-passing conventions,  Prev: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4973
49747.3 Non-Fortran Main Program
4975============================
4976
4977* Menu:
4978
4979* _gfortran_set_args:: Save command-line arguments
4980* _gfortran_set_options:: Set library option flags
4981* _gfortran_set_convert:: Set endian conversion
4982* _gfortran_set_record_marker:: Set length of record markers
4983* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
4984* _gfortran_set_max_subrecord_length:: Set subrecord length
4985
4986Even if you are doing mixed-language programming, it is very likely that
4987you do not need to know or use the information in this section.  Since
4988it is about the internal structure of GNU Fortran, it may also change in
4989GCC minor releases.
4990
4991   When you compile a 'PROGRAM' with GNU Fortran, a function with the
4992name 'main' (in the symbol table of the object file) is generated, which
4993initializes the libgfortran library and then calls the actual program
4994which uses the name 'MAIN__', for historic reasons.  If you link GNU
4995Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran
4996program compiled by a different compiler, the libgfortran library is not
4997initialized and thus a few intrinsic procedures do not work properly,
4998e.g.  those for obtaining the command-line arguments.
4999
5000   Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the
5001GNU Fortran compiled procedures require intrinsics relying on the
5002library initialization, you need to initialize the library yourself.
5003Using the default options, gfortran calls '_gfortran_set_args' and
5004'_gfortran_set_options'.  The initialization of the former is needed if
5005the called procedures access the command line (and for backtracing); the
5006latter sets some flags based on the standard chosen or to enable
5007backtracing.  In typical programs, it is not necessary to call any
5008initialization function.
5009
5010   If your 'PROGRAM' is compiled with GNU Fortran, you shall not call
5011any of the following functions.  The libgfortran initialization
5012functions are shown in C syntax but using C bindings they are also
5013accessible from Fortran.
5014
5015
5016File: gfortran.info,  Node: _gfortran_set_args,  Next: _gfortran_set_options,  Up: Non-Fortran Main Program
5017
50187.3.1 '_gfortran_set_args' -- Save command-line arguments
5019---------------------------------------------------------
5020
5021_Description_:
5022     '_gfortran_set_args' saves the command-line arguments; this
5023     initialization is required if any of the command-line intrinsics is
5024     called.  Additionally, it shall be called if backtracing is enabled
5025     (see '_gfortran_set_options').
5026
5027_Syntax_:
5028     'void _gfortran_set_args (int argc, char *argv[])'
5029
5030_Arguments_:
5031     ARGC        number of command line argument strings
5032     ARGV        the command-line argument strings; argv[0] is
5033                 the pathname of the executable itself.
5034
5035_Example_:
5036          int main (int argc, char *argv[])
5037          {
5038            /* Initialize libgfortran.  */
5039            _gfortran_set_args (argc, argv);
5040            return 0;
5041          }
5042
5043
5044File: gfortran.info,  Node: _gfortran_set_options,  Next: _gfortran_set_convert,  Prev: _gfortran_set_args,  Up: Non-Fortran Main Program
5045
50467.3.2 '_gfortran_set_options' -- Set library option flags
5047---------------------------------------------------------
5048
5049_Description_:
5050     '_gfortran_set_options' sets several flags related to the Fortran
5051     standard to be used, whether backtracing should be enabled and
5052     whether range checks should be performed.  The syntax allows for
5053     upward compatibility since the number of passed flags is specified;
5054     for non-passed flags, the default value is used.  See also *note
5055     Code Gen Options::.  Please note that not all flags are actually
5056     used.
5057
5058_Syntax_:
5059     'void _gfortran_set_options (int num, int options[])'
5060
5061_Arguments_:
5062     NUM         number of options passed
5063     ARGV        The list of flag values
5064
5065_option flag list_:
5066     OPTION[0]   Allowed standard; can give run-time errors if
5067                 e.g.  an input-output edit descriptor is invalid
5068                 in a given standard.  Possible values are
5069                 (bitwise or-ed) 'GFC_STD_F77' (1),
5070                 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4),
5071                 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16),
5072                 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64),
5073                 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS'
5074                 (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018'
5075                 (1024), 'GFC_STD_F2018_OBS' (2048), and
5076                 'GFC_STD=F2018_DEL' (4096).  Default:
5077                 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95
5078                 | GFC_STD_F2003 | GFC_STD_F2008 |
5079                 GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
5080                 GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS
5081                 | GFC_STD_F2018_DEL | GFC_STD_GNU |
5082                 GFC_STD_LEGACY'.
5083     OPTION[1]   Standard-warning flag; prints a warning to
5084                 standard error.  Default: 'GFC_STD_F95_DEL |
5085                 GFC_STD_LEGACY'.
5086     OPTION[2]   If non zero, enable pedantic checking.  Default:
5087                 off.
5088     OPTION[3]   Unused.
5089     OPTION[4]   If non zero, enable backtracing on run-time
5090                 errors.  Default: off.  (Default in the
5091                 compiler: on.)  Note: Installs a signal handler
5092                 and requires command-line initialization using
5093                 '_gfortran_set_args'.
5094     OPTION[5]   If non zero, supports signed zeros.  Default:
5095                 enabled.
5096     OPTION[6]   Enables run-time checking.  Possible values are
5097                 (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
5098                 GFC_RTCHECK_ARRAY_TEMPS (2),
5099                 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16),
5100                 GFC_RTCHECK_POINTER (32), GFC_RTCHECK_BITS (64).
5101                 Default: disabled.
5102     OPTION[7]   Unused.
5103     OPTION[8]   Show a warning when invoking 'STOP' and 'ERROR
5104                 STOP' if a floating-point exception occurred.
5105                 Possible values are (bitwise or-ed)
5106                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
5107                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
5108                 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT'
5109                 (32).  Default: None (0).  (Default in the
5110                 compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL |
5111                 GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
5112                 GFC_FPE_UNDERFLOW'.)
5113
5114_Example_:
5115            /* Use gfortran 4.9 default options.  */
5116            static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
5117            _gfortran_set_options (9, &options);
5118
5119
5120File: gfortran.info,  Node: _gfortran_set_convert,  Next: _gfortran_set_record_marker,  Prev: _gfortran_set_options,  Up: Non-Fortran Main Program
5121
51227.3.3 '_gfortran_set_convert' -- Set endian conversion
5123------------------------------------------------------
5124
5125_Description_:
5126     '_gfortran_set_convert' set the representation of data for
5127     unformatted files.
5128
5129_Syntax_:
5130     'void _gfortran_set_convert (int conv)'
5131
5132_Arguments_:
5133     CONV        Endian conversion, possible values:
5134                 GFC_CONVERT_NATIVE (0, default),
5135                 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
5136                 GFC_CONVERT_LITTLE (3).
5137
5138_Example_:
5139          int main (int argc, char *argv[])
5140          {
5141            /* Initialize libgfortran.  */
5142            _gfortran_set_args (argc, argv);
5143            _gfortran_set_convert (1);
5144            return 0;
5145          }
5146
5147
5148File: gfortran.info,  Node: _gfortran_set_record_marker,  Next: _gfortran_set_fpe,  Prev: _gfortran_set_convert,  Up: Non-Fortran Main Program
5149
51507.3.4 '_gfortran_set_record_marker' -- Set length of record markers
5151-------------------------------------------------------------------
5152
5153_Description_:
5154     '_gfortran_set_record_marker' sets the length of record markers for
5155     unformatted files.
5156
5157_Syntax_:
5158     'void _gfortran_set_record_marker (int val)'
5159
5160_Arguments_:
5161     VAL         Length of the record marker; valid values are 4
5162                 and 8.  Default is 4.
5163
5164_Example_:
5165          int main (int argc, char *argv[])
5166          {
5167            /* Initialize libgfortran.  */
5168            _gfortran_set_args (argc, argv);
5169            _gfortran_set_record_marker (8);
5170            return 0;
5171          }
5172
5173
5174File: gfortran.info,  Node: _gfortran_set_fpe,  Next: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_record_marker,  Up: Non-Fortran Main Program
5175
51767.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps
5177------------------------------------------------------------------
5178
5179_Description_:
5180     '_gfortran_set_fpe' enables floating point exception traps for the
5181     specified exceptions.  On most systems, this will result in a
5182     SIGFPE signal being sent and the program being aborted.
5183
5184_Syntax_:
5185     'void _gfortran_set_fpe (int val)'
5186
5187_Arguments_:
5188     OPTION[0]   IEEE exceptions.  Possible values are (bitwise
5189                 or-ed) zero (0, default) no trapping,
5190                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
5191                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
5192                 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT'
5193                 (32).
5194
5195_Example_:
5196          int main (int argc, char *argv[])
5197          {
5198            /* Initialize libgfortran.  */
5199            _gfortran_set_args (argc, argv);
5200            /* FPE for invalid operations such as SQRT(-1.0).  */
5201            _gfortran_set_fpe (1);
5202            return 0;
5203          }
5204
5205
5206File: gfortran.info,  Node: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_fpe,  Up: Non-Fortran Main Program
5207
52087.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length
5209------------------------------------------------------------------
5210
5211_Description_:
5212     '_gfortran_set_max_subrecord_length' set the maximum length for a
5213     subrecord.  This option only makes sense for testing and debugging
5214     of unformatted I/O.
5215
5216_Syntax_:
5217     'void _gfortran_set_max_subrecord_length (int val)'
5218
5219_Arguments_:
5220     VAL         the maximum length for a subrecord; the maximum
5221                 permitted value is 2147483639, which is also the
5222                 default.
5223
5224_Example_:
5225          int main (int argc, char *argv[])
5226          {
5227            /* Initialize libgfortran.  */
5228            _gfortran_set_args (argc, argv);
5229            _gfortran_set_max_subrecord_length (8);
5230            return 0;
5231          }
5232
5233
5234File: gfortran.info,  Node: Naming and argument-passing conventions,  Prev: Non-Fortran Main Program,  Up: Mixed-Language Programming
5235
52367.4 Naming and argument-passing conventions
5237===========================================
5238
5239This section gives an overview about the naming convention of procedures
5240and global variables and about the argument passing conventions used by
5241GNU Fortran.  If a C binding has been specified, the naming convention
5242and some of the argument-passing conventions change.  If possible,
5243mixed-language and mixed-compiler projects should use the better defined
5244C binding for interoperability.  See *note Interoperability with C::.
5245
5246* Menu:
5247
5248* Naming conventions::
5249* Argument passing conventions::
5250
5251
5252File: gfortran.info,  Node: Naming conventions,  Next: Argument passing conventions,  Up: Naming and argument-passing conventions
5253
52547.4.1 Naming conventions
5255------------------------
5256
5257According the Fortran standard, valid Fortran names consist of a letter
5258between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores
5259('_') with the restriction that names may only start with a letter.  As
5260vendor extension, the dollar sign ('$') is additionally permitted with
5261the option '-fdollar-ok', but not as first character and only if the
5262target system supports it.
5263
5264   By default, the procedure name is the lower-cased Fortran name with
5265an appended underscore ('_'); using '-fno-underscoring' no underscore is
5266appended while '-fsecond-underscore' appends two underscores.  Depending
5267on the target system and the calling convention, the procedure might be
5268additionally dressed; for instance, on 32bit Windows with 'stdcall', an
5269at-sign '@' followed by an integer number is appended.  For the changing
5270the calling convention, see *note GNU Fortran Compiler Directives::.
5271
5272   For common blocks, the same convention is used, i.e.  by default an
5273underscore is appended to the lower-cased Fortran name.  Blank commons
5274have the name '__BLNK__'.
5275
5276   For procedures and variables declared in the specification space of a
5277module, the name is formed by '__', followed by the lower-cased module
5278name, '_MOD_', and the lower-cased Fortran name.  Note that no
5279underscore is appended.
5280
5281
5282File: gfortran.info,  Node: Argument passing conventions,  Prev: Naming conventions,  Up: Naming and argument-passing conventions
5283
52847.4.2 Argument passing conventions
5285----------------------------------
5286
5287Subroutines do not return a value (matching C99's 'void') while
5288functions either return a value as specified in the platform ABI or the
5289result variable is passed as hidden argument to the function and no
5290result is returned.  A hidden result variable is used when the result
5291variable is an array or of type 'CHARACTER'.
5292
5293   Arguments are passed according to the platform ABI. In particular,
5294complex arguments might not be compatible to a struct with two real
5295components for the real and imaginary part.  The argument passing
5296matches the one of C99's '_Complex'.  Functions with scalar complex
5297result variables return their value and do not use a by-reference
5298argument.  Note that with the '-ff2c' option, the argument passing is
5299modified and no longer completely matches the platform ABI. Some other
5300Fortran compilers use 'f2c' semantic by default; this might cause
5301problems with interoperablility.
5302
5303   GNU Fortran passes most arguments by reference, i.e.  by passing a
5304pointer to the data.  Note that the compiler might use a temporary
5305variable into which the actual argument has been copied, if required
5306semantically (copy-in/copy-out).
5307
5308   For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including
5309procedure pointers), a pointer to the pointer is passed such that the
5310pointer address can be modified in the procedure.
5311
5312   For dummy arguments with the 'VALUE' attribute: Scalar arguments of
5313the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value
5314according to the platform ABI. (As vendor extension and not recommended,
5315using '%VAL()' in the call to a procedure has the same effect.)  For
5316'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such
5317that it can be modified without affecting the caller.
5318
5319   For Boolean ('LOGICAL') arguments, please note that GCC expects only
5320the integer value 0 and 1.  If a GNU Fortran 'LOGICAL' variable contains
5321another integer value, the result is undefined.  As some other Fortran
5322compilers use -1 for '.TRUE.', extra care has to be taken - such as
5323passing the value as 'INTEGER'.  (The same value restriction also
5324applies to other front ends of GCC, e.g.  to GCC's C99 compiler for
5325'_Bool' or GCC's Ada compiler for 'Boolean'.)
5326
5327   For arguments of 'CHARACTER' type, the character length is passed as
5328a hidden argument at the end of the argument list.  For deferred-length
5329strings, the value is passed by reference, otherwise by value.  The
5330character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in
5331Fortran).  Note that this is different to older versions of the GNU
5332Fortran compiler, where the type of the hidden character length argument
5333was a C 'int'.  In order to retain compatibility with older versions,
5334one can e.g.  for the following Fortran procedure
5335
5336     subroutine fstrlen (s, a)
5337        character(len=*) :: s
5338        integer :: a
5339        print*, len(s)
5340     end subroutine fstrlen
5341
5342   define the corresponding C prototype as follows:
5343
5344     #if __GNUC__ > 7
5345     typedef size_t fortran_charlen_t;
5346     #else
5347     typedef int fortran_charlen_t;
5348     #endif
5349
5350     void fstrlen_ (char*, int*, fortran_charlen_t);
5351
5352   In order to avoid such compiler-specific details, for new code it is
5353instead recommended to use the ISO_C_BINDING feature.
5354
5355   Note with C binding, 'CHARACTER(len=1)' result variables are returned
5356according to the platform ABI and no hidden length argument is used for
5357dummy arguments; with 'VALUE', those variables are passed by value.
5358
5359   For 'OPTIONAL' dummy arguments, an absent argument is denoted by a
5360NULL pointer, except for scalar dummy arguments of type 'INTEGER',
5361'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute.  For
5362those, a hidden Boolean argument ('logical(kind=C_bool),value') is used
5363to indicate whether the argument is present.
5364
5365   Arguments which are assumed-shape, assumed-rank or deferred-rank
5366arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an
5367array descriptor.  All other arrays pass the address of the first
5368element of the array.  With '-fcoarray=lib', the token and the offset
5369belonging to nonallocatable coarrays dummy arguments are passed as
5370hidden argument along the character length hidden arguments.  The token
5371is an oparque pointer identifying the coarray and the offset is a
5372passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset
5373between the base address of the coarray and the passed scalar or first
5374element of the passed array.
5375
5376   The arguments are passed in the following order
5377   * Result variable, when the function result is passed by reference
5378   * Character length of the function result, if it is a of type
5379     'CHARACTER' and no C binding is used
5380   * The arguments in the order in which they appear in the Fortran
5381     declaration
5382   * The the present status for optional arguments with value attribute,
5383     which are internally passed by value
5384   * The character length and/or coarray token and offset for the first
5385     argument which is a 'CHARACTER' or a nonallocatable coarray dummy
5386     argument, followed by the hidden arguments of the next dummy
5387     argument of such a type
5388
5389
5390File: gfortran.info,  Node: Coarray Programming,  Next: Intrinsic Procedures,  Prev: Mixed-Language Programming,  Up: Top
5391
53928 Coarray Programming
5393*********************
5394
5395* Menu:
5396
5397* Type and enum ABI Documentation::
5398* Function ABI Documentation::
5399
5400
5401File: gfortran.info,  Node: Type and enum ABI Documentation,  Next: Function ABI Documentation,  Up: Coarray Programming
5402
54038.1 Type and enum ABI Documentation
5404===================================
5405
5406* Menu:
5407
5408* caf_token_t::
5409* caf_register_t::
5410* caf_deregister_t::
5411* caf_reference_t::
5412* caf_team_t::
5413
5414
5415File: gfortran.info,  Node: caf_token_t,  Next: caf_register_t,  Up: Type and enum ABI Documentation
5416
54178.1.1 'caf_token_t'
5418-------------------
5419
5420Typedef of type 'void *' on the compiler side.  Can be any data type on
5421the library side.
5422
5423
5424File: gfortran.info,  Node: caf_register_t,  Next: caf_deregister_t,  Prev: caf_token_t,  Up: Type and enum ABI Documentation
5425
54268.1.2 'caf_register_t'
5427----------------------
5428
5429Indicates which kind of coarray variable should be registered.
5430
5431typedef enum caf_register_t {
5432  CAF_REGTYPE_COARRAY_STATIC,
5433  CAF_REGTYPE_COARRAY_ALLOC,
5434  CAF_REGTYPE_LOCK_STATIC,
5435  CAF_REGTYPE_LOCK_ALLOC,
5436  CAF_REGTYPE_CRITICAL,
5437  CAF_REGTYPE_EVENT_STATIC,
5438  CAF_REGTYPE_EVENT_ALLOC,
5439  CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY,
5440  CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY
5441}
5442caf_register_t;
5443
5444   The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and
5445'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components
5446in derived type coarrays only.  The first one sets up the token without
5447allocating memory for allocatable component.  The latter one only
5448allocates the memory for an allocatable component in a derived type
5449coarray.  The token needs to be setup previously by the REGISTER_ONLY.
5450This allows to have allocatable components un-allocated on some images.
5451The status whether an allocatable component is allocated on a remote
5452image can be queried by '_caf_is_present' which used internally by the
5453'ALLOCATED' intrinsic.
5454
5455
5456File: gfortran.info,  Node: caf_deregister_t,  Next: caf_reference_t,  Prev: caf_register_t,  Up: Type and enum ABI Documentation
5457
54588.1.3 'caf_deregister_t'
5459------------------------
5460
5461typedef enum caf_deregister_t {
5462  CAF_DEREGTYPE_COARRAY_DEREGISTER,
5463  CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
5464}
5465caf_deregister_t;
5466
5467   Allows to specifiy the type of deregistration of a coarray object.
5468The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for
5469allocatable components in derived type coarrays.
5470
5471
5472File: gfortran.info,  Node: caf_reference_t,  Next: caf_team_t,  Prev: caf_deregister_t,  Up: Type and enum ABI Documentation
5473
54748.1.4 'caf_reference_t'
5475-----------------------
5476
5477The structure used for implementing arbitrary reference chains.  A
5478'CAF_REFERENCE_T' allows to specify a component reference or any kind of
5479array reference of any rank supported by gfortran.  For array references
5480all kinds as known by the compiler/Fortran standard are supported
5481indicated by a 'MODE'.
5482
5483typedef enum caf_ref_type_t {
5484  /* Reference a component of a derived type, either regular one or an
5485     allocatable or pointer type.  For regular ones idx in caf_reference_t is
5486     set to -1.  */
5487  CAF_REF_COMPONENT,
5488  /* Reference an allocatable array.  */
5489  CAF_REF_ARRAY,
5490  /* Reference a non-allocatable/non-pointer array.  I.e., the coarray object
5491     has no array descriptor associated and the addressing is done
5492     completely using the ref.  */
5493  CAF_REF_STATIC_ARRAY
5494} caf_ref_type_t;
5495
5496typedef enum caf_array_ref_t {
5497  /* No array ref.  This terminates the array ref.  */
5498  CAF_ARR_REF_NONE = 0,
5499  /* Reference array elements given by a vector.  Only for this mode
5500     caf_reference_t.u.a.dim[i].v is valid.  */
5501  CAF_ARR_REF_VECTOR,
5502  /* A full array ref (:).  */
5503  CAF_ARR_REF_FULL,
5504  /* Reference a range on elements given by start, end and stride.  */
5505  CAF_ARR_REF_RANGE,
5506  /* Only a single item is referenced given in the start member.  */
5507  CAF_ARR_REF_SINGLE,
5508  /* An array ref of the kind (i:), where i is an arbitrary valid index in the
5509     array.  The index i is given in the start member.  */
5510  CAF_ARR_REF_OPEN_END,
5511  /* An array ref of the kind (:i), where the lower bound of the array ref
5512     is given by the remote side.  The index i is given in the end member.  */
5513  CAF_ARR_REF_OPEN_START
5514} caf_array_ref_t;
5515
5516/* References to remote components of a derived type.  */
5517typedef struct caf_reference_t {
5518  /* A pointer to the next ref or NULL.  */
5519  struct caf_reference_t *next;
5520  /* The type of the reference.  */
5521  /* caf_ref_type_t, replaced by int to allow specification in fortran FE.  */
5522  int type;
5523  /* The size of an item referenced in bytes.  I.e. in an array ref this is
5524     the factor to advance the array pointer with to get to the next item.
5525     For component refs this gives just the size of the element referenced.  */
5526  size_t item_size;
5527  union {
5528    struct {
5529      /* The offset (in bytes) of the component in the derived type.
5530         Unused for allocatable or pointer components.  */
5531      ptrdiff_t offset;
5532      /* The offset (in bytes) to the caf_token associated with this
5533         component.  NULL, when not allocatable/pointer ref.  */
5534      ptrdiff_t caf_token_offset;
5535    } c;
5536    struct {
5537      /* The mode of the array ref.  See CAF_ARR_REF_*.  */
5538      /* caf_array_ref_t, replaced by unsigend char to allow specification in
5539         fortran FE.  */
5540     unsigned char mode[GFC_MAX_DIMENSIONS];
5541      /* The type of a static array.  Unset for array's with descriptors.  */
5542      int static_array_type;
5543      /* Subscript refs (s) or vector refs (v).  */
5544      union {
5545        struct {
5546          /* The start and end boundary of the ref and the stride.  */
5547          index_type start, end, stride;
5548        } s;
5549        struct {
5550          /* nvec entries of kind giving the elements to reference.  */
5551          void *vector;
5552          /* The number of entries in vector.  */
5553          size_t nvec;
5554          /* The integer kind used for the elements in vector.  */
5555          int kind;
5556        } v;
5557      } dim[GFC_MAX_DIMENSIONS];
5558    } a;
5559  } u;
5560} caf_reference_t;
5561
5562   The references make up a single linked list of reference operations.
5563The 'NEXT' member links to the next reference or NULL to indicate the
5564end of the chain.  Component and array refs can be arbitrarly mixed as
5565long as they comply to the Fortran standard.
5566
5567   _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE'
5568is 'CAF_REF_STATIC_ARRAY'.  The member gives the type of the data
5569referenced.  Because no array descriptor is available for a
5570descriptor-less array and type conversion still needs to take place the
5571type is transported here.
5572
5573   At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front
5574end for descriptor-less arrays.  The library caf_single has untested
5575support for it.
5576
5577
5578File: gfortran.info,  Node: caf_team_t,  Prev: caf_reference_t,  Up: Type and enum ABI Documentation
5579
55808.1.5 'caf_team_t'
5581------------------
5582
5583Opaque pointer to represent a team-handle.  This type is a stand-in for
5584the future implementation of teams.  It is about to change without
5585further notice.
5586
5587
5588File: gfortran.info,  Node: Function ABI Documentation,  Prev: Type and enum ABI Documentation,  Up: Coarray Programming
5589
55908.2 Function ABI Documentation
5591==============================
5592
5593* Menu:
5594
5595* _gfortran_caf_init:: Initialiation function
5596* _gfortran_caf_finish:: Finalization function
5597* _gfortran_caf_this_image:: Querying the image number
5598* _gfortran_caf_num_images:: Querying the maximal number of images
5599* _gfortran_caf_image_status :: Query the status of an image
5600* _gfortran_caf_failed_images :: Get an array of the indexes of the failed images
5601* _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images
5602* _gfortran_caf_register:: Registering coarrays
5603* _gfortran_caf_deregister:: Deregistering coarrays
5604* _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated
5605* _gfortran_caf_send:: Sending data from a local image to a remote image
5606* _gfortran_caf_get:: Getting data from a remote image
5607* _gfortran_caf_sendget:: Sending data between remote images
5608* _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references
5609* _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references
5610* _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references
5611* _gfortran_caf_lock:: Locking a lock variable
5612* _gfortran_caf_unlock:: Unlocking a lock variable
5613* _gfortran_caf_event_post:: Post an event
5614* _gfortran_caf_event_wait:: Wait that an event occurred
5615* _gfortran_caf_event_query:: Query event count
5616* _gfortran_caf_sync_all:: All-image barrier
5617* _gfortran_caf_sync_images:: Barrier for selected images
5618* _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
5619* _gfortran_caf_error_stop:: Error termination with exit code
5620* _gfortran_caf_error_stop_str:: Error termination with string
5621* _gfortran_caf_fail_image :: Mark the image failed and end its execution
5622* _gfortran_caf_atomic_define:: Atomic variable assignment
5623* _gfortran_caf_atomic_ref:: Atomic variable reference
5624* _gfortran_caf_atomic_cas:: Atomic compare and swap
5625* _gfortran_caf_atomic_op:: Atomic operation
5626* _gfortran_caf_co_broadcast:: Sending data to all images
5627* _gfortran_caf_co_max:: Collective maximum reduction
5628* _gfortran_caf_co_min:: Collective minimum reduction
5629* _gfortran_caf_co_sum:: Collective summing reduction
5630* _gfortran_caf_co_reduce:: Generic collective reduction
5631
5632
5633File: gfortran.info,  Node: _gfortran_caf_init,  Next: _gfortran_caf_finish,  Up: Function ABI Documentation
5634
56358.2.1 '_gfortran_caf_init' -- Initialiation function
5636----------------------------------------------------
5637
5638_Description_:
5639     This function is called at startup of the program before the
5640     Fortran main program, if the latter has been compiled with
5641     '-fcoarray=lib'.  It takes as arguments the command-line arguments
5642     of the program.  It is permitted to pass two 'NULL' pointers as
5643     argument; if non-'NULL', the library is permitted to modify the
5644     arguments.
5645
5646_Syntax_:
5647     'void _gfortran_caf_init (int *argc, char ***argv)'
5648
5649_Arguments_:
5650     ARGC        intent(inout) An integer pointer with the number
5651                 of arguments passed to the program or 'NULL'.
5652     ARGV        intent(inout) A pointer to an array of strings
5653                 with the command-line arguments or 'NULL'.
5654
5655_NOTES_
5656     The function is modelled after the initialization function of the
5657     Message Passing Interface (MPI) specification.  Due to the way
5658     coarray registration works, it might not be the first call to the
5659     library.  If the main program is not written in Fortran and only a
5660     library uses coarrays, it can happen that this function is never
5661     called.  Therefore, it is recommended that the library does not
5662     rely on the passed arguments and whether the call has been done.
5663
5664
5665File: gfortran.info,  Node: _gfortran_caf_finish,  Next: _gfortran_caf_this_image,  Prev: _gfortran_caf_init,  Up: Function ABI Documentation
5666
56678.2.2 '_gfortran_caf_finish' -- Finalization function
5668-----------------------------------------------------
5669
5670_Description_:
5671     This function is called at the end of the Fortran main program, if
5672     it has been compiled with the '-fcoarray=lib' option.
5673
5674_Syntax_:
5675     'void _gfortran_caf_finish (void)'
5676
5677_NOTES_
5678     For non-Fortran programs, it is recommended to call the function at
5679     the end of the main program.  To ensure that the shutdown is also
5680     performed for programs where this function is not explicitly
5681     invoked, for instance non-Fortran programs or calls to the system's
5682     exit() function, the library can use a destructor function.  Note
5683     that programs can also be terminated using the STOP and ERROR STOP
5684     statements; those use different library calls.
5685
5686
5687File: gfortran.info,  Node: _gfortran_caf_this_image,  Next: _gfortran_caf_num_images,  Prev: _gfortran_caf_finish,  Up: Function ABI Documentation
5688
56898.2.3 '_gfortran_caf_this_image' -- Querying the image number
5690-------------------------------------------------------------
5691
5692_Description_:
5693     This function returns the current image number, which is a positive
5694     number.
5695
5696_Syntax_:
5697     'int _gfortran_caf_this_image (int distance)'
5698
5699_Arguments_:
5700     DISTANCE    As specified for the 'this_image' intrinsic in
5701                 TS18508.  Shall be a non-negative number.
5702
5703_NOTES_
5704     If the Fortran intrinsic 'this_image' is invoked without an
5705     argument, which is the only permitted form in Fortran 2008, GCC
5706     passes '0' as first argument.
5707
5708
5709File: gfortran.info,  Node: _gfortran_caf_num_images,  Next: _gfortran_caf_image_status,  Prev: _gfortran_caf_this_image,  Up: Function ABI Documentation
5710
57118.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images
5712-------------------------------------------------------------------------
5713
5714_Description_:
5715     This function returns the number of images in the current team, if
5716     DISTANCE is 0 or the number of images in the parent team at the
5717     specified distance.  If failed is -1, the function returns the
5718     number of all images at the specified distance; if it is 0, the
5719     function returns the number of nonfailed images, and if it is 1, it
5720     returns the number of failed images.
5721
5722_Syntax_:
5723     'int _gfortran_caf_num_images(int distance, int failed)'
5724
5725_Arguments_:
5726     DISTANCE    the distance from this image to the ancestor.
5727                 Shall be positive.
5728     FAILED      shall be -1, 0, or 1
5729
5730_NOTES_
5731     This function follows TS18508.  If the num_image intrinsic has no
5732     arguments, then the compiler passes 'distance=0' and 'failed=-1' to
5733     the function.
5734
5735
5736File: gfortran.info,  Node: _gfortran_caf_image_status,  Next: _gfortran_caf_failed_images,  Prev: _gfortran_caf_num_images,  Up: Function ABI Documentation
5737
57388.2.5 '_gfortran_caf_image_status' -- Query the status of an image
5739------------------------------------------------------------------
5740
5741_Description_:
5742     Get the status of the image given by the id IMAGE of the team given
5743     by TEAM.  Valid results are zero, for image is ok,
5744     'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate
5745     that the image has been stopped and 'STAT_FAILED_IMAGE' also from
5746     ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL
5747     IMAGE' statement.
5748
5749_Syntax_:
5750     'int _gfortran_caf_image_status (int image, caf_team_t * team)'
5751
5752_Arguments_:
5753     IMAGE       the positive scalar id of the image in the
5754                 current TEAM.
5755     TEAM        optional; team on the which the inquiry is to be
5756                 performed.
5757
5758_NOTES_
5759     This function follows TS18508.  Because team-functionality is not
5760     yet implemented a null-pointer is passed for the TEAM argument at
5761     the moment.
5762
5763
5764File: gfortran.info,  Node: _gfortran_caf_failed_images,  Next: _gfortran_caf_stopped_images,  Prev: _gfortran_caf_image_status,  Up: Function ABI Documentation
5765
57668.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images
5767---------------------------------------------------------------------------------------
5768
5769_Description_:
5770     Get an array of image indexes in the current TEAM that have failed.
5771     The array is sorted ascendingly.  When TEAM is not provided the
5772     current team is to be used.  When KIND is provided then the
5773     resulting array is of that integer kind else it is of default
5774     integer kind.  The returns an unallocated size zero array when no
5775     images have failed.
5776
5777_Syntax_:
5778     'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)'
5779
5780_Arguments_:
5781     TEAM        optional; team on the which the inquiry is to be
5782                 performed.
5783     IMAGE       optional; the kind of the resulting integer
5784                 array.
5785
5786_NOTES_
5787     This function follows TS18508.  Because team-functionality is not
5788     yet implemented a null-pointer is passed for the TEAM argument at
5789     the moment.
5790
5791
5792File: gfortran.info,  Node: _gfortran_caf_stopped_images,  Next: _gfortran_caf_register,  Prev: _gfortran_caf_failed_images,  Up: Function ABI Documentation
5793
57948.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images
5795-----------------------------------------------------------------------------------------
5796
5797_Description_:
5798     Get an array of image indexes in the current TEAM that have
5799     stopped.  The array is sorted ascendingly.  When TEAM is not
5800     provided the current team is to be used.  When KIND is provided
5801     then the resulting array is of that integer kind else it is of
5802     default integer kind.  The returns an unallocated size zero array
5803     when no images have failed.
5804
5805_Syntax_:
5806     'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)'
5807
5808_Arguments_:
5809     TEAM        optional; team on the which the inquiry is to be
5810                 performed.
5811     IMAGE       optional; the kind of the resulting integer
5812                 array.
5813
5814_NOTES_
5815     This function follows TS18508.  Because team-functionality is not
5816     yet implemented a null-pointer is passed for the TEAM argument at
5817     the moment.
5818
5819
5820File: gfortran.info,  Node: _gfortran_caf_register,  Next: _gfortran_caf_deregister,  Prev: _gfortran_caf_stopped_images,  Up: Function ABI Documentation
5821
58228.2.8 '_gfortran_caf_register' -- Registering coarrays
5823------------------------------------------------------
5824
5825_Description_:
5826     Registers memory for a coarray and creates a token to identify the
5827     coarray.  The routine is called for both coarrays with 'SAVE'
5828     attribute and using an explicit 'ALLOCATE' statement.  If an error
5829     occurs and STAT is a 'NULL' pointer, the function shall abort with
5830     printing an error message and starting the error termination.  If
5831     no error occurs and STAT is present, it shall be set to zero.
5832     Otherwise, it shall be set to a positive value and, if not-'NULL',
5833     ERRMSG shall be set to a string describing the failure.  The
5834     routine shall register the memory provided in the 'DATA'-component
5835     of the array descriptor DESC, when that component is non-'NULL',
5836     else it shall allocate sufficient memory and provide a pointer to
5837     it in the 'DATA'-component of DESC.  The array descriptor has rank
5838     zero, when a scalar object is to be registered and the array
5839     descriptor may be invalid after the call to
5840     '_gfortran_caf_register'.  When an array is to be allocated the
5841     descriptor persists.
5842
5843     For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC',
5844     the passed size is the byte size requested.  For
5845     'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and
5846     'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
5847
5848     When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a
5849     token for an allocatable or pointer component is created.  The
5850     'SIZE' parameter is not used then.  On the contrary when
5851     'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the
5852     TOKEN needs to be registered by a previous call with regtype
5853     'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory
5854     specified in the DESC's data-ptr is registered or allocate when the
5855     data-ptr is 'NULL'.
5856
5857_Syntax_:
5858     'void caf_register (size_t size, caf_register_t type, caf_token_t
5859     *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t
5860     errmsg_len)'
5861
5862_Arguments_:
5863     SIZE        For normal coarrays, the byte size of the
5864                 coarray to be allocated; for lock types and
5865                 event types, the number of elements.
5866     TYPE        one of the caf_register_t types.
5867     TOKEN       intent(out) An opaque pointer identifying the
5868                 coarray.
5869     DESC        intent(inout) The (pseudo) array descriptor.
5870     STAT        intent(out) For allocatable coarrays, stores the
5871                 STAT=; may be 'NULL'
5872     ERRMSG      intent(out) When an error occurs, this will be
5873                 set to an error message; may be 'NULL'
5874     ERRMSG_LEN  the buffer size of errmsg.
5875
5876_NOTES_
5877     Nonallocatable coarrays have to be registered prior use from remote
5878     images.  In order to guarantee this, they have to be registered
5879     before the main program.  This can be achieved by creating
5880     constructor functions.  That is what GCC does such that also for
5881     nonallocatable coarrays the memory is allocated and no static
5882     memory is used.  The token permits to identify the coarray; to the
5883     processor, the token is a nonaliasing pointer.  The library can,
5884     for instance, store the base address of the coarray in the token,
5885     some handle or a more complicated struct.  The library may also
5886     store the array descriptor DESC when its rank is non-zero.
5887
5888     For lock types, the value shall only be used for checking the
5889     allocation status.  Note that for critical blocks, the locking is
5890     only required on one image; in the locking statement, the processor
5891     shall always pass an image index of one for critical-block lock
5892     variables ('CAF_REGTYPE_CRITICAL').  For lock types and
5893     critical-block variables, the initial value shall be unlocked (or,
5894     respecitively, not in critical section) such as the value false;
5895     for event types, the initial state should be no event, e.g.  zero.
5896
5897
5898File: gfortran.info,  Node: _gfortran_caf_deregister,  Next: _gfortran_caf_is_present,  Prev: _gfortran_caf_register,  Up: Function ABI Documentation
5899
59008.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays
5901----------------------------------------------------------
5902
5903_Description_:
5904     Called to free or deregister the memory of a coarray; the processor
5905     calls this function for automatic and explicit deallocation.  In
5906     case of an error, this function shall fail with an error message,
5907     unless the STAT variable is not null.  The library is only expected
5908     to free memory it allocated itself during a call to
5909     '_gfortran_caf_register'.
5910
5911_Syntax_:
5912     'void caf_deregister (caf_token_t *token, caf_deregister_t type,
5913     int *stat, char *errmsg, size_t errmsg_len)'
5914
5915_Arguments_:
5916     TOKEN       the token to free.
5917     TYPE        the type of action to take for the coarray.  A
5918                 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is
5919                 allowed only for allocatable or pointer
5920                 components of derived type coarrays.  The action
5921                 only deallocates the local memory without
5922                 deleting the token.
5923     STAT        intent(out) Stores the STAT=; may be NULL
5924     ERRMSG      intent(out) When an error occurs, this will be
5925                 set to an error message; may be NULL
5926     ERRMSG_LEN  the buffer size of errmsg.
5927
5928_NOTES_
5929     For nonalloatable coarrays this function is never called.  If a
5930     cleanup is required, it has to be handled via the finish, stop and
5931     error stop functions, and via destructors.
5932
5933
5934File: gfortran.info,  Node: _gfortran_caf_is_present,  Next: _gfortran_caf_send,  Prev: _gfortran_caf_deregister,  Up: Function ABI Documentation
5935
59368.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated
5937-----------------------------------------------------------------------------------------------------------------------------
5938
5939_Description_:
5940     Used to query the coarray library whether an allocatable component
5941     in a derived type coarray is allocated on a remote image.
5942
5943_Syntax_:
5944     'void _gfortran_caf_is_present (caf_token_t token, int image_index,
5945     gfc_reference_t *ref)'
5946
5947_Arguments_:
5948     TOKEN       An opaque pointer identifying the coarray.
5949     IMAGE_INDEX The ID of the remote image; must be a positive
5950                 number.
5951     REF         A chain of references to address the allocatable
5952                 or pointer component in the derived type
5953                 coarray.  The object reference needs to be a
5954                 scalar or a full array reference, respectively.
5955
5956
5957File: gfortran.info,  Node: _gfortran_caf_send,  Next: _gfortran_caf_get,  Prev: _gfortran_caf_is_present,  Up: Function ABI Documentation
5958
59598.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image
5960--------------------------------------------------------------------------------
5961
5962_Description_:
5963     Called to send a scalar, an array section or a whole array from a
5964     local to a remote image identified by the image_index.
5965
5966_Syntax_:
5967     'void _gfortran_caf_send (caf_token_t token, size_t offset, int
5968     image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
5969     gfc_descriptor_t *src, int dst_kind, int src_kind, bool
5970     may_require_tmp, int *stat)'
5971
5972_Arguments_:
5973     TOKEN       intent(in) An opaque pointer identifying the
5974                 coarray.
5975     OFFSET      intent(in) By which amount of bytes the actual
5976                 data is shifted compared to the base address of
5977                 the coarray.
5978     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5979                 positive number.
5980     DEST        intent(in) Array descriptor for the remote image
5981                 for the bounds and the size.  The 'base_addr'
5982                 shall not be accessed.
5983     DST_VECTOR  intent(in) If not NULL, it contains the vector
5984                 subscript of the destination array; the values
5985                 are relative to the dimension triplet of the
5986                 dest argument.
5987     SRC         intent(in) Array descriptor of the local array
5988                 to be transferred to the remote image
5989     DST_KIND    intent(in) Kind of the destination argument
5990     SRC_KIND    intent(in) Kind of the source argument
5991     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5992                 known at compile time that the DEST and SRC
5993                 either cannot overlap or overlap (fully or
5994                 partially) such that walking SRC and DEST in
5995                 element wise element order (honoring the stride
5996                 value) will not lead to wrong results.
5997                 Otherwise, the value is 'true'.
5998     STAT        intent(out) when non-NULL give the result of the
5999                 operation, i.e., zero on success and non-zero on
6000                 error.  When NULL and an error occurs, then an
6001                 error message is printed and the program is
6002                 terminated.
6003
6004_NOTES_
6005     It is permitted to have IMAGE_INDEX equal the current image; the
6006     memory of the send-to and the send-from might (partially) overlap
6007     in that case.  The implementation has to take care that it handles
6008     this case, e.g.  using 'memmove' which handles (partially)
6009     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6010     additionally create a temporary variable, unless additional checks
6011     show that this is not required (e.g.  because walking backward is
6012     possible or because both arrays are contiguous and 'memmove' takes
6013     care of overlap issues).
6014
6015     Note that the assignment of a scalar to an array is permitted.  In
6016     addition, the library has to handle numeric-type conversion and for
6017     strings, padding and different character kinds.
6018
6019
6020File: gfortran.info,  Node: _gfortran_caf_get,  Next: _gfortran_caf_sendget,  Prev: _gfortran_caf_send,  Up: Function ABI Documentation
6021
60228.2.12 '_gfortran_caf_get' -- Getting data from a remote image
6023--------------------------------------------------------------
6024
6025_Description_:
6026     Called to get an array section or a whole array from a remote,
6027     image identified by the image_index.
6028
6029_Syntax_:
6030     'void _gfortran_caf_get (caf_token_t token, size_t offset, int
6031     image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
6032     gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
6033     may_require_tmp, int *stat)'
6034
6035_Arguments_:
6036     TOKEN       intent(in) An opaque pointer identifying the
6037                 coarray.
6038     OFFSET      intent(in) By which amount of bytes the actual
6039                 data is shifted compared to the base address of
6040                 the coarray.
6041     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6042                 positive number.
6043     DEST        intent(out) Array descriptor of the local array
6044                 to store the data retrieved from the remote
6045                 image
6046     SRC         intent(in) Array descriptor for the remote image
6047                 for the bounds and the size.  The 'base_addr'
6048                 shall not be accessed.
6049     SRC_VECTOR  intent(in) If not NULL, it contains the vector
6050                 subscript of the source array; the values are
6051                 relative to the dimension triplet of the SRC
6052                 argument.
6053     DST_KIND    intent(in) Kind of the destination argument
6054     SRC_KIND    intent(in) Kind of the source argument
6055     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6056                 known at compile time that the DEST and SRC
6057                 either cannot overlap or overlap (fully or
6058                 partially) such that walking SRC and DEST in
6059                 element wise element order (honoring the stride
6060                 value) will not lead to wrong results.
6061                 Otherwise, the value is 'true'.
6062     STAT        intent(out) When non-NULL give the result of the
6063                 operation, i.e., zero on success and non-zero on
6064                 error.  When NULL and an error occurs, then an
6065                 error message is printed and the program is
6066                 terminated.
6067
6068_NOTES_
6069     It is permitted to have IMAGE_INDEX equal the current image; the
6070     memory of the send-to and the send-from might (partially) overlap
6071     in that case.  The implementation has to take care that it handles
6072     this case, e.g.  using 'memmove' which handles (partially)
6073     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6074     additionally create a temporary variable, unless additional checks
6075     show that this is not required (e.g.  because walking backward is
6076     possible or because both arrays are contiguous and 'memmove' takes
6077     care of overlap issues).
6078
6079     Note that the library has to handle numeric-type conversion and for
6080     strings, padding and different character kinds.
6081
6082
6083File: gfortran.info,  Node: _gfortran_caf_sendget,  Next: _gfortran_caf_send_by_ref,  Prev: _gfortran_caf_get,  Up: Function ABI Documentation
6084
60858.2.13 '_gfortran_caf_sendget' -- Sending data between remote images
6086--------------------------------------------------------------------
6087
6088_Description_:
6089     Called to send a scalar, an array section or a whole array from a
6090     remote image identified by the SRC_IMAGE_INDEX to a remote image
6091     identified by the DST_IMAGE_INDEX.
6092
6093_Syntax_:
6094     'void _gfortran_caf_sendget (caf_token_t dst_token, size_t
6095     dst_offset, int dst_image_index, gfc_descriptor_t *dest,
6096     caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset,
6097     int src_image_index, gfc_descriptor_t *src, caf_vector_t
6098     *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int
6099     *stat)'
6100
6101_Arguments_:
6102     DST_TOKEN   intent(in) An opaque pointer identifying the
6103                 destination coarray.
6104     DST_OFFSET  intent(in) By which amount of bytes the actual
6105                 data is shifted compared to the base address of
6106                 the destination coarray.
6107     DST_IMAGE_INDEXintent(in) The ID of the destination remote
6108                 image; must be a positive number.
6109     DEST        intent(in) Array descriptor for the destination
6110                 remote image for the bounds and the size.  The
6111                 'base_addr' shall not be accessed.
6112     DST_VECTOR  intent(int) If not NULL, it contains the vector
6113                 subscript of the destination array; the values
6114                 are relative to the dimension triplet of the
6115                 DEST argument.
6116     SRC_TOKEN   intent(in) An opaque pointer identifying the
6117                 source coarray.
6118     SRC_OFFSET  intent(in) By which amount of bytes the actual
6119                 data is shifted compared to the base address of
6120                 the source coarray.
6121     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
6122                 must be a positive number.
6123     SRC         intent(in) Array descriptor of the local array
6124                 to be transferred to the remote image.
6125     SRC_VECTOR  intent(in) Array descriptor of the local array
6126                 to be transferred to the remote image
6127     DST_KIND    intent(in) Kind of the destination argument
6128     SRC_KIND    intent(in) Kind of the source argument
6129     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6130                 known at compile time that the DEST and SRC
6131                 either cannot overlap or overlap (fully or
6132                 partially) such that walking SRC and DEST in
6133                 element wise element order (honoring the stride
6134                 value) will not lead to wrong results.
6135                 Otherwise, the value is 'true'.
6136     STAT        intent(out) when non-NULL give the result of the
6137                 operation, i.e., zero on success and non-zero on
6138                 error.  When NULL and an error occurs, then an
6139                 error message is printed and the program is
6140                 terminated.
6141
6142_NOTES_
6143     It is permitted to have the same image index for both
6144     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
6145     the send-from might (partially) overlap in that case.  The
6146     implementation has to take care that it handles this case, e.g.
6147     using 'memmove' which handles (partially) overlapping memory.  If
6148     MAY_REQUIRE_TMP is true, the library might additionally create a
6149     temporary variable, unless additional checks show that this is not
6150     required (e.g.  because walking backward is possible or because
6151     both arrays are contiguous and 'memmove' takes care of overlap
6152     issues).
6153
6154     Note that the assignment of a scalar to an array is permitted.  In
6155     addition, the library has to handle numeric-type conversion and for
6156     strings, padding and different character kinds.
6157
6158
6159File: gfortran.info,  Node: _gfortran_caf_send_by_ref,  Next: _gfortran_caf_get_by_ref,  Prev: _gfortran_caf_sendget,  Up: Function ABI Documentation
6160
61618.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options
6162-------------------------------------------------------------------------------------------------------------------------
6163
6164_Description_:
6165     Called to send a scalar, an array section or a whole array from a
6166     local to a remote image identified by the IMAGE_INDEX.
6167
6168_Syntax_:
6169     'void _gfortran_caf_send_by_ref (caf_token_t token, int
6170     image_index, gfc_descriptor_t *src, caf_reference_t *refs, int
6171     dst_kind, int src_kind, bool may_require_tmp, bool
6172     dst_reallocatable, int *stat, int dst_type)'
6173
6174_Arguments_:
6175     TOKEN       intent(in) An opaque pointer identifying the
6176                 coarray.
6177     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6178                 positive number.
6179     SRC         intent(in) Array descriptor of the local array
6180                 to be transferred to the remote image
6181     REFS        intent(in) The references on the remote array to
6182                 store the data given by src.  Guaranteed to have
6183                 at least one entry.
6184     DST_KIND    intent(in) Kind of the destination argument
6185     SRC_KIND    intent(in) Kind of the source argument
6186     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6187                 known at compile time that the DEST and SRC
6188                 either cannot overlap or overlap (fully or
6189                 partially) such that walking SRC and DEST in
6190                 element wise element order (honoring the stride
6191                 value) will not lead to wrong results.
6192                 Otherwise, the value is 'true'.
6193     DST_REALLOCATABLEintent(in) Set when the destination is of
6194                 allocatable or pointer type and the refs will
6195                 allow reallocation, i.e., the ref is a full
6196                 array or component ref.
6197     STAT        intent(out) When non-'NULL' give the result of
6198                 the operation, i.e., zero on success and
6199                 non-zero on error.  When 'NULL' and an error
6200                 occurs, then an error message is printed and the
6201                 program is terminated.
6202     DST_TYPE    intent(in) Give the type of the destination.
6203                 When the destination is not an array, than the
6204                 precise type, e.g.  of a component in a derived
6205                 type, is not known, but provided here.
6206
6207_NOTES_
6208     It is permitted to have IMAGE_INDEX equal the current image; the
6209     memory of the send-to and the send-from might (partially) overlap
6210     in that case.  The implementation has to take care that it handles
6211     this case, e.g.  using 'memmove' which handles (partially)
6212     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6213     additionally create a temporary variable, unless additional checks
6214     show that this is not required (e.g.  because walking backward is
6215     possible or because both arrays are contiguous and 'memmove' takes
6216     care of overlap issues).
6217
6218     Note that the assignment of a scalar to an array is permitted.  In
6219     addition, the library has to handle numeric-type conversion and for
6220     strings, padding and different character kinds.
6221
6222     Because of the more complicated references possible some operations
6223     may be unsupported by certain libraries.  The library is expected
6224     to issue a precise error message why the operation is not
6225     permitted.
6226
6227
6228File: gfortran.info,  Node: _gfortran_caf_get_by_ref,  Next: _gfortran_caf_sendget_by_ref,  Prev: _gfortran_caf_send_by_ref,  Up: Function ABI Documentation
6229
62308.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references
6231-----------------------------------------------------------------------------------------------
6232
6233_Description_:
6234     Called to get a scalar, an array section or a whole array from a
6235     remote image identified by the IMAGE_INDEX.
6236
6237_Syntax_:
6238     'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index,
6239     caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int
6240     src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat,
6241     int src_type)'
6242
6243_Arguments_:
6244     TOKEN       intent(in) An opaque pointer identifying the
6245                 coarray.
6246     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6247                 positive number.
6248     REFS        intent(in) The references to apply to the remote
6249                 structure to get the data.
6250     DST         intent(in) Array descriptor of the local array
6251                 to store the data transferred from the remote
6252                 image.  May be reallocated where needed and when
6253                 DST_REALLOCATABLE allows it.
6254     DST_KIND    intent(in) Kind of the destination argument
6255     SRC_KIND    intent(in) Kind of the source argument
6256     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6257                 known at compile time that the DEST and SRC
6258                 either cannot overlap or overlap (fully or
6259                 partially) such that walking SRC and DEST in
6260                 element wise element order (honoring the stride
6261                 value) will not lead to wrong results.
6262                 Otherwise, the value is 'true'.
6263     DST_REALLOCATABLEintent(in) Set when DST is of allocatable or
6264                 pointer type and its refs allow reallocation,
6265                 i.e., the full array or a component is
6266                 referenced.
6267     STAT        intent(out) When non-'NULL' give the result of
6268                 the operation, i.e., zero on success and
6269                 non-zero on error.  When 'NULL' and an error
6270                 occurs, then an error message is printed and the
6271                 program is terminated.
6272     SRC_TYPE    intent(in) Give the type of the source.  When
6273                 the source is not an array, than the precise
6274                 type, e.g.  of a component in a derived type, is
6275                 not known, but provided here.
6276
6277_NOTES_
6278     It is permitted to have 'image_index' equal the current image; the
6279     memory of the send-to and the send-from might (partially) overlap
6280     in that case.  The implementation has to take care that it handles
6281     this case, e.g.  using 'memmove' which handles (partially)
6282     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6283     additionally create a temporary variable, unless additional checks
6284     show that this is not required (e.g.  because walking backward is
6285     possible or because both arrays are contiguous and 'memmove' takes
6286     care of overlap issues).
6287
6288     Note that the library has to handle numeric-type conversion and for
6289     strings, padding and different character kinds.
6290
6291     Because of the more complicated references possible some operations
6292     may be unsupported by certain libraries.  The library is expected
6293     to issue a precise error message why the operation is not
6294     permitted.
6295
6296
6297File: gfortran.info,  Node: _gfortran_caf_sendget_by_ref,  Next: _gfortran_caf_lock,  Prev: _gfortran_caf_get_by_ref,  Up: Function ABI Documentation
6298
62998.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides
6300-------------------------------------------------------------------------------------------------------------------
6301
6302_Description_:
6303     Called to send a scalar, an array section or a whole array from a
6304     remote image identified by the SRC_IMAGE_INDEX to a remote image
6305     identified by the DST_IMAGE_INDEX.
6306
6307_Syntax_:
6308     'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int
6309     dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token,
6310     int src_image_index, caf_reference_t *src_refs, int dst_kind, int
6311     src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int
6312     dst_type, int src_type)'
6313
6314_Arguments_:
6315     DST_TOKEN   intent(in) An opaque pointer identifying the
6316                 destination coarray.
6317     DST_IMAGE_INDEXintent(in) The ID of the destination remote
6318                 image; must be a positive number.
6319     DST_REFS    intent(in) The references on the remote array to
6320                 store the data given by the source.  Guaranteed
6321                 to have at least one entry.
6322     SRC_TOKEN   intent(in) An opaque pointer identifying the
6323                 source coarray.
6324     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
6325                 must be a positive number.
6326     SRC_REFS    intent(in) The references to apply to the remote
6327                 structure to get the data.
6328     DST_KIND    intent(in) Kind of the destination argument
6329     SRC_KIND    intent(in) Kind of the source argument
6330     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6331                 known at compile time that the DEST and SRC
6332                 either cannot overlap or overlap (fully or
6333                 partially) such that walking SRC and DEST in
6334                 element wise element order (honoring the stride
6335                 value) will not lead to wrong results.
6336                 Otherwise, the value is 'true'.
6337     DST_STAT    intent(out) when non-'NULL' give the result of
6338                 the send-operation, i.e., zero on success and
6339                 non-zero on error.  When 'NULL' and an error
6340                 occurs, then an error message is printed and the
6341                 program is terminated.
6342     SRC_STAT    intent(out) When non-'NULL' give the result of
6343                 the get-operation, i.e., zero on success and
6344                 non-zero on error.  When 'NULL' and an error
6345                 occurs, then an error message is printed and the
6346                 program is terminated.
6347     DST_TYPE    intent(in) Give the type of the destination.
6348                 When the destination is not an array, than the
6349                 precise type, e.g.  of a component in a derived
6350                 type, is not known, but provided here.
6351     SRC_TYPE    intent(in) Give the type of the source.  When
6352                 the source is not an array, than the precise
6353                 type, e.g.  of a component in a derived type, is
6354                 not known, but provided here.
6355
6356_NOTES_
6357     It is permitted to have the same image index for both
6358     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
6359     the send-from might (partially) overlap in that case.  The
6360     implementation has to take care that it handles this case, e.g.
6361     using 'memmove' which handles (partially) overlapping memory.  If
6362     MAY_REQUIRE_TMP is true, the library might additionally create a
6363     temporary variable, unless additional checks show that this is not
6364     required (e.g.  because walking backward is possible or because
6365     both arrays are contiguous and 'memmove' takes care of overlap
6366     issues).
6367
6368     Note that the assignment of a scalar to an array is permitted.  In
6369     addition, the library has to handle numeric-type conversion and for
6370     strings, padding and different character kinds.
6371
6372     Because of the more complicated references possible some operations
6373     may be unsupported by certain libraries.  The library is expected
6374     to issue a precise error message why the operation is not
6375     permitted.
6376
6377
6378File: gfortran.info,  Node: _gfortran_caf_lock,  Next: _gfortran_caf_unlock,  Prev: _gfortran_caf_sendget_by_ref,  Up: Function ABI Documentation
6379
63808.2.17 '_gfortran_caf_lock' -- Locking a lock variable
6381------------------------------------------------------
6382
6383_Description_:
6384     Acquire a lock on the given image on a scalar locking variable or
6385     for the given array element for an array-valued variable.  If the
6386     AQUIRED_LOCK is 'NULL', the function returns after having obtained
6387     the lock.  If it is non-'NULL', then ACQUIRED_LOCK is assigned the
6388     value true (one) when the lock could be obtained and false (zero)
6389     otherwise.  Locking a lock variable which has already been locked
6390     by the same image is an error.
6391
6392_Syntax_:
6393     'void _gfortran_caf_lock (caf_token_t token, size_t index, int
6394     image_index, int *aquired_lock, int *stat, char *errmsg, size_t
6395     errmsg_len)'
6396
6397_Arguments_:
6398     TOKEN       intent(in) An opaque pointer identifying the
6399                 coarray.
6400     INDEX       intent(in) Array index; first array index is 0.
6401                 For scalars, it is always 0.
6402     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6403                 positive number.
6404     AQUIRED_LOCKintent(out) If not NULL, it returns whether lock
6405                 could be obtained.
6406     STAT        intent(out) Stores the STAT=; may be NULL.
6407     ERRMSG      intent(out) When an error occurs, this will be
6408                 set to an error message; may be NULL.
6409     ERRMSG_LEN  intent(in) the buffer size of errmsg
6410
6411_NOTES_
6412     This function is also called for critical blocks; for those, the
6413     array index is always zero and the image index is one.  Libraries
6414     are permitted to use other images for critical-block locking
6415     variables.
6416
6417
6418File: gfortran.info,  Node: _gfortran_caf_unlock,  Next: _gfortran_caf_event_post,  Prev: _gfortran_caf_lock,  Up: Function ABI Documentation
6419
64208.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable
6421--------------------------------------------------------
6422
6423_Description_:
6424     Release a lock on the given image on a scalar locking variable or
6425     for the given array element for an array-valued variable.
6426     Unlocking a lock variable which is unlocked or has been locked by a
6427     different image is an error.
6428
6429_Syntax_:
6430     'void _gfortran_caf_unlock (caf_token_t token, size_t index, int
6431     image_index, int *stat, char *errmsg, size_t errmsg_len)'
6432
6433_Arguments_:
6434     TOKEN       intent(in) An opaque pointer identifying the
6435                 coarray.
6436     INDEX       intent(in) Array index; first array index is 0.
6437                 For scalars, it is always 0.
6438     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6439                 positive number.
6440     STAT        intent(out) For allocatable coarrays, stores the
6441                 STAT=; may be NULL.
6442     ERRMSG      intent(out) When an error occurs, this will be
6443                 set to an error message; may be NULL.
6444     ERRMSG_LEN  intent(in) the buffer size of errmsg
6445
6446_NOTES_
6447     This function is also called for critical block; for those, the
6448     array index is always zero and the image index is one.  Libraries
6449     are permitted to use other images for critical-block locking
6450     variables.
6451
6452
6453File: gfortran.info,  Node: _gfortran_caf_event_post,  Next: _gfortran_caf_event_wait,  Prev: _gfortran_caf_unlock,  Up: Function ABI Documentation
6454
64558.2.19 '_gfortran_caf_event_post' -- Post an event
6456--------------------------------------------------
6457
6458_Description_:
6459     Increment the event count of the specified event variable.
6460
6461_Syntax_:
6462     'void _gfortran_caf_event_post (caf_token_t token, size_t index,
6463     int image_index, int *stat, char *errmsg, size_t errmsg_len)'
6464
6465_Arguments_:
6466     TOKEN       intent(in) An opaque pointer identifying the
6467                 coarray.
6468     INDEX       intent(in) Array index; first array index is 0.
6469                 For scalars, it is always 0.
6470     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6471                 positive number; zero indicates the current
6472                 image, when accessed noncoindexed.
6473     STAT        intent(out) Stores the STAT=; may be NULL.
6474     ERRMSG      intent(out) When an error occurs, this will be
6475                 set to an error message; may be NULL.
6476     ERRMSG_LEN  intent(in) the buffer size of errmsg
6477
6478_NOTES_
6479     This acts like an atomic add of one to the remote image's event
6480     variable.  The statement is an image-control statement but does not
6481     imply sync memory.  Still, all preceeding push communications of
6482     this image to the specified remote image have to be completed
6483     before 'event_wait' on the remote image returns.
6484
6485
6486File: gfortran.info,  Node: _gfortran_caf_event_wait,  Next: _gfortran_caf_event_query,  Prev: _gfortran_caf_event_post,  Up: Function ABI Documentation
6487
64888.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred
6489----------------------------------------------------------------
6490
6491_Description_:
6492     Wait until the event count has reached at least the specified
6493     UNTIL_COUNT; if so, atomically decrement the event variable by this
6494     amount and return.
6495
6496_Syntax_:
6497     'void _gfortran_caf_event_wait (caf_token_t token, size_t index,
6498     int until_count, int *stat, char *errmsg, size_t errmsg_len)'
6499
6500_Arguments_:
6501     TOKEN       intent(in) An opaque pointer identifying the
6502                 coarray.
6503     INDEX       intent(in) Array index; first array index is 0.
6504                 For scalars, it is always 0.
6505     UNTIL_COUNT intent(in) The number of events which have to be
6506                 available before the function returns.
6507     STAT        intent(out) Stores the STAT=; may be NULL.
6508     ERRMSG      intent(out) When an error occurs, this will be
6509                 set to an error message; may be NULL.
6510     ERRMSG_LEN  intent(in) the buffer size of errmsg
6511
6512_NOTES_
6513     This function only operates on a local coarray.  It acts like a
6514     loop checking atomically the value of the event variable, breaking
6515     if the value is greater or equal the requested number of counts.
6516     Before the function returns, the event variable has to be
6517     decremented by the requested UNTIL_COUNT value.  A possible
6518     implementation would be a busy loop for a certain number of spins
6519     (possibly depending on the number of threads relative to the number
6520     of available cores) followed by another waiting strategy such as a
6521     sleeping wait (possibly with an increasing number of sleep time)
6522     or, if possible, a futex wait.
6523
6524     The statement is an image-control statement but does not imply sync
6525     memory.  Still, all preceeding push communications of this image to
6526     the specified remote image have to be completed before 'event_wait'
6527     on the remote image returns.
6528
6529
6530File: gfortran.info,  Node: _gfortran_caf_event_query,  Next: _gfortran_caf_sync_all,  Prev: _gfortran_caf_event_wait,  Up: Function ABI Documentation
6531
65328.2.21 '_gfortran_caf_event_query' -- Query event count
6533-------------------------------------------------------
6534
6535_Description_:
6536     Return the event count of the specified event variable.
6537
6538_Syntax_:
6539     'void _gfortran_caf_event_query (caf_token_t token, size_t index,
6540     int image_index, int *count, int *stat)'
6541
6542_Arguments_:
6543     TOKEN       intent(in) An opaque pointer identifying the
6544                 coarray.
6545     INDEX       intent(in) Array index; first array index is 0.
6546                 For scalars, it is always 0.
6547     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6548                 positive number; zero indicates the current
6549                 image when accessed noncoindexed.
6550     COUNT       intent(out) The number of events currently
6551                 posted to the event variable.
6552     STAT        intent(out) Stores the STAT=; may be NULL.
6553
6554_NOTES_
6555     The typical use is to check the local event variable to only call
6556     'event_wait' when the data is available.  However, a coindexed
6557     variable is permitted; there is no ordering or synchronization
6558     implied.  It acts like an atomic fetch of the value of the event
6559     variable.
6560
6561
6562File: gfortran.info,  Node: _gfortran_caf_sync_all,  Next: _gfortran_caf_sync_images,  Prev: _gfortran_caf_event_query,  Up: Function ABI Documentation
6563
65648.2.22 '_gfortran_caf_sync_all' -- All-image barrier
6565----------------------------------------------------
6566
6567_Description_:
6568     Synchronization of all images in the current team; the program only
6569     continues on a given image after this function has been called on
6570     all images of the current team.  Additionally, it ensures that all
6571     pending data transfers of previous segment have completed.
6572
6573_Syntax_:
6574     'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t
6575     errmsg_len)'
6576
6577_Arguments_:
6578     STAT        intent(out) Stores the status STAT= and may be
6579                 NULL.
6580     ERRMSG      intent(out) When an error occurs, this will be
6581                 set to an error message; may be NULL.
6582     ERRMSG_LEN  intent(in) the buffer size of errmsg
6583
6584
6585File: gfortran.info,  Node: _gfortran_caf_sync_images,  Next: _gfortran_caf_sync_memory,  Prev: _gfortran_caf_sync_all,  Up: Function ABI Documentation
6586
65878.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images
6588-----------------------------------------------------------------
6589
6590_Description_:
6591     Synchronization between the specified images; the program only
6592     continues on a given image after this function has been called on
6593     all images specified for that image.  Note that one image can wait
6594     for all other images in the current team (e.g.  via 'sync
6595     images(*)') while those only wait for that specific image.
6596     Additionally, 'sync images' ensures that all pending data transfers
6597     of previous segments have completed.
6598
6599_Syntax_:
6600     'void _gfortran_caf_sync_images (int count, int images[], int
6601     *stat, char *errmsg, size_t errmsg_len)'
6602
6603_Arguments_:
6604     COUNT       intent(in) The number of images which are
6605                 provided in the next argument.  For a zero-sized
6606                 array, the value is zero.  For 'sync images
6607                 (*)', the value is -1.
6608     IMAGES      intent(in) An array with the images provided by
6609                 the user.  If COUNT is zero, a NULL pointer is
6610                 passed.
6611     STAT        intent(out) Stores the status STAT= and may be
6612                 NULL.
6613     ERRMSG      intent(out) When an error occurs, this will be
6614                 set to an error message; may be NULL.
6615     ERRMSG_LEN  intent(in) the buffer size of errmsg
6616
6617
6618File: gfortran.info,  Node: _gfortran_caf_sync_memory,  Next: _gfortran_caf_error_stop,  Prev: _gfortran_caf_sync_images,  Up: Function ABI Documentation
6619
66208.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
6621--------------------------------------------------------------------------------------
6622
6623_Description_:
6624     Acts as optimization barrier between different segments.  It also
6625     ensures that all pending memory operations of this image have been
6626     completed.
6627
6628_Syntax_:
6629     'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t
6630     errmsg_len)'
6631
6632_Arguments_:
6633     STAT        intent(out) Stores the status STAT= and may be
6634                 NULL.
6635     ERRMSG      intent(out) When an error occurs, this will be
6636                 set to an error message; may be NULL.
6637     ERRMSG_LEN  intent(in) the buffer size of errmsg
6638
6639_NOTE_ A simple implementation could be
6640     '__asm__ __volatile__ ("":::"memory")' to prevent code movements.
6641
6642
6643File: gfortran.info,  Node: _gfortran_caf_error_stop,  Next: _gfortran_caf_error_stop_str,  Prev: _gfortran_caf_sync_memory,  Up: Function ABI Documentation
6644
66458.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code
6646---------------------------------------------------------------------
6647
6648_Description_:
6649     Invoked for an 'ERROR STOP' statement which has an integer
6650     argument.  The function should terminate the program with the
6651     specified exit code.
6652
6653_Syntax_:
6654     'void _gfortran_caf_error_stop (int error)'
6655
6656_Arguments_:
6657     ERROR       intent(in) The exit status to be used.
6658
6659
6660File: gfortran.info,  Node: _gfortran_caf_error_stop_str,  Next: _gfortran_caf_fail_image,  Prev: _gfortran_caf_error_stop,  Up: Function ABI Documentation
6661
66628.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string
6663----------------------------------------------------------------------
6664
6665_Description_:
6666     Invoked for an 'ERROR STOP' statement which has a string as
6667     argument.  The function should terminate the program with a
6668     nonzero-exit code.
6669
6670_Syntax_:
6671     'void _gfortran_caf_error_stop (const char *string, size_t len)'
6672
6673_Arguments_:
6674     STRING      intent(in) the error message (not zero
6675                 terminated)
6676     LEN         intent(in) the length of the string
6677
6678
6679File: gfortran.info,  Node: _gfortran_caf_fail_image,  Next: _gfortran_caf_atomic_define,  Prev: _gfortran_caf_error_stop_str,  Up: Function ABI Documentation
6680
66818.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution
6682--------------------------------------------------------------------------------
6683
6684_Description_:
6685     Invoked for an 'FAIL IMAGE' statement.  The function should
6686     terminate the current image.
6687
6688_Syntax_:
6689     'void _gfortran_caf_fail_image ()'
6690
6691_NOTES_
6692     This function follows TS18508.
6693
6694
6695File: gfortran.info,  Node: _gfortran_caf_atomic_define,  Next: _gfortran_caf_atomic_ref,  Prev: _gfortran_caf_fail_image,  Up: Function ABI Documentation
6696
66978.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment
6698------------------------------------------------------------------
6699
6700_Description_:
6701     Assign atomically a value to an integer or logical variable.
6702
6703_Syntax_:
6704     'void _gfortran_caf_atomic_define (caf_token_t token, size_t
6705     offset, int image_index, void *value, int *stat, int type, int
6706     kind)'
6707
6708_Arguments_:
6709     TOKEN       intent(in) An opaque pointer identifying the
6710                 coarray.
6711     OFFSET      intent(in) By which amount of bytes the actual
6712                 data is shifted compared to the base address of
6713                 the coarray.
6714     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6715                 positive number; zero indicates the current
6716                 image when used noncoindexed.
6717     VALUE       intent(in) the value to be assigned, passed by
6718                 reference
6719     STAT        intent(out) Stores the status STAT= and may be
6720                 NULL.
6721     TYPE        intent(in) The data type, i.e.  'BT_INTEGER' (1)
6722                 or 'BT_LOGICAL' (2).
6723     KIND        intent(in) The kind value (only 4; always 'int')
6724
6725
6726File: gfortran.info,  Node: _gfortran_caf_atomic_ref,  Next: _gfortran_caf_atomic_cas,  Prev: _gfortran_caf_atomic_define,  Up: Function ABI Documentation
6727
67288.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference
6729--------------------------------------------------------------
6730
6731_Description_:
6732     Reference atomically a value of a kind-4 integer or logical
6733     variable.
6734
6735_Syntax_:
6736     'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
6737     int image_index, void *value, int *stat, int type, int kind)'
6738
6739_Arguments_:
6740     TOKEN       intent(in) An opaque pointer identifying the
6741                 coarray.
6742     OFFSET      intent(in) By which amount of bytes the actual
6743                 data is shifted compared to the base address of
6744                 the coarray.
6745     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6746                 positive number; zero indicates the current
6747                 image when used noncoindexed.
6748     VALUE       intent(out) The variable assigned the atomically
6749                 referenced variable.
6750     STAT        intent(out) Stores the status STAT= and may be
6751                 NULL.
6752     TYPE        the data type, i.e.  'BT_INTEGER' (1) or
6753                 'BT_LOGICAL' (2).
6754     KIND        The kind value (only 4; always 'int')
6755
6756
6757File: gfortran.info,  Node: _gfortran_caf_atomic_cas,  Next: _gfortran_caf_atomic_op,  Prev: _gfortran_caf_atomic_ref,  Up: Function ABI Documentation
6758
67598.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap
6760------------------------------------------------------------
6761
6762_Description_:
6763     Atomic compare and swap of a kind-4 integer or logical variable.
6764     Assigns atomically the specified value to the atomic variable, if
6765     the latter has the value specified by the passed condition value.
6766
6767_Syntax_:
6768     'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
6769     int image_index, void *old, void *compare, void *new_val, int
6770     *stat, int type, int kind)'
6771
6772_Arguments_:
6773     TOKEN       intent(in) An opaque pointer identifying the
6774                 coarray.
6775     OFFSET      intent(in) By which amount of bytes the actual
6776                 data is shifted compared to the base address of
6777                 the coarray.
6778     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6779                 positive number; zero indicates the current
6780                 image when used noncoindexed.
6781     OLD         intent(out) The value which the atomic variable
6782                 had just before the cas operation.
6783     COMPARE     intent(in) The value used for comparision.
6784     NEW_VAL     intent(in) The new value for the atomic
6785                 variable, assigned to the atomic variable, if
6786                 'compare' equals the value of the atomic
6787                 variable.
6788     STAT        intent(out) Stores the status STAT= and may be
6789                 NULL.
6790     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6791                 or 'BT_LOGICAL' (2).
6792     KIND        intent(in) The kind value (only 4; always 'int')
6793
6794
6795File: gfortran.info,  Node: _gfortran_caf_atomic_op,  Next: _gfortran_caf_co_broadcast,  Prev: _gfortran_caf_atomic_cas,  Up: Function ABI Documentation
6796
67978.2.31 '_gfortran_caf_atomic_op' -- Atomic operation
6798----------------------------------------------------
6799
6800_Description_:
6801     Apply an operation atomically to an atomic integer or logical
6802     variable.  After the operation, OLD contains the value just before
6803     the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
6804     atomically the 'value' to the atomic integer variable or does a
6805     bitwise AND, OR or exclusive OR between the atomic variable and
6806     VALUE; the result is then stored in the atomic variable.
6807
6808_Syntax_:
6809     'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
6810     offset, int image_index, void *value, void *old, int *stat, int
6811     type, int kind)'
6812
6813_Arguments_:
6814     OP          intent(in) the operation to be performed;
6815                 possible values 'GFC_CAF_ATOMIC_ADD' (1),
6816                 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR'
6817                 (3), 'GFC_CAF_ATOMIC_XOR' (4).
6818     TOKEN       intent(in) An opaque pointer identifying the
6819                 coarray.
6820     OFFSET      intent(in) By which amount of bytes the actual
6821                 data is shifted compared to the base address of
6822                 the coarray.
6823     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6824                 positive number; zero indicates the current
6825                 image when used noncoindexed.
6826     OLD         intent(out) The value which the atomic variable
6827                 had just before the atomic operation.
6828     VAL         intent(in) The new value for the atomic
6829                 variable, assigned to the atomic variable, if
6830                 'compare' equals the value of the atomic
6831                 variable.
6832     STAT        intent(out) Stores the status STAT= and may be
6833                 NULL.
6834     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6835                 or 'BT_LOGICAL' (2)
6836     KIND        intent(in) the kind value (only 4; always 'int')
6837
6838
6839File: gfortran.info,  Node: _gfortran_caf_co_broadcast,  Next: _gfortran_caf_co_max,  Prev: _gfortran_caf_atomic_op,  Up: Function ABI Documentation
6840
68418.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images
6842-----------------------------------------------------------------
6843
6844_Description_:
6845     Distribute a value from a given image to all other images in the
6846     team.  Has to be called collectively.
6847
6848_Syntax_:
6849     'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
6850     source_image, int *stat, char *errmsg, size_t errmsg_len)'
6851
6852_Arguments_:
6853     A           intent(inout) An array descriptor with the data
6854                 to be broadcasted (on SOURCE_IMAGE) or to be
6855                 received (other images).
6856     SOURCE_IMAGEintent(in) The ID of the image from which the
6857                 data should be broadcasted.
6858     STAT        intent(out) Stores the status STAT= and may be
6859                 NULL.
6860     ERRMSG      intent(out) When an error occurs, this will be
6861                 set to an error message; may be NULL.
6862     ERRMSG_LEN  intent(in) the buffer size of errmsg.
6863
6864
6865File: gfortran.info,  Node: _gfortran_caf_co_max,  Next: _gfortran_caf_co_min,  Prev: _gfortran_caf_co_broadcast,  Up: Function ABI Documentation
6866
68678.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction
6868-------------------------------------------------------------
6869
6870_Description_:
6871     Calculates for each array element of the variable A the maximum
6872     value for that element in the current team; if RESULT_IMAGE has the
6873     value 0, the result shall be stored on all images, otherwise, only
6874     on the specified image.  This function operates on numeric values
6875     and character strings.
6876
6877_Syntax_:
6878     'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
6879     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6880
6881_Arguments_:
6882     A           intent(inout) An array descriptor for the data
6883                 to be processed.  On the destination image(s)
6884                 the result overwrites the old content.
6885     RESULT_IMAGEintent(in) The ID of the image to which the
6886                 reduced value should be copied to; if zero, it
6887                 has to be copied to all images.
6888     STAT        intent(out) Stores the status STAT= and may be
6889                 NULL.
6890     ERRMSG      intent(out) When an error occurs, this will be
6891                 set to an error message; may be NULL.
6892     A_LEN       intent(in) the string length of argument A
6893     ERRMSG_LEN  intent(in) the buffer size of errmsg
6894
6895_NOTES_
6896     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6897     all images except of the specified one become undefined; hence, the
6898     library may make use of this.
6899
6900
6901File: gfortran.info,  Node: _gfortran_caf_co_min,  Next: _gfortran_caf_co_sum,  Prev: _gfortran_caf_co_max,  Up: Function ABI Documentation
6902
69038.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction
6904-------------------------------------------------------------
6905
6906_Description_:
6907     Calculates for each array element of the variable A the minimum
6908     value for that element in the current team; if RESULT_IMAGE has the
6909     value 0, the result shall be stored on all images, otherwise, only
6910     on the specified image.  This function operates on numeric values
6911     and character strings.
6912
6913_Syntax_:
6914     'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
6915     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6916
6917_Arguments_:
6918     A           intent(inout) An array descriptor for the data
6919                 to be processed.  On the destination image(s)
6920                 the result overwrites the old content.
6921     RESULT_IMAGEintent(in) The ID of the image to which the
6922                 reduced value should be copied to; if zero, it
6923                 has to be copied to all images.
6924     STAT        intent(out) Stores the status STAT= and may be
6925                 NULL.
6926     ERRMSG      intent(out) When an error occurs, this will be
6927                 set to an error message; may be NULL.
6928     A_LEN       intent(in) the string length of argument A
6929     ERRMSG_LEN  intent(in) the buffer size of errmsg
6930
6931_NOTES_
6932     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6933     all images except of the specified one become undefined; hence, the
6934     library may make use of this.
6935
6936
6937File: gfortran.info,  Node: _gfortran_caf_co_sum,  Next: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_min,  Up: Function ABI Documentation
6938
69398.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction
6940-------------------------------------------------------------
6941
6942_Description_:
6943     Calculates for each array element of the variable A the sum of all
6944     values for that element in the current team; if RESULT_IMAGE has
6945     the value 0, the result shall be stored on all images, otherwise,
6946     only on the specified image.  This function operates on numeric
6947     values only.
6948
6949_Syntax_:
6950     'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
6951     int *stat, char *errmsg, size_t errmsg_len)'
6952
6953_Arguments_:
6954     A           intent(inout) An array descriptor with the data
6955                 to be processed.  On the destination image(s)
6956                 the result overwrites the old content.
6957     RESULT_IMAGEintent(in) The ID of the image to which the
6958                 reduced value should be copied to; if zero, it
6959                 has to be copied to all images.
6960     STAT        intent(out) Stores the status STAT= and may be
6961                 NULL.
6962     ERRMSG      intent(out) When an error occurs, this will be
6963                 set to an error message; may be NULL.
6964     ERRMSG_LEN  intent(in) the buffer size of errmsg
6965
6966_NOTES_
6967     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6968     all images except of the specified one become undefined; hence, the
6969     library may make use of this.
6970
6971
6972File: gfortran.info,  Node: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_sum,  Up: Function ABI Documentation
6973
69748.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction
6975----------------------------------------------------------------
6976
6977_Description_:
6978     Calculates for each array element of the variable A the reduction
6979     value for that element in the current team; if RESULT_IMAGE has the
6980     value 0, the result shall be stored on all images, otherwise, only
6981     on the specified image.  The OPR is a pure function doing a
6982     mathematically commutative and associative operation.
6983
6984     The OPR_FLAGS denote the following; the values are bitwise ored.
6985     'GFC_CAF_BYREF' (1) if the result should be returned by reference;
6986     'GFC_CAF_HIDDENLEN' (2) whether the result and argument string
6987     lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE'
6988     (4) whether the arguments shall be passed by value,
6989     'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
6990     descriptor.
6991
6992_Syntax_:
6993     'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
6994     (void *, void *), int opr_flags, int result_image, int *stat, char
6995     *errmsg, int a_len, size_t errmsg_len)'
6996
6997_Arguments_:
6998     A           intent(inout) An array descriptor with the data
6999                 to be processed.  On the destination image(s)
7000                 the result overwrites the old content.
7001     OPR         intent(in) Function pointer to the reduction
7002                 function
7003     OPR_FLAGS   intent(in) Flags regarding the reduction
7004                 function
7005     RESULT_IMAGEintent(in) The ID of the image to which the
7006                 reduced value should be copied to; if zero, it
7007                 has to be copied to all images.
7008     STAT        intent(out) Stores the status STAT= and may be
7009                 NULL.
7010     ERRMSG      intent(out) When an error occurs, this will be
7011                 set to an error message; may be NULL.
7012     A_LEN       intent(in) the string length of argument A
7013     ERRMSG_LEN  intent(in) the buffer size of errmsg
7014
7015_NOTES_
7016     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
7017     all images except of the specified one become undefined; hence, the
7018     library may make use of this.
7019
7020     For character arguments, the result is passed as first argument,
7021     followed by the result string length, next come the two string
7022     arguments, followed by the two hidden string length arguments.
7023     With C binding, there are no hidden arguments and by-reference
7024     passing and either only a single character is passed or an array
7025     descriptor.
7026
7027
7028File: gfortran.info,  Node: Intrinsic Procedures,  Next: Intrinsic Modules,  Prev: Coarray Programming,  Up: Top
7029
70309 Intrinsic Procedures
7031**********************
7032
7033* Menu:
7034
7035* Introduction:         Introduction to Intrinsics
7036* 'ABORT':         ABORT,     Abort the program
7037* 'ABS':           ABS,       Absolute value
7038* 'ACCESS':        ACCESS,    Checks file access modes
7039* 'ACHAR':         ACHAR,     Character in ASCII collating sequence
7040* 'ACOS':          ACOS,      Arccosine function
7041* 'ACOSD':         ACOSD,     Arccosine function, degrees
7042* 'ACOSH':         ACOSH,     Inverse hyperbolic cosine function
7043* 'ADJUSTL':       ADJUSTL,   Left adjust a string
7044* 'ADJUSTR':       ADJUSTR,   Right adjust a string
7045* 'AIMAG':         AIMAG,     Imaginary part of complex number
7046* 'AINT':          AINT,      Truncate to a whole number
7047* 'ALARM':         ALARM,     Set an alarm clock
7048* 'ALL':           ALL,       Determine if all values are true
7049* 'ALLOCATED':     ALLOCATED, Status of allocatable entity
7050* 'AND':           AND,       Bitwise logical AND
7051* 'ANINT':         ANINT,     Nearest whole number
7052* 'ANY':           ANY,       Determine if any values are true
7053* 'ASIN':          ASIN,      Arcsine function
7054* 'ASIND':         ASIND,     Arcsine function, degrees
7055* 'ASINH':         ASINH,     Inverse hyperbolic sine function
7056* 'ASSOCIATED':    ASSOCIATED, Status of a pointer or pointer/target pair
7057* 'ATAN':          ATAN,      Arctangent function
7058* 'ATAND':         ATAND,     Arctangent function, degrees
7059* 'ATAN2':         ATAN2,     Arctangent function
7060* 'ATAN2D':        ATAN2D,    Arctangent function, degrees
7061* 'ATANH':         ATANH,     Inverse hyperbolic tangent function
7062* 'ATOMIC_ADD':    ATOMIC_ADD, Atomic ADD operation
7063* 'ATOMIC_AND':    ATOMIC_AND, Atomic bitwise AND operation
7064* 'ATOMIC_CAS':    ATOMIC_CAS, Atomic compare and swap
7065* 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
7066* 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
7067* 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
7068* 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
7069* 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
7070* 'ATOMIC_OR':     ATOMIC_OR, Atomic bitwise OR operation
7071* 'ATOMIC_REF':    ATOMIC_REF, Obtaining the value of a variable atomically
7072* 'ATOMIC_XOR':    ATOMIC_XOR, Atomic bitwise OR operation
7073* 'BACKTRACE':     BACKTRACE, Show a backtrace
7074* 'BESSEL_J0':     BESSEL_J0, Bessel function of the first kind of order 0
7075* 'BESSEL_J1':     BESSEL_J1, Bessel function of the first kind of order 1
7076* 'BESSEL_JN':     BESSEL_JN, Bessel function of the first kind
7077* 'BESSEL_Y0':     BESSEL_Y0, Bessel function of the second kind of order 0
7078* 'BESSEL_Y1':     BESSEL_Y1, Bessel function of the second kind of order 1
7079* 'BESSEL_YN':     BESSEL_YN, Bessel function of the second kind
7080* 'BGE':           BGE,       Bitwise greater than or equal to
7081* 'BGT':           BGT,       Bitwise greater than
7082* 'BIT_SIZE':      BIT_SIZE,  Bit size inquiry function
7083* 'BLE':           BLE,       Bitwise less than or equal to
7084* 'BLT':           BLT,       Bitwise less than
7085* 'BTEST':         BTEST,     Bit test function
7086* 'C_ASSOCIATED':  C_ASSOCIATED, Status of a C pointer
7087* 'C_F_POINTER':   C_F_POINTER, Convert C into Fortran pointer
7088* 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
7089* 'C_FUNLOC':      C_FUNLOC,  Obtain the C address of a procedure
7090* 'C_LOC':         C_LOC,     Obtain the C address of an object
7091* 'C_SIZEOF':      C_SIZEOF,  Size in bytes of an expression
7092* 'CEILING':       CEILING,   Integer ceiling function
7093* 'CHAR':          CHAR,      Integer-to-character conversion function
7094* 'CHDIR':         CHDIR,     Change working directory
7095* 'CHMOD':         CHMOD,     Change access permissions of files
7096* 'CMPLX':         CMPLX,     Complex conversion function
7097* 'CO_BROADCAST':  CO_BROADCAST, Copy a value to all images the current set of images
7098* 'CO_MAX':        CO_MAX,    Maximal value on the current set of images
7099* 'CO_MIN':        CO_MIN,    Minimal value on the current set of images
7100* 'CO_REDUCE':     CO_REDUCE, Reduction of values on the current set of images
7101* 'CO_SUM':        CO_SUM,    Sum of values on the current set of images
7102* 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
7103* 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
7104* 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string
7105* 'COMPLEX':       COMPLEX,   Complex conversion function
7106* 'CONJG':         CONJG,     Complex conjugate function
7107* 'COS':           COS,       Cosine function
7108* 'COSD':          COSD,      Cosine function, degrees
7109* 'COSH':          COSH,      Hyperbolic cosine function
7110* 'COTAN':         COTAN,     Cotangent function
7111* 'COTAND':        COTAND,    Cotangent function, degrees
7112* 'COUNT':         COUNT,     Count occurrences of TRUE in an array
7113* 'CPU_TIME':      CPU_TIME,  CPU time subroutine
7114* 'CSHIFT':        CSHIFT,    Circular shift elements of an array
7115* 'CTIME':         CTIME,     Subroutine (or function) to convert a time into a string
7116* 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
7117* 'DBLE':          DBLE,      Double precision conversion function
7118* 'DCMPLX':        DCMPLX,    Double complex conversion function
7119* 'DIGITS':        DIGITS,    Significant digits function
7120* 'DIM':           DIM,       Positive difference
7121* 'DOT_PRODUCT':   DOT_PRODUCT, Dot product function
7122* 'DPROD':         DPROD,     Double product function
7123* 'DREAL':         DREAL,     Double real part function
7124* 'DSHIFTL':       DSHIFTL,   Combined left shift
7125* 'DSHIFTR':       DSHIFTR,   Combined right shift
7126* 'DTIME':         DTIME,     Execution time subroutine (or function)
7127* 'EOSHIFT':       EOSHIFT,   End-off shift elements of an array
7128* 'EPSILON':       EPSILON,   Epsilon function
7129* 'ERF':           ERF,       Error function
7130* 'ERFC':          ERFC,      Complementary error function
7131* 'ERFC_SCALED':   ERFC_SCALED, Exponentially-scaled complementary error function
7132* 'ETIME':         ETIME,     Execution time subroutine (or function)
7133* 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred
7134* 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
7135* 'EXIT':          EXIT,      Exit the program with status.
7136* 'EXP':           EXP,       Exponential function
7137* 'EXPONENT':      EXPONENT,  Exponent function
7138* 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF,  Query dynamic type for extension
7139* 'FDATE':         FDATE,     Subroutine (or function) to get the current time as a string
7140* 'FGET':          FGET,      Read a single character in stream mode from stdin
7141* 'FGETC':         FGETC,     Read a single character in stream mode
7142* 'FINDLOC':       FINDLOC,   Search an array for a value
7143* 'FLOOR':         FLOOR,     Integer floor function
7144* 'FLUSH':         FLUSH,     Flush I/O unit(s)
7145* 'FNUM':          FNUM,      File number function
7146* 'FPUT':          FPUT,      Write a single character in stream mode to stdout
7147* 'FPUTC':         FPUTC,     Write a single character in stream mode
7148* 'FRACTION':      FRACTION,  Fractional part of the model representation
7149* 'FREE':          FREE,      Memory de-allocation subroutine
7150* 'FSEEK':         FSEEK,     Low level file positioning subroutine
7151* 'FSTAT':         FSTAT,     Get file status
7152* 'FTELL':         FTELL,     Current stream position
7153* 'GAMMA':         GAMMA,     Gamma function
7154* 'GERROR':        GERROR,    Get last system error message
7155* 'GETARG':        GETARG,    Get command line arguments
7156* 'GET_COMMAND':   GET_COMMAND, Get the entire command line
7157* 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
7158* 'GETCWD':        GETCWD,    Get current working directory
7159* 'GETENV':        GETENV,    Get an environmental variable
7160* 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
7161* 'GETGID':        GETGID,    Group ID function
7162* 'GETLOG':        GETLOG,    Get login name
7163* 'GETPID':        GETPID,    Process ID function
7164* 'GETUID':        GETUID,    User ID function
7165* 'GMTIME':        GMTIME,    Convert time to GMT info
7166* 'HOSTNM':        HOSTNM,    Get system host name
7167* 'HUGE':          HUGE,      Largest number of a kind
7168* 'HYPOT':         HYPOT,     Euclidean distance function
7169* 'IACHAR':        IACHAR,    Code in ASCII collating sequence
7170* 'IALL':          IALL,      Bitwise AND of array elements
7171* 'IAND':          IAND,      Bitwise logical and
7172* 'IANY':          IANY,      Bitwise OR of array elements
7173* 'IARGC':         IARGC,     Get the number of command line arguments
7174* 'IBCLR':         IBCLR,     Clear bit
7175* 'IBITS':         IBITS,     Bit extraction
7176* 'IBSET':         IBSET,     Set bit
7177* 'ICHAR':         ICHAR,     Character-to-integer conversion function
7178* 'IDATE':         IDATE,     Current local time (day/month/year)
7179* 'IEOR':          IEOR,      Bitwise logical exclusive or
7180* 'IERRNO':        IERRNO,    Function to get the last system error number
7181* 'IMAGE_INDEX':   IMAGE_INDEX, Cosubscript to image index conversion
7182* 'INDEX':         INDEX intrinsic, Position of a substring within a string
7183* 'INT':           INT,       Convert to integer type
7184* 'INT2':          INT2,      Convert to 16-bit integer type
7185* 'INT8':          INT8,      Convert to 64-bit integer type
7186* 'IOR':           IOR,       Bitwise logical or
7187* 'IPARITY':       IPARITY,   Bitwise XOR of array elements
7188* 'IRAND':         IRAND,     Integer pseudo-random number
7189* 'IS_CONTIGUOUS':  IS_CONTIGUOUS, Test whether an array is contiguous
7190* 'IS_IOSTAT_END':  IS_IOSTAT_END, Test for end-of-file value
7191* 'IS_IOSTAT_EOR':  IS_IOSTAT_EOR, Test for end-of-record value
7192* 'ISATTY':        ISATTY,    Whether a unit is a terminal device
7193* 'ISHFT':         ISHFT,     Shift bits
7194* 'ISHFTC':        ISHFTC,    Shift bits circularly
7195* 'ISNAN':         ISNAN,     Tests for a NaN
7196* 'ITIME':         ITIME,     Current local time (hour/minutes/seconds)
7197* 'KILL':          KILL,      Send a signal to a process
7198* 'KIND':          KIND,      Kind of an entity
7199* 'LBOUND':        LBOUND,    Lower dimension bounds of an array
7200* 'LCOBOUND':      LCOBOUND,  Lower codimension bounds of an array
7201* 'LEADZ':         LEADZ,     Number of leading zero bits of an integer
7202* 'LEN':           LEN,       Length of a character entity
7203* 'LEN_TRIM':      LEN_TRIM,  Length of a character entity without trailing blank characters
7204* 'LGE':           LGE,       Lexical greater than or equal
7205* 'LGT':           LGT,       Lexical greater than
7206* 'LINK':          LINK,      Create a hard link
7207* 'LLE':           LLE,       Lexical less than or equal
7208* 'LLT':           LLT,       Lexical less than
7209* 'LNBLNK':        LNBLNK,    Index of the last non-blank character in a string
7210* 'LOC':           LOC,       Returns the address of a variable
7211* 'LOG':           LOG,       Logarithm function
7212* 'LOG10':         LOG10,     Base 10 logarithm function
7213* 'LOG_GAMMA':     LOG_GAMMA, Logarithm of the Gamma function
7214* 'LOGICAL':       LOGICAL,   Convert to logical type
7215* 'LONG':          LONG,      Convert to integer type
7216* 'LSHIFT':        LSHIFT,    Left shift bits
7217* 'LSTAT':         LSTAT,     Get file status
7218* 'LTIME':         LTIME,     Convert time to local time info
7219* 'MALLOC':        MALLOC,    Dynamic memory allocation function
7220* 'MASKL':         MASKL,     Left justified mask
7221* 'MASKR':         MASKR,     Right justified mask
7222* 'MATMUL':        MATMUL,    matrix multiplication
7223* 'MAX':           MAX,       Maximum value of an argument list
7224* 'MAXEXPONENT':   MAXEXPONENT, Maximum exponent of a real kind
7225* 'MAXLOC':        MAXLOC,    Location of the maximum value within an array
7226* 'MAXVAL':        MAXVAL,    Maximum value of an array
7227* 'MCLOCK':        MCLOCK,    Time function
7228* 'MCLOCK8':       MCLOCK8,   Time function (64-bit)
7229* 'MERGE':         MERGE,     Merge arrays
7230* 'MERGE_BITS':    MERGE_BITS, Merge of bits under mask
7231* 'MIN':           MIN,       Minimum value of an argument list
7232* 'MINEXPONENT':   MINEXPONENT, Minimum exponent of a real kind
7233* 'MINLOC':        MINLOC,    Location of the minimum value within an array
7234* 'MINVAL':        MINVAL,    Minimum value of an array
7235* 'MOD':           MOD,       Remainder function
7236* 'MODULO':        MODULO,    Modulo function
7237* 'MOVE_ALLOC':    MOVE_ALLOC, Move allocation from one object to another
7238* 'MVBITS':        MVBITS,    Move bits from one integer to another
7239* 'NEAREST':       NEAREST,   Nearest representable number
7240* 'NEW_LINE':      NEW_LINE,  New line character
7241* 'NINT':          NINT,      Nearest whole number
7242* 'NORM2':         NORM2,     Euclidean vector norm
7243* 'NOT':           NOT,       Logical negation
7244* 'NULL':          NULL,      Function that returns an disassociated pointer
7245* 'NUM_IMAGES':    NUM_IMAGES, Number of images
7246* 'OR':            OR,        Bitwise logical OR
7247* 'PACK':          PACK,      Pack an array into an array of rank one
7248* 'PARITY':        PARITY,    Reduction with exclusive OR
7249* 'PERROR':        PERROR,    Print system error message
7250* 'POPCNT':        POPCNT,    Number of bits set
7251* 'POPPAR':        POPPAR,    Parity of the number of bits set
7252* 'PRECISION':     PRECISION, Decimal precision of a real kind
7253* 'PRESENT':       PRESENT,   Determine whether an optional dummy argument is specified
7254* 'PRODUCT':       PRODUCT,   Product of array elements
7255* 'RADIX':         RADIX,     Base of a data model
7256* 'RAN':           RAN,       Real pseudo-random number
7257* 'RAND':          RAND,      Real pseudo-random number
7258* 'RANDOM_INIT':   RANDOM_INIT, Initialize pseudo-random number generator
7259* 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
7260* 'RANDOM_SEED':   RANDOM_SEED, Initialize a pseudo-random number sequence
7261* 'RANGE':         RANGE,     Decimal exponent range
7262* 'RANK' :         RANK,      Rank of a data object
7263* 'REAL':          REAL,      Convert to real type
7264* 'RENAME':        RENAME,    Rename a file
7265* 'REPEAT':        REPEAT,    Repeated string concatenation
7266* 'RESHAPE':       RESHAPE,   Function to reshape an array
7267* 'RRSPACING':     RRSPACING, Reciprocal of the relative spacing
7268* 'RSHIFT':        RSHIFT,    Right shift bits
7269* 'SAME_TYPE_AS':  SAME_TYPE_AS,  Query dynamic types for equality
7270* 'SCALE':         SCALE,     Scale a real value
7271* 'SCAN':          SCAN,      Scan a string for the presence of a set of characters
7272* 'SECNDS':        SECNDS,    Time function
7273* 'SECOND':        SECOND,    CPU time function
7274* 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND,  Choose character kind
7275* 'SELECTED_INT_KIND': SELECTED_INT_KIND,  Choose integer kind
7276* 'SELECTED_REAL_KIND': SELECTED_REAL_KIND,  Choose real kind
7277* 'SET_EXPONENT':  SET_EXPONENT, Set the exponent of the model
7278* 'SHAPE':         SHAPE,     Determine the shape of an array
7279* 'SHIFTA':        SHIFTA,    Right shift with fill
7280* 'SHIFTL':        SHIFTL,    Left shift
7281* 'SHIFTR':        SHIFTR,    Right shift
7282* 'SIGN':          SIGN,      Sign copying function
7283* 'SIGNAL':        SIGNAL,    Signal handling subroutine (or function)
7284* 'SIN':           SIN,       Sine function
7285* 'SIND':          SIND,      Sine function, degrees
7286* 'SINH':          SINH,      Hyperbolic sine function
7287* 'SIZE':          SIZE,      Function to determine the size of an array
7288* 'SIZEOF':        SIZEOF,    Determine the size in bytes of an expression
7289* 'SLEEP':         SLEEP,     Sleep for the specified number of seconds
7290* 'SPACING':       SPACING,   Smallest distance between two numbers of a given type
7291* 'SPREAD':        SPREAD,    Add a dimension to an array
7292* 'SQRT':          SQRT,      Square-root function
7293* 'SRAND':         SRAND,     Reinitialize the random number generator
7294* 'STAT':          STAT,      Get file status
7295* 'STORAGE_SIZE':  STORAGE_SIZE, Storage size in bits
7296* 'SUM':           SUM,       Sum of array elements
7297* 'SYMLNK':        SYMLNK,    Create a symbolic link
7298* 'SYSTEM':        SYSTEM,    Execute a shell command
7299* 'SYSTEM_CLOCK':  SYSTEM_CLOCK, Time function
7300* 'TAN':           TAN,       Tangent function
7301* 'TAND':          TAND,      Tangent function, degrees
7302* 'TANH':          TANH,      Hyperbolic tangent function
7303* 'THIS_IMAGE':    THIS_IMAGE, Cosubscript index of this image
7304* 'TIME':          TIME,      Time function
7305* 'TIME8':         TIME8,     Time function (64-bit)
7306* 'TINY':          TINY,      Smallest positive number of a real kind
7307* 'TRAILZ':        TRAILZ,    Number of trailing zero bits of an integer
7308* 'TRANSFER':      TRANSFER,  Transfer bit patterns
7309* 'TRANSPOSE':     TRANSPOSE, Transpose an array of rank two
7310* 'TRIM':          TRIM,      Remove trailing blank characters of a string
7311* 'TTYNAM':        TTYNAM,    Get the name of a terminal device.
7312* 'UBOUND':        UBOUND,    Upper dimension bounds of an array
7313* 'UCOBOUND':      UCOBOUND,  Upper codimension bounds of an array
7314* 'UMASK':         UMASK,     Set the file creation mask
7315* 'UNLINK':        UNLINK,    Remove a file from the file system
7316* 'UNPACK':        UNPACK,    Unpack an array of rank one into an array
7317* 'VERIFY':        VERIFY,    Scan a string for the absence of a set of characters
7318* 'XOR':           XOR,       Bitwise logical exclusive or
7319
7320
7321File: gfortran.info,  Node: Introduction to Intrinsics,  Next: ABORT,  Up: Intrinsic Procedures
7322
73239.1 Introduction to intrinsic procedures
7324========================================
7325
7326The intrinsic procedures provided by GNU Fortran include all of the
7327intrinsic procedures required by the Fortran 95 standard, a set of
7328intrinsic procedures for backwards compatibility with G77, and a
7329selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
7330standards.  Any conflict between a description here and a description in
7331either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
73322008 standard is unintentional, and the standard(s) should be considered
7333authoritative.
7334
7335   The enumeration of the 'KIND' type parameter is processor defined in
7336the Fortran 95 standard.  GNU Fortran defines the default integer type
7337and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)',
7338respectively.  The standard mandates that both data types shall have
7339another kind, which have more precision.  On typical target
7340architectures supported by 'gfortran', this kind type parameter is
7341'KIND=8'.  Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent.
7342In the description of generic intrinsic procedures, the kind type
7343parameter will be specified by 'KIND=*', and in the description of
7344specific names for an intrinsic procedure the kind type parameter will
7345be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)').  Finally,
7346for brevity the optional 'KIND=' syntax will be omitted.
7347
7348   Many of the intrinsic procedures take one or more optional arguments.
7349This document follows the convention used in the Fortran 95 standard,
7350and denotes such arguments by square brackets.
7351
7352   GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can
7353be used to restrict the set of intrinsic procedures to a given standard.
7354By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic
7355procedures described here are accepted.  There is one caveat.  For a
7356select group of intrinsic procedures, 'g77' implemented both a function
7357and a subroutine.  Both classes have been implemented in 'gfortran' for
7358backwards compatibility with 'g77'.  It is noted here that these
7359functions and subroutines cannot be intermixed in a given subprogram.
7360In the descriptions that follow, the applicable standard for each
7361intrinsic procedure is noted.
7362
7363
7364File: gfortran.info,  Node: ABORT,  Next: ABS,  Prev: Introduction to Intrinsics,  Up: Intrinsic Procedures
7365
73669.2 'ABORT' -- Abort the program
7367================================
7368
7369_Description_:
7370     'ABORT' causes immediate termination of the program.  On operating
7371     systems that support a core dump, 'ABORT' will produce a core dump.
7372     It will also print a backtrace, unless '-fno-backtrace' is given.
7373
7374_Standard_:
7375     GNU extension
7376
7377_Class_:
7378     Subroutine
7379
7380_Syntax_:
7381     'CALL ABORT'
7382
7383_Return value_:
7384     Does not return.
7385
7386_Example_:
7387          program test_abort
7388            integer :: i = 1, j = 2
7389            if (i /= j) call abort
7390          end program test_abort
7391
7392_See also_:
7393     *note EXIT::, *note KILL::, *note BACKTRACE::
7394
7395
7396File: gfortran.info,  Node: ABS,  Next: ACCESS,  Prev: ABORT,  Up: Intrinsic Procedures
7397
73989.3 'ABS' -- Absolute value
7399===========================
7400
7401_Description_:
7402     'ABS(A)' computes the absolute value of 'A'.
7403
7404_Standard_:
7405     Fortran 77 and later, has overloads that are GNU extensions
7406
7407_Class_:
7408     Elemental function
7409
7410_Syntax_:
7411     'RESULT = ABS(A)'
7412
7413_Arguments_:
7414     A           The type of the argument shall be an 'INTEGER',
7415                 'REAL', or 'COMPLEX'.
7416
7417_Return value_:
7418     The return value is of the same type and kind as the argument
7419     except the return value is 'REAL' for a 'COMPLEX' argument.
7420
7421_Example_:
7422          program test_abs
7423            integer :: i = -1
7424            real :: x = -1.e0
7425            complex :: z = (-1.e0,0.e0)
7426            i = abs(i)
7427            x = abs(x)
7428            x = abs(z)
7429          end program test_abs
7430
7431_Specific names_:
7432     Name           Argument       Return type    Standard
7433     'ABS(A)'       'REAL(4) A'    'REAL(4)'      Fortran 77 and
7434                                                  later
7435     'CABS(A)'      'COMPLEX(4)    'REAL(4)'      Fortran 77 and
7436                    A'                            later
7437     'DABS(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7438                                                  later
7439     'IABS(A)'      'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
7440                    A'                            later
7441     'BABS(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
7442                    A'
7443     'IIABS(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
7444                    A'
7445     'JIABS(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
7446                    A'
7447     'KIABS(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
7448                    A'
7449     'ZABS(A)'      'COMPLEX(8)    'REAL(8)'      GNU extension
7450                    A'
7451     'CDABS(A)'     'COMPLEX(8)    'REAL(8)'      GNU extension
7452                    A'
7453
7454
7455File: gfortran.info,  Node: ACCESS,  Next: ACHAR,  Prev: ABS,  Up: Intrinsic Procedures
7456
74579.4 'ACCESS' -- Checks file access modes
7458========================================
7459
7460_Description_:
7461     'ACCESS(NAME, MODE)' checks whether the file NAME exists, is
7462     readable, writable or executable.  Except for the executable check,
7463     'ACCESS' can be replaced by Fortran 95's 'INQUIRE'.
7464
7465_Standard_:
7466     GNU extension
7467
7468_Class_:
7469     Inquiry function
7470
7471_Syntax_:
7472     'RESULT = ACCESS(NAME, MODE)'
7473
7474_Arguments_:
7475     NAME        Scalar 'CHARACTER' of default kind with the file
7476                 name.  Tailing blank are ignored unless the
7477                 character 'achar(0)' is present, then all
7478                 characters up to and excluding 'achar(0)' are
7479                 used as file name.
7480     MODE        Scalar 'CHARACTER' of default kind with the file
7481                 access mode, may be any concatenation of '"r"'
7482                 (readable), '"w"' (writable) and '"x"'
7483                 (executable), or '" "' to check for existence.
7484
7485_Return value_:
7486     Returns a scalar 'INTEGER', which is '0' if the file is accessible
7487     in the given mode; otherwise or if an invalid argument has been
7488     given for 'MODE' the value '1' is returned.
7489
7490_Example_:
7491          program access_test
7492            implicit none
7493            character(len=*), parameter :: file  = 'test.dat'
7494            character(len=*), parameter :: file2 = 'test.dat  '//achar(0)
7495            if(access(file,' ') == 0) print *, trim(file),' is exists'
7496            if(access(file,'r') == 0) print *, trim(file),' is readable'
7497            if(access(file,'w') == 0) print *, trim(file),' is writable'
7498            if(access(file,'x') == 0) print *, trim(file),' is executable'
7499            if(access(file2,'rwx') == 0) &
7500              print *, trim(file2),' is readable, writable and executable'
7501          end program access_test
7502
7503
7504File: gfortran.info,  Node: ACHAR,  Next: ACOS,  Prev: ACCESS,  Up: Intrinsic Procedures
7505
75069.5 'ACHAR' -- Character in ASCII collating sequence
7507====================================================
7508
7509_Description_:
7510     'ACHAR(I)' returns the character located at position 'I' in the
7511     ASCII collating sequence.
7512
7513_Standard_:
7514     Fortran 77 and later, with KIND argument Fortran 2003 and later
7515
7516_Class_:
7517     Elemental function
7518
7519_Syntax_:
7520     'RESULT = ACHAR(I [, KIND])'
7521
7522_Arguments_:
7523     I           The type shall be 'INTEGER'.
7524     KIND        (Optional) An 'INTEGER' initialization
7525                 expression indicating the kind parameter of the
7526                 result.
7527
7528_Return value_:
7529     The return value is of type 'CHARACTER' with a length of one.  If
7530     the KIND argument is present, the return value is of the specified
7531     kind and of the default kind otherwise.
7532
7533_Example_:
7534          program test_achar
7535            character c
7536            c = achar(32)
7537          end program test_achar
7538
7539_Note_:
7540     See *note ICHAR:: for a discussion of converting between numerical
7541     values and formatted string representations.
7542
7543_See also_:
7544     *note CHAR::, *note IACHAR::, *note ICHAR::
7545
7546
7547File: gfortran.info,  Node: ACOS,  Next: ACOSD,  Prev: ACHAR,  Up: Intrinsic Procedures
7548
75499.6 'ACOS' -- Arccosine function
7550================================
7551
7552_Description_:
7553     'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)').
7554
7555_Standard_:
7556     Fortran 77 and later, for a complex argument Fortran 2008 or later
7557
7558_Class_:
7559     Elemental function
7560
7561_Syntax_:
7562     'RESULT = ACOS(X)'
7563
7564_Arguments_:
7565     X           The type shall either be 'REAL' with a magnitude
7566                 that is less than or equal to one - or the type
7567                 shall be 'COMPLEX'.
7568
7569_Return value_:
7570     The return value is of the same type and kind as X.  The real part
7571     of the result is in radians and lies in the range 0 \leq \Re
7572     \acos(x) \leq \pi.
7573
7574_Example_:
7575          program test_acos
7576            real(8) :: x = 0.866_8
7577            x = acos(x)
7578          end program test_acos
7579
7580_Specific names_:
7581     Name           Argument       Return type    Standard
7582     'ACOS(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
7583                                                  later
7584     'DACOS(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
7585                                                  later
7586
7587_See also_:
7588     Inverse function: *note COS:: Degrees function: *note ACOSD::
7589
7590
7591File: gfortran.info,  Node: ACOSD,  Next: ACOSH,  Prev: ACOS,  Up: Intrinsic Procedures
7592
75939.7 'ACOSD' -- Arccosine function, degrees
7594==========================================
7595
7596_Description_:
7597     'ACOSD(X)' computes the arccosine of X in degrees (inverse of
7598     'COSD(X)').
7599
7600     This function is for compatibility only and should be avoided in
7601     favor of standard constructs wherever possible.
7602
7603_Standard_:
7604     GNU extension, enabled with '-fdec-math'
7605
7606_Class_:
7607     Elemental function
7608
7609_Syntax_:
7610     'RESULT = ACOSD(X)'
7611
7612_Arguments_:
7613     X           The type shall either be 'REAL' with a magnitude
7614                 that is less than or equal to one - or the type
7615                 shall be 'COMPLEX'.
7616
7617_Return value_:
7618     The return value is of the same type and kind as X.  The real part
7619     of the result is in degrees and lies in the range 0 \leq \Re
7620     \acos(x) \leq 180.
7621
7622_Example_:
7623          program test_acosd
7624            real(8) :: x = 0.866_8
7625            x = acosd(x)
7626          end program test_acosd
7627
7628_Specific names_:
7629     Name           Argument       Return type    Standard
7630     'ACOSD(X)'     'REAL(4) X'    'REAL(4)'      GNU extension
7631     'DACOSD(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
7632
7633_See also_:
7634     Inverse function: *note COSD:: Radians function: *note ACOS::
7635
7636
7637File: gfortran.info,  Node: ACOSH,  Next: ADJUSTL,  Prev: ACOSD,  Up: Intrinsic Procedures
7638
76399.8 'ACOSH' -- Inverse hyperbolic cosine function
7640=================================================
7641
7642_Description_:
7643     'ACOSH(X)' computes the inverse hyperbolic cosine of X.
7644
7645_Standard_:
7646     Fortran 2008 and later
7647
7648_Class_:
7649     Elemental function
7650
7651_Syntax_:
7652     'RESULT = ACOSH(X)'
7653
7654_Arguments_:
7655     X           The type shall be 'REAL' or 'COMPLEX'.
7656
7657_Return value_:
7658     The return value has the same type and kind as X.  If X is complex,
7659     the imaginary part of the result is in radians and lies between 0
7660     \leq \Im \acosh(x) \leq \pi.
7661
7662_Example_:
7663          PROGRAM test_acosh
7664            REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
7665            WRITE (*,*) ACOSH(x)
7666          END PROGRAM
7667
7668_Specific names_:
7669     Name           Argument       Return type    Standard
7670     'DACOSH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
7671
7672_See also_:
7673     Inverse function: *note COSH::
7674
7675
7676File: gfortran.info,  Node: ADJUSTL,  Next: ADJUSTR,  Prev: ACOSH,  Up: Intrinsic Procedures
7677
76789.9 'ADJUSTL' -- Left adjust a string
7679=====================================
7680
7681_Description_:
7682     'ADJUSTL(STRING)' will left adjust a string by removing leading
7683     spaces.  Spaces are inserted at the end of the string as needed.
7684
7685_Standard_:
7686     Fortran 90 and later
7687
7688_Class_:
7689     Elemental function
7690
7691_Syntax_:
7692     'RESULT = ADJUSTL(STRING)'
7693
7694_Arguments_:
7695     STRING      The type shall be 'CHARACTER'.
7696
7697_Return value_:
7698     The return value is of type 'CHARACTER' and of the same kind as
7699     STRING where leading spaces are removed and the same number of
7700     spaces are inserted on the end of STRING.
7701
7702_Example_:
7703          program test_adjustl
7704            character(len=20) :: str = '   gfortran'
7705            str = adjustl(str)
7706            print *, str
7707          end program test_adjustl
7708
7709_See also_:
7710     *note ADJUSTR::, *note TRIM::
7711
7712
7713File: gfortran.info,  Node: ADJUSTR,  Next: AIMAG,  Prev: ADJUSTL,  Up: Intrinsic Procedures
7714
77159.10 'ADJUSTR' -- Right adjust a string
7716=======================================
7717
7718_Description_:
7719     'ADJUSTR(STRING)' will right adjust a string by removing trailing
7720     spaces.  Spaces are inserted at the start of the string as needed.
7721
7722_Standard_:
7723     Fortran 90 and later
7724
7725_Class_:
7726     Elemental function
7727
7728_Syntax_:
7729     'RESULT = ADJUSTR(STRING)'
7730
7731_Arguments_:
7732     STR         The type shall be 'CHARACTER'.
7733
7734_Return value_:
7735     The return value is of type 'CHARACTER' and of the same kind as
7736     STRING where trailing spaces are removed and the same number of
7737     spaces are inserted at the start of STRING.
7738
7739_Example_:
7740          program test_adjustr
7741            character(len=20) :: str = 'gfortran'
7742            str = adjustr(str)
7743            print *, str
7744          end program test_adjustr
7745
7746_See also_:
7747     *note ADJUSTL::, *note TRIM::
7748
7749
7750File: gfortran.info,  Node: AIMAG,  Next: AINT,  Prev: ADJUSTR,  Up: Intrinsic Procedures
7751
77529.11 'AIMAG' -- Imaginary part of complex number
7753================================================
7754
7755_Description_:
7756     'AIMAG(Z)' yields the imaginary part of complex argument 'Z'.  The
7757     'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for
7758     compatibility with 'g77', and their use in new code is strongly
7759     discouraged.
7760
7761_Standard_:
7762     Fortran 77 and later, has overloads that are GNU extensions
7763
7764_Class_:
7765     Elemental function
7766
7767_Syntax_:
7768     'RESULT = AIMAG(Z)'
7769
7770_Arguments_:
7771     Z           The type of the argument shall be 'COMPLEX'.
7772
7773_Return value_:
7774     The return value is of type 'REAL' with the kind type parameter of
7775     the argument.
7776
7777_Example_:
7778          program test_aimag
7779            complex(4) z4
7780            complex(8) z8
7781            z4 = cmplx(1.e0_4, 0.e0_4)
7782            z8 = cmplx(0.e0_8, 1.e0_8)
7783            print *, aimag(z4), dimag(z8)
7784          end program test_aimag
7785
7786_Specific names_:
7787     Name           Argument       Return type    Standard
7788     'AIMAG(Z)'     'COMPLEX Z'    'REAL'         Fortran 77 and
7789                                                  later
7790     'DIMAG(Z)'     'COMPLEX(8)    'REAL(8)'      GNU extension
7791                    Z'
7792     'IMAG(Z)'      'COMPLEX Z'    'REAL'         GNU extension
7793     'IMAGPART(Z)'  'COMPLEX Z'    'REAL'         GNU extension
7794
7795
7796File: gfortran.info,  Node: AINT,  Next: ALARM,  Prev: AIMAG,  Up: Intrinsic Procedures
7797
77989.12 'AINT' -- Truncate to a whole number
7799=========================================
7800
7801_Description_:
7802     'AINT(A [, KIND])' truncates its argument to a whole number.
7803
7804_Standard_:
7805     Fortran 77 and later
7806
7807_Class_:
7808     Elemental function
7809
7810_Syntax_:
7811     'RESULT = AINT(A [, KIND])'
7812
7813_Arguments_:
7814     A           The type of the argument shall be 'REAL'.
7815     KIND        (Optional) An 'INTEGER' initialization
7816                 expression indicating the kind parameter of the
7817                 result.
7818
7819_Return value_:
7820     The return value is of type 'REAL' with the kind type parameter of
7821     the argument if the optional KIND is absent; otherwise, the kind
7822     type parameter will be given by KIND.  If the magnitude of X is
7823     less than one, 'AINT(X)' returns zero.  If the magnitude is equal
7824     to or greater than one then it returns the largest whole number
7825     that does not exceed its magnitude.  The sign is the same as the
7826     sign of X.
7827
7828_Example_:
7829          program test_aint
7830            real(4) x4
7831            real(8) x8
7832            x4 = 1.234E0_4
7833            x8 = 4.321_8
7834            print *, aint(x4), dint(x8)
7835            x8 = aint(x4,8)
7836          end program test_aint
7837
7838_Specific names_:
7839     Name           Argument       Return type    Standard
7840     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
7841                                                  later
7842     'DINT(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7843                                                  later
7844
7845
7846File: gfortran.info,  Node: ALARM,  Next: ALL,  Prev: AINT,  Up: Intrinsic Procedures
7847
78489.13 'ALARM' -- Execute a routine after a given delay
7849=====================================================
7850
7851_Description_:
7852     'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
7853     HANDLER to be executed after a delay of SECONDS by using 'alarm(2)'
7854     to set up a signal and 'signal(2)' to catch it.  If STATUS is
7855     supplied, it will be returned with the number of seconds remaining
7856     until any previously scheduled alarm was due to be delivered, or
7857     zero if there was no previously scheduled alarm.
7858
7859_Standard_:
7860     GNU extension
7861
7862_Class_:
7863     Subroutine
7864
7865_Syntax_:
7866     'CALL ALARM(SECONDS, HANDLER [, STATUS])'
7867
7868_Arguments_:
7869     SECONDS     The type of the argument shall be a scalar
7870                 'INTEGER'.  It is 'INTENT(IN)'.
7871     HANDLER     Signal handler ('INTEGER FUNCTION' or
7872                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
7873                 The scalar values may be either 'SIG_IGN=1' to
7874                 ignore the alarm generated or 'SIG_DFL=0' to set
7875                 the default action.  It is 'INTENT(IN)'.
7876     STATUS      (Optional) STATUS shall be a scalar variable of
7877                 the default 'INTEGER' kind.  It is
7878                 'INTENT(OUT)'.
7879
7880_Example_:
7881          program test_alarm
7882            external handler_print
7883            integer i
7884            call alarm (3, handler_print, i)
7885            print *, i
7886            call sleep(10)
7887          end program test_alarm
7888     This will cause the external routine HANDLER_PRINT to be called
7889     after 3 seconds.
7890
7891
7892File: gfortran.info,  Node: ALL,  Next: ALLOCATED,  Prev: ALARM,  Up: Intrinsic Procedures
7893
78949.14 'ALL' -- All values in MASK along DIM are true
7895===================================================
7896
7897_Description_:
7898     'ALL(MASK [, DIM])' determines if all the values are true in MASK
7899     in the array along dimension DIM.
7900
7901_Standard_:
7902     Fortran 90 and later
7903
7904_Class_:
7905     Transformational function
7906
7907_Syntax_:
7908     'RESULT = ALL(MASK [, DIM])'
7909
7910_Arguments_:
7911     MASK        The type of the argument shall be 'LOGICAL' and
7912                 it shall not be scalar.
7913     DIM         (Optional) DIM shall be a scalar integer with a
7914                 value that lies between one and the rank of
7915                 MASK.
7916
7917_Return value_:
7918     'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind
7919     type parameter is the same as the kind type parameter of MASK.  If
7920     DIM is present, then 'ALL(MASK, DIM)' returns an array with the
7921     rank of MASK minus 1.  The shape is determined from the shape of
7922     MASK where the DIM dimension is elided.
7923
7924     (A)
7925          'ALL(MASK)' is true if all elements of MASK are true.  It also
7926          is true if MASK has zero size; otherwise, it is false.
7927     (B)
7928          If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent
7929          to 'ALL(MASK)'.  If the rank is greater than one, then
7930          'ALL(MASK,DIM)' is determined by applying 'ALL' to the array
7931          sections.
7932
7933_Example_:
7934          program test_all
7935            logical l
7936            l = all((/.true., .true., .true./))
7937            print *, l
7938            call section
7939            contains
7940              subroutine section
7941                integer a(2,3), b(2,3)
7942                a = 1
7943                b = 1
7944                b(2,2) = 2
7945                print *, all(a .eq. b, 1)
7946                print *, all(a .eq. b, 2)
7947              end subroutine section
7948          end program test_all
7949
7950
7951File: gfortran.info,  Node: ALLOCATED,  Next: AND,  Prev: ALL,  Up: Intrinsic Procedures
7952
79539.15 'ALLOCATED' -- Status of an allocatable entity
7954===================================================
7955
7956_Description_:
7957     'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation
7958     status of ARRAY and SCALAR, respectively.
7959
7960_Standard_:
7961     Fortran 90 and later.  Note, the 'SCALAR=' keyword and allocatable
7962     scalar entities are available in Fortran 2003 and later.
7963
7964_Class_:
7965     Inquiry function
7966
7967_Syntax_:
7968     'RESULT = ALLOCATED(ARRAY)'
7969     'RESULT = ALLOCATED(SCALAR)'
7970
7971_Arguments_:
7972     ARRAY       The argument shall be an 'ALLOCATABLE' array.
7973     SCALAR      The argument shall be an 'ALLOCATABLE' scalar.
7974
7975_Return value_:
7976     The return value is a scalar 'LOGICAL' with the default logical
7977     kind type parameter.  If the argument is allocated, then the result
7978     is '.TRUE.'; otherwise, it returns '.FALSE.'
7979
7980_Example_:
7981          program test_allocated
7982            integer :: i = 4
7983            real(4), allocatable :: x(:)
7984            if (.not. allocated(x)) allocate(x(i))
7985          end program test_allocated
7986
7987
7988File: gfortran.info,  Node: AND,  Next: ANINT,  Prev: ALLOCATED,  Up: Intrinsic Procedures
7989
79909.16 'AND' -- Bitwise logical AND
7991=================================
7992
7993_Description_:
7994     Bitwise logical 'AND'.
7995
7996     This intrinsic routine is provided for backwards compatibility with
7997     GNU Fortran 77.  For integer arguments, programmers should consider
7998     the use of the *note IAND:: intrinsic defined by the Fortran
7999     standard.
8000
8001_Standard_:
8002     GNU extension
8003
8004_Class_:
8005     Function
8006
8007_Syntax_:
8008     'RESULT = AND(I, J)'
8009
8010_Arguments_:
8011     I           The type shall be either a scalar 'INTEGER' type
8012                 or a scalar 'LOGICAL' type or a
8013                 boz-literal-constant.
8014     J           The type shall be the same as the type of I or a
8015                 boz-literal-constant.  I and J shall not both be
8016                 boz-literal-constants.  If either I or J is a
8017                 boz-literal-constant, then the other argument
8018                 must be a scalar 'INTEGER'.
8019
8020_Return value_:
8021     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
8022     If the kind type parameters differ, then the smaller kind type is
8023     implicitly converted to larger kind, and the return has the larger
8024     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
8025     kind type parameter of the other argument as-if a call to *note
8026     INT:: occurred.
8027
8028_Example_:
8029          PROGRAM test_and
8030            LOGICAL :: T = .TRUE., F = .FALSE.
8031            INTEGER :: a, b
8032            DATA a / Z'F' /, b / Z'3' /
8033
8034            WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
8035            WRITE (*,*) AND(a, b)
8036          END PROGRAM
8037
8038_See also_:
8039     Fortran 95 elemental function: *note IAND::
8040
8041
8042File: gfortran.info,  Node: ANINT,  Next: ANY,  Prev: AND,  Up: Intrinsic Procedures
8043
80449.17 'ANINT' -- Nearest whole number
8045====================================
8046
8047_Description_:
8048     'ANINT(A [, KIND])' rounds its argument to the nearest whole
8049     number.
8050
8051_Standard_:
8052     Fortran 77 and later
8053
8054_Class_:
8055     Elemental function
8056
8057_Syntax_:
8058     'RESULT = ANINT(A [, KIND])'
8059
8060_Arguments_:
8061     A           The type of the argument shall be 'REAL'.
8062     KIND        (Optional) An 'INTEGER' initialization
8063                 expression indicating the kind parameter of the
8064                 result.
8065
8066_Return value_:
8067     The return value is of type real with the kind type parameter of
8068     the argument if the optional KIND is absent; otherwise, the kind
8069     type parameter will be given by KIND.  If A is greater than zero,
8070     'ANINT(A)' returns 'AINT(X+0.5)'.  If A is less than or equal to
8071     zero then it returns 'AINT(X-0.5)'.
8072
8073_Example_:
8074          program test_anint
8075            real(4) x4
8076            real(8) x8
8077            x4 = 1.234E0_4
8078            x8 = 4.321_8
8079            print *, anint(x4), dnint(x8)
8080            x8 = anint(x4,8)
8081          end program test_anint
8082
8083_Specific names_:
8084     Name           Argument       Return type    Standard
8085     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
8086                                                  later
8087     'DNINT(A)'     'REAL(8) A'    'REAL(8)'      Fortran 77 and
8088                                                  later
8089
8090
8091File: gfortran.info,  Node: ANY,  Next: ASIN,  Prev: ANINT,  Up: Intrinsic Procedures
8092
80939.18 'ANY' -- Any value in MASK along DIM is true
8094=================================================
8095
8096_Description_:
8097     'ANY(MASK [, DIM])' determines if any of the values in the logical
8098     array MASK along dimension DIM are '.TRUE.'.
8099
8100_Standard_:
8101     Fortran 90 and later
8102
8103_Class_:
8104     Transformational function
8105
8106_Syntax_:
8107     'RESULT = ANY(MASK [, DIM])'
8108
8109_Arguments_:
8110     MASK        The type of the argument shall be 'LOGICAL' and
8111                 it shall not be scalar.
8112     DIM         (Optional) DIM shall be a scalar integer with a
8113                 value that lies between one and the rank of
8114                 MASK.
8115
8116_Return value_:
8117     'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind
8118     type parameter is the same as the kind type parameter of MASK.  If
8119     DIM is present, then 'ANY(MASK, DIM)' returns an array with the
8120     rank of MASK minus 1.  The shape is determined from the shape of
8121     MASK where the DIM dimension is elided.
8122
8123     (A)
8124          'ANY(MASK)' is true if any element of MASK is true; otherwise,
8125          it is false.  It also is false if MASK has zero size.
8126     (B)
8127          If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent
8128          to 'ANY(MASK)'.  If the rank is greater than one, then
8129          'ANY(MASK,DIM)' is determined by applying 'ANY' to the array
8130          sections.
8131
8132_Example_:
8133          program test_any
8134            logical l
8135            l = any((/.true., .true., .true./))
8136            print *, l
8137            call section
8138            contains
8139              subroutine section
8140                integer a(2,3), b(2,3)
8141                a = 1
8142                b = 1
8143                b(2,2) = 2
8144                print *, any(a .eq. b, 1)
8145                print *, any(a .eq. b, 2)
8146              end subroutine section
8147          end program test_any
8148
8149
8150File: gfortran.info,  Node: ASIN,  Next: ASIND,  Prev: ANY,  Up: Intrinsic Procedures
8151
81529.19 'ASIN' -- Arcsine function
8153===============================
8154
8155_Description_:
8156     'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)').
8157
8158_Standard_:
8159     Fortran 77 and later, for a complex argument Fortran 2008 or later
8160
8161_Class_:
8162     Elemental function
8163
8164_Syntax_:
8165     'RESULT = ASIN(X)'
8166
8167_Arguments_:
8168     X           The type shall be either 'REAL' and a magnitude
8169                 that is less than or equal to one - or be
8170                 'COMPLEX'.
8171
8172_Return value_:
8173     The return value is of the same type and kind as X.  The real part
8174     of the result is in radians and lies in the range -\pi/2 \leq \Re
8175     \asin(x) \leq \pi/2.
8176
8177_Example_:
8178          program test_asin
8179            real(8) :: x = 0.866_8
8180            x = asin(x)
8181          end program test_asin
8182
8183_Specific names_:
8184     Name           Argument       Return type    Standard
8185     'ASIN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
8186                                                  later
8187     'DASIN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
8188                                                  later
8189
8190_See also_:
8191     Inverse function: *note SIN:: Degrees function: *note ASIND::
8192
8193
8194File: gfortran.info,  Node: ASIND,  Next: ASINH,  Prev: ASIN,  Up: Intrinsic Procedures
8195
81969.20 'ASIND' -- Arcsine function, degrees
8197=========================================
8198
8199_Description_:
8200     'ASIND(X)' computes the arcsine of its X in degrees (inverse of
8201     'SIND(X)').
8202
8203     This function is for compatibility only and should be avoided in
8204     favor of standard constructs wherever possible.
8205
8206_Standard_:
8207     GNU extension, enabled with '-fdec-math'.
8208
8209_Class_:
8210     Elemental function
8211
8212_Syntax_:
8213     'RESULT = ASIND(X)'
8214
8215_Arguments_:
8216     X           The type shall be either 'REAL' and a magnitude
8217                 that is less than or equal to one - or be
8218                 'COMPLEX'.
8219
8220_Return value_:
8221     The return value is of the same type and kind as X.  The real part
8222     of the result is in degrees and lies in the range -90 \leq \Re
8223     \asin(x) \leq 90.
8224
8225_Example_:
8226          program test_asind
8227            real(8) :: x = 0.866_8
8228            x = asind(x)
8229          end program test_asind
8230
8231_Specific names_:
8232     Name           Argument       Return type    Standard
8233     'ASIND(X)'     'REAL(4) X'    'REAL(4)'      GNU extension
8234     'DASIND(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8235
8236_See also_:
8237     Inverse function: *note SIND:: Radians function: *note ASIN::
8238
8239
8240File: gfortran.info,  Node: ASINH,  Next: ASSOCIATED,  Prev: ASIND,  Up: Intrinsic Procedures
8241
82429.21 'ASINH' -- Inverse hyperbolic sine function
8243================================================
8244
8245_Description_:
8246     'ASINH(X)' computes the inverse hyperbolic sine of X.
8247
8248_Standard_:
8249     Fortran 2008 and later
8250
8251_Class_:
8252     Elemental function
8253
8254_Syntax_:
8255     'RESULT = ASINH(X)'
8256
8257_Arguments_:
8258     X           The type shall be 'REAL' or 'COMPLEX'.
8259
8260_Return value_:
8261     The return value is of the same type and kind as X.  If X is
8262     complex, the imaginary part of the result is in radians and lies
8263     between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
8264
8265_Example_:
8266          PROGRAM test_asinh
8267            REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
8268            WRITE (*,*) ASINH(x)
8269          END PROGRAM
8270
8271_Specific names_:
8272     Name           Argument       Return type    Standard
8273     'DASINH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension.
8274
8275_See also_:
8276     Inverse function: *note SINH::
8277
8278
8279File: gfortran.info,  Node: ASSOCIATED,  Next: ATAN,  Prev: ASINH,  Up: Intrinsic Procedures
8280
82819.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair
8282===============================================================
8283
8284_Description_:
8285     'ASSOCIATED(POINTER [, TARGET])' determines the status of the
8286     pointer POINTER or if POINTER is associated with the target TARGET.
8287
8288_Standard_:
8289     Fortran 90 and later
8290
8291_Class_:
8292     Inquiry function
8293
8294_Syntax_:
8295     'RESULT = ASSOCIATED(POINTER [, TARGET])'
8296
8297_Arguments_:
8298     POINTER     POINTER shall have the 'POINTER' attribute and
8299                 it can be of any type.
8300     TARGET      (Optional) TARGET shall be a pointer or a
8301                 target.  It must have the same type, kind type
8302                 parameter, and array rank as POINTER.
8303     The association status of neither POINTER nor TARGET shall be
8304     undefined.
8305
8306_Return value_:
8307     'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'.
8308     There are several cases:
8309     (A) When the optional TARGET is not present then
8310          'ASSOCIATED(POINTER)' is true if POINTER is associated with a
8311          target; otherwise, it returns false.
8312     (B) If TARGET is present and a scalar target, the result is true if
8313          TARGET is not a zero-sized storage sequence and the target
8314          associated with POINTER occupies the same storage units.  If
8315          POINTER is disassociated, the result is false.
8316     (C) If TARGET is present and an array target, the result is true if
8317          TARGET and POINTER have the same shape, are not zero-sized
8318          arrays, are arrays whose elements are not zero-sized storage
8319          sequences, and TARGET and POINTER occupy the same storage
8320          units in array element order.  As in case(B), the result is
8321          false, if POINTER is disassociated.
8322     (D) If TARGET is present and an scalar pointer, the result is true
8323          if TARGET is associated with POINTER, the target associated
8324          with TARGET are not zero-sized storage sequences and occupy
8325          the same storage units.  The result is false, if either TARGET
8326          or POINTER is disassociated.
8327     (E) If TARGET is present and an array pointer, the result is true if
8328          target associated with POINTER and the target associated with
8329          TARGET have the same shape, are not zero-sized arrays, are
8330          arrays whose elements are not zero-sized storage sequences,
8331          and TARGET and POINTER occupy the same storage units in array
8332          element order.  The result is false, if either TARGET or
8333          POINTER is disassociated.
8334
8335_Example_:
8336          program test_associated
8337             implicit none
8338             real, target  :: tgt(2) = (/1., 2./)
8339             real, pointer :: ptr(:)
8340             ptr => tgt
8341             if (associated(ptr)     .eqv. .false.) call abort
8342             if (associated(ptr,tgt) .eqv. .false.) call abort
8343          end program test_associated
8344
8345_See also_:
8346     *note NULL::
8347
8348
8349File: gfortran.info,  Node: ATAN,  Next: ATAND,  Prev: ASSOCIATED,  Up: Intrinsic Procedures
8350
83519.23 'ATAN' -- Arctangent function
8352==================================
8353
8354_Description_:
8355     'ATAN(X)' computes the arctangent of X.
8356
8357_Standard_:
8358     Fortran 77 and later, for a complex argument and for two arguments
8359     Fortran 2008 or later
8360
8361_Class_:
8362     Elemental function
8363
8364_Syntax_:
8365     'RESULT = ATAN(X)'
8366     'RESULT = ATAN(Y, X)'
8367
8368_Arguments_:
8369     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8370                 present, X shall be REAL.
8371     Y           The type and kind type parameter shall be the
8372                 same as X.
8373
8374_Return value_:
8375     The return value is of the same type and kind as X.  If Y is
8376     present, the result is identical to 'ATAN2(Y,X)'.  Otherwise, it
8377     the arcus tangent of X, where the real part of the result is in
8378     radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
8379
8380_Example_:
8381          program test_atan
8382            real(8) :: x = 2.866_8
8383            x = atan(x)
8384          end program test_atan
8385
8386_Specific names_:
8387     Name           Argument       Return type    Standard
8388     'ATAN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
8389                                                  later
8390     'DATAN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
8391                                                  later
8392
8393_See also_:
8394     Inverse function: *note TAN:: Degrees function: *note ATAND::
8395
8396
8397File: gfortran.info,  Node: ATAND,  Next: ATAN2,  Prev: ATAN,  Up: Intrinsic Procedures
8398
83999.24 'ATAND' -- Arctangent function, degrees
8400============================================
8401
8402_Description_:
8403     'ATAND(X)' computes the arctangent of X in degrees (inverse of
8404     *note TAND::).
8405
8406     This function is for compatibility only and should be avoided in
8407     favor of standard constructs wherever possible.
8408
8409_Standard_:
8410     GNU extension, enabled with '-fdec-math'.
8411
8412_Class_:
8413     Elemental function
8414
8415_Syntax_:
8416     'RESULT = ATAND(X)'
8417     'RESULT = ATAND(Y, X)'
8418
8419_Arguments_:
8420     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8421                 present, X shall be REAL.
8422     Y           The type and kind type parameter shall be the
8423                 same as X.
8424
8425_Return value_:
8426     The return value is of the same type and kind as X.  If Y is
8427     present, the result is identical to 'ATAND2(Y,X)'.  Otherwise, it
8428     is the arcus tangent of X, where the real part of the result is in
8429     degrees and lies in the range -90 \leq \Re \atand(x) \leq 90.
8430
8431_Example_:
8432          program test_atand
8433            real(8) :: x = 2.866_8
8434            x = atand(x)
8435          end program test_atand
8436
8437_Specific names_:
8438     Name           Argument       Return type    Standard
8439     'ATAND(X)'     'REAL(4) X'    'REAL(4)'      GNU extension
8440     'DATAND(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8441
8442_See also_:
8443     Inverse function: *note TAND:: Radians function: *note ATAN::
8444
8445
8446File: gfortran.info,  Node: ATAN2,  Next: ATAN2D,  Prev: ATAND,  Up: Intrinsic Procedures
8447
84489.25 'ATAN2' -- Arctangent function
8449===================================
8450
8451_Description_:
8452     'ATAN2(Y, X)' computes the principal value of the argument function
8453     of the complex number X + i Y.  This function can be used to
8454     transform from Cartesian into polar coordinates and allows to
8455     determine the angle in the correct quadrant.
8456
8457_Standard_:
8458     Fortran 77 and later
8459
8460_Class_:
8461     Elemental function
8462
8463_Syntax_:
8464     'RESULT = ATAN2(Y, X)'
8465
8466_Arguments_:
8467     Y           The type shall be 'REAL'.
8468     X           The type and kind type parameter shall be the
8469                 same as Y.  If Y is zero, then X must be
8470                 nonzero.
8471
8472_Return value_:
8473     The return value has the same type and kind type parameter as Y.
8474     It is the principal value of the complex number X + i Y.  If X is
8475     nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
8476     The sign is positive if Y is positive.  If Y is zero, then the
8477     return value is zero if X is strictly positive, \pi if X is
8478     negative and Y is positive zero (or the processor does not handle
8479     signed zeros), and -\pi if X is negative and Y is negative zero.
8480     Finally, if X is zero, then the magnitude of the result is \pi/2.
8481
8482_Example_:
8483          program test_atan2
8484            real(4) :: x = 1.e0_4, y = 0.5e0_4
8485            x = atan2(y,x)
8486          end program test_atan2
8487
8488_Specific names_:
8489     Name           Argument       Return type    Standard
8490     'ATAN2(X,      'REAL(4) X,    'REAL(4)'      Fortran 77 and
8491     Y)'            Y'                            later
8492     'DATAN2(X,     'REAL(8) X,    'REAL(8)'      Fortran 77 and
8493     Y)'            Y'                            later
8494
8495_See also_:
8496     Alias: *note ATAN:: Degrees function: *note ATAN2D::
8497
8498
8499File: gfortran.info,  Node: ATAN2D,  Next: ATANH,  Prev: ATAN2,  Up: Intrinsic Procedures
8500
85019.26 'ATAN2D' -- Arctangent function, degrees
8502=============================================
8503
8504_Description_:
8505     'ATAN2D(Y, X)' computes the principal value of the argument
8506     function of the complex number X + i Y in degrees.  This function
8507     can be used to transform from Cartesian into polar coordinates and
8508     allows to determine the angle in the correct quadrant.
8509
8510     This function is for compatibility only and should be avoided in
8511     favor of standard constructs wherever possible.
8512
8513_Standard_:
8514     GNU extension, enabled with '-fdec-math'.
8515
8516_Class_:
8517     Elemental function
8518
8519_Syntax_:
8520     'RESULT = ATAN2D(Y, X)'
8521
8522_Arguments_:
8523     Y           The type shall be 'REAL'.
8524     X           The type and kind type parameter shall be the
8525                 same as Y.  If Y is zero, then X must be
8526                 nonzero.
8527
8528_Return value_:
8529     The return value has the same type and kind type parameter as Y.
8530     It is the principal value of the complex number X + i Y.  If X is
8531     nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
8532     The sign is positive if Y is positive.  If Y is zero, then the
8533     return value is zero if X is strictly positive, 180 if X is
8534     negative and Y is positive zero (or the processor does not handle
8535     signed zeros), and -180 if X is negative and Y is negative zero.
8536     Finally, if X is zero, then the magnitude of the result is 90.
8537
8538_Example_:
8539          program test_atan2d
8540            real(4) :: x = 1.e0_4, y = 0.5e0_4
8541            x = atan2d(y,x)
8542          end program test_atan2d
8543
8544_Specific names_:
8545     Name           Argument       Return type    Standard
8546     'ATAN2D(X,     'REAL(4) X,    'REAL(4)'      GNU extension
8547     Y)'            Y'
8548     'DATAN2D(X,    'REAL(8) X,    'REAL(8)'      GNU extension
8549     Y)'            Y'
8550
8551_See also_:
8552     Alias: *note ATAND:: Radians function: *note ATAN2::
8553
8554
8555File: gfortran.info,  Node: ATANH,  Next: ATOMIC_ADD,  Prev: ATAN2D,  Up: Intrinsic Procedures
8556
85579.27 'ATANH' -- Inverse hyperbolic tangent function
8558===================================================
8559
8560_Description_:
8561     'ATANH(X)' computes the inverse hyperbolic tangent of X.
8562
8563_Standard_:
8564     Fortran 2008 and later
8565
8566_Class_:
8567     Elemental function
8568
8569_Syntax_:
8570     'RESULT = ATANH(X)'
8571
8572_Arguments_:
8573     X           The type shall be 'REAL' or 'COMPLEX'.
8574
8575_Return value_:
8576     The return value has same type and kind as X.  If X is complex, the
8577     imaginary part of the result is in radians and lies between -\pi/2
8578     \leq \Im \atanh(x) \leq \pi/2.
8579
8580_Example_:
8581          PROGRAM test_atanh
8582            REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
8583            WRITE (*,*) ATANH(x)
8584          END PROGRAM
8585
8586_Specific names_:
8587     Name           Argument       Return type    Standard
8588     'DATANH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8589
8590_See also_:
8591     Inverse function: *note TANH::
8592
8593
8594File: gfortran.info,  Node: ATOMIC_ADD,  Next: ATOMIC_AND,  Prev: ATANH,  Up: Intrinsic Procedures
8595
85969.28 'ATOMIC_ADD' -- Atomic ADD operation
8597=========================================
8598
8599_Description_:
8600     'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
8601     variable ATOM.  When STAT is present and the invocation was
8602     successful, it is assigned the value 0.  If it is present and the
8603     invocation has failed, it is assigned a positive value; in
8604     particular, for a coindexed ATOM, if the remote image has stopped,
8605     it is assigned the value of 'ISO_FORTRAN_ENV''s
8606     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8607     'STAT_FAILED_IMAGE'.
8608
8609_Standard_:
8610     TS 18508 or later
8611
8612_Class_:
8613     Atomic subroutine
8614
8615_Syntax_:
8616     'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
8617
8618_Arguments_:
8619     ATOM        Scalar coarray or coindexed variable of integer
8620                 type with 'ATOMIC_INT_KIND' kind.
8621     VALUE       Scalar of the same type as ATOM.  If the kind is
8622                 different, the value is converted to the kind of
8623                 ATOM.
8624     STAT        (optional) Scalar default-kind integer variable.
8625
8626_Example_:
8627          program atomic
8628            use iso_fortran_env
8629            integer(atomic_int_kind) :: atom[*]
8630            call atomic_add (atom[1], this_image())
8631          end program atomic
8632
8633_See also_:
8634     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
8635     ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8636     ATOMIC_XOR::
8637
8638
8639File: gfortran.info,  Node: ATOMIC_AND,  Next: ATOMIC_CAS,  Prev: ATOMIC_ADD,  Up: Intrinsic Procedures
8640
86419.29 'ATOMIC_AND' -- Atomic bitwise AND operation
8642=================================================
8643
8644_Description_:
8645     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
8646     AND between the values of ATOM and VALUE.  When STAT is present and
8647     the invocation was successful, it is assigned the value 0.  If it
8648     is present and the invocation has failed, it is assigned a positive
8649     value; in particular, for a coindexed ATOM, if the remote image has
8650     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8651     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8652     'STAT_FAILED_IMAGE'.
8653
8654_Standard_:
8655     TS 18508 or later
8656
8657_Class_:
8658     Atomic subroutine
8659
8660_Syntax_:
8661     'CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
8662
8663_Arguments_:
8664     ATOM        Scalar coarray or coindexed variable of integer
8665                 type with 'ATOMIC_INT_KIND' kind.
8666     VALUE       Scalar of the same type as ATOM.  If the kind is
8667                 different, the value is converted to the kind of
8668                 ATOM.
8669     STAT        (optional) Scalar default-kind integer variable.
8670
8671_Example_:
8672          program atomic
8673            use iso_fortran_env
8674            integer(atomic_int_kind) :: atom[*]
8675            call atomic_and (atom[1], int(b'10100011101'))
8676          end program atomic
8677
8678_See also_:
8679     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
8680     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8681     ATOMIC_XOR::
8682
8683
8684File: gfortran.info,  Node: ATOMIC_CAS,  Next: ATOMIC_DEFINE,  Prev: ATOMIC_AND,  Up: Intrinsic Procedures
8685
86869.30 'ATOMIC_CAS' -- Atomic compare and swap
8687============================================
8688
8689_Description_:
8690     'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
8691     if the value is the same, ATOM is set to the value of NEW.
8692     Additionally, OLD is set to the value of ATOM that was used for the
8693     comparison.  When STAT is present and the invocation was
8694     successful, it is assigned the value 0.  If it is present and the
8695     invocation has failed, it is assigned a positive value; in
8696     particular, for a coindexed ATOM, if the remote image has stopped,
8697     it is assigned the value of 'ISO_FORTRAN_ENV''s
8698     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8699     'STAT_FAILED_IMAGE'.
8700
8701_Standard_:
8702     TS 18508 or later
8703
8704_Class_:
8705     Atomic subroutine
8706
8707_Syntax_:
8708     'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
8709
8710_Arguments_:
8711     ATOM        Scalar coarray or coindexed variable of either
8712                 integer type with 'ATOMIC_INT_KIND' kind or
8713                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8714     OLD         Scalar of the same type and kind as ATOM.
8715     COMPARE     Scalar variable of the same type and kind as
8716                 ATOM.
8717     NEW         Scalar variable of the same type as ATOM.  If
8718                 kind is different, the value is converted to the
8719                 kind of ATOM.
8720     STAT        (optional) Scalar default-kind integer variable.
8721
8722_Example_:
8723          program atomic
8724            use iso_fortran_env
8725            logical(atomic_logical_kind) :: atom[*], prev
8726            call atomic_cas (atom[1], prev, .false., .true.))
8727          end program atomic
8728
8729_See also_:
8730     *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
8731
8732
8733File: gfortran.info,  Node: ATOMIC_DEFINE,  Next: ATOMIC_FETCH_ADD,  Prev: ATOMIC_CAS,  Up: Intrinsic Procedures
8734
87359.31 'ATOMIC_DEFINE' -- Setting a variable atomically
8736=====================================================
8737
8738_Description_:
8739     'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
8740     value VALUE atomically.  When STAT is present and the invocation
8741     was successful, it is assigned the value 0.  If it is present and
8742     the invocation has failed, it is assigned a positive value; in
8743     particular, for a coindexed ATOM, if the remote image has stopped,
8744     it is assigned the value of 'ISO_FORTRAN_ENV''s
8745     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8746     'STAT_FAILED_IMAGE'.
8747
8748_Standard_:
8749     Fortran 2008 and later; with STAT, TS 18508 or later
8750
8751_Class_:
8752     Atomic subroutine
8753
8754_Syntax_:
8755     'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
8756
8757_Arguments_:
8758     ATOM        Scalar coarray or coindexed variable of either
8759                 integer type with 'ATOMIC_INT_KIND' kind or
8760                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8761
8762     VALUE       Scalar of the same type as ATOM.  If the kind is
8763                 different, the value is converted to the kind of
8764                 ATOM.
8765     STAT        (optional) Scalar default-kind integer variable.
8766
8767_Example_:
8768          program atomic
8769            use iso_fortran_env
8770            integer(atomic_int_kind) :: atom[*]
8771            call atomic_define (atom[1], this_image())
8772          end program atomic
8773
8774_See also_:
8775     *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
8776     *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8777     ATOMIC_XOR::
8778
8779
8780File: gfortran.info,  Node: ATOMIC_FETCH_ADD,  Next: ATOMIC_FETCH_AND,  Prev: ATOMIC_DEFINE,  Up: Intrinsic Procedures
8781
87829.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
8783================================================================
8784
8785_Description_:
8786     'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
8787     ATOM in OLD and adds the value of VAR to the variable ATOM.  When
8788     STAT is present and the invocation was successful, it is assigned
8789     the value 0.  If it is present and the invocation has failed, it is
8790     assigned a positive value; in particular, for a coindexed ATOM, if
8791     the remote image has stopped, it is assigned the value of
8792     'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image
8793     has failed, the value 'STAT_FAILED_IMAGE'.
8794
8795_Standard_:
8796     TS 18508 or later
8797
8798_Class_:
8799     Atomic subroutine
8800
8801_Syntax_:
8802     'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
8803
8804_Arguments_:
8805     ATOM        Scalar coarray or coindexed variable of integer
8806                 type with 'ATOMIC_INT_KIND' kind.
8807                 'ATOMIC_LOGICAL_KIND' kind.
8808
8809     VALUE       Scalar of the same type as ATOM.  If the kind is
8810                 different, the value is converted to the kind of
8811                 ATOM.
8812     OLD         Scalar of the same type and kind as ATOM.
8813     STAT        (optional) Scalar default-kind integer variable.
8814
8815_Example_:
8816          program atomic
8817            use iso_fortran_env
8818            integer(atomic_int_kind) :: atom[*], old
8819            call atomic_add (atom[1], this_image(), old)
8820          end program atomic
8821
8822_See also_:
8823     *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
8824     *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
8825     ATOMIC_FETCH_XOR::
8826
8827
8828File: gfortran.info,  Node: ATOMIC_FETCH_AND,  Next: ATOMIC_FETCH_OR,  Prev: ATOMIC_FETCH_ADD,  Up: Intrinsic Procedures
8829
88309.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
8831========================================================================
8832
8833_Description_:
8834     'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
8835     OLD and defines ATOM with the bitwise AND between the values of
8836     ATOM and VALUE.  When STAT is present and the invocation was
8837     successful, it is assigned the value 0.  If it is present and the
8838     invocation has failed, it is assigned a positive value; in
8839     particular, for a coindexed ATOM, if the remote image has stopped,
8840     it is assigned the value of 'ISO_FORTRAN_ENV''s
8841     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8842     'STAT_FAILED_IMAGE'.
8843
8844_Standard_:
8845     TS 18508 or later
8846
8847_Class_:
8848     Atomic subroutine
8849
8850_Syntax_:
8851     'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
8852
8853_Arguments_:
8854     ATOM        Scalar coarray or coindexed variable of integer
8855                 type with 'ATOMIC_INT_KIND' kind.
8856     VALUE       Scalar of the same type as ATOM.  If the kind is
8857                 different, the value is converted to the kind of
8858                 ATOM.
8859     OLD         Scalar of the same type and kind as ATOM.
8860     STAT        (optional) Scalar default-kind integer variable.
8861
8862_Example_:
8863          program atomic
8864            use iso_fortran_env
8865            integer(atomic_int_kind) :: atom[*], old
8866            call atomic_fetch_and (atom[1], int(b'10100011101'), old)
8867          end program atomic
8868
8869_See also_:
8870     *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
8871     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
8872     ATOMIC_FETCH_XOR::
8873
8874
8875File: gfortran.info,  Node: ATOMIC_FETCH_OR,  Next: ATOMIC_FETCH_XOR,  Prev: ATOMIC_FETCH_AND,  Up: Intrinsic Procedures
8876
88779.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
8878======================================================================
8879
8880_Description_:
8881     'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD
8882     and defines ATOM with the bitwise OR between the values of ATOM and
8883     VALUE.  When STAT is present and the invocation was successful, it
8884     is assigned the value 0.  If it is present and the invocation has
8885     failed, it is assigned a positive value; in particular, for a
8886     coindexed ATOM, if the remote image has stopped, it is assigned the
8887     value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote
8888     image has failed, the value 'STAT_FAILED_IMAGE'.
8889
8890_Standard_:
8891     TS 18508 or later
8892
8893_Class_:
8894     Atomic subroutine
8895
8896_Syntax_:
8897     'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
8898
8899_Arguments_:
8900     ATOM        Scalar coarray or coindexed variable of integer
8901                 type with 'ATOMIC_INT_KIND' kind.
8902     VALUE       Scalar of the same type as ATOM.  If the kind is
8903                 different, the value is converted to the kind of
8904                 ATOM.
8905     OLD         Scalar of the same type and kind as ATOM.
8906     STAT        (optional) Scalar default-kind integer variable.
8907
8908_Example_:
8909          program atomic
8910            use iso_fortran_env
8911            integer(atomic_int_kind) :: atom[*], old
8912            call atomic_fetch_or (atom[1], int(b'10100011101'), old)
8913          end program atomic
8914
8915_See also_:
8916     *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
8917     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8918     ATOMIC_FETCH_XOR::
8919
8920
8921File: gfortran.info,  Node: ATOMIC_FETCH_XOR,  Next: ATOMIC_OR,  Prev: ATOMIC_FETCH_OR,  Up: Intrinsic Procedures
8922
89239.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
8924========================================================================
8925
8926_Description_:
8927     'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
8928     OLD and defines ATOM with the bitwise XOR between the values of
8929     ATOM and VALUE.  When STAT is present and the invocation was
8930     successful, it is assigned the value 0.  If it is present and the
8931     invocation has failed, it is assigned a positive value; in
8932     particular, for a coindexed ATOM, if the remote image has stopped,
8933     it is assigned the value of 'ISO_FORTRAN_ENV''s
8934     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8935     'STAT_FAILED_IMAGE'.
8936
8937_Standard_:
8938     TS 18508 or later
8939
8940_Class_:
8941     Atomic subroutine
8942
8943_Syntax_:
8944     'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
8945
8946_Arguments_:
8947     ATOM        Scalar coarray or coindexed variable of integer
8948                 type with 'ATOMIC_INT_KIND' kind.
8949     VALUE       Scalar of the same type as ATOM.  If the kind is
8950                 different, the value is converted to the kind of
8951                 ATOM.
8952     OLD         Scalar of the same type and kind as ATOM.
8953     STAT        (optional) Scalar default-kind integer variable.
8954
8955_Example_:
8956          program atomic
8957            use iso_fortran_env
8958            integer(atomic_int_kind) :: atom[*], old
8959            call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
8960          end program atomic
8961
8962_See also_:
8963     *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
8964     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8965     ATOMIC_FETCH_OR::
8966
8967
8968File: gfortran.info,  Node: ATOMIC_OR,  Next: ATOMIC_REF,  Prev: ATOMIC_FETCH_XOR,  Up: Intrinsic Procedures
8969
89709.36 'ATOMIC_OR' -- Atomic bitwise OR operation
8971===============================================
8972
8973_Description_:
8974     'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
8975     AND between the values of ATOM and VALUE.  When STAT is present and
8976     the invocation was successful, it is assigned the value 0.  If it
8977     is present and the invocation has failed, it is assigned a positive
8978     value; in particular, for a coindexed ATOM, if the remote image has
8979     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8980     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8981     'STAT_FAILED_IMAGE'.
8982
8983_Standard_:
8984     TS 18508 or later
8985
8986_Class_:
8987     Atomic subroutine
8988
8989_Syntax_:
8990     'CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
8991
8992_Arguments_:
8993     ATOM        Scalar coarray or coindexed variable of integer
8994                 type with 'ATOMIC_INT_KIND' kind.
8995     VALUE       Scalar of the same type as ATOM.  If the kind is
8996                 different, the value is converted to the kind of
8997                 ATOM.
8998     STAT        (optional) Scalar default-kind integer variable.
8999
9000_Example_:
9001          program atomic
9002            use iso_fortran_env
9003            integer(atomic_int_kind) :: atom[*]
9004            call atomic_or (atom[1], int(b'10100011101'))
9005          end program atomic
9006
9007_See also_:
9008     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
9009     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
9010     ATOMIC_XOR::
9011
9012
9013File: gfortran.info,  Node: ATOMIC_REF,  Next: ATOMIC_XOR,  Prev: ATOMIC_OR,  Up: Intrinsic Procedures
9014
90159.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically
9016=================================================================
9017
9018_Description_:
9019     'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
9020     variable ATOM to VALUE.  When STAT is present and the invocation
9021     was successful, it is assigned the value 0.  If it is present and
9022     the invocation has failed, it is assigned a positive value; in
9023     particular, for a coindexed ATOM, if the remote image has stopped,
9024     it is assigned the value of 'ISO_FORTRAN_ENV''s
9025     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
9026     'STAT_FAILED_IMAGE'.
9027
9028_Standard_:
9029     Fortran 2008 and later; with STAT, TS 18508 or later
9030
9031_Class_:
9032     Atomic subroutine
9033
9034_Syntax_:
9035     'CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
9036
9037_Arguments_:
9038     VALUE       Scalar of the same type as ATOM.  If the kind is
9039                 different, the value is converted to the kind of
9040                 ATOM.
9041     ATOM        Scalar coarray or coindexed variable of either
9042                 integer type with 'ATOMIC_INT_KIND' kind or
9043                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
9044     STAT        (optional) Scalar default-kind integer variable.
9045
9046_Example_:
9047          program atomic
9048            use iso_fortran_env
9049            logical(atomic_logical_kind) :: atom[*]
9050            logical :: val
9051            call atomic_ref (atom, .false.)
9052            ! ...
9053            call atomic_ref (atom, val)
9054            if (val) then
9055              print *, "Obtained"
9056            end if
9057          end program atomic
9058
9059_See also_:
9060     *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
9061     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
9062     ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
9063
9064
9065File: gfortran.info,  Node: ATOMIC_XOR,  Next: BACKTRACE,  Prev: ATOMIC_REF,  Up: Intrinsic Procedures
9066
90679.38 'ATOMIC_XOR' -- Atomic bitwise OR operation
9068================================================
9069
9070_Description_:
9071     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
9072     XOR between the values of ATOM and VALUE.  When STAT is present and
9073     the invocation was successful, it is assigned the value 0.  If it
9074     is present and the invocation has failed, it is assigned a positive
9075     value; in particular, for a coindexed ATOM, if the remote image has
9076     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
9077     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
9078     'STAT_FAILED_IMAGE'.
9079
9080_Standard_:
9081     TS 18508 or later
9082
9083_Class_:
9084     Atomic subroutine
9085
9086_Syntax_:
9087     'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
9088
9089_Arguments_:
9090     ATOM        Scalar coarray or coindexed variable of integer
9091                 type with 'ATOMIC_INT_KIND' kind.
9092     VALUE       Scalar of the same type as ATOM.  If the kind is
9093                 different, the value is converted to the kind of
9094                 ATOM.
9095     STAT        (optional) Scalar default-kind integer variable.
9096
9097_Example_:
9098          program atomic
9099            use iso_fortran_env
9100            integer(atomic_int_kind) :: atom[*]
9101            call atomic_xor (atom[1], int(b'10100011101'))
9102          end program atomic
9103
9104_See also_:
9105     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
9106     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
9107     ATOMIC_XOR::
9108
9109
9110File: gfortran.info,  Node: BACKTRACE,  Next: BESSEL_J0,  Prev: ATOMIC_XOR,  Up: Intrinsic Procedures
9111
91129.39 'BACKTRACE' -- Show a backtrace
9113====================================
9114
9115_Description_:
9116     'BACKTRACE' shows a backtrace at an arbitrary place in user code.
9117     Program execution continues normally afterwards.  The backtrace
9118     information is printed to the unit corresponding to 'ERROR_UNIT' in
9119     'ISO_FORTRAN_ENV'.
9120
9121_Standard_:
9122     GNU extension
9123
9124_Class_:
9125     Subroutine
9126
9127_Syntax_:
9128     'CALL BACKTRACE'
9129
9130_Arguments_:
9131     None
9132
9133_See also_:
9134     *note ABORT::
9135
9136
9137File: gfortran.info,  Node: BESSEL_J0,  Next: BESSEL_J1,  Prev: BACKTRACE,  Up: Intrinsic Procedures
9138
91399.40 'BESSEL_J0' -- Bessel function of the first kind of order 0
9140================================================================
9141
9142_Description_:
9143     'BESSEL_J0(X)' computes the Bessel function of the first kind of
9144     order 0 of X.  This function is available under the name 'BESJ0' as
9145     a GNU extension.
9146
9147_Standard_:
9148     Fortran 2008 and later
9149
9150_Class_:
9151     Elemental function
9152
9153_Syntax_:
9154     'RESULT = BESSEL_J0(X)'
9155
9156_Arguments_:
9157     X           The type shall be 'REAL'.
9158
9159_Return value_:
9160     The return value is of type 'REAL' and lies in the range -
9161     0.4027... \leq Bessel (0,x) \leq 1.  It has the same kind as X.
9162
9163_Example_:
9164          program test_besj0
9165            real(8) :: x = 0.0_8
9166            x = bessel_j0(x)
9167          end program test_besj0
9168
9169_Specific names_:
9170     Name           Argument       Return type    Standard
9171     'DBESJ0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9172
9173
9174File: gfortran.info,  Node: BESSEL_J1,  Next: BESSEL_JN,  Prev: BESSEL_J0,  Up: Intrinsic Procedures
9175
91769.41 'BESSEL_J1' -- Bessel function of the first kind of order 1
9177================================================================
9178
9179_Description_:
9180     'BESSEL_J1(X)' computes the Bessel function of the first kind of
9181     order 1 of X.  This function is available under the name 'BESJ1' as
9182     a GNU extension.
9183
9184_Standard_:
9185     Fortran 2008
9186
9187_Class_:
9188     Elemental function
9189
9190_Syntax_:
9191     'RESULT = BESSEL_J1(X)'
9192
9193_Arguments_:
9194     X           The type shall be 'REAL'.
9195
9196_Return value_:
9197     The return value is of type 'REAL' and lies in the range -
9198     0.5818... \leq Bessel (0,x) \leq 0.5818 .  It has the same kind as
9199     X.
9200
9201_Example_:
9202          program test_besj1
9203            real(8) :: x = 1.0_8
9204            x = bessel_j1(x)
9205          end program test_besj1
9206
9207_Specific names_:
9208     Name           Argument       Return type    Standard
9209     'DBESJ1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9210
9211
9212File: gfortran.info,  Node: BESSEL_JN,  Next: BESSEL_Y0,  Prev: BESSEL_J1,  Up: Intrinsic Procedures
9213
92149.42 'BESSEL_JN' -- Bessel function of the first kind
9215=====================================================
9216
9217_Description_:
9218     'BESSEL_JN(N, X)' computes the Bessel function of the first kind of
9219     order N of X.  This function is available under the name 'BESJN' as
9220     a GNU extension.  If N and X are arrays, their ranks and shapes
9221     shall conform.
9222
9223     'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
9224     of the first kind of the orders N1 to N2.
9225
9226_Standard_:
9227     Fortran 2008 and later, negative N is allowed as GNU extension
9228
9229_Class_:
9230     Elemental function, except for the transformational function
9231     'BESSEL_JN(N1, N2, X)'
9232
9233_Syntax_:
9234     'RESULT = BESSEL_JN(N, X)'
9235     'RESULT = BESSEL_JN(N1, N2, X)'
9236
9237_Arguments_:
9238     N           Shall be a scalar or an array of type 'INTEGER'.
9239     N1          Shall be a non-negative scalar of type
9240                 'INTEGER'.
9241     N2          Shall be a non-negative scalar of type
9242                 'INTEGER'.
9243     X           Shall be a scalar or an array of type 'REAL';
9244                 for 'BESSEL_JN(N1, N2, X)' it shall be scalar.
9245
9246_Return value_:
9247     The return value is a scalar of type 'REAL'.  It has the same kind
9248     as X.
9249
9250_Note_:
9251     The transformational function uses a recurrence algorithm which
9252     might, for some values of X, lead to different results than calls
9253     to the elemental function.
9254
9255_Example_:
9256          program test_besjn
9257            real(8) :: x = 1.0_8
9258            x = bessel_jn(5,x)
9259          end program test_besjn
9260
9261_Specific names_:
9262     Name           Argument       Return type    Standard
9263     'DBESJN(N,     'INTEGER N'    'REAL(8)'      GNU extension
9264     X)'
9265                    'REAL(8) X'
9266
9267
9268File: gfortran.info,  Node: BESSEL_Y0,  Next: BESSEL_Y1,  Prev: BESSEL_JN,  Up: Intrinsic Procedures
9269
92709.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0
9271=================================================================
9272
9273_Description_:
9274     'BESSEL_Y0(X)' computes the Bessel function of the second kind of
9275     order 0 of X.  This function is available under the name 'BESY0' as
9276     a GNU extension.
9277
9278_Standard_:
9279     Fortran 2008 and later
9280
9281_Class_:
9282     Elemental function
9283
9284_Syntax_:
9285     'RESULT = BESSEL_Y0(X)'
9286
9287_Arguments_:
9288     X           The type shall be 'REAL'.
9289
9290_Return value_:
9291     The return value is of type 'REAL'.  It has the same kind as X.
9292
9293_Example_:
9294          program test_besy0
9295            real(8) :: x = 0.0_8
9296            x = bessel_y0(x)
9297          end program test_besy0
9298
9299_Specific names_:
9300     Name           Argument       Return type    Standard
9301     'DBESY0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9302
9303
9304File: gfortran.info,  Node: BESSEL_Y1,  Next: BESSEL_YN,  Prev: BESSEL_Y0,  Up: Intrinsic Procedures
9305
93069.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1
9307=================================================================
9308
9309_Description_:
9310     'BESSEL_Y1(X)' computes the Bessel function of the second kind of
9311     order 1 of X.  This function is available under the name 'BESY1' as
9312     a GNU extension.
9313
9314_Standard_:
9315     Fortran 2008 and later
9316
9317_Class_:
9318     Elemental function
9319
9320_Syntax_:
9321     'RESULT = BESSEL_Y1(X)'
9322
9323_Arguments_:
9324     X           The type shall be 'REAL'.
9325
9326_Return value_:
9327     The return value is of type 'REAL'.  It has the same kind as X.
9328
9329_Example_:
9330          program test_besy1
9331            real(8) :: x = 1.0_8
9332            x = bessel_y1(x)
9333          end program test_besy1
9334
9335_Specific names_:
9336     Name           Argument       Return type    Standard
9337     'DBESY1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9338
9339
9340File: gfortran.info,  Node: BESSEL_YN,  Next: BGE,  Prev: BESSEL_Y1,  Up: Intrinsic Procedures
9341
93429.45 'BESSEL_YN' -- Bessel function of the second kind
9343======================================================
9344
9345_Description_:
9346     'BESSEL_YN(N, X)' computes the Bessel function of the second kind
9347     of order N of X.  This function is available under the name 'BESYN'
9348     as a GNU extension.  If N and X are arrays, their ranks and shapes
9349     shall conform.
9350
9351     'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
9352     of the first kind of the orders N1 to N2.
9353
9354_Standard_:
9355     Fortran 2008 and later, negative N is allowed as GNU extension
9356
9357_Class_:
9358     Elemental function, except for the transformational function
9359     'BESSEL_YN(N1, N2, X)'
9360
9361_Syntax_:
9362     'RESULT = BESSEL_YN(N, X)'
9363     'RESULT = BESSEL_YN(N1, N2, X)'
9364
9365_Arguments_:
9366     N           Shall be a scalar or an array of type 'INTEGER'
9367                 .
9368     N1          Shall be a non-negative scalar of type
9369                 'INTEGER'.
9370     N2          Shall be a non-negative scalar of type
9371                 'INTEGER'.
9372     X           Shall be a scalar or an array of type 'REAL';
9373                 for 'BESSEL_YN(N1, N2, X)' it shall be scalar.
9374
9375_Return value_:
9376     The return value is a scalar of type 'REAL'.  It has the same kind
9377     as X.
9378
9379_Note_:
9380     The transformational function uses a recurrence algorithm which
9381     might, for some values of X, lead to different results than calls
9382     to the elemental function.
9383
9384_Example_:
9385          program test_besyn
9386            real(8) :: x = 1.0_8
9387            x = bessel_yn(5,x)
9388          end program test_besyn
9389
9390_Specific names_:
9391     Name           Argument       Return type    Standard
9392     'DBESYN(N,X)'  'INTEGER N'    'REAL(8)'      GNU extension
9393                    'REAL(8) X'
9394
9395
9396File: gfortran.info,  Node: BGE,  Next: BGT,  Prev: BESSEL_YN,  Up: Intrinsic Procedures
9397
93989.46 'BGE' -- Bitwise greater than or equal to
9399==============================================
9400
9401_Description_:
9402     Determines whether an integral is a bitwise greater than or equal
9403     to another.
9404
9405_Standard_:
9406     Fortran 2008 and later
9407
9408_Class_:
9409     Elemental function
9410
9411_Syntax_:
9412     'RESULT = BGE(I, J)'
9413
9414_Arguments_:
9415     I           Shall be of 'INTEGER' type.
9416     J           Shall be of 'INTEGER' type, and of the same kind
9417                 as I.
9418
9419_Return value_:
9420     The return value is of type 'LOGICAL' and of the default kind.
9421
9422_See also_:
9423     *note BGT::, *note BLE::, *note BLT::
9424
9425
9426File: gfortran.info,  Node: BGT,  Next: BIT_SIZE,  Prev: BGE,  Up: Intrinsic Procedures
9427
94289.47 'BGT' -- Bitwise greater than
9429==================================
9430
9431_Description_:
9432     Determines whether an integral is a bitwise greater than another.
9433
9434_Standard_:
9435     Fortran 2008 and later
9436
9437_Class_:
9438     Elemental function
9439
9440_Syntax_:
9441     'RESULT = BGT(I, J)'
9442
9443_Arguments_:
9444     I           Shall be of 'INTEGER' type.
9445     J           Shall be of 'INTEGER' type, and of the same kind
9446                 as I.
9447
9448_Return value_:
9449     The return value is of type 'LOGICAL' and of the default kind.
9450
9451_See also_:
9452     *note BGE::, *note BLE::, *note BLT::
9453
9454
9455File: gfortran.info,  Node: BIT_SIZE,  Next: BLE,  Prev: BGT,  Up: Intrinsic Procedures
9456
94579.48 'BIT_SIZE' -- Bit size inquiry function
9458============================================
9459
9460_Description_:
9461     'BIT_SIZE(I)' returns the number of bits (integer precision plus
9462     sign bit) represented by the type of I.  The result of
9463     'BIT_SIZE(I)' is independent of the actual value of I.
9464
9465_Standard_:
9466     Fortran 90 and later
9467
9468_Class_:
9469     Inquiry function
9470
9471_Syntax_:
9472     'RESULT = BIT_SIZE(I)'
9473
9474_Arguments_:
9475     I           The type shall be 'INTEGER'.
9476
9477_Return value_:
9478     The return value is of type 'INTEGER'
9479
9480_Example_:
9481          program test_bit_size
9482              integer :: i = 123
9483              integer :: size
9484              size = bit_size(i)
9485              print *, size
9486          end program test_bit_size
9487
9488
9489File: gfortran.info,  Node: BLE,  Next: BLT,  Prev: BIT_SIZE,  Up: Intrinsic Procedures
9490
94919.49 'BLE' -- Bitwise less than or equal to
9492===========================================
9493
9494_Description_:
9495     Determines whether an integral is a bitwise less than or equal to
9496     another.
9497
9498_Standard_:
9499     Fortran 2008 and later
9500
9501_Class_:
9502     Elemental function
9503
9504_Syntax_:
9505     'RESULT = BLE(I, J)'
9506
9507_Arguments_:
9508     I           Shall be of 'INTEGER' type.
9509     J           Shall be of 'INTEGER' type, and of the same kind
9510                 as I.
9511
9512_Return value_:
9513     The return value is of type 'LOGICAL' and of the default kind.
9514
9515_See also_:
9516     *note BGT::, *note BGE::, *note BLT::
9517
9518
9519File: gfortran.info,  Node: BLT,  Next: BTEST,  Prev: BLE,  Up: Intrinsic Procedures
9520
95219.50 'BLT' -- Bitwise less than
9522===============================
9523
9524_Description_:
9525     Determines whether an integral is a bitwise less than another.
9526
9527_Standard_:
9528     Fortran 2008 and later
9529
9530_Class_:
9531     Elemental function
9532
9533_Syntax_:
9534     'RESULT = BLT(I, J)'
9535
9536_Arguments_:
9537     I           Shall be of 'INTEGER' type.
9538     J           Shall be of 'INTEGER' type, and of the same kind
9539                 as I.
9540
9541_Return value_:
9542     The return value is of type 'LOGICAL' and of the default kind.
9543
9544_See also_:
9545     *note BGE::, *note BGT::, *note BLE::
9546
9547
9548File: gfortran.info,  Node: BTEST,  Next: C_ASSOCIATED,  Prev: BLT,  Up: Intrinsic Procedures
9549
95509.51 'BTEST' -- Bit test function
9551=================================
9552
9553_Description_:
9554     'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is
9555     set.  The counting of the bits starts at 0.
9556
9557_Standard_:
9558     Fortran 90 and later, has overloads that are GNU extensions
9559
9560_Class_:
9561     Elemental function
9562
9563_Syntax_:
9564     'RESULT = BTEST(I, POS)'
9565
9566_Arguments_:
9567     I           The type shall be 'INTEGER'.
9568     POS         The type shall be 'INTEGER'.
9569
9570_Return value_:
9571     The return value is of type 'LOGICAL'
9572
9573_Example_:
9574          program test_btest
9575              integer :: i = 32768 + 1024 + 64
9576              integer :: pos
9577              logical :: bool
9578              do pos=0,16
9579                  bool = btest(i, pos)
9580                  print *, pos, bool
9581              end do
9582          end program test_btest
9583
9584_Specific names_:
9585     Name           Argument       Return type    Standard
9586     'BTEST(I,POS)' 'INTEGER       'LOGICAL'      Fortran 95 and
9587                    I,POS'                        later
9588     'BBTEST(I,POS)''INTEGER(1)    'LOGICAL(1)'   GNU extension
9589                    I,POS'
9590     'BITEST(I,POS)''INTEGER(2)    'LOGICAL(2)'   GNU extension
9591                    I,POS'
9592     'BJTEST(I,POS)''INTEGER(4)    'LOGICAL(4)'   GNU extension
9593                    I,POS'
9594     'BKTEST(I,POS)''INTEGER(8)    'LOGICAL(8)'   GNU extension
9595                    I,POS'
9596
9597
9598File: gfortran.info,  Node: C_ASSOCIATED,  Next: C_F_POINTER,  Prev: BTEST,  Up: Intrinsic Procedures
9599
96009.52 'C_ASSOCIATED' -- Status of a C pointer
9601============================================
9602
9603_Description_:
9604     'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
9605     pointer C_PTR_1 or if C_PTR_1 is associated with the target
9606     C_PTR_2.
9607
9608_Standard_:
9609     Fortran 2003 and later
9610
9611_Class_:
9612     Inquiry function
9613
9614_Syntax_:
9615     'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
9616
9617_Arguments_:
9618     C_PTR_1     Scalar of the type 'C_PTR' or 'C_FUNPTR'.
9619     C_PTR_2     (Optional) Scalar of the same type as C_PTR_1.
9620
9621_Return value_:
9622     The return value is of type 'LOGICAL'; it is '.false.' if either
9623     C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
9624     different addresses.
9625
9626_Example_:
9627          subroutine association_test(a,b)
9628            use iso_c_binding, only: c_associated, c_loc, c_ptr
9629            implicit none
9630            real, pointer :: a
9631            type(c_ptr) :: b
9632            if(c_associated(b, c_loc(a))) &
9633               stop 'b and a do not point to same target'
9634          end subroutine association_test
9635
9636_See also_:
9637     *note C_LOC::, *note C_FUNLOC::
9638
9639
9640File: gfortran.info,  Node: C_F_POINTER,  Next: C_F_PROCPOINTER,  Prev: C_ASSOCIATED,  Up: Intrinsic Procedures
9641
96429.53 'C_F_POINTER' -- Convert C into Fortran pointer
9643====================================================
9644
9645_Description_:
9646     'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
9647     pointer CPTR to the Fortran pointer FPTR and specifies its shape.
9648
9649_Standard_:
9650     Fortran 2003 and later
9651
9652_Class_:
9653     Subroutine
9654
9655_Syntax_:
9656     'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
9657
9658_Arguments_:
9659     CPTR        scalar of the type 'C_PTR'.  It is 'INTENT(IN)'.
9660     FPTR        pointer interoperable with CPTR.  It is
9661                 'INTENT(OUT)'.
9662     SHAPE       (Optional) Rank-one array of type 'INTEGER' with
9663                 'INTENT(IN)'.  It shall be present if and only
9664                 if FPTR is an array.  The size must be equal to
9665                 the rank of FPTR.
9666
9667_Example_:
9668          program main
9669            use iso_c_binding
9670            implicit none
9671            interface
9672              subroutine my_routine(p) bind(c,name='myC_func')
9673                import :: c_ptr
9674                type(c_ptr), intent(out) :: p
9675              end subroutine
9676            end interface
9677            type(c_ptr) :: cptr
9678            real,pointer :: a(:)
9679            call my_routine(cptr)
9680            call c_f_pointer(cptr, a, [12])
9681          end program main
9682
9683_See also_:
9684     *note C_LOC::, *note C_F_PROCPOINTER::
9685
9686
9687File: gfortran.info,  Node: C_F_PROCPOINTER,  Next: C_FUNLOC,  Prev: C_F_POINTER,  Up: Intrinsic Procedures
9688
96899.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
9690==================================================================
9691
9692_Description_:
9693     'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
9694     pointer CPTR to the Fortran procedure pointer FPTR.
9695
9696_Standard_:
9697     Fortran 2003 and later
9698
9699_Class_:
9700     Subroutine
9701
9702_Syntax_:
9703     'CALL C_F_PROCPOINTER(cptr, fptr)'
9704
9705_Arguments_:
9706     CPTR        scalar of the type 'C_FUNPTR'.  It is
9707                 'INTENT(IN)'.
9708     FPTR        procedure pointer interoperable with CPTR.  It
9709                 is 'INTENT(OUT)'.
9710
9711_Example_:
9712          program main
9713            use iso_c_binding
9714            implicit none
9715            abstract interface
9716              function func(a)
9717                import :: c_float
9718                real(c_float), intent(in) :: a
9719                real(c_float) :: func
9720              end function
9721            end interface
9722            interface
9723               function getIterFunc() bind(c,name="getIterFunc")
9724                 import :: c_funptr
9725                 type(c_funptr) :: getIterFunc
9726               end function
9727            end interface
9728            type(c_funptr) :: cfunptr
9729            procedure(func), pointer :: myFunc
9730            cfunptr = getIterFunc()
9731            call c_f_procpointer(cfunptr, myFunc)
9732          end program main
9733
9734_See also_:
9735     *note C_LOC::, *note C_F_POINTER::
9736
9737
9738File: gfortran.info,  Node: C_FUNLOC,  Next: C_LOC,  Prev: C_F_PROCPOINTER,  Up: Intrinsic Procedures
9739
97409.55 'C_FUNLOC' -- Obtain the C address of a procedure
9741======================================================
9742
9743_Description_:
9744     'C_FUNLOC(x)' determines the C address of the argument.
9745
9746_Standard_:
9747     Fortran 2003 and later
9748
9749_Class_:
9750     Inquiry function
9751
9752_Syntax_:
9753     'RESULT = C_FUNLOC(x)'
9754
9755_Arguments_:
9756     X           Interoperable function or pointer to such
9757                 function.
9758
9759_Return value_:
9760     The return value is of type 'C_FUNPTR' and contains the C address
9761     of the argument.
9762
9763_Example_:
9764          module x
9765            use iso_c_binding
9766            implicit none
9767          contains
9768            subroutine sub(a) bind(c)
9769              real(c_float) :: a
9770              a = sqrt(a)+5.0
9771            end subroutine sub
9772          end module x
9773          program main
9774            use iso_c_binding
9775            use x
9776            implicit none
9777            interface
9778              subroutine my_routine(p) bind(c,name='myC_func')
9779                import :: c_funptr
9780                type(c_funptr), intent(in) :: p
9781              end subroutine
9782            end interface
9783            call my_routine(c_funloc(sub))
9784          end program main
9785
9786_See also_:
9787     *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
9788     C_F_PROCPOINTER::
9789
9790
9791File: gfortran.info,  Node: C_LOC,  Next: C_SIZEOF,  Prev: C_FUNLOC,  Up: Intrinsic Procedures
9792
97939.56 'C_LOC' -- Obtain the C address of an object
9794=================================================
9795
9796_Description_:
9797     'C_LOC(X)' determines the C address of the argument.
9798
9799_Standard_:
9800     Fortran 2003 and later
9801
9802_Class_:
9803     Inquiry function
9804
9805_Syntax_:
9806     'RESULT = C_LOC(X)'
9807
9808_Arguments_:
9809     X       Shall have either the POINTER or TARGET attribute.
9810             It shall not be a coindexed object.  It shall either
9811             be a variable with interoperable type and kind type
9812             parameters, or be a scalar, nonpolymorphic variable
9813             with no length type parameters.
9814
9815
9816_Return value_:
9817     The return value is of type 'C_PTR' and contains the C address of
9818     the argument.
9819
9820_Example_:
9821          subroutine association_test(a,b)
9822            use iso_c_binding, only: c_associated, c_loc, c_ptr
9823            implicit none
9824            real, pointer :: a
9825            type(c_ptr) :: b
9826            if(c_associated(b, c_loc(a))) &
9827               stop 'b and a do not point to same target'
9828          end subroutine association_test
9829
9830_See also_:
9831     *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
9832     C_F_PROCPOINTER::
9833
9834
9835File: gfortran.info,  Node: C_SIZEOF,  Next: CEILING,  Prev: C_LOC,  Up: Intrinsic Procedures
9836
98379.57 'C_SIZEOF' -- Size in bytes of an expression
9838=================================================
9839
9840_Description_:
9841     'C_SIZEOF(X)' calculates the number of bytes of storage the
9842     expression 'X' occupies.
9843
9844_Standard_:
9845     Fortran 2008
9846
9847_Class_:
9848     Inquiry function of the module 'ISO_C_BINDING'
9849
9850_Syntax_:
9851     'N = C_SIZEOF(X)'
9852
9853_Arguments_:
9854     X           The argument shall be an interoperable data
9855                 entity.
9856
9857_Return value_:
9858     The return value is of type integer and of the system-dependent
9859     kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module).  Its value is
9860     the number of bytes occupied by the argument.  If the argument has
9861     the 'POINTER' attribute, the number of bytes of the storage area
9862     pointed to is returned.  If the argument is of a derived type with
9863     'POINTER' or 'ALLOCATABLE' components, the return value does not
9864     account for the sizes of the data pointed to by these components.
9865
9866_Example_:
9867             use iso_c_binding
9868             integer(c_int) :: i
9869             real(c_float) :: r, s(5)
9870             print *, (c_sizeof(s)/c_sizeof(r) == 5)
9871             end
9872     The example will print 'T' unless you are using a platform where
9873     default 'REAL' variables are unusually padded.
9874
9875_See also_:
9876     *note SIZEOF::, *note STORAGE_SIZE::
9877
9878
9879File: gfortran.info,  Node: CEILING,  Next: CHAR,  Prev: C_SIZEOF,  Up: Intrinsic Procedures
9880
98819.58 'CEILING' -- Integer ceiling function
9882==========================================
9883
9884_Description_:
9885     'CEILING(A)' returns the least integer greater than or equal to A.
9886
9887_Standard_:
9888     Fortran 95 and later
9889
9890_Class_:
9891     Elemental function
9892
9893_Syntax_:
9894     'RESULT = CEILING(A [, KIND])'
9895
9896_Arguments_:
9897     A           The type shall be 'REAL'.
9898     KIND        (Optional) An 'INTEGER' initialization
9899                 expression indicating the kind parameter of the
9900                 result.
9901
9902_Return value_:
9903     The return value is of type 'INTEGER(KIND)' if KIND is present and
9904     a default-kind 'INTEGER' otherwise.
9905
9906_Example_:
9907          program test_ceiling
9908              real :: x = 63.29
9909              real :: y = -63.59
9910              print *, ceiling(x) ! returns 64
9911              print *, ceiling(y) ! returns -63
9912          end program test_ceiling
9913
9914_See also_:
9915     *note FLOOR::, *note NINT::
9916
9917
9918File: gfortran.info,  Node: CHAR,  Next: CHDIR,  Prev: CEILING,  Up: Intrinsic Procedures
9919
99209.59 'CHAR' -- Character conversion function
9921============================================
9922
9923_Description_:
9924     'CHAR(I [, KIND])' returns the character represented by the integer
9925     I.
9926
9927_Standard_:
9928     Fortran 77 and later
9929
9930_Class_:
9931     Elemental function
9932
9933_Syntax_:
9934     'RESULT = CHAR(I [, KIND])'
9935
9936_Arguments_:
9937     I           The type shall be 'INTEGER'.
9938     KIND        (Optional) An 'INTEGER' initialization
9939                 expression indicating the kind parameter of the
9940                 result.
9941
9942_Return value_:
9943     The return value is of type 'CHARACTER(1)'
9944
9945_Example_:
9946          program test_char
9947              integer :: i = 74
9948              character(1) :: c
9949              c = char(i)
9950              print *, i, c ! returns 'J'
9951          end program test_char
9952
9953_Specific names_:
9954     Name          Argument      Return type       Standard
9955     'CHAR(I)'     'INTEGER I'   'CHARACTER(LEN=1)'Fortran 77 and
9956                                                   later
9957
9958_Note_:
9959     See *note ICHAR:: for a discussion of converting between numerical
9960     values and formatted string representations.
9961
9962_See also_:
9963     *note ACHAR::, *note IACHAR::, *note ICHAR::
9964
9965
9966File: gfortran.info,  Node: CHDIR,  Next: CHMOD,  Prev: CHAR,  Up: Intrinsic Procedures
9967
99689.60 'CHDIR' -- Change working directory
9969========================================
9970
9971_Description_:
9972     Change current working directory to a specified path.
9973
9974     This intrinsic is provided in both subroutine and function forms;
9975     however, only one form can be used in any given program unit.
9976
9977_Standard_:
9978     GNU extension
9979
9980_Class_:
9981     Subroutine, function
9982
9983_Syntax_:
9984     'CALL CHDIR(NAME [, STATUS])'
9985     'STATUS = CHDIR(NAME)'
9986
9987_Arguments_:
9988     NAME        The type shall be 'CHARACTER' of default kind
9989                 and shall specify a valid path within the file
9990                 system.
9991     STATUS      (Optional) 'INTEGER' status flag of the default
9992                 kind.  Returns 0 on success, and a system
9993                 specific and nonzero error code otherwise.
9994
9995_Example_:
9996          PROGRAM test_chdir
9997            CHARACTER(len=255) :: path
9998            CALL getcwd(path)
9999            WRITE(*,*) TRIM(path)
10000            CALL chdir("/tmp")
10001            CALL getcwd(path)
10002            WRITE(*,*) TRIM(path)
10003          END PROGRAM
10004
10005_See also_:
10006     *note GETCWD::
10007
10008
10009File: gfortran.info,  Node: CHMOD,  Next: CMPLX,  Prev: CHDIR,  Up: Intrinsic Procedures
10010
100119.61 'CHMOD' -- Change access permissions of files
10012==================================================
10013
10014_Description_:
10015     'CHMOD' changes the permissions of a file.
10016
10017     This intrinsic is provided in both subroutine and function forms;
10018     however, only one form can be used in any given program unit.
10019
10020_Standard_:
10021     GNU extension
10022
10023_Class_:
10024     Subroutine, function
10025
10026_Syntax_:
10027     'CALL CHMOD(NAME, MODE[, STATUS])'
10028     'STATUS = CHMOD(NAME, MODE)'
10029
10030_Arguments_:
10031
10032     NAME        Scalar 'CHARACTER' of default kind with the file
10033                 name.  Trailing blanks are ignored unless the
10034                 character 'achar(0)' is present, then all
10035                 characters up to and excluding 'achar(0)' are
10036                 used as the file name.
10037
10038     MODE        Scalar 'CHARACTER' of default kind giving the
10039                 file permission.  MODE uses the same syntax as
10040                 the 'chmod' utility as defined by the POSIX
10041                 standard.  The argument shall either be a string
10042                 of a nonnegative octal number or a symbolic
10043                 mode.
10044
10045     STATUS      (optional) scalar 'INTEGER', which is '0' on
10046                 success and nonzero otherwise.
10047
10048_Return value_:
10049     In either syntax, STATUS is set to '0' on success and nonzero
10050     otherwise.
10051
10052_Example_:
10053     'CHMOD' as subroutine
10054          program chmod_test
10055            implicit none
10056            integer :: status
10057            call chmod('test.dat','u+x',status)
10058            print *, 'Status: ', status
10059          end program chmod_test
10060     'CHMOD' as function:
10061          program chmod_test
10062            implicit none
10063            integer :: status
10064            status = chmod('test.dat','u+x')
10065            print *, 'Status: ', status
10066          end program chmod_test
10067
10068
10069File: gfortran.info,  Node: CMPLX,  Next: CO_BROADCAST,  Prev: CHMOD,  Up: Intrinsic Procedures
10070
100719.62 'CMPLX' -- Complex conversion function
10072===========================================
10073
10074_Description_:
10075     'CMPLX(X [, Y [, KIND]])' returns a complex number where X is
10076     converted to the real component.  If Y is present it is converted
10077     to the imaginary component.  If Y is not present then the imaginary
10078     component is set to 0.0.  If X is complex then Y must not be
10079     present.
10080
10081_Standard_:
10082     Fortran 77 and later
10083
10084_Class_:
10085     Elemental function
10086
10087_Syntax_:
10088     'RESULT = CMPLX(X [, Y [, KIND]])'
10089
10090_Arguments_:
10091     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
10092     Y           (Optional; only allowed if X is not 'COMPLEX'.)
10093                 May be 'INTEGER' or 'REAL'.
10094     KIND        (Optional) An 'INTEGER' initialization
10095                 expression indicating the kind parameter of the
10096                 result.
10097
10098_Return value_:
10099     The return value is of 'COMPLEX' type, with a kind equal to KIND if
10100     it is specified.  If KIND is not specified, the result is of the
10101     default 'COMPLEX' kind, regardless of the kinds of X and Y.
10102
10103_Example_:
10104          program test_cmplx
10105              integer :: i = 42
10106              real :: x = 3.14
10107              complex :: z
10108              z = cmplx(i, x)
10109              print *, z, cmplx(x)
10110          end program test_cmplx
10111
10112_See also_:
10113     *note COMPLEX::
10114
10115
10116File: gfortran.info,  Node: CO_BROADCAST,  Next: CO_MAX,  Prev: CMPLX,  Up: Intrinsic Procedures
10117
101189.63 'CO_BROADCAST' -- Copy a value to all images the current set of images
10119===========================================================================
10120
10121_Description_:
10122     'CO_BROADCAST' copies the value of argument A on the image with
10123     image index 'SOURCE_IMAGE' to all images in the current team.  A
10124     becomes defined as if by intrinsic assignment.  If the execution
10125     was successful and STAT is present, it is assigned the value zero.
10126     If the execution failed, STAT gets assigned a nonzero value and, if
10127     present, ERRMSG gets assigned a value describing the occurred
10128     error.
10129
10130_Standard_:
10131     Technical Specification (TS) 18508 or later
10132
10133_Class_:
10134     Collective subroutine
10135
10136_Syntax_:
10137     'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
10138
10139_Arguments_:
10140     A              INTENT(INOUT) argument; shall have the same
10141                    dynamic type and type parameters on all
10142                    images of the current team.  If it is an
10143                    array, it shall have the same shape on all
10144                    images.
10145     SOURCE_IMAGE   a scalar integer expression.  It shall have
10146                    the same the same value on all images and
10147                    refer to an image of the current team.
10148     STAT           (optional) a scalar integer variable
10149     ERRMSG         (optional) a scalar character variable
10150
10151_Example_:
10152          program test
10153            integer :: val(3)
10154            if (this_image() == 1) then
10155              val = [1, 5, 3]
10156            end if
10157            call co_broadcast (val, source_image=1)
10158            print *, this_image, ":", val
10159          end program test
10160
10161_See also_:
10162     *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
10163
10164
10165File: gfortran.info,  Node: CO_MAX,  Next: CO_MIN,  Prev: CO_BROADCAST,  Up: Intrinsic Procedures
10166
101679.64 'CO_MAX' -- Maximal value on the current set of images
10168===========================================================
10169
10170_Description_:
10171     'CO_MAX' determines element-wise the maximal value of A on all
10172     images of the current team.  If RESULT_IMAGE is present, the
10173     maximum values are returned in A on the specified image only and
10174     the value of A on the other images become undefined.  If
10175     RESULT_IMAGE is not present, the value is returned on all images.
10176     If the execution was successful and STAT is present, it is assigned
10177     the value zero.  If the execution failed, STAT gets assigned a
10178     nonzero value and, if present, ERRMSG gets assigned a value
10179     describing the occurred error.
10180
10181_Standard_:
10182     Technical Specification (TS) 18508 or later
10183
10184_Class_:
10185     Collective subroutine
10186
10187_Syntax_:
10188     'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
10189
10190_Arguments_:
10191     A              shall be an integer, real or character
10192                    variable, which has the same type and type
10193                    parameters on all images of the team.
10194     RESULT_IMAGE   (optional) a scalar integer expression; if
10195                    present, it shall have the same the same
10196                    value on all images and refer to an image of
10197                    the current team.
10198     STAT           (optional) a scalar integer variable
10199     ERRMSG         (optional) a scalar character variable
10200
10201_Example_:
10202          program test
10203            integer :: val
10204            val = this_image ()
10205            call co_max (val, result_image=1)
10206            if (this_image() == 1) then
10207              write(*,*) "Maximal value", val  ! prints num_images()
10208            end if
10209          end program test
10210
10211_See also_:
10212     *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
10213     CO_BROADCAST::
10214
10215
10216File: gfortran.info,  Node: CO_MIN,  Next: CO_REDUCE,  Prev: CO_MAX,  Up: Intrinsic Procedures
10217
102189.65 'CO_MIN' -- Minimal value on the current set of images
10219===========================================================
10220
10221_Description_:
10222     'CO_MIN' determines element-wise the minimal value of A on all
10223     images of the current team.  If RESULT_IMAGE is present, the
10224     minimal values are returned in A on the specified image only and
10225     the value of A on the other images become undefined.  If
10226     RESULT_IMAGE is not present, the value is returned on all images.
10227     If the execution was successful and STAT is present, it is assigned
10228     the value zero.  If the execution failed, STAT gets assigned a
10229     nonzero value and, if present, ERRMSG gets assigned a value
10230     describing the occurred error.
10231
10232_Standard_:
10233     Technical Specification (TS) 18508 or later
10234
10235_Class_:
10236     Collective subroutine
10237
10238_Syntax_:
10239     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
10240
10241_Arguments_:
10242     A              shall be an integer, real or character
10243                    variable, which has the same type and type
10244                    parameters on all images of the team.
10245     RESULT_IMAGE   (optional) a scalar integer expression; if
10246                    present, it shall have the same the same
10247                    value on all images and refer to an image of
10248                    the current team.
10249     STAT           (optional) a scalar integer variable
10250     ERRMSG         (optional) a scalar character variable
10251
10252_Example_:
10253          program test
10254            integer :: val
10255            val = this_image ()
10256            call co_min (val, result_image=1)
10257            if (this_image() == 1) then
10258              write(*,*) "Minimal value", val  ! prints 1
10259            end if
10260          end program test
10261
10262_See also_:
10263     *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
10264     CO_BROADCAST::
10265
10266
10267File: gfortran.info,  Node: CO_REDUCE,  Next: CO_SUM,  Prev: CO_MIN,  Up: Intrinsic Procedures
10268
102699.66 'CO_REDUCE' -- Reduction of values on the current set of images
10270====================================================================
10271
10272_Description_:
10273     'CO_REDUCE' determines element-wise the reduction of the value of A
10274     on all images of the current team.  The pure function passed as
10275     OPERATOR is used to pairwise reduce the values of A by passing
10276     either the value of A of different images or the result values of
10277     such a reduction as argument.  If A is an array, the deduction is
10278     done element wise.  If RESULT_IMAGE is present, the result values
10279     are returned in A on the specified image only and the value of A on
10280     the other images become undefined.  If RESULT_IMAGE is not present,
10281     the value is returned on all images.  If the execution was
10282     successful and STAT is present, it is assigned the value zero.  If
10283     the execution failed, STAT gets assigned a nonzero value and, if
10284     present, ERRMSG gets assigned a value describing the occurred
10285     error.
10286
10287_Standard_:
10288     Technical Specification (TS) 18508 or later
10289
10290_Class_:
10291     Collective subroutine
10292
10293_Syntax_:
10294     'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
10295
10296_Arguments_:
10297     A              is an 'INTENT(INOUT)' argument and shall be
10298                    nonpolymorphic.  If it is allocatable, it
10299                    shall be allocated; if it is a pointer, it
10300                    shall be associated.  A shall have the same
10301                    type and type parameters on all images of the
10302                    team; if it is an array, it shall have the
10303                    same shape on all images.
10304     OPERATOR       pure function with two scalar nonallocatable
10305                    arguments, which shall be nonpolymorphic and
10306                    have the same type and type parameters as A.
10307                    The function shall return a nonallocatable
10308                    scalar of the same type and type parameters
10309                    as A.  The function shall be the same on all
10310                    images and with regards to the arguments
10311                    mathematically commutative and associative.
10312                    Note that OPERATOR may not be an elemental
10313                    function, unless it is an intrisic function.
10314     RESULT_IMAGE   (optional) a scalar integer expression; if
10315                    present, it shall have the same the same
10316                    value on all images and refer to an image of
10317                    the current team.
10318     STAT           (optional) a scalar integer variable
10319     ERRMSG         (optional) a scalar character variable
10320
10321_Example_:
10322          program test
10323            integer :: val
10324            val = this_image ()
10325            call co_reduce (val, result_image=1, operator=myprod)
10326            if (this_image() == 1) then
10327              write(*,*) "Product value", val  ! prints num_images() factorial
10328            end if
10329          contains
10330            pure function myprod(a, b)
10331              integer, value :: a, b
10332              integer :: myprod
10333              myprod = a * b
10334            end function myprod
10335          end program test
10336
10337_Note_:
10338     While the rules permit in principle an intrinsic function, none of
10339     the intrinsics in the standard fulfill the criteria of having a
10340     specific function, which takes two arguments of the same type and
10341     returning that type as result.
10342
10343_See also_:
10344     *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
10345     CO_BROADCAST::
10346
10347
10348File: gfortran.info,  Node: CO_SUM,  Next: COMMAND_ARGUMENT_COUNT,  Prev: CO_REDUCE,  Up: Intrinsic Procedures
10349
103509.67 'CO_SUM' -- Sum of values on the current set of images
10351===========================================================
10352
10353_Description_:
10354     'CO_SUM' sums up the values of each element of A on all images of
10355     the current team.  If RESULT_IMAGE is present, the summed-up values
10356     are returned in A on the specified image only and the value of A on
10357     the other images become undefined.  If RESULT_IMAGE is not present,
10358     the value is returned on all images.  If the execution was
10359     successful and STAT is present, it is assigned the value zero.  If
10360     the execution failed, STAT gets assigned a nonzero value and, if
10361     present, ERRMSG gets assigned a value describing the occurred
10362     error.
10363
10364_Standard_:
10365     Technical Specification (TS) 18508 or later
10366
10367_Class_:
10368     Collective subroutine
10369
10370_Syntax_:
10371     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
10372
10373_Arguments_:
10374     A              shall be an integer, real or complex
10375                    variable, which has the same type and type
10376                    parameters on all images of the team.
10377     RESULT_IMAGE   (optional) a scalar integer expression; if
10378                    present, it shall have the same the same
10379                    value on all images and refer to an image of
10380                    the current team.
10381     STAT           (optional) a scalar integer variable
10382     ERRMSG         (optional) a scalar character variable
10383
10384_Example_:
10385          program test
10386            integer :: val
10387            val = this_image ()
10388            call co_sum (val, result_image=1)
10389            if (this_image() == 1) then
10390              write(*,*) "The sum is ", val ! prints (n**2 + n)/2,
10391                                            ! with n = num_images()
10392            end if
10393          end program test
10394
10395_See also_:
10396     *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
10397     CO_BROADCAST::
10398
10399
10400File: gfortran.info,  Node: COMMAND_ARGUMENT_COUNT,  Next: COMPILER_OPTIONS,  Prev: CO_SUM,  Up: Intrinsic Procedures
10401
104029.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
10403=====================================================================
10404
10405_Description_:
10406     'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
10407     the command line when the containing program was invoked.
10408
10409_Standard_:
10410     Fortran 2003 and later
10411
10412_Class_:
10413     Inquiry function
10414
10415_Syntax_:
10416     'RESULT = COMMAND_ARGUMENT_COUNT()'
10417
10418_Arguments_:
10419     None
10420
10421_Return value_:
10422     The return value is an 'INTEGER' of default kind.
10423
10424_Example_:
10425          program test_command_argument_count
10426              integer :: count
10427              count = command_argument_count()
10428              print *, count
10429          end program test_command_argument_count
10430
10431_See also_:
10432     *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
10433
10434
10435File: gfortran.info,  Node: COMPILER_OPTIONS,  Next: COMPILER_VERSION,  Prev: COMMAND_ARGUMENT_COUNT,  Up: Intrinsic Procedures
10436
104379.69 'COMPILER_OPTIONS' -- Options passed to the compiler
10438=========================================================
10439
10440_Description_:
10441     'COMPILER_OPTIONS' returns a string with the options used for
10442     compiling.
10443
10444_Standard_:
10445     Fortran 2008
10446
10447_Class_:
10448     Inquiry function of the module 'ISO_FORTRAN_ENV'
10449
10450_Syntax_:
10451     'STR = COMPILER_OPTIONS()'
10452
10453_Arguments_:
10454     None
10455
10456_Return value_:
10457     The return value is a default-kind string with system-dependent
10458     length.  It contains the compiler flags used to compile the file,
10459     which called the 'COMPILER_OPTIONS' intrinsic.
10460
10461_Example_:
10462             use iso_fortran_env
10463             print '(4a)', 'This file was compiled by ', &
10464                           compiler_version(), ' using the options ', &
10465                           compiler_options()
10466             end
10467
10468_See also_:
10469     *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
10470
10471
10472File: gfortran.info,  Node: COMPILER_VERSION,  Next: COMPLEX,  Prev: COMPILER_OPTIONS,  Up: Intrinsic Procedures
10473
104749.70 'COMPILER_VERSION' -- Compiler version string
10475==================================================
10476
10477_Description_:
10478     'COMPILER_VERSION' returns a string with the name and the version
10479     of the compiler.
10480
10481_Standard_:
10482     Fortran 2008
10483
10484_Class_:
10485     Inquiry function of the module 'ISO_FORTRAN_ENV'
10486
10487_Syntax_:
10488     'STR = COMPILER_VERSION()'
10489
10490_Arguments_:
10491     None
10492
10493_Return value_:
10494     The return value is a default-kind string with system-dependent
10495     length.  It contains the name of the compiler and its version
10496     number.
10497
10498_Example_:
10499             use iso_fortran_env
10500             print '(4a)', 'This file was compiled by ', &
10501                           compiler_version(), ' using the options ', &
10502                           compiler_options()
10503             end
10504
10505_See also_:
10506     *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
10507
10508
10509File: gfortran.info,  Node: COMPLEX,  Next: CONJG,  Prev: COMPILER_VERSION,  Up: Intrinsic Procedures
10510
105119.71 'COMPLEX' -- Complex conversion function
10512=============================================
10513
10514_Description_:
10515     'COMPLEX(X, Y)' returns a complex number where X is converted to
10516     the real component and Y is converted to the imaginary component.
10517
10518_Standard_:
10519     GNU extension
10520
10521_Class_:
10522     Elemental function
10523
10524_Syntax_:
10525     'RESULT = COMPLEX(X, Y)'
10526
10527_Arguments_:
10528     X           The type may be 'INTEGER' or 'REAL'.
10529     Y           The type may be 'INTEGER' or 'REAL'.
10530
10531_Return value_:
10532     If X and Y are both of 'INTEGER' type, then the return value is of
10533     default 'COMPLEX' type.
10534
10535     If X and Y are of 'REAL' type, or one is of 'REAL' type and one is
10536     of 'INTEGER' type, then the return value is of 'COMPLEX' type with
10537     a kind equal to that of the 'REAL' argument with the highest
10538     precision.
10539
10540_Example_:
10541          program test_complex
10542              integer :: i = 42
10543              real :: x = 3.14
10544              print *, complex(i, x)
10545          end program test_complex
10546
10547_See also_:
10548     *note CMPLX::
10549
10550
10551File: gfortran.info,  Node: CONJG,  Next: COS,  Prev: COMPLEX,  Up: Intrinsic Procedures
10552
105539.72 'CONJG' -- Complex conjugate function
10554==========================================
10555
10556_Description_:
10557     'CONJG(Z)' returns the conjugate of Z.  If Z is '(x, y)' then the
10558     result is '(x, -y)'
10559
10560_Standard_:
10561     Fortran 77 and later, has an overload that is a GNU extension
10562
10563_Class_:
10564     Elemental function
10565
10566_Syntax_:
10567     'Z = CONJG(Z)'
10568
10569_Arguments_:
10570     Z           The type shall be 'COMPLEX'.
10571
10572_Return value_:
10573     The return value is of type 'COMPLEX'.
10574
10575_Example_:
10576          program test_conjg
10577              complex :: z = (2.0, 3.0)
10578              complex(8) :: dz = (2.71_8, -3.14_8)
10579              z= conjg(z)
10580              print *, z
10581              dz = dconjg(dz)
10582              print *, dz
10583          end program test_conjg
10584
10585_Specific names_:
10586     Name           Argument       Return type    Standard
10587     'DCONJG(Z)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10588                    Z'
10589
10590
10591File: gfortran.info,  Node: COS,  Next: COSD,  Prev: CONJG,  Up: Intrinsic Procedures
10592
105939.73 'COS' -- Cosine function
10594=============================
10595
10596_Description_:
10597     'COS(X)' computes the cosine of X.
10598
10599_Standard_:
10600     Fortran 77 and later, has overloads that are GNU extensions
10601
10602_Class_:
10603     Elemental function
10604
10605_Syntax_:
10606     'RESULT = COS(X)'
10607
10608_Arguments_:
10609     X           The type shall be 'REAL' or 'COMPLEX'.
10610
10611_Return value_:
10612     The return value is of the same type and kind as X.  The real part
10613     of the result is in radians.  If X is of the type 'REAL', the
10614     return value lies in the range -1 \leq \cos (x) \leq 1.
10615
10616_Example_:
10617          program test_cos
10618            real :: x = 0.0
10619            x = cos(x)
10620          end program test_cos
10621
10622_Specific names_:
10623     Name           Argument       Return type    Standard
10624     'COS(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
10625                                                  later
10626     'DCOS(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
10627                                                  later
10628     'CCOS(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
10629                    X'                            later
10630     'ZCOS(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10631                    X'
10632     'CDCOS(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10633                    X'
10634
10635_See also_:
10636     Inverse function: *note ACOS:: Degrees function: *note COSD::
10637
10638
10639File: gfortran.info,  Node: COSD,  Next: COSH,  Prev: COS,  Up: Intrinsic Procedures
10640
106419.74 'COSD' -- Cosine function, degrees
10642=======================================
10643
10644_Description_:
10645     'COSD(X)' computes the cosine of X in degrees.
10646
10647     This function is for compatibility only and should be avoided in
10648     favor of standard constructs wherever possible.
10649
10650_Standard_:
10651     GNU extension, enabled with '-fdec-math'.
10652
10653_Class_:
10654     Elemental function
10655
10656_Syntax_:
10657     'RESULT = COSD(X)'
10658
10659_Arguments_:
10660     X           The type shall be 'REAL' or 'COMPLEX'.
10661
10662_Return value_:
10663     The return value is of the same type and kind as X.  The real part
10664     of the result is in degrees.  If X is of the type 'REAL', the
10665     return value lies in the range -1 \leq \cosd (x) \leq 1.
10666
10667_Example_:
10668          program test_cosd
10669            real :: x = 0.0
10670            x = cosd(x)
10671          end program test_cosd
10672
10673_Specific names_:
10674     Name           Argument       Return type    Standard
10675     'COSD(X)'      'REAL(4) X'    'REAL(4)'      GNU extension
10676     'DCOSD(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
10677     'CCOSD(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU extension
10678                    X'
10679     'ZCOSD(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10680                    X'
10681     'CDCOSD(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10682                    X'
10683
10684_See also_:
10685     Inverse function: *note ACOSD:: Radians function: *note COS::
10686
10687
10688File: gfortran.info,  Node: COSH,  Next: COTAN,  Prev: COSD,  Up: Intrinsic Procedures
10689
106909.75 'COSH' -- Hyperbolic cosine function
10691=========================================
10692
10693_Description_:
10694     'COSH(X)' computes the hyperbolic cosine of X.
10695
10696_Standard_:
10697     Fortran 77 and later, for a complex argument Fortran 2008 or later
10698
10699_Class_:
10700     Elemental function
10701
10702_Syntax_:
10703     'X = COSH(X)'
10704
10705_Arguments_:
10706     X           The type shall be 'REAL' or 'COMPLEX'.
10707
10708_Return value_:
10709     The return value has same type and kind as X.  If X is complex, the
10710     imaginary part of the result is in radians.  If X is 'REAL', the
10711     return value has a lower bound of one, \cosh (x) \geq 1.
10712
10713_Example_:
10714          program test_cosh
10715            real(8) :: x = 1.0_8
10716            x = cosh(x)
10717          end program test_cosh
10718
10719_Specific names_:
10720     Name           Argument       Return type    Standard
10721     'COSH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
10722                                                  later
10723     'DCOSH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
10724                                                  later
10725
10726_See also_:
10727     Inverse function: *note ACOSH::
10728
10729
10730File: gfortran.info,  Node: COTAN,  Next: COTAND,  Prev: COSH,  Up: Intrinsic Procedures
10731
107329.76 'COTAN' -- Cotangent function
10733==================================
10734
10735_Description_:
10736     'COTAN(X)' computes the cotangent of X.  Equivalent to 'COS(x)'
10737     divided by 'SIN(x)', or '1 / TAN(x)'.
10738
10739     This function is for compatibility only and should be avoided in
10740     favor of standard constructs wherever possible.
10741
10742_Standard_:
10743     GNU extension, enabled with '-fdec-math'.
10744
10745_Class_:
10746     Elemental function
10747
10748_Syntax_:
10749     'RESULT = COTAN(X)'
10750
10751_Arguments_:
10752     X           The type shall be 'REAL' or 'COMPLEX'.
10753
10754_Return value_:
10755     The return value has same type and kind as X, and its value is in
10756     radians.
10757
10758_Example_:
10759          program test_cotan
10760            real(8) :: x = 0.165_8
10761            x = cotan(x)
10762          end program test_cotan
10763
10764_Specific names_:
10765     Name           Argument       Return type    Standard
10766     'COTAN(X)'     'REAL(4) X'    'REAL(4)'      GNU extension
10767     'DCOTAN(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
10768
10769_See also_:
10770     Converse function: *note TAN:: Degrees function: *note COTAND::
10771
10772
10773File: gfortran.info,  Node: COTAND,  Next: COUNT,  Prev: COTAN,  Up: Intrinsic Procedures
10774
107759.77 'COTAND' -- Cotangent function, degrees
10776============================================
10777
10778_Description_:
10779     'COTAND(X)' computes the cotangent of X in degrees.  Equivalent to
10780     'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'.
10781
10782_Standard_:
10783     GNU extension, enabled with '-fdec-math'.
10784
10785     This function is for compatibility only and should be avoided in
10786     favor of standard constructs wherever possible.
10787
10788_Class_:
10789     Elemental function
10790
10791_Syntax_:
10792     'RESULT = COTAND(X)'
10793
10794_Arguments_:
10795     X           The type shall be 'REAL' or 'COMPLEX'.
10796
10797_Return value_:
10798     The return value has same type and kind as X, and its value is in
10799     degrees.
10800
10801_Example_:
10802          program test_cotand
10803            real(8) :: x = 0.165_8
10804            x = cotand(x)
10805          end program test_cotand
10806
10807_Specific names_:
10808     Name           Argument       Return type    Standard
10809     'COTAND(X)'    'REAL(4) X'    'REAL(4)'      GNU extension
10810     'DCOTAND(X)'   'REAL(8) X'    'REAL(8)'      GNU extension
10811
10812_See also_:
10813     Converse function: *note TAND:: Radians function: *note COTAN::
10814
10815
10816File: gfortran.info,  Node: COUNT,  Next: CPU_TIME,  Prev: COTAND,  Up: Intrinsic Procedures
10817
108189.78 'COUNT' -- Count function
10819==============================
10820
10821_Description_:
10822
10823     Counts the number of '.TRUE.' elements in a logical MASK, or, if
10824     the DIM argument is supplied, counts the number of elements along
10825     each row of the array in the DIM direction.  If the array has zero
10826     size, or all of the elements of MASK are '.FALSE.', then the result
10827     is '0'.
10828
10829_Standard_:
10830     Fortran 90 and later, with KIND argument Fortran 2003 and later
10831
10832_Class_:
10833     Transformational function
10834
10835_Syntax_:
10836     'RESULT = COUNT(MASK [, DIM, KIND])'
10837
10838_Arguments_:
10839     MASK        The type shall be 'LOGICAL'.
10840     DIM         (Optional) The type shall be 'INTEGER'.
10841     KIND        (Optional) An 'INTEGER' initialization
10842                 expression indicating the kind parameter of the
10843                 result.
10844
10845_Return value_:
10846     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
10847     absent, the return value is of default integer kind.  If DIM is
10848     present, the result is an array with a rank one less than the rank
10849     of ARRAY, and a size corresponding to the shape of ARRAY with the
10850     DIM dimension removed.
10851
10852_Example_:
10853          program test_count
10854              integer, dimension(2,3) :: a, b
10855              logical, dimension(2,3) :: mask
10856              a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
10857              b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
10858              print '(3i3)', a(1,:)
10859              print '(3i3)', a(2,:)
10860              print *
10861              print '(3i3)', b(1,:)
10862              print '(3i3)', b(2,:)
10863              print *
10864              mask = a.ne.b
10865              print '(3l3)', mask(1,:)
10866              print '(3l3)', mask(2,:)
10867              print *
10868              print '(3i3)', count(mask)
10869              print *
10870              print '(3i3)', count(mask, 1)
10871              print *
10872              print '(3i3)', count(mask, 2)
10873          end program test_count
10874
10875
10876File: gfortran.info,  Node: CPU_TIME,  Next: CSHIFT,  Prev: COUNT,  Up: Intrinsic Procedures
10877
108789.79 'CPU_TIME' -- CPU elapsed time in seconds
10879==============================================
10880
10881_Description_:
10882     Returns a 'REAL' value representing the elapsed CPU time in
10883     seconds.  This is useful for testing segments of code to determine
10884     execution time.
10885
10886     If a time source is available, time will be reported with
10887     microsecond resolution.  If no time source is available, TIME is
10888     set to '-1.0'.
10889
10890     Note that TIME may contain a, system dependent, arbitrary offset
10891     and may not start with '0.0'.  For 'CPU_TIME', the absolute value
10892     is meaningless, only differences between subsequent calls to this
10893     subroutine, as shown in the example below, should be used.
10894
10895_Standard_:
10896     Fortran 95 and later
10897
10898_Class_:
10899     Subroutine
10900
10901_Syntax_:
10902     'CALL CPU_TIME(TIME)'
10903
10904_Arguments_:
10905     TIME        The type shall be 'REAL' with 'INTENT(OUT)'.
10906
10907_Return value_:
10908     None
10909
10910_Example_:
10911          program test_cpu_time
10912              real :: start, finish
10913              call cpu_time(start)
10914                  ! put code to test here
10915              call cpu_time(finish)
10916              print '("Time = ",f6.3," seconds.")',finish-start
10917          end program test_cpu_time
10918
10919_See also_:
10920     *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
10921
10922
10923File: gfortran.info,  Node: CSHIFT,  Next: CTIME,  Prev: CPU_TIME,  Up: Intrinsic Procedures
10924
109259.80 'CSHIFT' -- Circular shift elements of an array
10926====================================================
10927
10928_Description_:
10929     'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
10930     elements of ARRAY along the dimension of DIM.  If DIM is omitted it
10931     is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the range
10932     of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the rank of
10933     ARRAY is one, then all elements of ARRAY are shifted by SHIFT
10934     places.  If rank is greater than one, then all complete rank one
10935     sections of ARRAY along the given dimension are shifted.  Elements
10936     shifted out one end of each rank one section are shifted back in
10937     the other end.
10938
10939_Standard_:
10940     Fortran 90 and later
10941
10942_Class_:
10943     Transformational function
10944
10945_Syntax_:
10946     'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
10947
10948_Arguments_:
10949     ARRAY       Shall be an array of any type.
10950     SHIFT       The type shall be 'INTEGER'.
10951     DIM         The type shall be 'INTEGER'.
10952
10953_Return value_:
10954     Returns an array of same type and rank as the ARRAY argument.
10955
10956_Example_:
10957          program test_cshift
10958              integer, dimension(3,3) :: a
10959              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
10960              print '(3i3)', a(1,:)
10961              print '(3i3)', a(2,:)
10962              print '(3i3)', a(3,:)
10963              a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
10964              print *
10965              print '(3i3)', a(1,:)
10966              print '(3i3)', a(2,:)
10967              print '(3i3)', a(3,:)
10968          end program test_cshift
10969
10970
10971File: gfortran.info,  Node: CTIME,  Next: DATE_AND_TIME,  Prev: CSHIFT,  Up: Intrinsic Procedures
10972
109739.81 'CTIME' -- Convert a time into a string
10974============================================
10975
10976_Description_:
10977     'CTIME' converts a system time value, such as returned by *note
10978     TIME8::, to a string.  The output will be of the form 'Sat Aug 19
10979     18:13:14 1995'.
10980
10981     This intrinsic is provided in both subroutine and function forms;
10982     however, only one form can be used in any given program unit.
10983
10984_Standard_:
10985     GNU extension
10986
10987_Class_:
10988     Subroutine, function
10989
10990_Syntax_:
10991     'CALL CTIME(TIME, RESULT)'.
10992     'RESULT = CTIME(TIME)'.
10993
10994_Arguments_:
10995     TIME        The type shall be of type 'INTEGER'.
10996     RESULT      The type shall be of type 'CHARACTER' and of
10997                 default kind.  It is an 'INTENT(OUT)' argument.
10998                 If the length of this variable is too short for
10999                 the time and date string to fit completely, it
11000                 will be blank on procedure return.
11001
11002_Return value_:
11003     The converted date and time as a string.
11004
11005_Example_:
11006          program test_ctime
11007              integer(8) :: i
11008              character(len=30) :: date
11009              i = time8()
11010
11011              ! Do something, main part of the program
11012
11013              call ctime(i,date)
11014              print *, 'Program was started on ', date
11015          end program test_ctime
11016
11017_See Also_:
11018     *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::,
11019     *note TIME8::
11020
11021
11022File: gfortran.info,  Node: DATE_AND_TIME,  Next: DBLE,  Prev: CTIME,  Up: Intrinsic Procedures
11023
110249.82 'DATE_AND_TIME' -- Date and time subroutine
11025================================================
11026
11027_Description_:
11028     'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
11029     date and time information from the real-time system clock.  DATE is
11030     'INTENT(OUT)' and has form ccyymmdd.  TIME is 'INTENT(OUT)' and has
11031     form hhmmss.sss.  ZONE is 'INTENT(OUT)' and has form (+-)hhmm,
11032     representing the difference with respect to Coordinated Universal
11033     Time (UTC). Unavailable time and date parameters return blanks.
11034
11035     VALUES is 'INTENT(OUT)' and provides the following:
11036
11037                 'VALUE(1)':            The year
11038                 'VALUE(2)':            The month
11039                 'VALUE(3)':            The day of the month
11040                 'VALUE(4)':            Time difference with UTC in
11041                                        minutes
11042                 'VALUE(5)':            The hour of the day
11043                 'VALUE(6)':            The minutes of the hour
11044                 'VALUE(7)':            The seconds of the minute
11045                 'VALUE(8)':            The milliseconds of the
11046                                        second
11047
11048_Standard_:
11049     Fortran 90 and later
11050
11051_Class_:
11052     Subroutine
11053
11054_Syntax_:
11055     'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
11056
11057_Arguments_:
11058     DATE        (Optional) The type shall be 'CHARACTER(LEN=8)'
11059                 or larger, and of default kind.
11060     TIME        (Optional) The type shall be 'CHARACTER(LEN=10)'
11061                 or larger, and of default kind.
11062     ZONE        (Optional) The type shall be 'CHARACTER(LEN=5)'
11063                 or larger, and of default kind.
11064     VALUES      (Optional) The type shall be 'INTEGER(8)'.
11065
11066_Return value_:
11067     None
11068
11069_Example_:
11070          program test_time_and_date
11071              character(8)  :: date
11072              character(10) :: time
11073              character(5)  :: zone
11074              integer,dimension(8) :: values
11075              ! using keyword arguments
11076              call date_and_time(date,time,zone,values)
11077              call date_and_time(DATE=date,ZONE=zone)
11078              call date_and_time(TIME=time)
11079              call date_and_time(VALUES=values)
11080              print '(a,2x,a,2x,a)', date, time, zone
11081              print '(8i5)', values
11082          end program test_time_and_date
11083
11084_See also_:
11085     *note CPU_TIME::, *note SYSTEM_CLOCK::
11086
11087
11088File: gfortran.info,  Node: DBLE,  Next: DCMPLX,  Prev: DATE_AND_TIME,  Up: Intrinsic Procedures
11089
110909.83 'DBLE' -- Double conversion function
11091=========================================
11092
11093_Description_:
11094     'DBLE(A)' Converts A to double precision real type.
11095
11096_Standard_:
11097     Fortran 77 and later
11098
11099_Class_:
11100     Elemental function
11101
11102_Syntax_:
11103     'RESULT = DBLE(A)'
11104
11105_Arguments_:
11106     A           The type shall be 'INTEGER', 'REAL', or
11107                 'COMPLEX'.
11108
11109_Return value_:
11110     The return value is of type double precision real.
11111
11112_Example_:
11113          program test_dble
11114              real    :: x = 2.18
11115              integer :: i = 5
11116              complex :: z = (2.3,1.14)
11117              print *, dble(x), dble(i), dble(z)
11118          end program test_dble
11119
11120_See also_:
11121     *note REAL::
11122
11123
11124File: gfortran.info,  Node: DCMPLX,  Next: DIGITS,  Prev: DBLE,  Up: Intrinsic Procedures
11125
111269.84 'DCMPLX' -- Double complex conversion function
11127===================================================
11128
11129_Description_:
11130     'DCMPLX(X [,Y])' returns a double complex number where X is
11131     converted to the real component.  If Y is present it is converted
11132     to the imaginary component.  If Y is not present then the imaginary
11133     component is set to 0.0.  If X is complex then Y must not be
11134     present.
11135
11136_Standard_:
11137     GNU extension
11138
11139_Class_:
11140     Elemental function
11141
11142_Syntax_:
11143     'RESULT = DCMPLX(X [, Y])'
11144
11145_Arguments_:
11146     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
11147     Y           (Optional if X is not 'COMPLEX'.)  May be
11148                 'INTEGER' or 'REAL'.
11149
11150_Return value_:
11151     The return value is of type 'COMPLEX(8)'
11152
11153_Example_:
11154          program test_dcmplx
11155              integer :: i = 42
11156              real :: x = 3.14
11157              complex :: z
11158              z = cmplx(i, x)
11159              print *, dcmplx(i)
11160              print *, dcmplx(x)
11161              print *, dcmplx(z)
11162              print *, dcmplx(x,i)
11163          end program test_dcmplx
11164
11165
11166File: gfortran.info,  Node: DIGITS,  Next: DIM,  Prev: DCMPLX,  Up: Intrinsic Procedures
11167
111689.85 'DIGITS' -- Significant binary digits function
11169===================================================
11170
11171_Description_:
11172     'DIGITS(X)' returns the number of significant binary digits of the
11173     internal model representation of X.  For example, on a system using
11174     a 32-bit floating point representation, a default real number would
11175     likely return 24.
11176
11177_Standard_:
11178     Fortran 90 and later
11179
11180_Class_:
11181     Inquiry function
11182
11183_Syntax_:
11184     'RESULT = DIGITS(X)'
11185
11186_Arguments_:
11187     X           The type may be 'INTEGER' or 'REAL'.
11188
11189_Return value_:
11190     The return value is of type 'INTEGER'.
11191
11192_Example_:
11193          program test_digits
11194              integer :: i = 12345
11195              real :: x = 3.143
11196              real(8) :: y = 2.33
11197              print *, digits(i)
11198              print *, digits(x)
11199              print *, digits(y)
11200          end program test_digits
11201
11202
11203File: gfortran.info,  Node: DIM,  Next: DOT_PRODUCT,  Prev: DIGITS,  Up: Intrinsic Procedures
11204
112059.86 'DIM' -- Positive difference
11206=================================
11207
11208_Description_:
11209     'DIM(X,Y)' returns the difference 'X-Y' if the result is positive;
11210     otherwise returns zero.
11211
11212_Standard_:
11213     Fortran 77 and later
11214
11215_Class_:
11216     Elemental function
11217
11218_Syntax_:
11219     'RESULT = DIM(X, Y)'
11220
11221_Arguments_:
11222     X           The type shall be 'INTEGER' or 'REAL'
11223     Y           The type shall be the same type and kind as X.
11224                 (As a GNU extension, arguments of different
11225                 kinds are permitted.)
11226
11227_Return value_:
11228     The return value is of type 'INTEGER' or 'REAL'.  (As a GNU
11229     extension, kind is the largest kind of the actual arguments.)
11230
11231_Example_:
11232          program test_dim
11233              integer :: i
11234              real(8) :: x
11235              i = dim(4, 15)
11236              x = dim(4.345_8, 2.111_8)
11237              print *, i
11238              print *, x
11239          end program test_dim
11240
11241_Specific names_:
11242     Name           Argument       Return type    Standard
11243     'DIM(X,Y)'     'REAL(4) X,    'REAL(4)'      Fortran 77 and
11244                    Y'                            later
11245     'IDIM(X,Y)'    'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
11246                    X, Y'                         later
11247     'DDIM(X,Y)'    'REAL(8) X,    'REAL(8)'      Fortran 77 and
11248                    Y'                            later
11249
11250
11251File: gfortran.info,  Node: DOT_PRODUCT,  Next: DPROD,  Prev: DIM,  Up: Intrinsic Procedures
11252
112539.87 'DOT_PRODUCT' -- Dot product function
11254==========================================
11255
11256_Description_:
11257     'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
11258     multiplication of two vectors VECTOR_A and VECTOR_B.  The two
11259     vectors may be either numeric or logical and must be arrays of rank
11260     one and of equal size.  If the vectors are 'INTEGER' or 'REAL', the
11261     result is 'SUM(VECTOR_A*VECTOR_B)'.  If the vectors are 'COMPLEX',
11262     the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'.  If the vectors are
11263     'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'.
11264
11265_Standard_:
11266     Fortran 90 and later
11267
11268_Class_:
11269     Transformational function
11270
11271_Syntax_:
11272     'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
11273
11274_Arguments_:
11275     VECTOR_A    The type shall be numeric or 'LOGICAL', rank 1.
11276     VECTOR_B    The type shall be numeric if VECTOR_A is of
11277                 numeric type or 'LOGICAL' if VECTOR_A is of type
11278                 'LOGICAL'.  VECTOR_B shall be a rank-one array.
11279
11280_Return value_:
11281     If the arguments are numeric, the return value is a scalar of
11282     numeric type, 'INTEGER', 'REAL', or 'COMPLEX'.  If the arguments
11283     are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'.
11284
11285_Example_:
11286          program test_dot_prod
11287              integer, dimension(3) :: a, b
11288              a = (/ 1, 2, 3 /)
11289              b = (/ 4, 5, 6 /)
11290              print '(3i3)', a
11291              print *
11292              print '(3i3)', b
11293              print *
11294              print *, dot_product(a,b)
11295          end program test_dot_prod
11296
11297
11298File: gfortran.info,  Node: DPROD,  Next: DREAL,  Prev: DOT_PRODUCT,  Up: Intrinsic Procedures
11299
113009.88 'DPROD' -- Double product function
11301=======================================
11302
11303_Description_:
11304     'DPROD(X,Y)' returns the product 'X*Y'.
11305
11306_Standard_:
11307     Fortran 77 and later
11308
11309_Class_:
11310     Elemental function
11311
11312_Syntax_:
11313     'RESULT = DPROD(X, Y)'
11314
11315_Arguments_:
11316     X           The type shall be 'REAL'.
11317     Y           The type shall be 'REAL'.
11318
11319_Return value_:
11320     The return value is of type 'REAL(8)'.
11321
11322_Example_:
11323          program test_dprod
11324              real :: x = 5.2
11325              real :: y = 2.3
11326              real(8) :: d
11327              d = dprod(x,y)
11328              print *, d
11329          end program test_dprod
11330
11331_Specific names_:
11332     Name           Argument       Return type    Standard
11333     'DPROD(X,Y)'   'REAL(4) X,    'REAL(8)'      Fortran 77 and
11334                    Y'                            later
11335
11336
11337File: gfortran.info,  Node: DREAL,  Next: DSHIFTL,  Prev: DPROD,  Up: Intrinsic Procedures
11338
113399.89 'DREAL' -- Double real part function
11340=========================================
11341
11342_Description_:
11343     'DREAL(Z)' returns the real part of complex variable Z.
11344
11345_Standard_:
11346     GNU extension
11347
11348_Class_:
11349     Elemental function
11350
11351_Syntax_:
11352     'RESULT = DREAL(A)'
11353
11354_Arguments_:
11355     A           The type shall be 'COMPLEX(8)'.
11356
11357_Return value_:
11358     The return value is of type 'REAL(8)'.
11359
11360_Example_:
11361          program test_dreal
11362              complex(8) :: z = (1.3_8,7.2_8)
11363              print *, dreal(z)
11364          end program test_dreal
11365
11366_See also_:
11367     *note AIMAG::
11368
11369
11370File: gfortran.info,  Node: DSHIFTL,  Next: DSHIFTR,  Prev: DREAL,  Up: Intrinsic Procedures
11371
113729.90 'DSHIFTL' -- Combined left shift
11373=====================================
11374
11375_Description_:
11376     'DSHIFTL(I, J, SHIFT)' combines bits of I and J.  The rightmost
11377     SHIFT bits of the result are the leftmost SHIFT bits of J, and the
11378     remaining bits are the rightmost bits of I.
11379
11380_Standard_:
11381     Fortran 2008 and later
11382
11383_Class_:
11384     Elemental function
11385
11386_Syntax_:
11387     'RESULT = DSHIFTL(I, J, SHIFT)'
11388
11389_Arguments_:
11390     I           Shall be of type 'INTEGER' or a BOZ constant.
11391     J           Shall be of type 'INTEGER' or a BOZ constant.
11392                 If both I and J have integer type, then they
11393                 shall have the same kind type parameter.  I and
11394                 J shall not both be BOZ constants.
11395     SHIFT       Shall be of type 'INTEGER'.  It shall be
11396                 nonnegative.  If I is not a BOZ constant, then
11397                 SHIFT shall be less than or equal to
11398                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11399                 than or equal to 'BIT_SIZE(J)'.
11400
11401_Return value_:
11402     If either I or J is a BOZ constant, it is first converted as if by
11403     the intrinsic function 'INT' to an integer type with the kind type
11404     parameter of the other.
11405
11406_See also_:
11407     *note DSHIFTR::
11408
11409
11410File: gfortran.info,  Node: DSHIFTR,  Next: DTIME,  Prev: DSHIFTL,  Up: Intrinsic Procedures
11411
114129.91 'DSHIFTR' -- Combined right shift
11413======================================
11414
11415_Description_:
11416     'DSHIFTR(I, J, SHIFT)' combines bits of I and J.  The leftmost
11417     SHIFT bits of the result are the rightmost SHIFT bits of I, and the
11418     remaining bits are the leftmost bits of J.
11419
11420_Standard_:
11421     Fortran 2008 and later
11422
11423_Class_:
11424     Elemental function
11425
11426_Syntax_:
11427     'RESULT = DSHIFTR(I, J, SHIFT)'
11428
11429_Arguments_:
11430     I           Shall be of type 'INTEGER' or a BOZ constant.
11431     J           Shall be of type 'INTEGER' or a BOZ constant.
11432                 If both I and J have integer type, then they
11433                 shall have the same kind type parameter.  I and
11434                 J shall not both be BOZ constants.
11435     SHIFT       Shall be of type 'INTEGER'.  It shall be
11436                 nonnegative.  If I is not a BOZ constant, then
11437                 SHIFT shall be less than or equal to
11438                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11439                 than or equal to 'BIT_SIZE(J)'.
11440
11441_Return value_:
11442     If either I or J is a BOZ constant, it is first converted as if by
11443     the intrinsic function 'INT' to an integer type with the kind type
11444     parameter of the other.
11445
11446_See also_:
11447     *note DSHIFTL::
11448
11449
11450File: gfortran.info,  Node: DTIME,  Next: EOSHIFT,  Prev: DSHIFTR,  Up: Intrinsic Procedures
11451
114529.92 'DTIME' -- Execution time subroutine (or function)
11453=======================================================
11454
11455_Description_:
11456     'DTIME(VALUES, TIME)' initially returns the number of seconds of
11457     runtime since the start of the process's execution in TIME.  VALUES
11458     returns the user and system components of this time in 'VALUES(1)'
11459     and 'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11460     VALUES(2)'.
11461
11462     Subsequent invocations of 'DTIME' return values accumulated since
11463     the previous invocation.
11464
11465     On some systems, the underlying timings are represented using types
11466     with sufficiently small limits that overflows (wrap around) are
11467     possible, such as 32-bit types.  Therefore, the values returned by
11468     this intrinsic might be, or become, negative, or numerically less
11469     than previous values, during a single run of the compiled program.
11470
11471     Please note, that this implementation is thread safe if used within
11472     OpenMP directives, i.e., its state will be consistent while called
11473     from multiple threads.  However, if 'DTIME' is called from multiple
11474     threads, the result is still the time since the last invocation.
11475     This may not give the intended results.  If possible, use
11476     'CPU_TIME' instead.
11477
11478     This intrinsic is provided in both subroutine and function forms;
11479     however, only one form can be used in any given program unit.
11480
11481     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11482
11483                 'VALUES(1)':           User time in seconds.
11484                 'VALUES(2)':           System time in seconds.
11485                 'TIME':                Run time since start in
11486                                        seconds.
11487
11488_Standard_:
11489     GNU extension
11490
11491_Class_:
11492     Subroutine, function
11493
11494_Syntax_:
11495     'CALL DTIME(VALUES, TIME)'.
11496     'TIME = DTIME(VALUES)', (not recommended).
11497
11498_Arguments_:
11499     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11500     TIME        The type shall be 'REAL(4)'.
11501
11502_Return value_:
11503     Elapsed time in seconds since the last invocation or since the
11504     start of program execution if not called before.
11505
11506_Example_:
11507          program test_dtime
11508              integer(8) :: i, j
11509              real, dimension(2) :: tarray
11510              real :: result
11511              call dtime(tarray, result)
11512              print *, result
11513              print *, tarray(1)
11514              print *, tarray(2)
11515              do i=1,100000000    ! Just a delay
11516                  j = i * i - i
11517              end do
11518              call dtime(tarray, result)
11519              print *, result
11520              print *, tarray(1)
11521              print *, tarray(2)
11522          end program test_dtime
11523
11524_See also_:
11525     *note CPU_TIME::
11526
11527
11528File: gfortran.info,  Node: EOSHIFT,  Next: EPSILON,  Prev: DTIME,  Up: Intrinsic Procedures
11529
115309.93 'EOSHIFT' -- End-off shift elements of an array
11531====================================================
11532
11533_Description_:
11534     'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
11535     on elements of ARRAY along the dimension of DIM.  If DIM is omitted
11536     it is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the
11537     range of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the
11538     rank of ARRAY is one, then all elements of ARRAY are shifted by
11539     SHIFT places.  If rank is greater than one, then all complete rank
11540     one sections of ARRAY along the given dimension are shifted.
11541     Elements shifted out one end of each rank one section are dropped.
11542     If BOUNDARY is present then the corresponding value of from
11543     BOUNDARY is copied back in the other end.  If BOUNDARY is not
11544     present then the following are copied in depending on the type of
11545     ARRAY.
11546
11547     _Array      _Boundary Value_
11548     Type_
11549     Numeric     0 of the type and kind of ARRAY.
11550     Logical     '.FALSE.'.
11551     Character(LEN)LEN blanks.
11552
11553_Standard_:
11554     Fortran 90 and later
11555
11556_Class_:
11557     Transformational function
11558
11559_Syntax_:
11560     'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
11561
11562_Arguments_:
11563     ARRAY       May be any type, not scalar.
11564     SHIFT       The type shall be 'INTEGER'.
11565     BOUNDARY    Same type as ARRAY.
11566     DIM         The type shall be 'INTEGER'.
11567
11568_Return value_:
11569     Returns an array of same type and rank as the ARRAY argument.
11570
11571_Example_:
11572          program test_eoshift
11573              integer, dimension(3,3) :: a
11574              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
11575              print '(3i3)', a(1,:)
11576              print '(3i3)', a(2,:)
11577              print '(3i3)', a(3,:)
11578              a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
11579              print *
11580              print '(3i3)', a(1,:)
11581              print '(3i3)', a(2,:)
11582              print '(3i3)', a(3,:)
11583          end program test_eoshift
11584
11585
11586File: gfortran.info,  Node: EPSILON,  Next: ERF,  Prev: EOSHIFT,  Up: Intrinsic Procedures
11587
115889.94 'EPSILON' -- Epsilon function
11589==================================
11590
11591_Description_:
11592     'EPSILON(X)' returns the smallest number E of the same kind as X
11593     such that 1 + E > 1.
11594
11595_Standard_:
11596     Fortran 90 and later
11597
11598_Class_:
11599     Inquiry function
11600
11601_Syntax_:
11602     'RESULT = EPSILON(X)'
11603
11604_Arguments_:
11605     X           The type shall be 'REAL'.
11606
11607_Return value_:
11608     The return value is of same type as the argument.
11609
11610_Example_:
11611          program test_epsilon
11612              real :: x = 3.143
11613              real(8) :: y = 2.33
11614              print *, EPSILON(x)
11615              print *, EPSILON(y)
11616          end program test_epsilon
11617
11618
11619File: gfortran.info,  Node: ERF,  Next: ERFC,  Prev: EPSILON,  Up: Intrinsic Procedures
11620
116219.95 'ERF' -- Error function
11622============================
11623
11624_Description_:
11625     'ERF(X)' computes the error function of X.
11626
11627_Standard_:
11628     Fortran 2008 and later
11629
11630_Class_:
11631     Elemental function
11632
11633_Syntax_:
11634     'RESULT = ERF(X)'
11635
11636_Arguments_:
11637     X           The type shall be 'REAL'.
11638
11639_Return value_:
11640     The return value is of type 'REAL', of the same kind as X and lies
11641     in the range -1 \leq erf (x) \leq 1 .
11642
11643_Example_:
11644          program test_erf
11645            real(8) :: x = 0.17_8
11646            x = erf(x)
11647          end program test_erf
11648
11649_Specific names_:
11650     Name           Argument       Return type    Standard
11651     'DERF(X)'      'REAL(8) X'    'REAL(8)'      GNU extension
11652
11653
11654File: gfortran.info,  Node: ERFC,  Next: ERFC_SCALED,  Prev: ERF,  Up: Intrinsic Procedures
11655
116569.96 'ERFC' -- Error function
11657=============================
11658
11659_Description_:
11660     'ERFC(X)' computes the complementary error function of X.
11661
11662_Standard_:
11663     Fortran 2008 and later
11664
11665_Class_:
11666     Elemental function
11667
11668_Syntax_:
11669     'RESULT = ERFC(X)'
11670
11671_Arguments_:
11672     X           The type shall be 'REAL'.
11673
11674_Return value_:
11675     The return value is of type 'REAL' and of the same kind as X.  It
11676     lies in the range 0 \leq erfc (x) \leq 2 .
11677
11678_Example_:
11679          program test_erfc
11680            real(8) :: x = 0.17_8
11681            x = erfc(x)
11682          end program test_erfc
11683
11684_Specific names_:
11685     Name           Argument       Return type    Standard
11686     'DERFC(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
11687
11688
11689File: gfortran.info,  Node: ERFC_SCALED,  Next: ETIME,  Prev: ERFC,  Up: Intrinsic Procedures
11690
116919.97 'ERFC_SCALED' -- Error function
11692====================================
11693
11694_Description_:
11695     'ERFC_SCALED(X)' computes the exponentially-scaled complementary
11696     error function of X.
11697
11698_Standard_:
11699     Fortran 2008 and later
11700
11701_Class_:
11702     Elemental function
11703
11704_Syntax_:
11705     'RESULT = ERFC_SCALED(X)'
11706
11707_Arguments_:
11708     X           The type shall be 'REAL'.
11709
11710_Return value_:
11711     The return value is of type 'REAL' and of the same kind as X.
11712
11713_Example_:
11714          program test_erfc_scaled
11715            real(8) :: x = 0.17_8
11716            x = erfc_scaled(x)
11717          end program test_erfc_scaled
11718
11719
11720File: gfortran.info,  Node: ETIME,  Next: EVENT_QUERY,  Prev: ERFC_SCALED,  Up: Intrinsic Procedures
11721
117229.98 'ETIME' -- Execution time subroutine (or function)
11723=======================================================
11724
11725_Description_:
11726     'ETIME(VALUES, TIME)' returns the number of seconds of runtime
11727     since the start of the process's execution in TIME.  VALUES returns
11728     the user and system components of this time in 'VALUES(1)' and
11729     'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11730     VALUES(2)'.
11731
11732     On some systems, the underlying timings are represented using types
11733     with sufficiently small limits that overflows (wrap around) are
11734     possible, such as 32-bit types.  Therefore, the values returned by
11735     this intrinsic might be, or become, negative, or numerically less
11736     than previous values, during a single run of the compiled program.
11737
11738     This intrinsic is provided in both subroutine and function forms;
11739     however, only one form can be used in any given program unit.
11740
11741     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11742
11743                 'VALUES(1)':           User time in seconds.
11744                 'VALUES(2)':           System time in seconds.
11745                 'TIME':                Run time since start in seconds.
11746
11747_Standard_:
11748     GNU extension
11749
11750_Class_:
11751     Subroutine, function
11752
11753_Syntax_:
11754     'CALL ETIME(VALUES, TIME)'.
11755     'TIME = ETIME(VALUES)', (not recommended).
11756
11757_Arguments_:
11758     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11759     TIME        The type shall be 'REAL(4)'.
11760
11761_Return value_:
11762     Elapsed time in seconds since the start of program execution.
11763
11764_Example_:
11765          program test_etime
11766              integer(8) :: i, j
11767              real, dimension(2) :: tarray
11768              real :: result
11769              call ETIME(tarray, result)
11770              print *, result
11771              print *, tarray(1)
11772              print *, tarray(2)
11773              do i=1,100000000    ! Just a delay
11774                  j = i * i - i
11775              end do
11776              call ETIME(tarray, result)
11777              print *, result
11778              print *, tarray(1)
11779              print *, tarray(2)
11780          end program test_etime
11781
11782_See also_:
11783     *note CPU_TIME::
11784
11785
11786File: gfortran.info,  Node: EVENT_QUERY,  Next: EXECUTE_COMMAND_LINE,  Prev: ETIME,  Up: Intrinsic Procedures
11787
117889.99 'EVENT_QUERY' -- Query whether a coarray event has occurred
11789================================================================
11790
11791_Description_:
11792     'EVENT_QUERY' assignes the number of events to COUNT which have
11793     been posted to the EVENT variable and not yet been removed by
11794     calling 'EVENT WAIT'.  When STAT is present and the invocation was
11795     successful, it is assigned the value 0.  If it is present and the
11796     invocation has failed, it is assigned a positive value and COUNT is
11797     assigned the value -1.
11798
11799_Standard_:
11800     TS 18508 or later
11801
11802_Class_:
11803     subroutine
11804
11805_Syntax_:
11806     'CALL EVENT_QUERY (EVENT, COUNT [, STAT])'
11807
11808_Arguments_:
11809     EVENT       (intent(IN)) Scalar of type 'EVENT_TYPE',
11810                 defined in 'ISO_FORTRAN_ENV'; shall not be
11811                 coindexed.
11812     COUNT       (intent(out))Scalar integer with at least the
11813                 precision of default integer.
11814     STAT        (optional) Scalar default-kind integer variable.
11815
11816_Example_:
11817          program atomic
11818            use iso_fortran_env
11819            implicit none
11820            type(event_type) :: event_value_has_been_set[*]
11821            integer :: cnt
11822            if (this_image() == 1) then
11823              call event_query (event_value_has_been_set, cnt)
11824              if (cnt > 0) write(*,*) "Value has been set"
11825            elseif (this_image() == 2) then
11826              event post (event_value_has_been_set[1])
11827            end if
11828          end program atomic
11829
11830
11831File: gfortran.info,  Node: EXECUTE_COMMAND_LINE,  Next: EXIT,  Prev: EVENT_QUERY,  Up: Intrinsic Procedures
11832
118339.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command
11834=======================================================
11835
11836_Description_:
11837     'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
11838     asynchronously.
11839
11840     The 'COMMAND' argument is passed to the shell and executed (The
11841     shell is 'sh' on Unix systems, and 'cmd.exe' on Windows.).  If
11842     'WAIT' is present and has the value false, the execution of the
11843     command is asynchronous if the system supports it; otherwise, the
11844     command is executed synchronously using the C library's 'system'
11845     call.
11846
11847     The three last arguments allow the user to get status information.
11848     After synchronous execution, 'EXITSTAT' contains the integer exit
11849     code of the command, as returned by 'system'.  'CMDSTAT' is set to
11850     zero if the command line was executed (whatever its exit status
11851     was).  'CMDMSG' is assigned an error message if an error has
11852     occurred.
11853
11854     Note that the 'system' function need not be thread-safe.  It is the
11855     responsibility of the user to ensure that 'system' is not called
11856     concurrently.
11857
11858     For asynchronous execution on supported targets, the POSIX
11859     'posix_spawn' or 'fork' functions are used.  Also, a signal handler
11860     for the 'SIGCHLD' signal is installed.
11861
11862_Standard_:
11863     Fortran 2008 and later
11864
11865_Class_:
11866     Subroutine
11867
11868_Syntax_:
11869     'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
11870     CMDMSG ])'
11871
11872_Arguments_:
11873     COMMAND     Shall be a default 'CHARACTER' scalar.
11874     WAIT        (Optional) Shall be a default 'LOGICAL' scalar.
11875     EXITSTAT    (Optional) Shall be an 'INTEGER' of the default
11876                 kind.
11877     CMDSTAT     (Optional) Shall be an 'INTEGER' of the default
11878                 kind.
11879     CMDMSG      (Optional) Shall be an 'CHARACTER' scalar of the
11880                 default kind.
11881
11882_Example_:
11883          program test_exec
11884            integer :: i
11885
11886            call execute_command_line ("external_prog.exe", exitstat=i)
11887            print *, "Exit status of external_prog.exe was ", i
11888
11889            call execute_command_line ("reindex_files.exe", wait=.false.)
11890            print *, "Now reindexing files in the background"
11891
11892          end program test_exec
11893
11894_Note_:
11895
11896     Because this intrinsic is implemented in terms of the 'system'
11897     function call, its behavior with respect to signaling is processor
11898     dependent.  In particular, on POSIX-compliant systems, the SIGINT
11899     and SIGQUIT signals will be ignored, and the SIGCHLD will be
11900     blocked.  As such, if the parent process is terminated, the child
11901     process might not be terminated alongside.
11902
11903_See also_:
11904     *note SYSTEM::
11905
11906
11907File: gfortran.info,  Node: EXIT,  Next: EXP,  Prev: EXECUTE_COMMAND_LINE,  Up: Intrinsic Procedures
11908
119099.101 'EXIT' -- Exit the program with status.
11910=============================================
11911
11912_Description_:
11913     'EXIT' causes immediate termination of the program with status.  If
11914     status is omitted it returns the canonical _success_ for the
11915     system.  All Fortran I/O units are closed.
11916
11917_Standard_:
11918     GNU extension
11919
11920_Class_:
11921     Subroutine
11922
11923_Syntax_:
11924     'CALL EXIT([STATUS])'
11925
11926_Arguments_:
11927     STATUS      Shall be an 'INTEGER' of the default kind.
11928
11929_Return value_:
11930     'STATUS' is passed to the parent process on exit.
11931
11932_Example_:
11933          program test_exit
11934            integer :: STATUS = 0
11935            print *, 'This program is going to exit.'
11936            call EXIT(STATUS)
11937          end program test_exit
11938
11939_See also_:
11940     *note ABORT::, *note KILL::
11941
11942
11943File: gfortran.info,  Node: EXP,  Next: EXPONENT,  Prev: EXIT,  Up: Intrinsic Procedures
11944
119459.102 'EXP' -- Exponential function
11946===================================
11947
11948_Description_:
11949     'EXP(X)' computes the base e exponential of X.
11950
11951_Standard_:
11952     Fortran 77 and later, has overloads that are GNU extensions
11953
11954_Class_:
11955     Elemental function
11956
11957_Syntax_:
11958     'RESULT = EXP(X)'
11959
11960_Arguments_:
11961     X           The type shall be 'REAL' or 'COMPLEX'.
11962
11963_Return value_:
11964     The return value has same type and kind as X.
11965
11966_Example_:
11967          program test_exp
11968            real :: x = 1.0
11969            x = exp(x)
11970          end program test_exp
11971
11972_Specific names_:
11973     Name           Argument       Return type    Standard
11974     'EXP(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
11975                                                  later
11976     'DEXP(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
11977                                                  later
11978     'CEXP(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
11979                    X'                            later
11980     'ZEXP(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11981                    X'
11982     'CDEXP(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11983                    X'
11984
11985
11986File: gfortran.info,  Node: EXPONENT,  Next: EXTENDS_TYPE_OF,  Prev: EXP,  Up: Intrinsic Procedures
11987
119889.103 'EXPONENT' -- Exponent function
11989=====================================
11990
11991_Description_:
11992     'EXPONENT(X)' returns the value of the exponent part of X.  If X is
11993     zero the value returned is zero.
11994
11995_Standard_:
11996     Fortran 90 and later
11997
11998_Class_:
11999     Elemental function
12000
12001_Syntax_:
12002     'RESULT = EXPONENT(X)'
12003
12004_Arguments_:
12005     X           The type shall be 'REAL'.
12006
12007_Return value_:
12008     The return value is of type default 'INTEGER'.
12009
12010_Example_:
12011          program test_exponent
12012            real :: x = 1.0
12013            integer :: i
12014            i = exponent(x)
12015            print *, i
12016            print *, exponent(0.0)
12017          end program test_exponent
12018
12019
12020File: gfortran.info,  Node: EXTENDS_TYPE_OF,  Next: FDATE,  Prev: EXPONENT,  Up: Intrinsic Procedures
12021
120229.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension
12023===========================================================
12024
12025_Description_:
12026     Query dynamic type for extension.
12027
12028_Standard_:
12029     Fortran 2003 and later
12030
12031_Class_:
12032     Inquiry function
12033
12034_Syntax_:
12035     'RESULT = EXTENDS_TYPE_OF(A, MOLD)'
12036
12037_Arguments_:
12038     A           Shall be an object of extensible declared type
12039                 or unlimited polymorphic.
12040     MOLD        Shall be an object of extensible declared type
12041                 or unlimited polymorphic.
12042
12043_Return value_:
12044     The return value is a scalar of type default logical.  It is true
12045     if and only if the dynamic type of A is an extension type of the
12046     dynamic type of MOLD.
12047
12048_See also_:
12049     *note SAME_TYPE_AS::
12050
12051
12052File: gfortran.info,  Node: FDATE,  Next: FGET,  Prev: EXTENDS_TYPE_OF,  Up: Intrinsic Procedures
12053
120549.105 'FDATE' -- Get the current time as a string
12055=================================================
12056
12057_Description_:
12058     'FDATE(DATE)' returns the current date (using the same format as
12059     *note CTIME::) in DATE.  It is equivalent to 'CALL CTIME(DATE,
12060     TIME())'.
12061
12062     This intrinsic is provided in both subroutine and function forms;
12063     however, only one form can be used in any given program unit.
12064
12065_Standard_:
12066     GNU extension
12067
12068_Class_:
12069     Subroutine, function
12070
12071_Syntax_:
12072     'CALL FDATE(DATE)'.
12073     'DATE = FDATE()'.
12074
12075_Arguments_:
12076     DATE        The type shall be of type 'CHARACTER' of the
12077                 default kind.  It is an 'INTENT(OUT)' argument.
12078                 If the length of this variable is too short for
12079                 the date and time string to fit completely, it
12080                 will be blank on procedure return.
12081
12082_Return value_:
12083     The current date and time as a string.
12084
12085_Example_:
12086          program test_fdate
12087              integer(8) :: i, j
12088              character(len=30) :: date
12089              call fdate(date)
12090              print *, 'Program started on ', date
12091              do i = 1, 100000000 ! Just a delay
12092                  j = i * i - i
12093              end do
12094              call fdate(date)
12095              print *, 'Program ended on ', date
12096          end program test_fdate
12097
12098_See also_:
12099     *note DATE_AND_TIME::, *note CTIME::
12100
12101
12102File: gfortran.info,  Node: FGET,  Next: FGETC,  Prev: FDATE,  Up: Intrinsic Procedures
12103
121049.106 'FGET' -- Read a single character in stream mode from stdin
12105=================================================================
12106
12107_Description_:
12108     Read a single character in stream mode from stdin by bypassing
12109     normal formatted output.  Stream I/O should not be mixed with
12110     normal record-oriented (formatted or unformatted) I/O on the same
12111     unit; the results are unpredictable.
12112
12113     This intrinsic is provided in both subroutine and function forms;
12114     however, only one form can be used in any given program unit.
12115
12116     Note that the 'FGET' intrinsic is provided for backwards
12117     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12118     Stream facility.  Programmers should consider the use of new stream
12119     IO feature in new code for future portability.  See also *note
12120     Fortran 2003 status::.
12121
12122_Standard_:
12123     GNU extension
12124
12125_Class_:
12126     Subroutine, function
12127
12128_Syntax_:
12129     'CALL FGET(C [, STATUS])'
12130     'STATUS = FGET(C)'
12131
12132_Arguments_:
12133     C           The type shall be 'CHARACTER' and of default
12134                 kind.
12135     STATUS      (Optional) status flag of type 'INTEGER'.
12136                 Returns 0 on success, -1 on end-of-file, and a
12137                 system specific positive error code otherwise.
12138
12139_Example_:
12140          PROGRAM test_fget
12141            INTEGER, PARAMETER :: strlen = 100
12142            INTEGER :: status, i = 1
12143            CHARACTER(len=strlen) :: str = ""
12144
12145            WRITE (*,*) 'Enter text:'
12146            DO
12147              CALL fget(str(i:i), status)
12148              if (status /= 0 .OR. i > strlen) exit
12149              i = i + 1
12150            END DO
12151            WRITE (*,*) TRIM(str)
12152          END PROGRAM
12153
12154_See also_:
12155     *note FGETC::, *note FPUT::, *note FPUTC::
12156
12157
12158File: gfortran.info,  Node: FGETC,  Next: FINDLOC,  Prev: FGET,  Up: Intrinsic Procedures
12159
121609.107 'FGETC' -- Read a single character in stream mode
12161=======================================================
12162
12163_Description_:
12164     Read a single character in stream mode by bypassing normal
12165     formatted output.  Stream I/O should not be mixed with normal
12166     record-oriented (formatted or unformatted) I/O on the same unit;
12167     the results are unpredictable.
12168
12169     This intrinsic is provided in both subroutine and function forms;
12170     however, only one form can be used in any given program unit.
12171
12172     Note that the 'FGET' intrinsic is provided for backwards
12173     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12174     Stream facility.  Programmers should consider the use of new stream
12175     IO feature in new code for future portability.  See also *note
12176     Fortran 2003 status::.
12177
12178_Standard_:
12179     GNU extension
12180
12181_Class_:
12182     Subroutine, function
12183
12184_Syntax_:
12185     'CALL FGETC(UNIT, C [, STATUS])'
12186     'STATUS = FGETC(UNIT, C)'
12187
12188_Arguments_:
12189     UNIT        The type shall be 'INTEGER'.
12190     C           The type shall be 'CHARACTER' and of default
12191                 kind.
12192     STATUS      (Optional) status flag of type 'INTEGER'.
12193                 Returns 0 on success, -1 on end-of-file and a
12194                 system specific positive error code otherwise.
12195
12196_Example_:
12197          PROGRAM test_fgetc
12198            INTEGER :: fd = 42, status
12199            CHARACTER :: c
12200
12201            OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
12202            DO
12203              CALL fgetc(fd, c, status)
12204              IF (status /= 0) EXIT
12205              call fput(c)
12206            END DO
12207            CLOSE(UNIT=fd)
12208          END PROGRAM
12209
12210_See also_:
12211     *note FGET::, *note FPUT::, *note FPUTC::
12212
12213
12214File: gfortran.info,  Node: FINDLOC,  Next: FLOOR,  Prev: FGETC,  Up: Intrinsic Procedures
12215
122169.108 'FINDLOC' -- Search an array for a value
12217==============================================
12218
12219_Description_:
12220     Determines the location of the element in the array with the value
12221     given in the VALUE argument, or, if the DIM argument is supplied,
12222     determines the locations of the elements equal to the VALUE
12223     argument element along each row of the array in the DIM direction.
12224     If MASK is present, only the elements for which MASK is '.TRUE.'
12225     are considered.  If more than one element in the array has the
12226     value VALUE, the location returned is that of the first such
12227     element in array element order if the BACK is not present or if it
12228     is '.FALSE.'.  If BACK is true, the location returned is that of
12229     the last such element.  If the array has zero size, or all of the
12230     elements of MASK are '.FALSE.', then the result is an array of
12231     zeroes.  Similarly, if DIM is supplied and all of the elements of
12232     MASK along a given row are zero, the result value for that row is
12233     zero.
12234
12235_Standard_:
12236     Fortran 2008 and later.
12237
12238_Class_:
12239     Transformational function
12240
12241_Syntax_:
12242     'RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND]
12243     [,BACK])'
12244     'RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND]
12245     [,BACK])'
12246
12247_Arguments_:
12248     ARRAY       Shall be an array of intrinsic type.
12249     VALUE       A scalar of intrinsic type which is in type
12250                 conformance with ARRAY.
12251     DIM         (Optional) Shall be a scalar of type 'INTEGER',
12252                 with a value between one and the rank of ARRAY,
12253                 inclusive.  It may not be an optional dummy
12254                 argument.
12255     KIND        (Optional) An 'INTEGER' initialization
12256                 expression indicating the kind parameter of the
12257                 result.
12258     BACK        (Optional) A scalar of type 'LOGICAL'.
12259
12260_Return value_:
12261     If DIM is absent, the result is a rank-one array with a length
12262     equal to the rank of ARRAY.  If DIM is present, the result is an
12263     array with a rank one less than the rank of ARRAY, and a size
12264     corresponding to the size of ARRAY with the DIM dimension removed.
12265     If DIM is present and ARRAY has a rank of one, the result is a
12266     scalar.  If the optional argument KIND is present, the result is an
12267     integer of kind KIND, otherwise it is of default kind.
12268
12269_See also_:
12270     *note MAXLOC::, *note MINLOC::
12271
12272
12273File: gfortran.info,  Node: FLOOR,  Next: FLUSH,  Prev: FINDLOC,  Up: Intrinsic Procedures
12274
122759.109 'FLOOR' -- Integer floor function
12276=======================================
12277
12278_Description_:
12279     'FLOOR(A)' returns the greatest integer less than or equal to X.
12280
12281_Standard_:
12282     Fortran 95 and later
12283
12284_Class_:
12285     Elemental function
12286
12287_Syntax_:
12288     'RESULT = FLOOR(A [, KIND])'
12289
12290_Arguments_:
12291     A           The type shall be 'REAL'.
12292     KIND        (Optional) An 'INTEGER' initialization
12293                 expression indicating the kind parameter of the
12294                 result.
12295
12296_Return value_:
12297     The return value is of type 'INTEGER(KIND)' if KIND is present and
12298     of default-kind 'INTEGER' otherwise.
12299
12300_Example_:
12301          program test_floor
12302              real :: x = 63.29
12303              real :: y = -63.59
12304              print *, floor(x) ! returns 63
12305              print *, floor(y) ! returns -64
12306          end program test_floor
12307
12308_See also_:
12309     *note CEILING::, *note NINT::
12310
12311
12312File: gfortran.info,  Node: FLUSH,  Next: FNUM,  Prev: FLOOR,  Up: Intrinsic Procedures
12313
123149.110 'FLUSH' -- Flush I/O unit(s)
12315==================================
12316
12317_Description_:
12318     Flushes Fortran unit(s) currently open for output.  Without the
12319     optional argument, all units are flushed, otherwise just the unit
12320     specified.
12321
12322_Standard_:
12323     GNU extension
12324
12325_Class_:
12326     Subroutine
12327
12328_Syntax_:
12329     'CALL FLUSH(UNIT)'
12330
12331_Arguments_:
12332     UNIT        (Optional) The type shall be 'INTEGER'.
12333
12334_Note_:
12335     Beginning with the Fortran 2003 standard, there is a 'FLUSH'
12336     statement that should be preferred over the 'FLUSH' intrinsic.
12337
12338     The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have
12339     identical effect: they flush the runtime library's I/O buffer so
12340     that the data becomes visible to other processes.  This does not
12341     guarantee that the data is committed to disk.
12342
12343     On POSIX systems, you can request that all data is transferred to
12344     the storage device by calling the 'fsync' function, with the POSIX
12345     file descriptor of the I/O unit as argument (retrieved with GNU
12346     intrinsic 'FNUM').  The following example shows how:
12347
12348            ! Declare the interface for POSIX fsync function
12349            interface
12350              function fsync (fd) bind(c,name="fsync")
12351              use iso_c_binding, only: c_int
12352                integer(c_int), value :: fd
12353                integer(c_int) :: fsync
12354              end function fsync
12355            end interface
12356
12357            ! Variable declaration
12358            integer :: ret
12359
12360            ! Opening unit 10
12361            open (10,file="foo")
12362
12363            ! ...
12364            ! Perform I/O on unit 10
12365            ! ...
12366
12367            ! Flush and sync
12368            flush(10)
12369            ret = fsync(fnum(10))
12370
12371            ! Handle possible error
12372            if (ret /= 0) stop "Error calling FSYNC"
12373
12374
12375File: gfortran.info,  Node: FNUM,  Next: FPUT,  Prev: FLUSH,  Up: Intrinsic Procedures
12376
123779.111 'FNUM' -- File number function
12378====================================
12379
12380_Description_:
12381     'FNUM(UNIT)' returns the POSIX file descriptor number corresponding
12382     to the open Fortran I/O unit 'UNIT'.
12383
12384_Standard_:
12385     GNU extension
12386
12387_Class_:
12388     Function
12389
12390_Syntax_:
12391     'RESULT = FNUM(UNIT)'
12392
12393_Arguments_:
12394     UNIT        The type shall be 'INTEGER'.
12395
12396_Return value_:
12397     The return value is of type 'INTEGER'
12398
12399_Example_:
12400          program test_fnum
12401            integer :: i
12402            open (unit=10, status = "scratch")
12403            i = fnum(10)
12404            print *, i
12405            close (10)
12406          end program test_fnum
12407
12408
12409File: gfortran.info,  Node: FPUT,  Next: FPUTC,  Prev: FNUM,  Up: Intrinsic Procedures
12410
124119.112 'FPUT' -- Write a single character in stream mode to stdout
12412=================================================================
12413
12414_Description_:
12415     Write a single character in stream mode to stdout by bypassing
12416     normal formatted output.  Stream I/O should not be mixed with
12417     normal record-oriented (formatted or unformatted) I/O on the same
12418     unit; the results are unpredictable.
12419
12420     This intrinsic is provided in both subroutine and function forms;
12421     however, only one form can be used in any given program unit.
12422
12423     Note that the 'FGET' intrinsic is provided for backwards
12424     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12425     Stream facility.  Programmers should consider the use of new stream
12426     IO feature in new code for future portability.  See also *note
12427     Fortran 2003 status::.
12428
12429_Standard_:
12430     GNU extension
12431
12432_Class_:
12433     Subroutine, function
12434
12435_Syntax_:
12436     'CALL FPUT(C [, STATUS])'
12437     'STATUS = FPUT(C)'
12438
12439_Arguments_:
12440     C           The type shall be 'CHARACTER' and of default
12441                 kind.
12442     STATUS      (Optional) status flag of type 'INTEGER'.
12443                 Returns 0 on success, -1 on end-of-file and a
12444                 system specific positive error code otherwise.
12445
12446_Example_:
12447          PROGRAM test_fput
12448            CHARACTER(len=10) :: str = "gfortran"
12449            INTEGER :: i
12450            DO i = 1, len_trim(str)
12451              CALL fput(str(i:i))
12452            END DO
12453          END PROGRAM
12454
12455_See also_:
12456     *note FPUTC::, *note FGET::, *note FGETC::
12457
12458
12459File: gfortran.info,  Node: FPUTC,  Next: FRACTION,  Prev: FPUT,  Up: Intrinsic Procedures
12460
124619.113 'FPUTC' -- Write a single character in stream mode
12462========================================================
12463
12464_Description_:
12465     Write a single character in stream mode by bypassing normal
12466     formatted output.  Stream I/O should not be mixed with normal
12467     record-oriented (formatted or unformatted) I/O on the same unit;
12468     the results are unpredictable.
12469
12470     This intrinsic is provided in both subroutine and function forms;
12471     however, only one form can be used in any given program unit.
12472
12473     Note that the 'FGET' intrinsic is provided for backwards
12474     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12475     Stream facility.  Programmers should consider the use of new stream
12476     IO feature in new code for future portability.  See also *note
12477     Fortran 2003 status::.
12478
12479_Standard_:
12480     GNU extension
12481
12482_Class_:
12483     Subroutine, function
12484
12485_Syntax_:
12486     'CALL FPUTC(UNIT, C [, STATUS])'
12487     'STATUS = FPUTC(UNIT, C)'
12488
12489_Arguments_:
12490     UNIT        The type shall be 'INTEGER'.
12491     C           The type shall be 'CHARACTER' and of default
12492                 kind.
12493     STATUS      (Optional) status flag of type 'INTEGER'.
12494                 Returns 0 on success, -1 on end-of-file and a
12495                 system specific positive error code otherwise.
12496
12497_Example_:
12498          PROGRAM test_fputc
12499            CHARACTER(len=10) :: str = "gfortran"
12500            INTEGER :: fd = 42, i
12501
12502            OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
12503            DO i = 1, len_trim(str)
12504              CALL fputc(fd, str(i:i))
12505            END DO
12506            CLOSE(fd)
12507          END PROGRAM
12508
12509_See also_:
12510     *note FPUT::, *note FGET::, *note FGETC::
12511
12512
12513File: gfortran.info,  Node: FRACTION,  Next: FREE,  Prev: FPUTC,  Up: Intrinsic Procedures
12514
125159.114 'FRACTION' -- Fractional part of the model representation
12516===============================================================
12517
12518_Description_:
12519     'FRACTION(X)' returns the fractional part of the model
12520     representation of 'X'.
12521
12522_Standard_:
12523     Fortran 90 and later
12524
12525_Class_:
12526     Elemental function
12527
12528_Syntax_:
12529     'Y = FRACTION(X)'
12530
12531_Arguments_:
12532     X           The type of the argument shall be a 'REAL'.
12533
12534_Return value_:
12535     The return value is of the same type and kind as the argument.  The
12536     fractional part of the model representation of 'X' is returned; it
12537     is 'X * RADIX(X)**(-EXPONENT(X))'.
12538
12539_Example_:
12540          program test_fraction
12541            real :: x
12542            x = 178.1387e-4
12543            print *, fraction(x), x * radix(x)**(-exponent(x))
12544          end program test_fraction
12545
12546
12547File: gfortran.info,  Node: FREE,  Next: FSEEK,  Prev: FRACTION,  Up: Intrinsic Procedures
12548
125499.115 'FREE' -- Frees memory
12550============================
12551
12552_Description_:
12553     Frees memory previously allocated by 'MALLOC'.  The 'FREE'
12554     intrinsic is an extension intended to be used with Cray pointers,
12555     and is provided in GNU Fortran to allow user to compile legacy
12556     code.  For new code using Fortran 95 pointers, the memory
12557     de-allocation intrinsic is 'DEALLOCATE'.
12558
12559_Standard_:
12560     GNU extension
12561
12562_Class_:
12563     Subroutine
12564
12565_Syntax_:
12566     'CALL FREE(PTR)'
12567
12568_Arguments_:
12569     PTR         The type shall be 'INTEGER'.  It represents the
12570                 location of the memory that should be
12571                 de-allocated.
12572
12573_Return value_:
12574     None
12575
12576_Example_:
12577     See 'MALLOC' for an example.
12578
12579_See also_:
12580     *note MALLOC::
12581
12582
12583File: gfortran.info,  Node: FSEEK,  Next: FSTAT,  Prev: FREE,  Up: Intrinsic Procedures
12584
125859.116 'FSEEK' -- Low level file positioning subroutine
12586======================================================
12587
12588_Description_:
12589     Moves UNIT to the specified OFFSET.  If WHENCE is set to 0, the
12590     OFFSET is taken as an absolute value 'SEEK_SET', if set to 1,
12591     OFFSET is taken to be relative to the current position 'SEEK_CUR',
12592     and if set to 2 relative to the end of the file 'SEEK_END'.  On
12593     error, STATUS is set to a nonzero value.  If STATUS the seek fails
12594     silently.
12595
12596     This intrinsic routine is not fully backwards compatible with
12597     'g77'.  In 'g77', the 'FSEEK' takes a statement label instead of a
12598     STATUS variable.  If FSEEK is used in old code, change
12599            CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
12600     to
12601            INTEGER :: status
12602            CALL FSEEK(UNIT, OFFSET, WHENCE, status)
12603            IF (status /= 0) GOTO label
12604
12605     Please note that GNU Fortran provides the Fortran 2003 Stream
12606     facility.  Programmers should consider the use of new stream IO
12607     feature in new code for future portability.  See also *note Fortran
12608     2003 status::.
12609
12610_Standard_:
12611     GNU extension
12612
12613_Class_:
12614     Subroutine
12615
12616_Syntax_:
12617     'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
12618
12619_Arguments_:
12620     UNIT        Shall be a scalar of type 'INTEGER'.
12621     OFFSET      Shall be a scalar of type 'INTEGER'.
12622     WHENCE      Shall be a scalar of type 'INTEGER'.  Its value
12623                 shall be either 0, 1 or 2.
12624     STATUS      (Optional) shall be a scalar of type
12625                 'INTEGER(4)'.
12626
12627_Example_:
12628          PROGRAM test_fseek
12629            INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
12630            INTEGER :: fd, offset, ierr
12631
12632            ierr   = 0
12633            offset = 5
12634            fd     = 10
12635
12636            OPEN(UNIT=fd, FILE="fseek.test")
12637            CALL FSEEK(fd, offset, SEEK_SET, ierr)  ! move to OFFSET
12638            print *, FTELL(fd), ierr
12639
12640            CALL FSEEK(fd, 0, SEEK_END, ierr)       ! move to end
12641            print *, FTELL(fd), ierr
12642
12643            CALL FSEEK(fd, 0, SEEK_SET, ierr)       ! move to beginning
12644            print *, FTELL(fd), ierr
12645
12646            CLOSE(UNIT=fd)
12647          END PROGRAM
12648
12649_See also_:
12650     *note FTELL::
12651
12652
12653File: gfortran.info,  Node: FSTAT,  Next: FTELL,  Prev: FSEEK,  Up: Intrinsic Procedures
12654
126559.117 'FSTAT' -- Get file status
12656================================
12657
12658_Description_:
12659     'FSTAT' is identical to *note STAT::, except that information about
12660     an already opened file is obtained.
12661
12662     The elements in 'VALUES' are the same as described by *note STAT::.
12663
12664     This intrinsic is provided in both subroutine and function forms;
12665     however, only one form can be used in any given program unit.
12666
12667_Standard_:
12668     GNU extension
12669
12670_Class_:
12671     Subroutine, function
12672
12673_Syntax_:
12674     'CALL FSTAT(UNIT, VALUES [, STATUS])'
12675     'STATUS = FSTAT(UNIT, VALUES)'
12676
12677_Arguments_:
12678     UNIT        An open I/O unit number of type 'INTEGER'.
12679     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
12680     STATUS      (Optional) status flag of type 'INTEGER(4)'.
12681                 Returns 0 on success and a system specific error
12682                 code otherwise.
12683
12684_Example_:
12685     See *note STAT:: for an example.
12686
12687_See also_:
12688     To stat a link: *note LSTAT:: To stat a file: *note STAT::
12689
12690
12691File: gfortran.info,  Node: FTELL,  Next: GAMMA,  Prev: FSTAT,  Up: Intrinsic Procedures
12692
126939.118 'FTELL' -- Current stream position
12694========================================
12695
12696_Description_:
12697     Retrieves the current position within an open file.
12698
12699     This intrinsic is provided in both subroutine and function forms;
12700     however, only one form can be used in any given program unit.
12701
12702_Standard_:
12703     GNU extension
12704
12705_Class_:
12706     Subroutine, function
12707
12708_Syntax_:
12709     'CALL FTELL(UNIT, OFFSET)'
12710     'OFFSET = FTELL(UNIT)'
12711
12712_Arguments_:
12713     OFFSET      Shall of type 'INTEGER'.
12714     UNIT        Shall of type 'INTEGER'.
12715
12716_Return value_:
12717     In either syntax, OFFSET is set to the current offset of unit
12718     number UNIT, or to -1 if the unit is not currently open.
12719
12720_Example_:
12721          PROGRAM test_ftell
12722            INTEGER :: i
12723            OPEN(10, FILE="temp.dat")
12724            CALL ftell(10,i)
12725            WRITE(*,*) i
12726          END PROGRAM
12727
12728_See also_:
12729     *note FSEEK::
12730
12731
12732File: gfortran.info,  Node: GAMMA,  Next: GERROR,  Prev: FTELL,  Up: Intrinsic Procedures
12733
127349.119 'GAMMA' -- Gamma function
12735===============================
12736
12737_Description_:
12738     'GAMMA(X)' computes Gamma (\Gamma) of X.  For positive, integer
12739     values of X the Gamma function simplifies to the factorial function
12740     \Gamma(x)=(x-1)!.
12741
12742_Standard_:
12743     Fortran 2008 and later
12744
12745_Class_:
12746     Elemental function
12747
12748_Syntax_:
12749     'X = GAMMA(X)'
12750
12751_Arguments_:
12752     X           Shall be of type 'REAL' and neither zero nor a
12753                 negative integer.
12754
12755_Return value_:
12756     The return value is of type 'REAL' of the same kind as X.
12757
12758_Example_:
12759          program test_gamma
12760            real :: x = 1.0
12761            x = gamma(x) ! returns 1.0
12762          end program test_gamma
12763
12764_Specific names_:
12765     Name           Argument       Return type    Standard
12766     'DGAMMA(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
12767
12768_See also_:
12769     Logarithm of the Gamma function: *note LOG_GAMMA::
12770
12771
12772File: gfortran.info,  Node: GERROR,  Next: GETARG,  Prev: GAMMA,  Up: Intrinsic Procedures
12773
127749.120 'GERROR' -- Get last system error message
12775===============================================
12776
12777_Description_:
12778     Returns the system error message corresponding to the last system
12779     error.  This resembles the functionality of 'strerror(3)' in C.
12780
12781_Standard_:
12782     GNU extension
12783
12784_Class_:
12785     Subroutine
12786
12787_Syntax_:
12788     'CALL GERROR(RESULT)'
12789
12790_Arguments_:
12791     RESULT      Shall of type 'CHARACTER' and of default
12792
12793_Example_:
12794          PROGRAM test_gerror
12795            CHARACTER(len=100) :: msg
12796            CALL gerror(msg)
12797            WRITE(*,*) msg
12798          END PROGRAM
12799
12800_See also_:
12801     *note IERRNO::, *note PERROR::
12802
12803
12804File: gfortran.info,  Node: GETARG,  Next: GET_COMMAND,  Prev: GERROR,  Up: Intrinsic Procedures
12805
128069.121 'GETARG' -- Get command line arguments
12807============================================
12808
12809_Description_:
12810     Retrieve the POS-th argument that was passed on the command line
12811     when the containing program was invoked.
12812
12813     This intrinsic routine is provided for backwards compatibility with
12814     GNU Fortran 77.  In new code, programmers should consider the use
12815     of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
12816     Fortran 2003 standard.
12817
12818_Standard_:
12819     GNU extension
12820
12821_Class_:
12822     Subroutine
12823
12824_Syntax_:
12825     'CALL GETARG(POS, VALUE)'
12826
12827_Arguments_:
12828     POS         Shall be of type 'INTEGER' and not wider than
12829                 the default integer kind; POS \geq 0
12830     VALUE       Shall be of type 'CHARACTER' and of default
12831                 kind.
12832     VALUE       Shall be of type 'CHARACTER'.
12833
12834_Return value_:
12835     After 'GETARG' returns, the VALUE argument holds the POSth command
12836     line argument.  If VALUE cannot hold the argument, it is truncated
12837     to fit the length of VALUE.  If there are less than POS arguments
12838     specified at the command line, VALUE will be filled with blanks.
12839     If POS = 0, VALUE is set to the name of the program (on systems
12840     that support this feature).
12841
12842_Example_:
12843          PROGRAM test_getarg
12844            INTEGER :: i
12845            CHARACTER(len=32) :: arg
12846
12847            DO i = 1, iargc()
12848              CALL getarg(i, arg)
12849              WRITE (*,*) arg
12850            END DO
12851          END PROGRAM
12852
12853_See also_:
12854     GNU Fortran 77 compatibility function: *note IARGC:: Fortran 2003
12855     functions and subroutines: *note GET_COMMAND::, *note
12856     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12857
12858
12859File: gfortran.info,  Node: GET_COMMAND,  Next: GET_COMMAND_ARGUMENT,  Prev: GETARG,  Up: Intrinsic Procedures
12860
128619.122 'GET_COMMAND' -- Get the entire command line
12862==================================================
12863
12864_Description_:
12865     Retrieve the entire command line that was used to invoke the
12866     program.
12867
12868_Standard_:
12869     Fortran 2003 and later
12870
12871_Class_:
12872     Subroutine
12873
12874_Syntax_:
12875     'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
12876
12877_Arguments_:
12878     COMMAND     (Optional) shall be of type 'CHARACTER' and of
12879                 default kind.
12880     LENGTH      (Optional) Shall be of type 'INTEGER' and of
12881                 default kind.
12882     STATUS      (Optional) Shall be of type 'INTEGER' and of
12883                 default kind.
12884
12885_Return value_:
12886     If COMMAND is present, stores the entire command line that was used
12887     to invoke the program in COMMAND.  If LENGTH is present, it is
12888     assigned the length of the command line.  If STATUS is present, it
12889     is assigned 0 upon success of the command, -1 if COMMAND is too
12890     short to store the command line, or a positive value in case of an
12891     error.
12892
12893_Example_:
12894          PROGRAM test_get_command
12895            CHARACTER(len=255) :: cmd
12896            CALL get_command(cmd)
12897            WRITE (*,*) TRIM(cmd)
12898          END PROGRAM
12899
12900_See also_:
12901     *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12902
12903
12904File: gfortran.info,  Node: GET_COMMAND_ARGUMENT,  Next: GETCWD,  Prev: GET_COMMAND,  Up: Intrinsic Procedures
12905
129069.123 'GET_COMMAND_ARGUMENT' -- Get command line arguments
12907==========================================================
12908
12909_Description_:
12910     Retrieve the NUMBER-th argument that was passed on the command line
12911     when the containing program was invoked.
12912
12913_Standard_:
12914     Fortran 2003 and later
12915
12916_Class_:
12917     Subroutine
12918
12919_Syntax_:
12920     'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
12921
12922_Arguments_:
12923     NUMBER      Shall be a scalar of type 'INTEGER' and of
12924                 default kind, NUMBER \geq 0
12925     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
12926                 and of default kind.
12927     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
12928                 and of default kind.
12929     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
12930                 and of default kind.
12931
12932_Return value_:
12933     After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
12934     NUMBER-th command line argument.  If VALUE cannot hold the
12935     argument, it is truncated to fit the length of VALUE.  If there are
12936     less than NUMBER arguments specified at the command line, VALUE
12937     will be filled with blanks.  If NUMBER = 0, VALUE is set to the
12938     name of the program (on systems that support this feature).  The
12939     LENGTH argument contains the length of the NUMBER-th command line
12940     argument.  If the argument retrieval fails, STATUS is a positive
12941     number; if VALUE contains a truncated command line argument, STATUS
12942     is -1; and otherwise the STATUS is zero.
12943
12944_Example_:
12945          PROGRAM test_get_command_argument
12946            INTEGER :: i
12947            CHARACTER(len=32) :: arg
12948
12949            i = 0
12950            DO
12951              CALL get_command_argument(i, arg)
12952              IF (LEN_TRIM(arg) == 0) EXIT
12953
12954              WRITE (*,*) TRIM(arg)
12955              i = i+1
12956            END DO
12957          END PROGRAM
12958
12959_See also_:
12960     *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
12961
12962
12963File: gfortran.info,  Node: GETCWD,  Next: GETENV,  Prev: GET_COMMAND_ARGUMENT,  Up: Intrinsic Procedures
12964
129659.124 'GETCWD' -- Get current working directory
12966===============================================
12967
12968_Description_:
12969     Get current working directory.
12970
12971     This intrinsic is provided in both subroutine and function forms;
12972     however, only one form can be used in any given program unit.
12973
12974_Standard_:
12975     GNU extension
12976
12977_Class_:
12978     Subroutine, function
12979
12980_Syntax_:
12981     'CALL GETCWD(C [, STATUS])'
12982     'STATUS = GETCWD(C)'
12983
12984_Arguments_:
12985     C           The type shall be 'CHARACTER' and of default
12986                 kind.
12987     STATUS      (Optional) status flag.  Returns 0 on success, a
12988                 system specific and nonzero error code
12989                 otherwise.
12990
12991_Example_:
12992          PROGRAM test_getcwd
12993            CHARACTER(len=255) :: cwd
12994            CALL getcwd(cwd)
12995            WRITE(*,*) TRIM(cwd)
12996          END PROGRAM
12997
12998_See also_:
12999     *note CHDIR::
13000
13001
13002File: gfortran.info,  Node: GETENV,  Next: GET_ENVIRONMENT_VARIABLE,  Prev: GETCWD,  Up: Intrinsic Procedures
13003
130049.125 'GETENV' -- Get an environmental variable
13005===============================================
13006
13007_Description_:
13008     Get the VALUE of the environmental variable NAME.
13009
13010     This intrinsic routine is provided for backwards compatibility with
13011     GNU Fortran 77.  In new code, programmers should consider the use
13012     of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
13013     Fortran 2003 standard.
13014
13015     Note that 'GETENV' need not be thread-safe.  It is the
13016     responsibility of the user to ensure that the environment is not
13017     being updated concurrently with a call to the 'GETENV' intrinsic.
13018
13019_Standard_:
13020     GNU extension
13021
13022_Class_:
13023     Subroutine
13024
13025_Syntax_:
13026     'CALL GETENV(NAME, VALUE)'
13027
13028_Arguments_:
13029     NAME        Shall be of type 'CHARACTER' and of default
13030                 kind.
13031     VALUE       Shall be of type 'CHARACTER' and of default
13032                 kind.
13033
13034_Return value_:
13035     Stores the value of NAME in VALUE.  If VALUE is not large enough to
13036     hold the data, it is truncated.  If NAME is not set, VALUE will be
13037     filled with blanks.
13038
13039_Example_:
13040          PROGRAM test_getenv
13041            CHARACTER(len=255) :: homedir
13042            CALL getenv("HOME", homedir)
13043            WRITE (*,*) TRIM(homedir)
13044          END PROGRAM
13045
13046_See also_:
13047     *note GET_ENVIRONMENT_VARIABLE::
13048
13049
13050File: gfortran.info,  Node: GET_ENVIRONMENT_VARIABLE,  Next: GETGID,  Prev: GETENV,  Up: Intrinsic Procedures
13051
130529.126 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
13053=================================================================
13054
13055_Description_:
13056     Get the VALUE of the environmental variable NAME.
13057
13058     Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe.  It
13059     is the responsibility of the user to ensure that the environment is
13060     not being updated concurrently with a call to the
13061     'GET_ENVIRONMENT_VARIABLE' intrinsic.
13062
13063_Standard_:
13064     Fortran 2003 and later
13065
13066_Class_:
13067     Subroutine
13068
13069_Syntax_:
13070     'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
13071     TRIM_NAME)'
13072
13073_Arguments_:
13074     NAME        Shall be a scalar of type 'CHARACTER' and of
13075                 default kind.
13076     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
13077                 and of default kind.
13078     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
13079                 and of default kind.
13080     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
13081                 and of default kind.
13082     TRIM_NAME   (Optional) Shall be a scalar of type 'LOGICAL'
13083                 and of default kind.
13084
13085_Return value_:
13086     Stores the value of NAME in VALUE.  If VALUE is not large enough to
13087     hold the data, it is truncated.  If NAME is not set, VALUE will be
13088     filled with blanks.  Argument LENGTH contains the length needed for
13089     storing the environment variable NAME or zero if it is not present.
13090     STATUS is -1 if VALUE is present but too short for the environment
13091     variable; it is 1 if the environment variable does not exist and 2
13092     if the processor does not support environment variables; in all
13093     other cases STATUS is zero.  If TRIM_NAME is present with the value
13094     '.FALSE.', the trailing blanks in NAME are significant; otherwise
13095     they are not part of the environment variable name.
13096
13097_Example_:
13098          PROGRAM test_getenv
13099            CHARACTER(len=255) :: homedir
13100            CALL get_environment_variable("HOME", homedir)
13101            WRITE (*,*) TRIM(homedir)
13102          END PROGRAM
13103
13104
13105File: gfortran.info,  Node: GETGID,  Next: GETLOG,  Prev: GET_ENVIRONMENT_VARIABLE,  Up: Intrinsic Procedures
13106
131079.127 'GETGID' -- Group ID function
13108===================================
13109
13110_Description_:
13111     Returns the numerical group ID of the current process.
13112
13113_Standard_:
13114     GNU extension
13115
13116_Class_:
13117     Function
13118
13119_Syntax_:
13120     'RESULT = GETGID()'
13121
13122_Return value_:
13123     The return value of 'GETGID' is an 'INTEGER' of the default kind.
13124
13125_Example_:
13126     See 'GETPID' for an example.
13127
13128_See also_:
13129     *note GETPID::, *note GETUID::
13130
13131
13132File: gfortran.info,  Node: GETLOG,  Next: GETPID,  Prev: GETGID,  Up: Intrinsic Procedures
13133
131349.128 'GETLOG' -- Get login name
13135================================
13136
13137_Description_:
13138     Gets the username under which the program is running.
13139
13140_Standard_:
13141     GNU extension
13142
13143_Class_:
13144     Subroutine
13145
13146_Syntax_:
13147     'CALL GETLOG(C)'
13148
13149_Arguments_:
13150     C           Shall be of type 'CHARACTER' and of default
13151                 kind.
13152
13153_Return value_:
13154     Stores the current user name in LOGIN.  (On systems where POSIX
13155     functions 'geteuid' and 'getpwuid' are not available, and the
13156     'getlogin' function is not implemented either, this will return a
13157     blank string.)
13158
13159_Example_:
13160          PROGRAM TEST_GETLOG
13161            CHARACTER(32) :: login
13162            CALL GETLOG(login)
13163            WRITE(*,*) login
13164          END PROGRAM
13165
13166_See also_:
13167     *note GETUID::
13168
13169
13170File: gfortran.info,  Node: GETPID,  Next: GETUID,  Prev: GETLOG,  Up: Intrinsic Procedures
13171
131729.129 'GETPID' -- Process ID function
13173=====================================
13174
13175_Description_:
13176     Returns the numerical process identifier of the current process.
13177
13178_Standard_:
13179     GNU extension
13180
13181_Class_:
13182     Function
13183
13184_Syntax_:
13185     'RESULT = GETPID()'
13186
13187_Return value_:
13188     The return value of 'GETPID' is an 'INTEGER' of the default kind.
13189
13190_Example_:
13191          program info
13192            print *, "The current process ID is ", getpid()
13193            print *, "Your numerical user ID is ", getuid()
13194            print *, "Your numerical group ID is ", getgid()
13195          end program info
13196
13197_See also_:
13198     *note GETGID::, *note GETUID::
13199
13200
13201File: gfortran.info,  Node: GETUID,  Next: GMTIME,  Prev: GETPID,  Up: Intrinsic Procedures
13202
132039.130 'GETUID' -- User ID function
13204==================================
13205
13206_Description_:
13207     Returns the numerical user ID of the current process.
13208
13209_Standard_:
13210     GNU extension
13211
13212_Class_:
13213     Function
13214
13215_Syntax_:
13216     'RESULT = GETUID()'
13217
13218_Return value_:
13219     The return value of 'GETUID' is an 'INTEGER' of the default kind.
13220
13221_Example_:
13222     See 'GETPID' for an example.
13223
13224_See also_:
13225     *note GETPID::, *note GETLOG::
13226
13227
13228File: gfortran.info,  Node: GMTIME,  Next: HOSTNM,  Prev: GETUID,  Up: Intrinsic Procedures
13229
132309.131 'GMTIME' -- Convert time to GMT info
13231==========================================
13232
13233_Description_:
13234     Given a system time value TIME (as provided by the *note TIME::
13235     intrinsic), fills VALUES with values extracted from it appropriate
13236     to the UTC time zone (Universal Coordinated Time, also known in
13237     some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'.
13238
13239     This intrinsic routine is provided for backwards compatibility with
13240     GNU Fortran 77.  In new code, programmers should consider the use
13241     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
13242     standard.
13243
13244_Standard_:
13245     GNU extension
13246
13247_Class_:
13248     Subroutine
13249
13250_Syntax_:
13251     'CALL GMTIME(TIME, VALUES)'
13252
13253_Arguments_:
13254     TIME        An 'INTEGER' scalar expression corresponding to
13255                 a system time, with 'INTENT(IN)'.
13256     VALUES      A default 'INTEGER' array with 9 elements, with
13257                 'INTENT(OUT)'.
13258
13259_Return value_:
13260     The elements of VALUES are assigned as follows:
13261       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
13262          seconds
13263       2. Minutes after the hour, range 0-59
13264       3. Hours past midnight, range 0-23
13265       4. Day of month, range 1-31
13266       5. Number of months since January, range 0-11
13267       6. Years since 1900
13268       7. Number of days since Sunday, range 0-6
13269       8. Days since January 1, range 0-365
13270       9. Daylight savings indicator: positive if daylight savings is in
13271          effect, zero if not, and negative if the information is not
13272          available.
13273
13274_See also_:
13275     *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::,
13276     *note TIME8::
13277
13278
13279File: gfortran.info,  Node: HOSTNM,  Next: HUGE,  Prev: GMTIME,  Up: Intrinsic Procedures
13280
132819.132 'HOSTNM' -- Get system host name
13282======================================
13283
13284_Description_:
13285     Retrieves the host name of the system on which the program is
13286     running.
13287
13288     This intrinsic is provided in both subroutine and function forms;
13289     however, only one form can be used in any given program unit.
13290
13291_Standard_:
13292     GNU extension
13293
13294_Class_:
13295     Subroutine, function
13296
13297_Syntax_:
13298     'CALL HOSTNM(C [, STATUS])'
13299     'STATUS = HOSTNM(NAME)'
13300
13301_Arguments_:
13302     C           Shall of type 'CHARACTER' and of default kind.
13303     STATUS      (Optional) status flag of type 'INTEGER'.
13304                 Returns 0 on success, or a system specific error
13305                 code otherwise.
13306
13307_Return value_:
13308     In either syntax, NAME is set to the current hostname if it can be
13309     obtained, or to a blank string otherwise.
13310
13311
13312File: gfortran.info,  Node: HUGE,  Next: HYPOT,  Prev: HOSTNM,  Up: Intrinsic Procedures
13313
133149.133 'HUGE' -- Largest number of a kind
13315========================================
13316
13317_Description_:
13318     'HUGE(X)' returns the largest number that is not an infinity in the
13319     model of the type of 'X'.
13320
13321_Standard_:
13322     Fortran 90 and later
13323
13324_Class_:
13325     Inquiry function
13326
13327_Syntax_:
13328     'RESULT = HUGE(X)'
13329
13330_Arguments_:
13331     X           Shall be of type 'REAL' or 'INTEGER'.
13332
13333_Return value_:
13334     The return value is of the same type and kind as X
13335
13336_Example_:
13337          program test_huge_tiny
13338            print *, huge(0), huge(0.0), huge(0.0d0)
13339            print *, tiny(0.0), tiny(0.0d0)
13340          end program test_huge_tiny
13341
13342
13343File: gfortran.info,  Node: HYPOT,  Next: IACHAR,  Prev: HUGE,  Up: Intrinsic Procedures
13344
133459.134 'HYPOT' -- Euclidean distance function
13346============================================
13347
13348_Description_:
13349     'HYPOT(X,Y)' is the Euclidean distance function.  It is equal to
13350     \sqrt{X^2 + Y^2}, without undue underflow or overflow.
13351
13352_Standard_:
13353     Fortran 2008 and later
13354
13355_Class_:
13356     Elemental function
13357
13358_Syntax_:
13359     'RESULT = HYPOT(X, Y)'
13360
13361_Arguments_:
13362     X           The type shall be 'REAL'.
13363     Y           The type and kind type parameter shall be the
13364                 same as X.
13365
13366_Return value_:
13367     The return value has the same type and kind type parameter as X.
13368
13369_Example_:
13370          program test_hypot
13371            real(4) :: x = 1.e0_4, y = 0.5e0_4
13372            x = hypot(x,y)
13373          end program test_hypot
13374
13375
13376File: gfortran.info,  Node: IACHAR,  Next: IALL,  Prev: HYPOT,  Up: Intrinsic Procedures
13377
133789.135 'IACHAR' -- Code in ASCII collating sequence
13379==================================================
13380
13381_Description_:
13382     'IACHAR(C)' returns the code for the ASCII character in the first
13383     character position of 'C'.
13384
13385_Standard_:
13386     Fortran 95 and later, with KIND argument Fortran 2003 and later
13387
13388_Class_:
13389     Elemental function
13390
13391_Syntax_:
13392     'RESULT = IACHAR(C [, KIND])'
13393
13394_Arguments_:
13395     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13396     KIND        (Optional) An 'INTEGER' initialization
13397                 expression indicating the kind parameter of the
13398                 result.
13399
13400_Return value_:
13401     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13402     absent, the return value is of default integer kind.
13403
13404_Example_:
13405          program test_iachar
13406            integer i
13407            i = iachar(' ')
13408          end program test_iachar
13409
13410_Note_:
13411     See *note ICHAR:: for a discussion of converting between numerical
13412     values and formatted string representations.
13413
13414_See also_:
13415     *note ACHAR::, *note CHAR::, *note ICHAR::
13416
13417
13418File: gfortran.info,  Node: IALL,  Next: IAND,  Prev: IACHAR,  Up: Intrinsic Procedures
13419
134209.136 'IALL' -- Bitwise AND of array elements
13421=============================================
13422
13423_Description_:
13424     Reduces with bitwise AND the elements of ARRAY along dimension DIM
13425     if the corresponding element in MASK is 'TRUE'.
13426
13427_Standard_:
13428     Fortran 2008 and later
13429
13430_Class_:
13431     Transformational function
13432
13433_Syntax_:
13434     'RESULT = IALL(ARRAY[, MASK])'
13435     'RESULT = IALL(ARRAY, DIM[, MASK])'
13436
13437_Arguments_:
13438     ARRAY       Shall be an array of type 'INTEGER'
13439     DIM         (Optional) shall be a scalar of type 'INTEGER'
13440                 with a value in the range from 1 to n, where n
13441                 equals the rank of ARRAY.
13442     MASK        (Optional) shall be of type 'LOGICAL' and either
13443                 be a scalar or an array of the same shape as
13444                 ARRAY.
13445
13446_Return value_:
13447     The result is of the same type as ARRAY.
13448
13449     If DIM is absent, a scalar with the bitwise ALL of all elements in
13450     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13451     the rank of ARRAY, and a shape similar to that of ARRAY with
13452     dimension DIM dropped is returned.
13453
13454_Example_:
13455          PROGRAM test_iall
13456            INTEGER(1) :: a(2)
13457
13458            a(1) = b'00100100'
13459            a(2) = b'01101010'
13460
13461            ! prints 00100000
13462            PRINT '(b8.8)', IALL(a)
13463          END PROGRAM
13464
13465_See also_:
13466     *note IANY::, *note IPARITY::, *note IAND::
13467
13468
13469File: gfortran.info,  Node: IAND,  Next: IANY,  Prev: IALL,  Up: Intrinsic Procedures
13470
134719.137 'IAND' -- Bitwise logical and
13472===================================
13473
13474_Description_:
13475     Bitwise logical 'AND'.
13476
13477_Standard_:
13478     Fortran 90 and later, with boz-literal-constant Fortran 2008 and
13479     later, has overloads that are GNU extensions
13480
13481_Class_:
13482     Elemental function
13483
13484_Syntax_:
13485     'RESULT = IAND(I, J)'
13486
13487_Arguments_:
13488     I           The type shall be 'INTEGER' or a
13489                 boz-literal-constant.
13490     J           The type shall be 'INTEGER' with the same kind
13491                 type parameter as I or a boz-literal-constant.
13492                 I and J shall not both be boz-literal-constants.
13493
13494_Return value_:
13495     The return type is 'INTEGER' with the kind type parameter of the
13496     arguments.  A boz-literal-constant is converted to an 'INTEGER'
13497     with the kind type parameter of the other argument as-if a call to
13498     *note INT:: occurred.
13499
13500_Example_:
13501          PROGRAM test_iand
13502            INTEGER :: a, b
13503            DATA a / Z'F' /, b / Z'3' /
13504            WRITE (*,*) IAND(a, b)
13505          END PROGRAM
13506
13507_Specific names_:
13508     Name           Argument       Return type    Standard
13509     'IAND(A)'      'INTEGER A'    'INTEGER'      Fortran 90 and
13510                                                  later
13511     'BIAND(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13512                    A'
13513     'IIAND(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13514                    A'
13515     'JIAND(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13516                    A'
13517     'KIAND(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13518                    A'
13519
13520_See also_:
13521     *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
13522     IBCLR::, *note NOT::
13523
13524
13525File: gfortran.info,  Node: IANY,  Next: IARGC,  Prev: IAND,  Up: Intrinsic Procedures
13526
135279.138 'IANY' -- Bitwise OR of array elements
13528============================================
13529
13530_Description_:
13531     Reduces with bitwise OR (inclusive or) the elements of ARRAY along
13532     dimension DIM if the corresponding element in MASK is 'TRUE'.
13533
13534_Standard_:
13535     Fortran 2008 and later
13536
13537_Class_:
13538     Transformational function
13539
13540_Syntax_:
13541     'RESULT = IANY(ARRAY[, MASK])'
13542     'RESULT = IANY(ARRAY, DIM[, MASK])'
13543
13544_Arguments_:
13545     ARRAY       Shall be an array of type 'INTEGER'
13546     DIM         (Optional) shall be a scalar of type 'INTEGER'
13547                 with a value in the range from 1 to n, where n
13548                 equals the rank of ARRAY.
13549     MASK        (Optional) shall be of type 'LOGICAL' and either
13550                 be a scalar or an array of the same shape as
13551                 ARRAY.
13552
13553_Return value_:
13554     The result is of the same type as ARRAY.
13555
13556     If DIM is absent, a scalar with the bitwise OR of all elements in
13557     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13558     the rank of ARRAY, and a shape similar to that of ARRAY with
13559     dimension DIM dropped is returned.
13560
13561_Example_:
13562          PROGRAM test_iany
13563            INTEGER(1) :: a(2)
13564
13565            a(1) = b'00100100'
13566            a(2) = b'01101010'
13567
13568            ! prints 01101110
13569            PRINT '(b8.8)', IANY(a)
13570          END PROGRAM
13571
13572_See also_:
13573     *note IPARITY::, *note IALL::, *note IOR::
13574
13575
13576File: gfortran.info,  Node: IARGC,  Next: IBCLR,  Prev: IANY,  Up: Intrinsic Procedures
13577
135789.139 'IARGC' -- Get the number of command line arguments
13579=========================================================
13580
13581_Description_:
13582     'IARGC' returns the number of arguments passed on the command line
13583     when the containing program was invoked.
13584
13585     This intrinsic routine is provided for backwards compatibility with
13586     GNU Fortran 77.  In new code, programmers should consider the use
13587     of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
13588     Fortran 2003 standard.
13589
13590_Standard_:
13591     GNU extension
13592
13593_Class_:
13594     Function
13595
13596_Syntax_:
13597     'RESULT = IARGC()'
13598
13599_Arguments_:
13600     None
13601
13602_Return value_:
13603     The number of command line arguments, type 'INTEGER(4)'.
13604
13605_Example_:
13606     See *note GETARG::
13607
13608_See also_:
13609     GNU Fortran 77 compatibility subroutine: *note GETARG:: Fortran
13610     2003 functions and subroutines: *note GET_COMMAND::, *note
13611     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
13612
13613
13614File: gfortran.info,  Node: IBCLR,  Next: IBITS,  Prev: IARGC,  Up: Intrinsic Procedures
13615
136169.140 'IBCLR' -- Clear bit
13617==========================
13618
13619_Description_:
13620     'IBCLR' returns the value of I with the bit at position POS set to
13621     zero.
13622
13623_Standard_:
13624     Fortran 90 and later, has overloads that are GNU extensions
13625
13626_Class_:
13627     Elemental function
13628
13629_Syntax_:
13630     'RESULT = IBCLR(I, POS)'
13631
13632_Arguments_:
13633     I           The type shall be 'INTEGER'.
13634     POS         The type shall be 'INTEGER'.
13635
13636_Return value_:
13637     The return value is of type 'INTEGER' and of the same kind as I.
13638
13639_Specific names_:
13640     Name           Argument       Return type    Standard
13641     'IBCLR(A)'     'INTEGER A'    'INTEGER'      Fortran 90 and
13642                                                  later
13643     'BBCLR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13644                    A'
13645     'IIBCLR(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13646                    A'
13647     'JIBCLR(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13648                    A'
13649     'KIBCLR(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13650                    A'
13651
13652_See also_:
13653     *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
13654     IEOR::, *note MVBITS::
13655
13656
13657File: gfortran.info,  Node: IBITS,  Next: IBSET,  Prev: IBCLR,  Up: Intrinsic Procedures
13658
136599.141 'IBITS' -- Bit extraction
13660===============================
13661
13662_Description_:
13663     'IBITS' extracts a field of length LEN from I, starting from bit
13664     position POS and extending left for LEN bits.  The result is
13665     right-justified and the remaining bits are zeroed.  The value of
13666     'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'.
13667
13668_Standard_:
13669     Fortran 90 and later, has overloads that are GNU extensions
13670
13671_Class_:
13672     Elemental function
13673
13674_Syntax_:
13675     'RESULT = IBITS(I, POS, LEN)'
13676
13677_Arguments_:
13678     I           The type shall be 'INTEGER'.
13679     POS         The type shall be 'INTEGER'.
13680     LEN         The type shall be 'INTEGER'.
13681
13682_Return value_:
13683     The return value is of type 'INTEGER' and of the same kind as I.
13684
13685_Specific names_:
13686     Name           Argument       Return type    Standard
13687     'IBITS(A)'     'INTEGER A'    'INTEGER'      Fortran 90 and
13688                                                  later
13689     'BBITS(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13690                    A'
13691     'IIBITS(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13692                    A'
13693     'JIBITS(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13694                    A'
13695     'KIBITS(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13696                    A'
13697
13698_See also_:
13699     *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note
13700     IOR::, *note IEOR::
13701
13702
13703File: gfortran.info,  Node: IBSET,  Next: ICHAR,  Prev: IBITS,  Up: Intrinsic Procedures
13704
137059.142 'IBSET' -- Set bit
13706========================
13707
13708_Description_:
13709     'IBSET' returns the value of I with the bit at position POS set to
13710     one.
13711
13712_Standard_:
13713     Fortran 90 and later, has overloads that are GNU extensions
13714
13715_Class_:
13716     Elemental function
13717
13718_Syntax_:
13719     'RESULT = IBSET(I, POS)'
13720
13721_Arguments_:
13722     I           The type shall be 'INTEGER'.
13723     POS         The type shall be 'INTEGER'.
13724
13725_Return value_:
13726     The return value is of type 'INTEGER' and of the same kind as I.
13727
13728_Specific names_:
13729     Name           Argument       Return type    Standard
13730     'IBSET(A)'     'INTEGER A'    'INTEGER'      Fortran 90 and
13731                                                  later
13732     'BBSET(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13733                    A'
13734     'IIBSET(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13735                    A'
13736     'JIBSET(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13737                    A'
13738     'KIBSET(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13739                    A'
13740
13741_See also_:
13742     *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
13743     IEOR::, *note MVBITS::
13744
13745
13746File: gfortran.info,  Node: ICHAR,  Next: IDATE,  Prev: IBSET,  Up: Intrinsic Procedures
13747
137489.143 'ICHAR' -- Character-to-integer conversion function
13749=========================================================
13750
13751_Description_:
13752     'ICHAR(C)' returns the code for the character in the first
13753     character position of 'C' in the system's native character set.
13754     The correspondence between characters and their codes is not
13755     necessarily the same across different GNU Fortran implementations.
13756
13757_Standard_:
13758     Fortran 77 and later, with KIND argument Fortran 2003 and later
13759
13760_Class_:
13761     Elemental function
13762
13763_Syntax_:
13764     'RESULT = ICHAR(C [, KIND])'
13765
13766_Arguments_:
13767     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13768     KIND        (Optional) An 'INTEGER' initialization
13769                 expression indicating the kind parameter of the
13770                 result.
13771
13772_Return value_:
13773     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13774     absent, the return value is of default integer kind.
13775
13776_Example_:
13777          program test_ichar
13778            integer i
13779            i = ichar(' ')
13780          end program test_ichar
13781
13782_Specific names_:
13783     Name           Argument       Return type    Standard
13784     'ICHAR(C)'     'CHARACTER     'INTEGER(4)'   Fortran 77 and
13785                    C'                            later
13786
13787_Note_:
13788     No intrinsic exists to convert between a numeric value and a
13789     formatted character string representation - for instance, given the
13790     'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value
13791     with the value 154, or vice versa.  Instead, this functionality is
13792     provided by internal-file I/O, as in the following example:
13793          program read_val
13794            integer value
13795            character(len=10) string, string2
13796            string = '154'
13797
13798            ! Convert a string to a numeric value
13799            read (string,'(I10)') value
13800            print *, value
13801
13802            ! Convert a value to a formatted string
13803            write (string2,'(I10)') value
13804            print *, string2
13805          end program read_val
13806
13807_See also_:
13808     *note ACHAR::, *note CHAR::, *note IACHAR::
13809
13810
13811File: gfortran.info,  Node: IDATE,  Next: IEOR,  Prev: ICHAR,  Up: Intrinsic Procedures
13812
138139.144 'IDATE' -- Get current local time subroutine (day/month/year)
13814===================================================================
13815
13816_Description_:
13817     'IDATE(VALUES)' Fills VALUES with the numerical values at the
13818     current local time.  The day (in the range 1-31), month (in the
13819     range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
13820     respectively.  The year has four significant digits.
13821
13822     This intrinsic routine is provided for backwards compatibility with
13823     GNU Fortran 77.  In new code, programmers should consider the use
13824     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
13825     standard.
13826
13827_Standard_:
13828     GNU extension
13829
13830_Class_:
13831     Subroutine
13832
13833_Syntax_:
13834     'CALL IDATE(VALUES)'
13835
13836_Arguments_:
13837     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
13838                 the kind shall be the default integer kind.
13839
13840_Return value_:
13841     Does not return anything.
13842
13843_Example_:
13844          program test_idate
13845            integer, dimension(3) :: tarray
13846            call idate(tarray)
13847            print *, tarray(1)
13848            print *, tarray(2)
13849            print *, tarray(3)
13850          end program test_idate
13851
13852_See also_:
13853     *note DATE_AND_TIME::
13854
13855
13856File: gfortran.info,  Node: IEOR,  Next: IERRNO,  Prev: IDATE,  Up: Intrinsic Procedures
13857
138589.145 'IEOR' -- Bitwise logical exclusive or
13859============================================
13860
13861_Description_:
13862     'IEOR' returns the bitwise Boolean exclusive-OR of I and J.
13863
13864_Standard_:
13865     Fortran 90 and later, with boz-literal-constant Fortran 2008 and
13866     later, has overloads that are GNU extensions
13867
13868_Class_:
13869     Elemental function
13870
13871_Syntax_:
13872     'RESULT = IEOR(I, J)'
13873
13874_Arguments_:
13875     I           The type shall be 'INTEGER' or a
13876                 boz-literal-constant.
13877     J           The type shall be 'INTEGER' with the same kind
13878                 type parameter as I or a boz-literal-constant.
13879                 I and J shall not both be boz-literal-constants.
13880
13881_Return value_:
13882     The return type is 'INTEGER' with the kind type parameter of the
13883     arguments.  A boz-literal-constant is converted to an 'INTEGER'
13884     with the kind type parameter of the other argument as-if a call to
13885     *note INT:: occurred.
13886
13887_Specific names_:
13888     Name           Argument       Return type    Standard
13889     'IEOR(A)'      'INTEGER A'    'INTEGER'      Fortran 90 and
13890                                                  later
13891     'BIEOR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13892                    A'
13893     'IIEOR(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13894                    A'
13895     'JIEOR(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13896                    A'
13897     'KIEOR(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13898                    A'
13899
13900_See also_:
13901     *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
13902     IBCLR::, *note NOT::
13903
13904
13905File: gfortran.info,  Node: IERRNO,  Next: IMAGE_INDEX,  Prev: IEOR,  Up: Intrinsic Procedures
13906
139079.146 'IERRNO' -- Get the last system error number
13908==================================================
13909
13910_Description_:
13911     Returns the last system error number, as given by the C 'errno'
13912     variable.
13913
13914_Standard_:
13915     GNU extension
13916
13917_Class_:
13918     Function
13919
13920_Syntax_:
13921     'RESULT = IERRNO()'
13922
13923_Arguments_:
13924     None
13925
13926_Return value_:
13927     The return value is of type 'INTEGER' and of the default integer
13928     kind.
13929
13930_See also_:
13931     *note PERROR::
13932
13933
13934File: gfortran.info,  Node: IMAGE_INDEX,  Next: INDEX intrinsic,  Prev: IERRNO,  Up: Intrinsic Procedures
13935
139369.147 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index
13937=============================================================================
13938
13939_Description_:
13940     Returns the image index belonging to a cosubscript.
13941
13942_Standard_:
13943     Fortran 2008 and later
13944
13945_Class_:
13946     Inquiry function.
13947
13948_Syntax_:
13949     'RESULT = IMAGE_INDEX(COARRAY, SUB)'
13950
13951_Arguments_:
13952     COARRAY     Coarray of any type.
13953     SUB         default integer rank-1 array of a size equal to
13954                 the corank of COARRAY.
13955
13956_Return value_:
13957     Scalar default integer with the value of the image index which
13958     corresponds to the cosubscripts.  For invalid cosubscripts the
13959     result is zero.
13960
13961_Example_:
13962          INTEGER :: array[2,-1:4,8,*]
13963          ! Writes  28 (or 0 if there are fewer than 28 images)
13964          WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
13965
13966_See also_:
13967     *note THIS_IMAGE::, *note NUM_IMAGES::
13968
13969
13970File: gfortran.info,  Node: INDEX intrinsic,  Next: INT,  Prev: IMAGE_INDEX,  Up: Intrinsic Procedures
13971
139729.148 'INDEX' -- Position of a substring within a string
13973========================================================
13974
13975_Description_:
13976     Returns the position of the start of the first occurrence of string
13977     SUBSTRING as a substring in STRING, counting from one.  If
13978     SUBSTRING is not present in STRING, zero is returned.  If the BACK
13979     argument is present and true, the return value is the start of the
13980     last occurrence rather than the first.
13981
13982_Standard_:
13983     Fortran 77 and later, with KIND argument Fortran 2003 and later
13984
13985_Class_:
13986     Elemental function
13987
13988_Syntax_:
13989     'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
13990
13991_Arguments_:
13992     STRING      Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13993     SUBSTRING   Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13994     BACK        (Optional) Shall be a scalar 'LOGICAL', with
13995                 'INTENT(IN)'
13996     KIND        (Optional) An 'INTEGER' initialization
13997                 expression indicating the kind parameter of the
13998                 result.
13999
14000_Return value_:
14001     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14002     absent, the return value is of default integer kind.
14003
14004_Specific names_:
14005     Name           Argument       Return type    Standard
14006     'INDEX(STRING, 'CHARACTER'    'INTEGER(4)'   Fortran 77 and
14007     SUBSTRING)'                                  later
14008
14009_See also_:
14010     *note SCAN::, *note VERIFY::
14011
14012
14013File: gfortran.info,  Node: INT,  Next: INT2,  Prev: INDEX intrinsic,  Up: Intrinsic Procedures
14014
140159.149 'INT' -- Convert to integer type
14016======================================
14017
14018_Description_:
14019     Convert to integer type
14020
14021_Standard_:
14022     Fortran 77 and later, with boz-literal-constant Fortran 2008 and
14023     later.
14024
14025_Class_:
14026     Elemental function
14027
14028_Syntax_:
14029     'RESULT = INT(A [, KIND))'
14030
14031_Arguments_:
14032     A           Shall be of type 'INTEGER', 'REAL', or 'COMPLEX'
14033                 or or a boz-literal-constant.
14034     KIND        (Optional) An 'INTEGER' initialization
14035                 expression indicating the kind parameter of the
14036                 result.
14037
14038_Return value_:
14039     These functions return a 'INTEGER' variable or array under the
14040     following rules:
14041
14042     (A)
14043          If A is of type 'INTEGER', 'INT(A) = A'
14044     (B)
14045          If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'.  If
14046          |A| \geq 1, then 'INT(A)' is the integer whose magnitude is
14047          the largest integer that does not exceed the magnitude of A
14048          and whose sign is the same as the sign of A.
14049     (C)
14050          If A is of type 'COMPLEX', rule B is applied to the real part
14051          of A.
14052
14053_Example_:
14054          program test_int
14055            integer :: i = 42
14056            complex :: z = (-3.7, 1.0)
14057            print *, int(i)
14058            print *, int(z), int(z,8)
14059          end program
14060
14061_Specific names_:
14062     Name           Argument       Return type    Standard
14063     'INT(A)'       'REAL(4) A'    'INTEGER'      Fortran 77 and
14064                                                  later
14065     'IFIX(A)'      'REAL(4) A'    'INTEGER'      Fortran 77 and
14066                                                  later
14067     'IDINT(A)'     'REAL(8) A'    'INTEGER'      Fortran 77 and
14068                                                  later
14069
14070
14071File: gfortran.info,  Node: INT2,  Next: INT8,  Prev: INT,  Up: Intrinsic Procedures
14072
140739.150 'INT2' -- Convert to 16-bit integer type
14074==============================================
14075
14076_Description_:
14077     Convert to a 'KIND=2' integer type.  This is equivalent to the
14078     standard 'INT' intrinsic with an optional argument of 'KIND=2', and
14079     is only included for backwards compatibility.
14080
14081     The 'SHORT' intrinsic is equivalent to 'INT2'.
14082
14083_Standard_:
14084     GNU extension
14085
14086_Class_:
14087     Elemental function
14088
14089_Syntax_:
14090     'RESULT = INT2(A)'
14091
14092_Arguments_:
14093     A           Shall be of type 'INTEGER', 'REAL', or
14094                 'COMPLEX'.
14095
14096_Return value_:
14097     The return value is a 'INTEGER(2)' variable.
14098
14099_See also_:
14100     *note INT::, *note INT8::, *note LONG::
14101
14102
14103File: gfortran.info,  Node: INT8,  Next: IOR,  Prev: INT2,  Up: Intrinsic Procedures
14104
141059.151 'INT8' -- Convert to 64-bit integer type
14106==============================================
14107
14108_Description_:
14109     Convert to a 'KIND=8' integer type.  This is equivalent to the
14110     standard 'INT' intrinsic with an optional argument of 'KIND=8', and
14111     is only included for backwards compatibility.
14112
14113_Standard_:
14114     GNU extension
14115
14116_Class_:
14117     Elemental function
14118
14119_Syntax_:
14120     'RESULT = INT8(A)'
14121
14122_Arguments_:
14123     A           Shall be of type 'INTEGER', 'REAL', or
14124                 'COMPLEX'.
14125
14126_Return value_:
14127     The return value is a 'INTEGER(8)' variable.
14128
14129_See also_:
14130     *note INT::, *note INT2::, *note LONG::
14131
14132
14133File: gfortran.info,  Node: IOR,  Next: IPARITY,  Prev: INT8,  Up: Intrinsic Procedures
14134
141359.152 'IOR' -- Bitwise logical or
14136=================================
14137
14138_Description_:
14139     'IOR' returns the bitwise Boolean inclusive-OR of I and J.
14140
14141_Standard_:
14142     Fortran 90 and later, with boz-literal-constant Fortran 2008 and
14143     later, has overloads that are GNU extensions
14144
14145_Class_:
14146     Elemental function
14147
14148_Syntax_:
14149     'RESULT = IOR(I, J)'
14150
14151_Arguments_:
14152     I           The type shall be 'INTEGER' or a
14153                 boz-literal-constant.
14154     J           The type shall be 'INTEGER' with the same kind
14155                 type parameter as I or a boz-literal-constant.
14156                 I and J shall not both be boz-literal-constants.
14157
14158_Return value_:
14159     The return type is 'INTEGER' with the kind type parameter of the
14160     arguments.  A boz-literal-constant is converted to an 'INTEGER'
14161     with the kind type parameter of the other argument as-if a call to
14162     *note INT:: occurred.
14163
14164_Specific names_:
14165     Name           Argument       Return type    Standard
14166     'IOR(A)'       'INTEGER A'    'INTEGER'      Fortran 90 and
14167                                                  later
14168     'BIOR(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
14169                    A'
14170     'IIOR(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
14171                    A'
14172     'JIOR(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
14173                    A'
14174     'KIOR(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
14175                    A'
14176
14177_See also_:
14178     *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
14179     IBCLR::, *note NOT::
14180
14181
14182File: gfortran.info,  Node: IPARITY,  Next: IRAND,  Prev: IOR,  Up: Intrinsic Procedures
14183
141849.153 'IPARITY' -- Bitwise XOR of array elements
14185================================================
14186
14187_Description_:
14188     Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
14189     dimension DIM if the corresponding element in MASK is 'TRUE'.
14190
14191_Standard_:
14192     Fortran 2008 and later
14193
14194_Class_:
14195     Transformational function
14196
14197_Syntax_:
14198     'RESULT = IPARITY(ARRAY[, MASK])'
14199     'RESULT = IPARITY(ARRAY, DIM[, MASK])'
14200
14201_Arguments_:
14202     ARRAY       Shall be an array of type 'INTEGER'
14203     DIM         (Optional) shall be a scalar of type 'INTEGER'
14204                 with a value in the range from 1 to n, where n
14205                 equals the rank of ARRAY.
14206     MASK        (Optional) shall be of type 'LOGICAL' and either
14207                 be a scalar or an array of the same shape as
14208                 ARRAY.
14209
14210_Return value_:
14211     The result is of the same type as ARRAY.
14212
14213     If DIM is absent, a scalar with the bitwise XOR of all elements in
14214     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
14215     the rank of ARRAY, and a shape similar to that of ARRAY with
14216     dimension DIM dropped is returned.
14217
14218_Example_:
14219          PROGRAM test_iparity
14220            INTEGER(1) :: a(2)
14221
14222            a(1) = int(b'00100100', 1)
14223            a(2) = int(b'01101010', 1)
14224
14225            ! prints 01001110
14226            PRINT '(b8.8)', IPARITY(a)
14227          END PROGRAM
14228
14229_See also_:
14230     *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
14231
14232
14233File: gfortran.info,  Node: IRAND,  Next: IS_CONTIGUOUS,  Prev: IPARITY,  Up: Intrinsic Procedures
14234
142359.154 'IRAND' -- Integer pseudo-random number
14236=============================================
14237
14238_Description_:
14239     'IRAND(FLAG)' returns a pseudo-random number from a uniform
14240     distribution between 0 and a system-dependent limit (which is in
14241     most cases 2147483647).  If FLAG is 0, the next number in the
14242     current sequence is returned; if FLAG is 1, the generator is
14243     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
14244     used as a new seed with 'SRAND'.
14245
14246     This intrinsic routine is provided for backwards compatibility with
14247     GNU Fortran 77.  It implements a simple modulo generator as
14248     provided by 'g77'.  For new code, one should consider the use of
14249     *note RANDOM_NUMBER:: as it implements a superior algorithm.
14250
14251_Standard_:
14252     GNU extension
14253
14254_Class_:
14255     Function
14256
14257_Syntax_:
14258     'RESULT = IRAND(I)'
14259
14260_Arguments_:
14261     I           Shall be a scalar 'INTEGER' of kind 4.
14262
14263_Return value_:
14264     The return value is of 'INTEGER(kind=4)' type.
14265
14266_Example_:
14267          program test_irand
14268            integer,parameter :: seed = 86456
14269
14270            call srand(seed)
14271            print *, irand(), irand(), irand(), irand()
14272            print *, irand(seed), irand(), irand(), irand()
14273          end program test_irand
14274
14275
14276File: gfortran.info,  Node: IS_CONTIGUOUS,  Next: IS_IOSTAT_END,  Prev: IRAND,  Up: Intrinsic Procedures
14277
142789.155 'IS_CONTIGUOUS' -- Test whether an array is contiguous
14279============================================================
14280
14281_Description_:
14282     'IS_CONTIGUOUS' tests whether an array is contiguous.
14283
14284_Standard_:
14285     Fortran 2008 and later
14286
14287_Class_:
14288     Inquiry function
14289
14290_Syntax_:
14291     'RESULT = IS_CONTIGUOUS(ARRAY)'
14292
14293_Arguments_:
14294     ARRAY       Shall be an array of any type.
14295
14296_Return value_:
14297     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if ARRAY is
14298     contiguous and false otherwise.
14299
14300_Example_:
14301          program test
14302            integer :: a(10)
14303            a = [1,2,3,4,5,6,7,8,9,10]
14304            call sub (a)      ! every element, is contiguous
14305            call sub (a(::2)) ! every other element, is noncontiguous
14306          contains
14307            subroutine sub (x)
14308              integer :: x(:)
14309              if (is_contiguous (x)) then
14310                write (*,*) 'X is contiguous'
14311              else
14312                write (*,*) 'X is not contiguous'
14313              end if
14314            end subroutine sub
14315          end program test
14316
14317
14318File: gfortran.info,  Node: IS_IOSTAT_END,  Next: IS_IOSTAT_EOR,  Prev: IS_CONTIGUOUS,  Up: Intrinsic Procedures
14319
143209.156 'IS_IOSTAT_END' -- Test for end-of-file value
14321===================================================
14322
14323_Description_:
14324     'IS_IOSTAT_END' tests whether an variable has the value of the I/O
14325     status "end of file".  The function is equivalent to comparing the
14326     variable with the 'IOSTAT_END' parameter of the intrinsic module
14327     'ISO_FORTRAN_ENV'.
14328
14329_Standard_:
14330     Fortran 2003 and later
14331
14332_Class_:
14333     Elemental function
14334
14335_Syntax_:
14336     'RESULT = IS_IOSTAT_END(I)'
14337
14338_Arguments_:
14339     I           Shall be of the type 'INTEGER'.
14340
14341_Return value_:
14342     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
14343     the value which indicates an end of file condition for 'IOSTAT='
14344     specifiers, and is '.FALSE.' otherwise.
14345
14346_Example_:
14347          PROGRAM iostat
14348            IMPLICIT NONE
14349            INTEGER :: stat, i
14350            OPEN(88, FILE='test.dat')
14351            READ(88, *, IOSTAT=stat) i
14352            IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
14353          END PROGRAM
14354
14355
14356File: gfortran.info,  Node: IS_IOSTAT_EOR,  Next: ISATTY,  Prev: IS_IOSTAT_END,  Up: Intrinsic Procedures
14357
143589.157 'IS_IOSTAT_EOR' -- Test for end-of-record value
14359=====================================================
14360
14361_Description_:
14362     'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
14363     status "end of record".  The function is equivalent to comparing
14364     the variable with the 'IOSTAT_EOR' parameter of the intrinsic
14365     module 'ISO_FORTRAN_ENV'.
14366
14367_Standard_:
14368     Fortran 2003 and later
14369
14370_Class_:
14371     Elemental function
14372
14373_Syntax_:
14374     'RESULT = IS_IOSTAT_EOR(I)'
14375
14376_Arguments_:
14377     I           Shall be of the type 'INTEGER'.
14378
14379_Return value_:
14380     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
14381     the value which indicates an end of file condition for 'IOSTAT='
14382     specifiers, and is '.FALSE.' otherwise.
14383
14384_Example_:
14385          PROGRAM iostat
14386            IMPLICIT NONE
14387            INTEGER :: stat, i(50)
14388            OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
14389            READ(88, IOSTAT=stat) i
14390            IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
14391          END PROGRAM
14392
14393
14394File: gfortran.info,  Node: ISATTY,  Next: ISHFT,  Prev: IS_IOSTAT_EOR,  Up: Intrinsic Procedures
14395
143969.158 'ISATTY' -- Whether a unit is a terminal device.
14397======================================================
14398
14399_Description_:
14400     Determine whether a unit is connected to a terminal device.
14401
14402_Standard_:
14403     GNU extension
14404
14405_Class_:
14406     Function
14407
14408_Syntax_:
14409     'RESULT = ISATTY(UNIT)'
14410
14411_Arguments_:
14412     UNIT        Shall be a scalar 'INTEGER'.
14413
14414_Return value_:
14415     Returns '.TRUE.' if the UNIT is connected to a terminal device,
14416     '.FALSE.' otherwise.
14417
14418_Example_:
14419          PROGRAM test_isatty
14420            INTEGER(kind=1) :: unit
14421            DO unit = 1, 10
14422              write(*,*) isatty(unit=unit)
14423            END DO
14424          END PROGRAM
14425_See also_:
14426     *note TTYNAM::
14427
14428
14429File: gfortran.info,  Node: ISHFT,  Next: ISHFTC,  Prev: ISATTY,  Up: Intrinsic Procedures
14430
144319.159 'ISHFT' -- Shift bits
14432===========================
14433
14434_Description_:
14435     'ISHFT' returns a value corresponding to I with all of the bits
14436     shifted SHIFT places.  A value of SHIFT greater than zero
14437     corresponds to a left shift, a value of zero corresponds to no
14438     shift, and a value less than zero corresponds to a right shift.  If
14439     the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the
14440     value is undefined.  Bits shifted out from the left end or right
14441     end are lost; zeros are shifted in from the opposite end.
14442
14443_Standard_:
14444     Fortran 90 and later, has overloads that are GNU extensions
14445
14446_Class_:
14447     Elemental function
14448
14449_Syntax_:
14450     'RESULT = ISHFT(I, SHIFT)'
14451
14452_Arguments_:
14453     I           The type shall be 'INTEGER'.
14454     SHIFT       The type shall be 'INTEGER'.
14455
14456_Return value_:
14457     The return value is of type 'INTEGER' and of the same kind as I.
14458
14459_Specific names_:
14460     Name           Argument       Return type    Standard
14461     'ISHFT(A)'     'INTEGER A'    'INTEGER'      Fortran 90 and
14462                                                  later
14463     'BSHFT(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
14464                    A'
14465     'IISHFT(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
14466                    A'
14467     'JISHFT(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
14468                    A'
14469     'KISHFT(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
14470                    A'
14471
14472_See also_:
14473     *note ISHFTC::
14474
14475
14476File: gfortran.info,  Node: ISHFTC,  Next: ISNAN,  Prev: ISHFT,  Up: Intrinsic Procedures
14477
144789.160 'ISHFTC' -- Shift bits circularly
14479=======================================
14480
14481_Description_:
14482     'ISHFTC' returns a value corresponding to I with the rightmost SIZE
14483     bits shifted circularly SHIFT places; that is, bits shifted out one
14484     end are shifted into the opposite end.  A value of SHIFT greater
14485     than zero corresponds to a left shift, a value of zero corresponds
14486     to no shift, and a value less than zero corresponds to a right
14487     shift.  The absolute value of SHIFT must be less than SIZE.  If the
14488     SIZE argument is omitted, it is taken to be equivalent to
14489     'BIT_SIZE(I)'.
14490
14491_Standard_:
14492     Fortran 90 and later, has overloads that are GNU extensions
14493
14494_Class_:
14495     Elemental function
14496
14497_Syntax_:
14498     'RESULT = ISHFTC(I, SHIFT [, SIZE])'
14499
14500_Arguments_:
14501     I           The type shall be 'INTEGER'.
14502     SHIFT       The type shall be 'INTEGER'.
14503     SIZE        (Optional) The type shall be 'INTEGER'; the
14504                 value must be greater than zero and less than or
14505                 equal to 'BIT_SIZE(I)'.
14506
14507_Return value_:
14508     The return value is of type 'INTEGER' and of the same kind as I.
14509
14510_Specific names_:
14511     Name           Argument       Return type    Standard
14512     'ISHFTC(A)'    'INTEGER A'    'INTEGER'      Fortran 90 and
14513                                                  later
14514     'BSHFTC(A)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
14515                    A'
14516     'IISHFTC(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
14517                    A'
14518     'JISHFTC(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
14519                    A'
14520     'KISHFTC(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
14521                    A'
14522
14523_See also_:
14524     *note ISHFT::
14525
14526
14527File: gfortran.info,  Node: ISNAN,  Next: ITIME,  Prev: ISHFTC,  Up: Intrinsic Procedures
14528
145299.161 'ISNAN' -- Test for a NaN
14530===============================
14531
14532_Description_:
14533     'ISNAN' tests whether a floating-point value is an IEEE
14534     Not-a-Number (NaN).
14535_Standard_:
14536     GNU extension
14537
14538_Class_:
14539     Elemental function
14540
14541_Syntax_:
14542     'ISNAN(X)'
14543
14544_Arguments_:
14545     X           Variable of the type 'REAL'.
14546
14547
14548_Return value_:
14549     Returns a default-kind 'LOGICAL'.  The returned value is 'TRUE' if
14550     X is a NaN and 'FALSE' otherwise.
14551
14552_Example_:
14553          program test_nan
14554            implicit none
14555            real :: x
14556            x = -1.0
14557            x = sqrt(x)
14558            if (isnan(x)) stop '"x" is a NaN'
14559          end program test_nan
14560
14561
14562File: gfortran.info,  Node: ITIME,  Next: KILL,  Prev: ISNAN,  Up: Intrinsic Procedures
14563
145649.162 'ITIME' -- Get current local time subroutine (hour/minutes/seconds)
14565=========================================================================
14566
14567_Description_:
14568     'ITIME(VALUES)' Fills VALUES with the numerical values at the
14569     current local time.  The hour (in the range 1-24), minute (in the
14570     range 1-60), and seconds (in the range 1-60) appear in elements 1,
14571     2, and 3 of VALUES, respectively.
14572
14573     This intrinsic routine is provided for backwards compatibility with
14574     GNU Fortran 77.  In new code, programmers should consider the use
14575     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
14576     standard.
14577
14578_Standard_:
14579     GNU extension
14580
14581_Class_:
14582     Subroutine
14583
14584_Syntax_:
14585     'CALL ITIME(VALUES)'
14586
14587_Arguments_:
14588     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
14589                 the kind shall be the default integer kind.
14590
14591_Return value_:
14592     Does not return anything.
14593
14594_Example_:
14595          program test_itime
14596            integer, dimension(3) :: tarray
14597            call itime(tarray)
14598            print *, tarray(1)
14599            print *, tarray(2)
14600            print *, tarray(3)
14601          end program test_itime
14602
14603_See also_:
14604     *note DATE_AND_TIME::
14605
14606
14607File: gfortran.info,  Node: KILL,  Next: KIND,  Prev: ITIME,  Up: Intrinsic Procedures
14608
146099.163 'KILL' -- Send a signal to a process
14610==========================================
14611
14612_Description_:
14613     Sends the signal specified by SIG to the process PID.  See
14614     'kill(2)'.
14615
14616     This intrinsic is provided in both subroutine and function forms;
14617     however, only one form can be used in any given program unit.
14618_Standard_:
14619     GNU extension
14620
14621_Standard_:
14622     GNU extension
14623
14624_Class_:
14625     Subroutine, function
14626
14627_Syntax_:
14628     'CALL KILL(PID, SIG [, STATUS])'
14629     'STATUS = KILL(PID, SIG)'
14630
14631_Arguments_:
14632     PID         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14633     SIG         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14634     STATUS      [Subroutine](Optional) Shall be a scalar
14635                 'INTEGER'.  Returns 0 on success; otherwise a
14636                 system-specific error code is returned.
14637     STATUS      [Function] The kind type parameter is that of
14638                 'pid'.  Returns 0 on success; otherwise a
14639                 system-specific error code is returned.
14640
14641_See also_:
14642     *note ABORT::, *note EXIT::
14643
14644
14645File: gfortran.info,  Node: KIND,  Next: LBOUND,  Prev: KILL,  Up: Intrinsic Procedures
14646
146479.164 'KIND' -- Kind of an entity
14648=================================
14649
14650_Description_:
14651     'KIND(X)' returns the kind value of the entity X.
14652
14653_Standard_:
14654     Fortran 95 and later
14655
14656_Class_:
14657     Inquiry function
14658
14659_Syntax_:
14660     'K = KIND(X)'
14661
14662_Arguments_:
14663     X           Shall be of type 'LOGICAL', 'INTEGER', 'REAL',
14664                 'COMPLEX' or 'CHARACTER'.  It may be scalar or
14665                 array valued.
14666
14667_Return value_:
14668     The return value is a scalar of type 'INTEGER' and of the default
14669     integer kind.
14670
14671_Example_:
14672          program test_kind
14673            integer,parameter :: kc = kind(' ')
14674            integer,parameter :: kl = kind(.true.)
14675
14676            print *, "The default character kind is ", kc
14677            print *, "The default logical kind is ", kl
14678          end program test_kind
14679
14680
14681File: gfortran.info,  Node: LBOUND,  Next: LCOBOUND,  Prev: KIND,  Up: Intrinsic Procedures
14682
146839.165 'LBOUND' -- Lower dimension bounds of an array
14684====================================================
14685
14686_Description_:
14687     Returns the lower bounds of an array, or a single lower bound along
14688     the DIM dimension.
14689_Standard_:
14690     Fortran 90 and later, with KIND argument Fortran 2003 and later
14691
14692_Class_:
14693     Inquiry function
14694
14695_Syntax_:
14696     'RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
14697
14698_Arguments_:
14699     ARRAY       Shall be an array, of any type.
14700     DIM         (Optional) Shall be a scalar 'INTEGER'.
14701     KIND        (Optional) An 'INTEGER' initialization
14702                 expression indicating the kind parameter of the
14703                 result.
14704
14705_Return value_:
14706     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14707     absent, the return value is of default integer kind.  If DIM is
14708     absent, the result is an array of the lower bounds of ARRAY.  If
14709     DIM is present, the result is a scalar corresponding to the lower
14710     bound of the array along that dimension.  If ARRAY is an expression
14711     rather than a whole array or array structure component, or if it
14712     has a zero extent along the relevant dimension, the lower bound is
14713     taken to be 1.
14714
14715_See also_:
14716     *note UBOUND::, *note LCOBOUND::
14717
14718
14719File: gfortran.info,  Node: LCOBOUND,  Next: LEADZ,  Prev: LBOUND,  Up: Intrinsic Procedures
14720
147219.166 'LCOBOUND' -- Lower codimension bounds of an array
14722========================================================
14723
14724_Description_:
14725     Returns the lower bounds of a coarray, or a single lower cobound
14726     along the DIM codimension.
14727_Standard_:
14728     Fortran 2008 and later
14729
14730_Class_:
14731     Inquiry function
14732
14733_Syntax_:
14734     'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
14735
14736_Arguments_:
14737     ARRAY       Shall be an coarray, of any type.
14738     DIM         (Optional) Shall be a scalar 'INTEGER'.
14739     KIND        (Optional) An 'INTEGER' initialization
14740                 expression indicating the kind parameter of the
14741                 result.
14742
14743_Return value_:
14744     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14745     absent, the return value is of default integer kind.  If DIM is
14746     absent, the result is an array of the lower cobounds of COARRAY.
14747     If DIM is present, the result is a scalar corresponding to the
14748     lower cobound of the array along that codimension.
14749
14750_See also_:
14751     *note UCOBOUND::, *note LBOUND::
14752
14753
14754File: gfortran.info,  Node: LEADZ,  Next: LEN,  Prev: LCOBOUND,  Up: Intrinsic Procedures
14755
147569.167 'LEADZ' -- Number of leading zero bits of an integer
14757==========================================================
14758
14759_Description_:
14760     'LEADZ' returns the number of leading zero bits of an integer.
14761
14762_Standard_:
14763     Fortran 2008 and later
14764
14765_Class_:
14766     Elemental function
14767
14768_Syntax_:
14769     'RESULT = LEADZ(I)'
14770
14771_Arguments_:
14772     I           Shall be of type 'INTEGER'.
14773
14774_Return value_:
14775     The type of the return value is the default 'INTEGER'.  If all the
14776     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
14777
14778_Example_:
14779          PROGRAM test_leadz
14780            WRITE (*,*) BIT_SIZE(1)  ! prints 32
14781            WRITE (*,*) LEADZ(1)     ! prints 31
14782          END PROGRAM
14783
14784_See also_:
14785     *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
14786
14787
14788File: gfortran.info,  Node: LEN,  Next: LEN_TRIM,  Prev: LEADZ,  Up: Intrinsic Procedures
14789
147909.168 'LEN' -- Length of a character entity
14791===========================================
14792
14793_Description_:
14794     Returns the length of a character string.  If STRING is an array,
14795     the length of an element of STRING is returned.  Note that STRING
14796     need not be defined when this intrinsic is invoked, since only the
14797     length, not the content, of STRING is needed.
14798
14799_Standard_:
14800     Fortran 77 and later, with KIND argument Fortran 2003 and later
14801
14802_Class_:
14803     Inquiry function
14804
14805_Syntax_:
14806     'L = LEN(STRING [, KIND])'
14807
14808_Arguments_:
14809     STRING      Shall be a scalar or array of type 'CHARACTER',
14810                 with 'INTENT(IN)'
14811     KIND        (Optional) An 'INTEGER' initialization
14812                 expression indicating the kind parameter of the
14813                 result.
14814
14815_Return value_:
14816     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14817     absent, the return value is of default integer kind.
14818
14819_Specific names_:
14820     Name           Argument       Return type    Standard
14821     'LEN(STRING)'  'CHARACTER'    'INTEGER'      Fortran 77 and
14822                                                  later
14823
14824_See also_:
14825     *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
14826
14827
14828File: gfortran.info,  Node: LEN_TRIM,  Next: LGE,  Prev: LEN,  Up: Intrinsic Procedures
14829
148309.169 'LEN_TRIM' -- Length of a character entity without trailing blank characters
14831==================================================================================
14832
14833_Description_:
14834     Returns the length of a character string, ignoring any trailing
14835     blanks.
14836
14837_Standard_:
14838     Fortran 90 and later, with KIND argument Fortran 2003 and later
14839
14840_Class_:
14841     Elemental function
14842
14843_Syntax_:
14844     'RESULT = LEN_TRIM(STRING [, KIND])'
14845
14846_Arguments_:
14847     STRING      Shall be a scalar of type 'CHARACTER', with
14848                 'INTENT(IN)'
14849     KIND        (Optional) An 'INTEGER' initialization
14850                 expression indicating the kind parameter of the
14851                 result.
14852
14853_Return value_:
14854     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14855     absent, the return value is of default integer kind.
14856
14857_See also_:
14858     *note LEN::, *note ADJUSTL::, *note ADJUSTR::
14859
14860
14861File: gfortran.info,  Node: LGE,  Next: LGT,  Prev: LEN_TRIM,  Up: Intrinsic Procedures
14862
148639.170 'LGE' -- Lexical greater than or equal
14864============================================
14865
14866_Description_:
14867     Determines whether one string is lexically greater than or equal to
14868     another string, where the two strings are interpreted as containing
14869     ASCII character codes.  If the String A and String B are not the
14870     same length, the shorter is compared as if spaces were appended to
14871     it to form a value that has the same length as the longer.
14872
14873     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14874     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14875     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14876     character ordering (which is not ASCII on some targets), whereas
14877     the former always use the ASCII ordering.
14878
14879_Standard_:
14880     Fortran 77 and later
14881
14882_Class_:
14883     Elemental function
14884
14885_Syntax_:
14886     'RESULT = LGE(STRING_A, STRING_B)'
14887
14888_Arguments_:
14889     STRING_A    Shall be of default 'CHARACTER' type.
14890     STRING_B    Shall be of default 'CHARACTER' type.
14891
14892_Return value_:
14893     Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.'
14894     otherwise, based on the ASCII ordering.
14895
14896_Specific names_:
14897     Name           Argument       Return type    Standard
14898     'LGE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14899     STRING_B)'                                   later
14900
14901_See also_:
14902     *note LGT::, *note LLE::, *note LLT::
14903
14904
14905File: gfortran.info,  Node: LGT,  Next: LINK,  Prev: LGE,  Up: Intrinsic Procedures
14906
149079.171 'LGT' -- Lexical greater than
14908===================================
14909
14910_Description_:
14911     Determines whether one string is lexically greater than another
14912     string, where the two strings are interpreted as containing ASCII
14913     character codes.  If the String A and String B are not the same
14914     length, the shorter is compared as if spaces were appended to it to
14915     form a value that has the same length as the longer.
14916
14917     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14918     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14919     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14920     character ordering (which is not ASCII on some targets), whereas
14921     the former always use the ASCII ordering.
14922
14923_Standard_:
14924     Fortran 77 and later
14925
14926_Class_:
14927     Elemental function
14928
14929_Syntax_:
14930     'RESULT = LGT(STRING_A, STRING_B)'
14931
14932_Arguments_:
14933     STRING_A    Shall be of default 'CHARACTER' type.
14934     STRING_B    Shall be of default 'CHARACTER' type.
14935
14936_Return value_:
14937     Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise,
14938     based on the ASCII ordering.
14939
14940_Specific names_:
14941     Name           Argument       Return type    Standard
14942     'LGT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14943     STRING_B)'                                   later
14944
14945_See also_:
14946     *note LGE::, *note LLE::, *note LLT::
14947
14948
14949File: gfortran.info,  Node: LINK,  Next: LLE,  Prev: LGT,  Up: Intrinsic Procedures
14950
149519.172 'LINK' -- Create a hard link
14952==================================
14953
14954_Description_:
14955     Makes a (hard) link from file PATH1 to PATH2.  A null character
14956     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
14957     PATH2; otherwise, trailing blanks in the file names are ignored.
14958     If the STATUS argument is supplied, it contains 0 on success or a
14959     nonzero error code upon return; see 'link(2)'.
14960
14961     This intrinsic is provided in both subroutine and function forms;
14962     however, only one form can be used in any given program unit.
14963
14964_Standard_:
14965     GNU extension
14966
14967_Class_:
14968     Subroutine, function
14969
14970_Syntax_:
14971     'CALL LINK(PATH1, PATH2 [, STATUS])'
14972     'STATUS = LINK(PATH1, PATH2)'
14973
14974_Arguments_:
14975     PATH1       Shall be of default 'CHARACTER' type.
14976     PATH2       Shall be of default 'CHARACTER' type.
14977     STATUS      (Optional) Shall be of default 'INTEGER' type.
14978
14979_See also_:
14980     *note SYMLNK::, *note UNLINK::
14981
14982
14983File: gfortran.info,  Node: LLE,  Next: LLT,  Prev: LINK,  Up: Intrinsic Procedures
14984
149859.173 'LLE' -- Lexical less than or equal
14986=========================================
14987
14988_Description_:
14989     Determines whether one string is lexically less than or equal to
14990     another string, where the two strings are interpreted as containing
14991     ASCII character codes.  If the String A and String B are not the
14992     same length, the shorter is compared as if spaces were appended to
14993     it to form a value that has the same length as the longer.
14994
14995     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14996     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14997     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14998     character ordering (which is not ASCII on some targets), whereas
14999     the former always use the ASCII ordering.
15000
15001_Standard_:
15002     Fortran 77 and later
15003
15004_Class_:
15005     Elemental function
15006
15007_Syntax_:
15008     'RESULT = LLE(STRING_A, STRING_B)'
15009
15010_Arguments_:
15011     STRING_A    Shall be of default 'CHARACTER' type.
15012     STRING_B    Shall be of default 'CHARACTER' type.
15013
15014_Return value_:
15015     Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.'
15016     otherwise, based on the ASCII ordering.
15017
15018_Specific names_:
15019     Name           Argument       Return type    Standard
15020     'LLE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
15021     STRING_B)'                                   later
15022
15023_See also_:
15024     *note LGE::, *note LGT::, *note LLT::
15025
15026
15027File: gfortran.info,  Node: LLT,  Next: LNBLNK,  Prev: LLE,  Up: Intrinsic Procedures
15028
150299.174 'LLT' -- Lexical less than
15030================================
15031
15032_Description_:
15033     Determines whether one string is lexically less than another
15034     string, where the two strings are interpreted as containing ASCII
15035     character codes.  If the String A and String B are not the same
15036     length, the shorter is compared as if spaces were appended to it to
15037     form a value that has the same length as the longer.
15038
15039     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
15040     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
15041     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
15042     character ordering (which is not ASCII on some targets), whereas
15043     the former always use the ASCII ordering.
15044
15045_Standard_:
15046     Fortran 77 and later
15047
15048_Class_:
15049     Elemental function
15050
15051_Syntax_:
15052     'RESULT = LLT(STRING_A, STRING_B)'
15053
15054_Arguments_:
15055     STRING_A    Shall be of default 'CHARACTER' type.
15056     STRING_B    Shall be of default 'CHARACTER' type.
15057
15058_Return value_:
15059     Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise,
15060     based on the ASCII ordering.
15061
15062_Specific names_:
15063     Name           Argument       Return type    Standard
15064     'LLT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
15065     STRING_B)'                                   later
15066
15067_See also_:
15068     *note LGE::, *note LGT::, *note LLE::
15069
15070
15071File: gfortran.info,  Node: LNBLNK,  Next: LOC,  Prev: LLT,  Up: Intrinsic Procedures
15072
150739.175 'LNBLNK' -- Index of the last non-blank character in a string
15074===================================================================
15075
15076_Description_:
15077     Returns the length of a character string, ignoring any trailing
15078     blanks.  This is identical to the standard 'LEN_TRIM' intrinsic,
15079     and is only included for backwards compatibility.
15080
15081_Standard_:
15082     GNU extension
15083
15084_Class_:
15085     Elemental function
15086
15087_Syntax_:
15088     'RESULT = LNBLNK(STRING)'
15089
15090_Arguments_:
15091     STRING      Shall be a scalar of type 'CHARACTER', with
15092                 'INTENT(IN)'
15093
15094_Return value_:
15095     The return value is of 'INTEGER(kind=4)' type.
15096
15097_See also_:
15098     *note INDEX intrinsic::, *note LEN_TRIM::
15099
15100
15101File: gfortran.info,  Node: LOC,  Next: LOG,  Prev: LNBLNK,  Up: Intrinsic Procedures
15102
151039.176 'LOC' -- Returns the address of a variable
15104================================================
15105
15106_Description_:
15107     'LOC(X)' returns the address of X as an integer.
15108
15109_Standard_:
15110     GNU extension
15111
15112_Class_:
15113     Inquiry function
15114
15115_Syntax_:
15116     'RESULT = LOC(X)'
15117
15118_Arguments_:
15119     X           Variable of any type.
15120
15121_Return value_:
15122     The return value is of type 'INTEGER', with a 'KIND' corresponding
15123     to the size (in bytes) of a memory address on the target machine.
15124
15125_Example_:
15126          program test_loc
15127            integer :: i
15128            real :: r
15129            i = loc(r)
15130            print *, i
15131          end program test_loc
15132
15133
15134File: gfortran.info,  Node: LOG,  Next: LOG10,  Prev: LOC,  Up: Intrinsic Procedures
15135
151369.177 'LOG' -- Natural logarithm function
15137=========================================
15138
15139_Description_:
15140     'LOG(X)' computes the natural logarithm of X, i.e.  the logarithm
15141     to the base e.
15142
15143_Standard_:
15144     Fortran 77 and later, has GNU extensions
15145
15146_Class_:
15147     Elemental function
15148
15149_Syntax_:
15150     'RESULT = LOG(X)'
15151
15152_Arguments_:
15153     X           The type shall be 'REAL' or 'COMPLEX'.
15154
15155_Return value_:
15156     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
15157     parameter is the same as X.  If X is 'COMPLEX', the imaginary part
15158     \omega is in the range -\pi < \omega \leq \pi.
15159
15160_Example_:
15161          program test_log
15162            real(8) :: x = 2.7182818284590451_8
15163            complex :: z = (1.0, 2.0)
15164            x = log(x)    ! will yield (approximately) 1
15165            z = log(z)
15166          end program test_log
15167
15168_Specific names_:
15169     Name           Argument       Return type    Standard
15170     'ALOG(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 or
15171                                                  later
15172     'DLOG(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 or
15173                                                  later
15174     'CLOG(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 or
15175                    X'                            later
15176     'ZLOG(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
15177                    X'
15178     'CDLOG(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
15179                    X'
15180
15181
15182File: gfortran.info,  Node: LOG10,  Next: LOG_GAMMA,  Prev: LOG,  Up: Intrinsic Procedures
15183
151849.178 'LOG10' -- Base 10 logarithm function
15185===========================================
15186
15187_Description_:
15188     'LOG10(X)' computes the base 10 logarithm of X.
15189
15190_Standard_:
15191     Fortran 77 and later
15192
15193_Class_:
15194     Elemental function
15195
15196_Syntax_:
15197     'RESULT = LOG10(X)'
15198
15199_Arguments_:
15200     X           The type shall be 'REAL'.
15201
15202_Return value_:
15203     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
15204     parameter is the same as X.
15205
15206_Example_:
15207          program test_log10
15208            real(8) :: x = 10.0_8
15209            x = log10(x)
15210          end program test_log10
15211
15212_Specific names_:
15213     Name           Argument       Return type    Standard
15214     'ALOG10(X)'    'REAL(4) X'    'REAL(4)'      Fortran 77 and
15215                                                  later
15216     'DLOG10(X)'    'REAL(8) X'    'REAL(8)'      Fortran 77 and
15217                                                  later
15218
15219
15220File: gfortran.info,  Node: LOG_GAMMA,  Next: LOGICAL,  Prev: LOG10,  Up: Intrinsic Procedures
15221
152229.179 'LOG_GAMMA' -- Logarithm of the Gamma function
15223====================================================
15224
15225_Description_:
15226     'LOG_GAMMA(X)' computes the natural logarithm of the absolute value
15227     of the Gamma (\Gamma) function.
15228
15229_Standard_:
15230     Fortran 2008 and later
15231
15232_Class_:
15233     Elemental function
15234
15235_Syntax_:
15236     'X = LOG_GAMMA(X)'
15237
15238_Arguments_:
15239     X           Shall be of type 'REAL' and neither zero nor a
15240                 negative integer.
15241
15242_Return value_:
15243     The return value is of type 'REAL' of the same kind as X.
15244
15245_Example_:
15246          program test_log_gamma
15247            real :: x = 1.0
15248            x = lgamma(x) ! returns 0.0
15249          end program test_log_gamma
15250
15251_Specific names_:
15252     Name           Argument       Return type    Standard
15253     'LGAMMA(X)'    'REAL(4) X'    'REAL(4)'      GNU extension
15254     'ALGAMA(X)'    'REAL(4) X'    'REAL(4)'      GNU extension
15255     'DLGAMA(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
15256
15257_See also_:
15258     Gamma function: *note GAMMA::
15259
15260
15261File: gfortran.info,  Node: LOGICAL,  Next: LONG,  Prev: LOG_GAMMA,  Up: Intrinsic Procedures
15262
152639.180 'LOGICAL' -- Convert to logical type
15264==========================================
15265
15266_Description_:
15267     Converts one kind of 'LOGICAL' variable to another.
15268
15269_Standard_:
15270     Fortran 90 and later
15271
15272_Class_:
15273     Elemental function
15274
15275_Syntax_:
15276     'RESULT = LOGICAL(L [, KIND])'
15277
15278_Arguments_:
15279     L           The type shall be 'LOGICAL'.
15280     KIND        (Optional) An 'INTEGER' initialization
15281                 expression indicating the kind parameter of the
15282                 result.
15283
15284_Return value_:
15285     The return value is a 'LOGICAL' value equal to L, with a kind
15286     corresponding to KIND, or of the default logical kind if KIND is
15287     not given.
15288
15289_See also_:
15290     *note INT::, *note REAL::, *note CMPLX::
15291
15292
15293File: gfortran.info,  Node: LONG,  Next: LSHIFT,  Prev: LOGICAL,  Up: Intrinsic Procedures
15294
152959.181 'LONG' -- Convert to integer type
15296=======================================
15297
15298_Description_:
15299     Convert to a 'KIND=4' integer type, which is the same size as a C
15300     'long' integer.  This is equivalent to the standard 'INT' intrinsic
15301     with an optional argument of 'KIND=4', and is only included for
15302     backwards compatibility.
15303
15304_Standard_:
15305     GNU extension
15306
15307_Class_:
15308     Elemental function
15309
15310_Syntax_:
15311     'RESULT = LONG(A)'
15312
15313_Arguments_:
15314     A           Shall be of type 'INTEGER', 'REAL', or
15315                 'COMPLEX'.
15316
15317_Return value_:
15318     The return value is a 'INTEGER(4)' variable.
15319
15320_See also_:
15321     *note INT::, *note INT2::, *note INT8::
15322
15323
15324File: gfortran.info,  Node: LSHIFT,  Next: LSTAT,  Prev: LONG,  Up: Intrinsic Procedures
15325
153269.182 'LSHIFT' -- Left shift bits
15327=================================
15328
15329_Description_:
15330     'LSHIFT' returns a value corresponding to I with all of the bits
15331     shifted left by SHIFT places.  SHIFT shall be nonnegative and less
15332     than or equal to 'BIT_SIZE(I)', otherwise the result value is
15333     undefined.  Bits shifted out from the left end are lost; zeros are
15334     shifted in from the opposite end.
15335
15336     This function has been superseded by the 'ISHFT' intrinsic, which
15337     is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic,
15338     which is standard in Fortran 2008 and later.
15339
15340_Standard_:
15341     GNU extension
15342
15343_Class_:
15344     Elemental function
15345
15346_Syntax_:
15347     'RESULT = LSHIFT(I, SHIFT)'
15348
15349_Arguments_:
15350     I           The type shall be 'INTEGER'.
15351     SHIFT       The type shall be 'INTEGER'.
15352
15353_Return value_:
15354     The return value is of type 'INTEGER' and of the same kind as I.
15355
15356_See also_:
15357     *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
15358     *note SHIFTL::, *note SHIFTR::
15359
15360
15361File: gfortran.info,  Node: LSTAT,  Next: LTIME,  Prev: LSHIFT,  Up: Intrinsic Procedures
15362
153639.183 'LSTAT' -- Get file status
15364================================
15365
15366_Description_:
15367     'LSTAT' is identical to *note STAT::, except that if path is a
15368     symbolic link, then the link itself is statted, not the file that
15369     it refers to.
15370
15371     The elements in 'VALUES' are the same as described by *note STAT::.
15372
15373     This intrinsic is provided in both subroutine and function forms;
15374     however, only one form can be used in any given program unit.
15375
15376_Standard_:
15377     GNU extension
15378
15379_Class_:
15380     Subroutine, function
15381
15382_Syntax_:
15383     'CALL LSTAT(NAME, VALUES [, STATUS])'
15384     'STATUS = LSTAT(NAME, VALUES)'
15385
15386_Arguments_:
15387     NAME        The type shall be 'CHARACTER' of the default
15388                 kind, a valid path within the file system.
15389     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
15390     STATUS      (Optional) status flag of type 'INTEGER(4)'.
15391                 Returns 0 on success and a system specific error
15392                 code otherwise.
15393
15394_Example_:
15395     See *note STAT:: for an example.
15396
15397_See also_:
15398     To stat an open file: *note FSTAT:: To stat a file: *note STAT::
15399
15400
15401File: gfortran.info,  Node: LTIME,  Next: MALLOC,  Prev: LSTAT,  Up: Intrinsic Procedures
15402
154039.184 'LTIME' -- Convert time to local time info
15404================================================
15405
15406_Description_:
15407     Given a system time value TIME (as provided by the *note TIME::
15408     intrinsic), fills VALUES with values extracted from it appropriate
15409     to the local time zone using 'localtime(3)'.
15410
15411     This intrinsic routine is provided for backwards compatibility with
15412     GNU Fortran 77.  In new code, programmers should consider the use
15413     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
15414     standard.
15415
15416_Standard_:
15417     GNU extension
15418
15419_Class_:
15420     Subroutine
15421
15422_Syntax_:
15423     'CALL LTIME(TIME, VALUES)'
15424
15425_Arguments_:
15426     TIME        An 'INTEGER' scalar expression corresponding to
15427                 a system time, with 'INTENT(IN)'.
15428     VALUES      A default 'INTEGER' array with 9 elements, with
15429                 'INTENT(OUT)'.
15430
15431_Return value_:
15432     The elements of VALUES are assigned as follows:
15433       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
15434          seconds
15435       2. Minutes after the hour, range 0-59
15436       3. Hours past midnight, range 0-23
15437       4. Day of month, range 1-31
15438       5. Number of months since January, range 0-11
15439       6. Years since 1900
15440       7. Number of days since Sunday, range 0-6
15441       8. Days since January 1, range 0-365
15442       9. Daylight savings indicator: positive if daylight savings is in
15443          effect, zero if not, and negative if the information is not
15444          available.
15445
15446_See also_:
15447     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::,
15448     *note TIME8::
15449
15450
15451File: gfortran.info,  Node: MALLOC,  Next: MASKL,  Prev: LTIME,  Up: Intrinsic Procedures
15452
154539.185 'MALLOC' -- Allocate dynamic memory
15454=========================================
15455
15456_Description_:
15457     'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
15458     the address of the allocated memory.  The 'MALLOC' intrinsic is an
15459     extension intended to be used with Cray pointers, and is provided
15460     in GNU Fortran to allow the user to compile legacy code.  For new
15461     code using Fortran 95 pointers, the memory allocation intrinsic is
15462     'ALLOCATE'.
15463
15464_Standard_:
15465     GNU extension
15466
15467_Class_:
15468     Function
15469
15470_Syntax_:
15471     'PTR = MALLOC(SIZE)'
15472
15473_Arguments_:
15474     SIZE        The type shall be 'INTEGER'.
15475
15476_Return value_:
15477     The return value is of type 'INTEGER(K)', with K such that
15478     variables of type 'INTEGER(K)' have the same size as C pointers
15479     ('sizeof(void *)').
15480
15481_Example_:
15482     The following example demonstrates the use of 'MALLOC' and 'FREE'
15483     with Cray pointers.
15484
15485          program test_malloc
15486            implicit none
15487            integer i
15488            real*8 x(*), z
15489            pointer(ptr_x,x)
15490
15491            ptr_x = malloc(20*8)
15492            do i = 1, 20
15493              x(i) = sqrt(1.0d0 / i)
15494            end do
15495            z = 0
15496            do i = 1, 20
15497              z = z + x(i)
15498              print *, z
15499            end do
15500            call free(ptr_x)
15501          end program test_malloc
15502
15503_See also_:
15504     *note FREE::
15505
15506
15507File: gfortran.info,  Node: MASKL,  Next: MASKR,  Prev: MALLOC,  Up: Intrinsic Procedures
15508
155099.186 'MASKL' -- Left justified mask
15510====================================
15511
15512_Description_:
15513     'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
15514     remaining bits set to 0.
15515
15516_Standard_:
15517     Fortran 2008 and later
15518
15519_Class_:
15520     Elemental function
15521
15522_Syntax_:
15523     'RESULT = MASKL(I[, KIND])'
15524
15525_Arguments_:
15526     I           Shall be of type 'INTEGER'.
15527     KIND        Shall be a scalar constant expression of type
15528                 'INTEGER'.
15529
15530_Return value_:
15531     The return value is of type 'INTEGER'.  If KIND is present, it
15532     specifies the kind value of the return type; otherwise, it is of
15533     the default integer kind.
15534
15535_See also_:
15536     *note MASKR::
15537
15538
15539File: gfortran.info,  Node: MASKR,  Next: MATMUL,  Prev: MASKL,  Up: Intrinsic Procedures
15540
155419.187 'MASKR' -- Right justified mask
15542=====================================
15543
15544_Description_:
15545     'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
15546     remaining bits set to 0.
15547
15548_Standard_:
15549     Fortran 2008 and later
15550
15551_Class_:
15552     Elemental function
15553
15554_Syntax_:
15555     'RESULT = MASKR(I[, KIND])'
15556
15557_Arguments_:
15558     I           Shall be of type 'INTEGER'.
15559     KIND        Shall be a scalar constant expression of type
15560                 'INTEGER'.
15561
15562_Return value_:
15563     The return value is of type 'INTEGER'.  If KIND is present, it
15564     specifies the kind value of the return type; otherwise, it is of
15565     the default integer kind.
15566
15567_See also_:
15568     *note MASKL::
15569
15570
15571File: gfortran.info,  Node: MATMUL,  Next: MAX,  Prev: MASKR,  Up: Intrinsic Procedures
15572
155739.188 'MATMUL' -- matrix multiplication
15574=======================================
15575
15576_Description_:
15577     Performs a matrix multiplication on numeric or logical arguments.
15578
15579_Standard_:
15580     Fortran 90 and later
15581
15582_Class_:
15583     Transformational function
15584
15585_Syntax_:
15586     'RESULT = MATMUL(MATRIX_A, MATRIX_B)'
15587
15588_Arguments_:
15589     MATRIX_A    An array of 'INTEGER', 'REAL', 'COMPLEX', or
15590                 'LOGICAL' type, with a rank of one or two.
15591     MATRIX_B    An array of 'INTEGER', 'REAL', or 'COMPLEX' type
15592                 if MATRIX_A is of a numeric type; otherwise, an
15593                 array of 'LOGICAL' type.  The rank shall be one
15594                 or two, and the first (or only) dimension of
15595                 MATRIX_B shall be equal to the last (or only)
15596                 dimension of MATRIX_A.  MATRIX_A and MATRIX_B
15597                 shall not both be rank one arrays.
15598
15599_Return value_:
15600     The matrix product of MATRIX_A and MATRIX_B.  The type and kind of
15601     the result follow the usual type and kind promotion rules, as for
15602     the '*' or '.AND.' operators.
15603
15604
15605File: gfortran.info,  Node: MAX,  Next: MAXEXPONENT,  Prev: MATMUL,  Up: Intrinsic Procedures
15606
156079.189 'MAX' -- Maximum value of an argument list
15608================================================
15609
15610_Description_:
15611     Returns the argument with the largest (most positive) value.
15612
15613_Standard_:
15614     Fortran 77 and later
15615
15616_Class_:
15617     Elemental function
15618
15619_Syntax_:
15620     'RESULT = MAX(A1, A2 [, A3 [, ...]])'
15621
15622_Arguments_:
15623     A1          The type shall be 'INTEGER' or 'REAL'.
15624     A2, A3,     An expression of the same type and kind as A1.
15625     ...         (As a GNU extension, arguments of different
15626                 kinds are permitted.)
15627
15628_Return value_:
15629     The return value corresponds to the maximum value among the
15630     arguments, and has the same type and kind as the first argument.
15631
15632_Specific names_:
15633     Name           Argument       Return type    Standard
15634     'MAX0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15635                    A1'                           later
15636     'AMAX0(A1)'    'INTEGER(4)    'REAL(MAX(X))' Fortran 77 and
15637                    A1'                           later
15638     'MAX1(A1)'     'REAL A1'      'INT(MAX(X))'  Fortran 77 and
15639                                                  later
15640     'AMAX1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15641                                                  later
15642     'DMAX1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15643                                                  later
15644
15645_See also_:
15646     *note MAXLOC:: *note MAXVAL::, *note MIN::
15647
15648
15649File: gfortran.info,  Node: MAXEXPONENT,  Next: MAXLOC,  Prev: MAX,  Up: Intrinsic Procedures
15650
156519.190 'MAXEXPONENT' -- Maximum exponent of a real kind
15652======================================================
15653
15654_Description_:
15655     'MAXEXPONENT(X)' returns the maximum exponent in the model of the
15656     type of 'X'.
15657
15658_Standard_:
15659     Fortran 90 and later
15660
15661_Class_:
15662     Inquiry function
15663
15664_Syntax_:
15665     'RESULT = MAXEXPONENT(X)'
15666
15667_Arguments_:
15668     X           Shall be of type 'REAL'.
15669
15670_Return value_:
15671     The return value is of type 'INTEGER' and of the default integer
15672     kind.
15673
15674_Example_:
15675          program exponents
15676            real(kind=4) :: x
15677            real(kind=8) :: y
15678
15679            print *, minexponent(x), maxexponent(x)
15680            print *, minexponent(y), maxexponent(y)
15681          end program exponents
15682
15683
15684File: gfortran.info,  Node: MAXLOC,  Next: MAXVAL,  Prev: MAXEXPONENT,  Up: Intrinsic Procedures
15685
156869.191 'MAXLOC' -- Location of the maximum value within an array
15687===============================================================
15688
15689_Description_:
15690     Determines the location of the element in the array with the
15691     maximum value, or, if the DIM argument is supplied, determines the
15692     locations of the maximum element along each row of the array in the
15693     DIM direction.  If MASK is present, only the elements for which
15694     MASK is '.TRUE.' are considered.  If more than one element in the
15695     array has the maximum value, the location returned is that of the
15696     first such element in array element order if the BACK is not
15697     present, or is false; if BACK is true, the location returned is
15698     that of the last such element.  If the array has zero size, or all
15699     of the elements of MASK are '.FALSE.', then the result is an array
15700     of zeroes.  Similarly, if DIM is supplied and all of the elements
15701     of MASK along a given row are zero, the result value for that row
15702     is zero.
15703
15704_Standard_:
15705     Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
15706     are available in Fortran 2003 and later.  The BACK argument is
15707     available in Fortran 2008 and later.
15708
15709_Class_:
15710     Transformational function
15711
15712_Syntax_:
15713     'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
15714     'RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])'
15715
15716_Arguments_:
15717     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15718     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15719                 with a value between one and the rank of ARRAY,
15720                 inclusive.  It may not be an optional dummy
15721                 argument.
15722     MASK        Shall be an array of type 'LOGICAL', and
15723                 conformable with ARRAY.
15724     KIND        (Optional) An 'INTEGER' initialization
15725                 expression indicating the kind parameter of the
15726                 result.
15727     BACK        (Optional) A scalar of type 'LOGICAL'.
15728
15729_Return value_:
15730     If DIM is absent, the result is a rank-one array with a length
15731     equal to the rank of ARRAY.  If DIM is present, the result is an
15732     array with a rank one less than the rank of ARRAY, and a size
15733     corresponding to the size of ARRAY with the DIM dimension removed.
15734     If DIM is present and ARRAY has a rank of one, the result is a
15735     scalar.  If the optional argument KIND is present, the result is an
15736     integer of kind KIND, otherwise it is of default kind.
15737
15738_See also_:
15739     *note FINDLOC::, *note MAX::, *note MAXVAL::
15740
15741
15742File: gfortran.info,  Node: MAXVAL,  Next: MCLOCK,  Prev: MAXLOC,  Up: Intrinsic Procedures
15743
157449.192 'MAXVAL' -- Maximum value of an array
15745===========================================
15746
15747_Description_:
15748     Determines the maximum value of the elements in an array value, or,
15749     if the DIM argument is supplied, determines the maximum value along
15750     each row of the array in the DIM direction.  If MASK is present,
15751     only the elements for which MASK is '.TRUE.' are considered.  If
15752     the array has zero size, or all of the elements of MASK are
15753     '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric,
15754     or a string of nulls if ARRAY is of character type.
15755
15756_Standard_:
15757     Fortran 90 and later
15758
15759_Class_:
15760     Transformational function
15761
15762_Syntax_:
15763     'RESULT = MAXVAL(ARRAY, DIM [, MASK])'
15764     'RESULT = MAXVAL(ARRAY [, MASK])'
15765
15766_Arguments_:
15767     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15768     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15769                 with a value between one and the rank of ARRAY,
15770                 inclusive.  It may not be an optional dummy
15771                 argument.
15772     MASK        (Opional) Shall be an array of type 'LOGICAL',
15773                 and conformable with ARRAY.
15774
15775_Return value_:
15776     If DIM is absent, or if ARRAY has a rank of one, the result is a
15777     scalar.  If DIM is present, the result is an array with a rank one
15778     less than the rank of ARRAY, and a size corresponding to the size
15779     of ARRAY with the DIM dimension removed.  In all cases, the result
15780     is of the same type and kind as ARRAY.
15781
15782_See also_:
15783     *note MAX::, *note MAXLOC::
15784
15785
15786File: gfortran.info,  Node: MCLOCK,  Next: MCLOCK8,  Prev: MAXVAL,  Up: Intrinsic Procedures
15787
157889.193 'MCLOCK' -- Time function
15789===============================
15790
15791_Description_:
15792     Returns the number of clock ticks since the start of the process,
15793     based on the function 'clock(3)' in the C standard library.
15794
15795     This intrinsic is not fully portable, such as to systems with
15796     32-bit 'INTEGER' types but supporting times wider than 32 bits.
15797     Therefore, the values returned by this intrinsic might be, or
15798     become, negative, or numerically less than previous values, during
15799     a single run of the compiled program.
15800
15801_Standard_:
15802     GNU extension
15803
15804_Class_:
15805     Function
15806
15807_Syntax_:
15808     'RESULT = MCLOCK()'
15809
15810_Return value_:
15811     The return value is a scalar of type 'INTEGER(4)', equal to the
15812     number of clock ticks since the start of the process, or '-1' if
15813     the system does not support 'clock(3)'.
15814
15815_See also_:
15816     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15817     TIME::
15818
15819
15820File: gfortran.info,  Node: MCLOCK8,  Next: MERGE,  Prev: MCLOCK,  Up: Intrinsic Procedures
15821
158229.194 'MCLOCK8' -- Time function (64-bit)
15823=========================================
15824
15825_Description_:
15826     Returns the number of clock ticks since the start of the process,
15827     based on the function 'clock(3)' in the C standard library.
15828
15829     _Warning:_ this intrinsic does not increase the range of the timing
15830     values over that returned by 'clock(3)'.  On a system with a 32-bit
15831     'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is
15832     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
15833     the 32-bit value can still occur.  Therefore, the values returned
15834     by this intrinsic might be or become negative or numerically less
15835     than previous values during a single run of the compiled program.
15836
15837_Standard_:
15838     GNU extension
15839
15840_Class_:
15841     Function
15842
15843_Syntax_:
15844     'RESULT = MCLOCK8()'
15845
15846_Return value_:
15847     The return value is a scalar of type 'INTEGER(8)', equal to the
15848     number of clock ticks since the start of the process, or '-1' if
15849     the system does not support 'clock(3)'.
15850
15851_See also_:
15852     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15853     TIME8::
15854
15855
15856File: gfortran.info,  Node: MERGE,  Next: MERGE_BITS,  Prev: MCLOCK8,  Up: Intrinsic Procedures
15857
158589.195 'MERGE' -- Merge variables
15859================================
15860
15861_Description_:
15862     Select values from two arrays according to a logical mask.  The
15863     result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE
15864     if it is '.FALSE.'.
15865
15866_Standard_:
15867     Fortran 90 and later
15868
15869_Class_:
15870     Elemental function
15871
15872_Syntax_:
15873     'RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
15874
15875_Arguments_:
15876     TSOURCE     May be of any type.
15877     FSOURCE     Shall be of the same type and type parameters as
15878                 TSOURCE.
15879     MASK        Shall be of type 'LOGICAL'.
15880
15881_Return value_:
15882     The result is of the same type and type parameters as TSOURCE.
15883
15884
15885File: gfortran.info,  Node: MERGE_BITS,  Next: MIN,  Prev: MERGE,  Up: Intrinsic Procedures
15886
158879.196 'MERGE_BITS' -- Merge of bits under mask
15888==============================================
15889
15890_Description_:
15891     'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
15892     by the mask.  The i-th bit of the result is equal to the i-th bit
15893     of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J
15894     otherwise.
15895
15896_Standard_:
15897     Fortran 2008 and later
15898
15899_Class_:
15900     Elemental function
15901
15902_Syntax_:
15903     'RESULT = MERGE_BITS(I, J, MASK)'
15904
15905_Arguments_:
15906     I           Shall be of type 'INTEGER' or a
15907                 boz-literal-constant.
15908     J           Shall be of type 'INTEGER' with the same kind
15909                 type parameter as I or a boz-literal-constant.
15910                 I and J shall not both be boz-literal-constants.
15911     MASK        Shall be of type 'INTEGER' or a
15912                 boz-literal-constant and of the same kind as I.
15913
15914_Return value_:
15915     The result is of the same type and kind as I.
15916
15917
15918File: gfortran.info,  Node: MIN,  Next: MINEXPONENT,  Prev: MERGE_BITS,  Up: Intrinsic Procedures
15919
159209.197 'MIN' -- Minimum value of an argument list
15921================================================
15922
15923_Description_:
15924     Returns the argument with the smallest (most negative) value.
15925
15926_Standard_:
15927     Fortran 77 and later
15928
15929_Class_:
15930     Elemental function
15931
15932_Syntax_:
15933     'RESULT = MIN(A1, A2 [, A3, ...])'
15934
15935_Arguments_:
15936     A1          The type shall be 'INTEGER' or 'REAL'.
15937     A2, A3,     An expression of the same type and kind as A1.
15938     ...         (As a GNU extension, arguments of different
15939                 kinds are permitted.)
15940
15941_Return value_:
15942     The return value corresponds to the maximum value among the
15943     arguments, and has the same type and kind as the first argument.
15944
15945_Specific names_:
15946     Name           Argument       Return type    Standard
15947     'MIN0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15948                    A1'                           later
15949     'AMIN0(A1)'    'INTEGER(4)    'REAL(4)'      Fortran 77 and
15950                    A1'                           later
15951     'MIN1(A1)'     'REAL A1'      'INTEGER(4)'   Fortran 77 and
15952                                                  later
15953     'AMIN1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15954                                                  later
15955     'DMIN1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15956                                                  later
15957
15958_See also_:
15959     *note MAX::, *note MINLOC::, *note MINVAL::
15960
15961
15962File: gfortran.info,  Node: MINEXPONENT,  Next: MINLOC,  Prev: MIN,  Up: Intrinsic Procedures
15963
159649.198 'MINEXPONENT' -- Minimum exponent of a real kind
15965======================================================
15966
15967_Description_:
15968     'MINEXPONENT(X)' returns the minimum exponent in the model of the
15969     type of 'X'.
15970
15971_Standard_:
15972     Fortran 90 and later
15973
15974_Class_:
15975     Inquiry function
15976
15977_Syntax_:
15978     'RESULT = MINEXPONENT(X)'
15979
15980_Arguments_:
15981     X           Shall be of type 'REAL'.
15982
15983_Return value_:
15984     The return value is of type 'INTEGER' and of the default integer
15985     kind.
15986
15987_Example_:
15988     See 'MAXEXPONENT' for an example.
15989
15990
15991File: gfortran.info,  Node: MINLOC,  Next: MINVAL,  Prev: MINEXPONENT,  Up: Intrinsic Procedures
15992
159939.199 'MINLOC' -- Location of the minimum value within an array
15994===============================================================
15995
15996_Description_:
15997     Determines the location of the element in the array with the
15998     minimum value, or, if the DIM argument is supplied, determines the
15999     locations of the minimum element along each row of the array in the
16000     DIM direction.  If MASK is present, only the elements for which
16001     MASK is '.TRUE.' are considered.  If more than one element in the
16002     array has the minimum value, the location returned is that of the
16003     first such element in array element order if the BACK is not
16004     present, or is false; if BACK is true, the location returned is
16005     that of the last such element.  If the array has zero size, or all
16006     of the elements of MASK are '.FALSE.', then the result is an array
16007     of zeroes.  Similarly, if DIM is supplied and all of the elements
16008     of MASK along a given row are zero, the result value for that row
16009     is zero.
16010
16011_Standard_:
16012     Fortran 90 and later; ARRAY of 'CHARACTER' and the KIND argument
16013     are available in Fortran 2003 and later.  The BACK argument is
16014     available in Fortran 2008 and later.
16015
16016_Class_:
16017     Transformational function
16018
16019_Syntax_:
16020     'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
16021     'RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])'
16022
16023_Arguments_:
16024     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
16025                 'CHARACTER'.
16026     DIM         (Optional) Shall be a scalar of type 'INTEGER',
16027                 with a value between one and the rank of ARRAY,
16028                 inclusive.  It may not be an optional dummy
16029                 argument.
16030     MASK        Shall be an array of type 'LOGICAL', and
16031                 conformable with ARRAY.
16032     KIND        (Optional) An 'INTEGER' initialization
16033                 expression indicating the kind parameter of the
16034                 result.
16035     BACK        (Optional) A scalar of type 'LOGICAL'.
16036
16037_Return value_:
16038     If DIM is absent, the result is a rank-one array with a length
16039     equal to the rank of ARRAY.  If DIM is present, the result is an
16040     array with a rank one less than the rank of ARRAY, and a size
16041     corresponding to the size of ARRAY with the DIM dimension removed.
16042     If DIM is present and ARRAY has a rank of one, the result is a
16043     scalar.  If the optional argument KIND is present, the result is an
16044     integer of kind KIND, otherwise it is of default kind.
16045
16046_See also_:
16047     *note FINDLOC::, *note MIN::, *note MINVAL::
16048
16049
16050File: gfortran.info,  Node: MINVAL,  Next: MOD,  Prev: MINLOC,  Up: Intrinsic Procedures
16051
160529.200 'MINVAL' -- Minimum value of an array
16053===========================================
16054
16055_Description_:
16056     Determines the minimum value of the elements in an array value, or,
16057     if the DIM argument is supplied, determines the minimum value along
16058     each row of the array in the DIM direction.  If MASK is present,
16059     only the elements for which MASK is '.TRUE.' are considered.  If
16060     the array has zero size, or all of the elements of MASK are
16061     '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or
16062     a string of 'CHAR(255)' characters if ARRAY is of character type.
16063
16064_Standard_:
16065     Fortran 90 and later
16066
16067_Class_:
16068     Transformational function
16069
16070_Syntax_:
16071     'RESULT = MINVAL(ARRAY, DIM [, MASK])'
16072     'RESULT = MINVAL(ARRAY [, MASK])'
16073
16074_Arguments_:
16075     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
16076     DIM         (Optional) Shall be a scalar of type 'INTEGER',
16077                 with a value between one and the rank of ARRAY,
16078                 inclusive.  It may not be an optional dummy
16079                 argument.
16080     MASK        Shall be an array of type 'LOGICAL', and
16081                 conformable with ARRAY.
16082
16083_Return value_:
16084     If DIM is absent, or if ARRAY has a rank of one, the result is a
16085     scalar.  If DIM is present, the result is an array with a rank one
16086     less than the rank of ARRAY, and a size corresponding to the size
16087     of ARRAY with the DIM dimension removed.  In all cases, the result
16088     is of the same type and kind as ARRAY.
16089
16090_See also_:
16091     *note MIN::, *note MINLOC::
16092
16093
16094File: gfortran.info,  Node: MOD,  Next: MODULO,  Prev: MINVAL,  Up: Intrinsic Procedures
16095
160969.201 'MOD' -- Remainder function
16097=================================
16098
16099_Description_:
16100     'MOD(A,P)' computes the remainder of the division of A by P.
16101
16102_Standard_:
16103     Fortran 77 and later, has overloads that are GNU extensions
16104
16105_Class_:
16106     Elemental function
16107
16108_Syntax_:
16109     'RESULT = MOD(A, P)'
16110
16111_Arguments_:
16112     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
16113     P           Shall be a scalar of the same type and kind as A
16114                 and not equal to zero.  (As a GNU extension,
16115                 arguments of different kinds are permitted.)
16116
16117_Return value_:
16118     The return value is the result of 'A - (INT(A/P) * P)'.  The type
16119     and kind of the return value is the same as that of the arguments.
16120     The returned value has the same sign as A and a magnitude less than
16121     the magnitude of P. (As a GNU extension, kind is the largest kind
16122     of the actual arguments.)
16123
16124_Example_:
16125          program test_mod
16126            print *, mod(17,3)
16127            print *, mod(17.5,5.5)
16128            print *, mod(17.5d0,5.5)
16129            print *, mod(17.5,5.5d0)
16130
16131            print *, mod(-17,3)
16132            print *, mod(-17.5,5.5)
16133            print *, mod(-17.5d0,5.5)
16134            print *, mod(-17.5,5.5d0)
16135
16136            print *, mod(17,-3)
16137            print *, mod(17.5,-5.5)
16138            print *, mod(17.5d0,-5.5)
16139            print *, mod(17.5,-5.5d0)
16140          end program test_mod
16141
16142_Specific names_:
16143     Name           Arguments      Return type    Standard
16144     'MOD(A,P)'     'INTEGER       'INTEGER'      Fortran 77 and
16145                    A,P'                          later
16146     'AMOD(A,P)'    'REAL(4)       'REAL(4)'      Fortran 77 and
16147                    A,P'                          later
16148     'DMOD(A,P)'    'REAL(8)       'REAL(8)'      Fortran 77 and
16149                    A,P'                          later
16150     'BMOD(A,P)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
16151                    A,P'
16152     'IMOD(A,P)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
16153                    A,P'
16154     'JMOD(A,P)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
16155                    A,P'
16156     'KMOD(A,P)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
16157                    A,P'
16158
16159_See also_:
16160     *note MODULO::
16161
16162
16163File: gfortran.info,  Node: MODULO,  Next: MOVE_ALLOC,  Prev: MOD,  Up: Intrinsic Procedures
16164
161659.202 'MODULO' -- Modulo function
16166=================================
16167
16168_Description_:
16169     'MODULO(A,P)' computes the A modulo P.
16170
16171_Standard_:
16172     Fortran 95 and later
16173
16174_Class_:
16175     Elemental function
16176
16177_Syntax_:
16178     'RESULT = MODULO(A, P)'
16179
16180_Arguments_:
16181     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
16182     P           Shall be a scalar of the same type and kind as
16183                 A.  It shall not be zero.  (As a GNU extension,
16184                 arguments of different kinds are permitted.)
16185
16186_Return value_:
16187     The type and kind of the result are those of the arguments.  (As a
16188     GNU extension, kind is the largest kind of the actual arguments.)
16189     If A and P are of type 'INTEGER':
16190          'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is
16191          an integer and R is between 0 (inclusive) and P (exclusive).
16192     If A and P are of type 'REAL':
16193          'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'.
16194     The returned value has the same sign as P and a magnitude less than
16195     the magnitude of P.
16196
16197_Example_:
16198          program test_modulo
16199            print *, modulo(17,3)
16200            print *, modulo(17.5,5.5)
16201
16202            print *, modulo(-17,3)
16203            print *, modulo(-17.5,5.5)
16204
16205            print *, modulo(17,-3)
16206            print *, modulo(17.5,-5.5)
16207          end program
16208
16209_See also_:
16210     *note MOD::
16211
16212
16213File: gfortran.info,  Node: MOVE_ALLOC,  Next: MVBITS,  Prev: MODULO,  Up: Intrinsic Procedures
16214
162159.203 'MOVE_ALLOC' -- Move allocation from one object to another
16216================================================================
16217
16218_Description_:
16219     'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO.  FROM
16220     will become deallocated in the process.
16221
16222_Standard_:
16223     Fortran 2003 and later
16224
16225_Class_:
16226     Pure subroutine
16227
16228_Syntax_:
16229     'CALL MOVE_ALLOC(FROM, TO)'
16230
16231_Arguments_:
16232     FROM        'ALLOCATABLE', 'INTENT(INOUT)', may be of any
16233                 type and kind.
16234     TO          'ALLOCATABLE', 'INTENT(OUT)', shall be of the
16235                 same type, kind and rank as FROM.
16236
16237_Return value_:
16238     None
16239
16240_Example_:
16241          program test_move_alloc
16242              integer, allocatable :: a(:), b(:)
16243
16244              allocate(a(3))
16245              a = [ 1, 2, 3 ]
16246              call move_alloc(a, b)
16247              print *, allocated(a), allocated(b)
16248              print *, b
16249          end program test_move_alloc
16250
16251
16252File: gfortran.info,  Node: MVBITS,  Next: NEAREST,  Prev: MOVE_ALLOC,  Up: Intrinsic Procedures
16253
162549.204 'MVBITS' -- Move bits from one integer to another
16255=======================================================
16256
16257_Description_:
16258     Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of
16259     FROM to positions TOPOS through 'TOPOS+LEN-1' of TO.  The portion
16260     of argument TO not affected by the movement of bits is unchanged.
16261     The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than
16262     'BIT_SIZE(FROM)'.
16263
16264_Standard_:
16265     Fortran 90 and later, has overloads that are GNU extensions
16266
16267_Class_:
16268     Elemental subroutine
16269
16270_Syntax_:
16271     'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
16272
16273_Arguments_:
16274     FROM        The type shall be 'INTEGER'.
16275     FROMPOS     The type shall be 'INTEGER'.
16276     LEN         The type shall be 'INTEGER'.
16277     TO          The type shall be 'INTEGER', of the same kind as
16278                 FROM.
16279     TOPOS       The type shall be 'INTEGER'.
16280
16281_Specific names_:
16282     Name           Argument       Return type    Standard
16283     'MVBITS(A)'    'INTEGER A'    'INTEGER'      Fortran 90 and
16284                                                  later
16285     'BMVBITS(A)'   'INTEGER(1)    'INTEGER(1)'   GNU extension
16286                    A'
16287     'IMVBITS(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
16288                    A'
16289     'JMVBITS(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
16290                    A'
16291     'KMVBITS(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
16292                    A'
16293
16294_See also_:
16295     *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
16296     IOR::, *note IEOR::
16297
16298
16299File: gfortran.info,  Node: NEAREST,  Next: NEW_LINE,  Prev: MVBITS,  Up: Intrinsic Procedures
16300
163019.205 'NEAREST' -- Nearest representable number
16302===============================================
16303
16304_Description_:
16305     'NEAREST(X, S)' returns the processor-representable number nearest
16306     to 'X' in the direction indicated by the sign of 'S'.
16307
16308_Standard_:
16309     Fortran 90 and later
16310
16311_Class_:
16312     Elemental function
16313
16314_Syntax_:
16315     'RESULT = NEAREST(X, S)'
16316
16317_Arguments_:
16318     X           Shall be of type 'REAL'.
16319     S           Shall be of type 'REAL' and not equal to zero.
16320
16321_Return value_:
16322     The return value is of the same type as 'X'.  If 'S' is positive,
16323     'NEAREST' returns the processor-representable number greater than
16324     'X' and nearest to it.  If 'S' is negative, 'NEAREST' returns the
16325     processor-representable number smaller than 'X' and nearest to it.
16326
16327_Example_:
16328          program test_nearest
16329            real :: x, y
16330            x = nearest(42.0, 1.0)
16331            y = nearest(42.0, -1.0)
16332            write (*,"(3(G20.15))") x, y, x - y
16333          end program test_nearest
16334
16335
16336File: gfortran.info,  Node: NEW_LINE,  Next: NINT,  Prev: NEAREST,  Up: Intrinsic Procedures
16337
163389.206 'NEW_LINE' -- New line character
16339======================================
16340
16341_Description_:
16342     'NEW_LINE(C)' returns the new-line character.
16343
16344_Standard_:
16345     Fortran 2003 and later
16346
16347_Class_:
16348     Inquiry function
16349
16350_Syntax_:
16351     'RESULT = NEW_LINE(C)'
16352
16353_Arguments_:
16354     C           The argument shall be a scalar or array of the
16355                 type 'CHARACTER'.
16356
16357_Return value_:
16358     Returns a CHARACTER scalar of length one with the new-line
16359     character of the same kind as parameter C.
16360
16361_Example_:
16362          program newline
16363            implicit none
16364            write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
16365          end program newline
16366
16367
16368File: gfortran.info,  Node: NINT,  Next: NORM2,  Prev: NEW_LINE,  Up: Intrinsic Procedures
16369
163709.207 'NINT' -- Nearest whole number
16371====================================
16372
16373_Description_:
16374     'NINT(A)' rounds its argument to the nearest whole number.
16375
16376_Standard_:
16377     Fortran 77 and later, with KIND argument Fortran 90 and later
16378
16379_Class_:
16380     Elemental function
16381
16382_Syntax_:
16383     'RESULT = NINT(A [, KIND])'
16384
16385_Arguments_:
16386     A           The type of the argument shall be 'REAL'.
16387     KIND        (Optional) An 'INTEGER' initialization
16388                 expression indicating the kind parameter of the
16389                 result.
16390
16391_Return value_:
16392     Returns A with the fractional portion of its magnitude eliminated
16393     by rounding to the nearest whole number and with its sign
16394     preserved, converted to an 'INTEGER' of the default kind.
16395
16396_Example_:
16397          program test_nint
16398            real(4) x4
16399            real(8) x8
16400            x4 = 1.234E0_4
16401            x8 = 4.321_8
16402            print *, nint(x4), idnint(x8)
16403          end program test_nint
16404
16405_Specific names_:
16406     Name           Argument       Return Type    Standard
16407     'NINT(A)'      'REAL(4) A'    'INTEGER'      Fortran 77 and
16408                                                  later
16409     'IDNINT(A)'    'REAL(8) A'    'INTEGER'      Fortran 77 and
16410                                                  later
16411
16412_See also_:
16413     *note CEILING::, *note FLOOR::
16414
16415
16416File: gfortran.info,  Node: NORM2,  Next: NOT,  Prev: NINT,  Up: Intrinsic Procedures
16417
164189.208 'NORM2' -- Euclidean vector norms
16419=======================================
16420
16421_Description_:
16422     Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
16423     dimension DIM.
16424
16425_Standard_:
16426     Fortran 2008 and later
16427
16428_Class_:
16429     Transformational function
16430
16431_Syntax_:
16432     'RESULT = NORM2(ARRAY[, DIM])'
16433
16434_Arguments_:
16435     ARRAY       Shall be an array of type 'REAL'
16436     DIM         (Optional) shall be a scalar of type 'INTEGER'
16437                 with a value in the range from 1 to n, where n
16438                 equals the rank of ARRAY.
16439
16440_Return value_:
16441     The result is of the same type as ARRAY.
16442
16443     If DIM is absent, a scalar with the square root of the sum of all
16444     elements in ARRAY squared is returned.  Otherwise, an array of rank
16445     n-1, where n equals the rank of ARRAY, and a shape similar to that
16446     of ARRAY with dimension DIM dropped is returned.
16447
16448_Example_:
16449          PROGRAM test_sum
16450            REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
16451            print *, NORM2(x)  ! = sqrt(55.) ~ 7.416
16452          END PROGRAM
16453
16454
16455File: gfortran.info,  Node: NOT,  Next: NULL,  Prev: NORM2,  Up: Intrinsic Procedures
16456
164579.209 'NOT' -- Logical negation
16458===============================
16459
16460_Description_:
16461     'NOT' returns the bitwise Boolean inverse of I.
16462
16463_Standard_:
16464     Fortran 90 and later, has overloads that are GNU extensions
16465
16466_Class_:
16467     Elemental function
16468
16469_Syntax_:
16470     'RESULT = NOT(I)'
16471
16472_Arguments_:
16473     I           The type shall be 'INTEGER'.
16474
16475_Return value_:
16476     The return type is 'INTEGER', of the same kind as the argument.
16477
16478_Specific names_:
16479     Name           Argument       Return type    Standard
16480     'NOT(A)'       'INTEGER A'    'INTEGER'      Fortran 95 and
16481                                                  later
16482     'BNOT(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
16483                    A'
16484     'INOT(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
16485                    A'
16486     'JNOT(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
16487                    A'
16488     'KNOT(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
16489                    A'
16490
16491_See also_:
16492     *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
16493     IBSET::, *note IBCLR::
16494
16495
16496File: gfortran.info,  Node: NULL,  Next: NUM_IMAGES,  Prev: NOT,  Up: Intrinsic Procedures
16497
164989.210 'NULL' -- Function that returns an disassociated pointer
16499==============================================================
16500
16501_Description_:
16502     Returns a disassociated pointer.
16503
16504     If MOLD is present, a disassociated pointer of the same type is
16505     returned, otherwise the type is determined by context.
16506
16507     In Fortran 95, MOLD is optional.  Please note that Fortran 2003
16508     includes cases where it is required.
16509
16510_Standard_:
16511     Fortran 95 and later
16512
16513_Class_:
16514     Transformational function
16515
16516_Syntax_:
16517     'PTR => NULL([MOLD])'
16518
16519_Arguments_:
16520     MOLD        (Optional) shall be a pointer of any association
16521                 status and of any type.
16522
16523_Return value_:
16524     A disassociated pointer.
16525
16526_Example_:
16527          REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
16528
16529_See also_:
16530     *note ASSOCIATED::
16531
16532
16533File: gfortran.info,  Node: NUM_IMAGES,  Next: OR,  Prev: NULL,  Up: Intrinsic Procedures
16534
165359.211 'NUM_IMAGES' -- Function that returns the number of images
16536================================================================
16537
16538_Description_:
16539     Returns the number of images.
16540
16541_Standard_:
16542     Fortran 2008 and later.  With DISTANCE or FAILED argument,
16543     Technical Specification (TS) 18508 or later
16544
16545_Class_:
16546     Transformational function
16547
16548_Syntax_:
16549     'RESULT = NUM_IMAGES(DISTANCE, FAILED)'
16550
16551_Arguments_:
16552     DISTANCE    (optional, intent(in)) Nonnegative scalar
16553                 integer
16554     FAILED      (optional, intent(in)) Scalar logical expression
16555
16556_Return value_:
16557     Scalar default-kind integer.  If DISTANCE is not present or has
16558     value 0, the number of images in the current team is returned.  For
16559     values smaller or equal distance to the initial team, it returns
16560     the number of images index on the ancestor team which has a
16561     distance of DISTANCE from the invoking team.  If DISTANCE is larger
16562     than the distance to the initial team, the number of images of the
16563     initial team is returned.  If FAILED is not present the total
16564     number of images is returned; if it has the value '.TRUE.', the
16565     number of failed images is returned, otherwise, the number of
16566     images which do have not the failed status.
16567
16568_Example_:
16569          INTEGER :: value[*]
16570          INTEGER :: i
16571          value = THIS_IMAGE()
16572          SYNC ALL
16573          IF (THIS_IMAGE() == 1) THEN
16574            DO i = 1, NUM_IMAGES()
16575              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
16576            END DO
16577          END IF
16578
16579_See also_:
16580     *note THIS_IMAGE::, *note IMAGE_INDEX::
16581
16582
16583File: gfortran.info,  Node: OR,  Next: PACK,  Prev: NUM_IMAGES,  Up: Intrinsic Procedures
16584
165859.212 'OR' -- Bitwise logical OR
16586================================
16587
16588_Description_:
16589     Bitwise logical 'OR'.
16590
16591     This intrinsic routine is provided for backwards compatibility with
16592     GNU Fortran 77.  For integer arguments, programmers should consider
16593     the use of the *note IOR:: intrinsic defined by the Fortran
16594     standard.
16595
16596_Standard_:
16597     GNU extension
16598
16599_Class_:
16600     Function
16601
16602_Syntax_:
16603     'RESULT = OR(I, J)'
16604
16605_Arguments_:
16606     I           The type shall be either a scalar 'INTEGER' type
16607                 or a scalar 'LOGICAL' type or a
16608                 boz-literal-constant.
16609     J           The type shall be the same as the type of I or a
16610                 boz-literal-constant.  I and J shall not both be
16611                 boz-literal-constants.  If either I and J is a
16612                 boz-literal-constant, then the other argument
16613                 must be a scalar 'INTEGER'.
16614
16615_Return value_:
16616     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
16617     If the kind type parameters differ, then the smaller kind type is
16618     implicitly converted to larger kind, and the return has the larger
16619     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
16620     kind type parameter of the other argument as-if a call to *note
16621     INT:: occurred.
16622
16623_Example_:
16624          PROGRAM test_or
16625            LOGICAL :: T = .TRUE., F = .FALSE.
16626            INTEGER :: a, b
16627            DATA a / Z'F' /, b / Z'3' /
16628
16629            WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
16630            WRITE (*,*) OR(a, b)
16631          END PROGRAM
16632
16633_See also_:
16634     Fortran 95 elemental function: *note IOR::
16635
16636
16637File: gfortran.info,  Node: PACK,  Next: PARITY,  Prev: OR,  Up: Intrinsic Procedures
16638
166399.213 'PACK' -- Pack an array into an array of rank one
16640=======================================================
16641
16642_Description_:
16643     Stores the elements of ARRAY in an array of rank one.
16644
16645     The beginning of the resulting array is made up of elements whose
16646     MASK equals 'TRUE'.  Afterwards, positions are filled with elements
16647     taken from VECTOR.
16648
16649_Standard_:
16650     Fortran 90 and later
16651
16652_Class_:
16653     Transformational function
16654
16655_Syntax_:
16656     'RESULT = PACK(ARRAY, MASK[,VECTOR])'
16657
16658_Arguments_:
16659     ARRAY       Shall be an array of any type.
16660     MASK        Shall be an array of type 'LOGICAL' and of the
16661                 same size as ARRAY.  Alternatively, it may be a
16662                 'LOGICAL' scalar.
16663     VECTOR      (Optional) shall be an array of the same type as
16664                 ARRAY and of rank one.  If present, the number
16665                 of elements in VECTOR shall be equal to or
16666                 greater than the number of true elements in
16667                 MASK.  If MASK is scalar, the number of elements
16668                 in VECTOR shall be equal to or greater than the
16669                 number of elements in ARRAY.
16670
16671_Return value_:
16672     The result is an array of rank one and the same type as that of
16673     ARRAY.  If VECTOR is present, the result size is that of VECTOR,
16674     the number of 'TRUE' values in MASK otherwise.
16675
16676_Example_:
16677     Gathering nonzero elements from an array:
16678          PROGRAM test_pack_1
16679            INTEGER :: m(6)
16680            m = (/ 1, 0, 0, 0, 5, 0 /)
16681            WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0)  ! "1 5"
16682          END PROGRAM
16683
16684     Gathering nonzero elements from an array and appending elements
16685     from VECTOR:
16686          PROGRAM test_pack_2
16687            INTEGER :: m(4)
16688            m = (/ 1, 0, 0, 2 /)
16689            ! The following results in "1 2 3 4"
16690            WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /))
16691          END PROGRAM
16692
16693_See also_:
16694     *note UNPACK::
16695
16696
16697File: gfortran.info,  Node: PARITY,  Next: PERROR,  Prev: PACK,  Up: Intrinsic Procedures
16698
166999.214 'PARITY' -- Reduction with exclusive OR
16700=============================================
16701
16702_Description_:
16703     Calculates the parity, i.e.  the reduction using '.XOR.', of MASK
16704     along dimension DIM.
16705
16706_Standard_:
16707     Fortran 2008 and later
16708
16709_Class_:
16710     Transformational function
16711
16712_Syntax_:
16713     'RESULT = PARITY(MASK[, DIM])'
16714
16715_Arguments_:
16716     LOGICAL     Shall be an array of type 'LOGICAL'
16717     DIM         (Optional) shall be a scalar of type 'INTEGER'
16718                 with a value in the range from 1 to n, where n
16719                 equals the rank of MASK.
16720
16721_Return value_:
16722     The result is of the same type as MASK.
16723
16724     If DIM is absent, a scalar with the parity of all elements in MASK
16725     is returned, i.e.  true if an odd number of elements is '.true.'
16726     and false otherwise.  If DIM is present, an array of rank n-1,
16727     where n equals the rank of ARRAY, and a shape similar to that of
16728     MASK with dimension DIM dropped is returned.
16729
16730_Example_:
16731          PROGRAM test_sum
16732            LOGICAL :: x(2) = [ .true., .false. ]
16733            print *, PARITY(x) ! prints "T" (true).
16734          END PROGRAM
16735
16736
16737File: gfortran.info,  Node: PERROR,  Next: POPCNT,  Prev: PARITY,  Up: Intrinsic Procedures
16738
167399.215 'PERROR' -- Print system error message
16740============================================
16741
16742_Description_:
16743     Prints (on the C 'stderr' stream) a newline-terminated error
16744     message corresponding to the last system error.  This is prefixed
16745     by STRING, a colon and a space.  See 'perror(3)'.
16746
16747_Standard_:
16748     GNU extension
16749
16750_Class_:
16751     Subroutine
16752
16753_Syntax_:
16754     'CALL PERROR(STRING)'
16755
16756_Arguments_:
16757     STRING      A scalar of type 'CHARACTER' and of the default
16758                 kind.
16759
16760_See also_:
16761     *note IERRNO::
16762
16763
16764File: gfortran.info,  Node: POPCNT,  Next: POPPAR,  Prev: PERROR,  Up: Intrinsic Procedures
16765
167669.216 'POPCNT' -- Number of bits set
16767====================================
16768
16769_Description_:
16770     'POPCNT(I)' returns the number of bits set ('1' bits) in the binary
16771     representation of 'I'.
16772
16773_Standard_:
16774     Fortran 2008 and later
16775
16776_Class_:
16777     Elemental function
16778
16779_Syntax_:
16780     'RESULT = POPCNT(I)'
16781
16782_Arguments_:
16783     I           Shall be of type 'INTEGER'.
16784
16785_Return value_:
16786     The return value is of type 'INTEGER' and of the default integer
16787     kind.
16788
16789_Example_:
16790          program test_population
16791            print *, popcnt(127),       poppar(127)
16792            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16793            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16794          end program test_population
16795_See also_:
16796     *note POPPAR::, *note LEADZ::, *note TRAILZ::
16797
16798
16799File: gfortran.info,  Node: POPPAR,  Next: PRECISION,  Prev: POPCNT,  Up: Intrinsic Procedures
16800
168019.217 'POPPAR' -- Parity of the number of bits set
16802==================================================
16803
16804_Description_:
16805     'POPPAR(I)' returns parity of the integer 'I', i.e.  the parity of
16806     the number of bits set ('1' bits) in the binary representation of
16807     'I'.  It is equal to 0 if 'I' has an even number of bits set, and 1
16808     for an odd number of '1' bits.
16809
16810_Standard_:
16811     Fortran 2008 and later
16812
16813_Class_:
16814     Elemental function
16815
16816_Syntax_:
16817     'RESULT = POPPAR(I)'
16818
16819_Arguments_:
16820     I           Shall be of type 'INTEGER'.
16821
16822_Return value_:
16823     The return value is of type 'INTEGER' and of the default integer
16824     kind.
16825
16826_Example_:
16827          program test_population
16828            print *, popcnt(127),       poppar(127)
16829            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16830            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16831          end program test_population
16832_See also_:
16833     *note POPCNT::, *note LEADZ::, *note TRAILZ::
16834
16835
16836File: gfortran.info,  Node: PRECISION,  Next: PRESENT,  Prev: POPPAR,  Up: Intrinsic Procedures
16837
168389.218 'PRECISION' -- Decimal precision of a real kind
16839=====================================================
16840
16841_Description_:
16842     'PRECISION(X)' returns the decimal precision in the model of the
16843     type of 'X'.
16844
16845_Standard_:
16846     Fortran 90 and later
16847
16848_Class_:
16849     Inquiry function
16850
16851_Syntax_:
16852     'RESULT = PRECISION(X)'
16853
16854_Arguments_:
16855     X           Shall be of type 'REAL' or 'COMPLEX'.  It may be
16856                 scalar or valued.
16857
16858_Return value_:
16859     The return value is of type 'INTEGER' and of the default integer
16860     kind.
16861
16862_Example_:
16863          program prec_and_range
16864            real(kind=4) :: x(2)
16865            complex(kind=8) :: y
16866
16867            print *, precision(x), range(x)
16868            print *, precision(y), range(y)
16869          end program prec_and_range
16870_See also_:
16871     *note SELECTED_REAL_KIND::, *note RANGE::
16872
16873
16874File: gfortran.info,  Node: PRESENT,  Next: PRODUCT,  Prev: PRECISION,  Up: Intrinsic Procedures
16875
168769.219 'PRESENT' -- Determine whether an optional dummy argument is specified
16877============================================================================
16878
16879_Description_:
16880     Determines whether an optional dummy argument is present.
16881
16882_Standard_:
16883     Fortran 90 and later
16884
16885_Class_:
16886     Inquiry function
16887
16888_Syntax_:
16889     'RESULT = PRESENT(A)'
16890
16891_Arguments_:
16892     A           May be of any type and may be a pointer, scalar
16893                 or array value, or a dummy procedure.  It shall
16894                 be the name of an optional dummy argument
16895                 accessible within the current subroutine or
16896                 function.
16897
16898_Return value_:
16899     Returns either 'TRUE' if the optional argument A is present, or
16900     'FALSE' otherwise.
16901
16902_Example_:
16903          PROGRAM test_present
16904            WRITE(*,*) f(), f(42)      ! "F T"
16905          CONTAINS
16906            LOGICAL FUNCTION f(x)
16907              INTEGER, INTENT(IN), OPTIONAL :: x
16908              f = PRESENT(x)
16909            END FUNCTION
16910          END PROGRAM
16911
16912
16913File: gfortran.info,  Node: PRODUCT,  Next: RADIX,  Prev: PRESENT,  Up: Intrinsic Procedures
16914
169159.220 'PRODUCT' -- Product of array elements
16916============================================
16917
16918_Description_:
16919     Multiplies the elements of ARRAY along dimension DIM if the
16920     corresponding element in MASK is 'TRUE'.
16921
16922_Standard_:
16923     Fortran 90 and later
16924
16925_Class_:
16926     Transformational function
16927
16928_Syntax_:
16929     'RESULT = PRODUCT(ARRAY[, MASK])'
16930     'RESULT = PRODUCT(ARRAY, DIM[, MASK])'
16931
16932_Arguments_:
16933     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
16934                 'COMPLEX'.
16935     DIM         (Optional) shall be a scalar of type 'INTEGER'
16936                 with a value in the range from 1 to n, where n
16937                 equals the rank of ARRAY.
16938     MASK        (Optional) shall be of type 'LOGICAL' and either
16939                 be a scalar or an array of the same shape as
16940                 ARRAY.
16941
16942_Return value_:
16943     The result is of the same type as ARRAY.
16944
16945     If DIM is absent, a scalar with the product of all elements in
16946     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
16947     the rank of ARRAY, and a shape similar to that of ARRAY with
16948     dimension DIM dropped is returned.
16949
16950_Example_:
16951          PROGRAM test_product
16952            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
16953            print *, PRODUCT(x)                    ! all elements, product = 120
16954            print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
16955          END PROGRAM
16956
16957_See also_:
16958     *note SUM::
16959
16960
16961File: gfortran.info,  Node: RADIX,  Next: RAN,  Prev: PRODUCT,  Up: Intrinsic Procedures
16962
169639.221 'RADIX' -- Base of a model number
16964=======================================
16965
16966_Description_:
16967     'RADIX(X)' returns the base of the model representing the entity X.
16968
16969_Standard_:
16970     Fortran 90 and later
16971
16972_Class_:
16973     Inquiry function
16974
16975_Syntax_:
16976     'RESULT = RADIX(X)'
16977
16978_Arguments_:
16979     X           Shall be of type 'INTEGER' or 'REAL'
16980
16981_Return value_:
16982     The return value is a scalar of type 'INTEGER' and of the default
16983     integer kind.
16984
16985_Example_:
16986          program test_radix
16987            print *, "The radix for the default integer kind is", radix(0)
16988            print *, "The radix for the default real kind is", radix(0.0)
16989          end program test_radix
16990_See also_:
16991     *note SELECTED_REAL_KIND::
16992
16993
16994File: gfortran.info,  Node: RAN,  Next: RAND,  Prev: RADIX,  Up: Intrinsic Procedures
16995
169969.222 'RAN' -- Real pseudo-random number
16997========================================
16998
16999_Description_:
17000     For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is
17001     provided as an alias for 'RAND'.  See *note RAND:: for complete
17002     documentation.
17003
17004_Standard_:
17005     GNU extension
17006
17007_Class_:
17008     Function
17009
17010_See also_:
17011     *note RAND::, *note RANDOM_NUMBER::
17012
17013
17014File: gfortran.info,  Node: RAND,  Next: RANDOM_INIT,  Prev: RAN,  Up: Intrinsic Procedures
17015
170169.223 'RAND' -- Real pseudo-random number
17017=========================================
17018
17019_Description_:
17020     'RAND(FLAG)' returns a pseudo-random number from a uniform
17021     distribution between 0 and 1.  If FLAG is 0, the next number in the
17022     current sequence is returned; if FLAG is 1, the generator is
17023     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
17024     used as a new seed with 'SRAND'.
17025
17026     This intrinsic routine is provided for backwards compatibility with
17027     GNU Fortran 77.  It implements a simple modulo generator as
17028     provided by 'g77'.  For new code, one should consider the use of
17029     *note RANDOM_NUMBER:: as it implements a superior algorithm.
17030
17031_Standard_:
17032     GNU extension
17033
17034_Class_:
17035     Function
17036
17037_Syntax_:
17038     'RESULT = RAND(I)'
17039
17040_Arguments_:
17041     I           Shall be a scalar 'INTEGER' of kind 4.
17042
17043_Return value_:
17044     The return value is of 'REAL' type and the default kind.
17045
17046_Example_:
17047          program test_rand
17048            integer,parameter :: seed = 86456
17049
17050            call srand(seed)
17051            print *, rand(), rand(), rand(), rand()
17052            print *, rand(seed), rand(), rand(), rand()
17053          end program test_rand
17054
17055_See also_:
17056     *note SRAND::, *note RANDOM_NUMBER::
17057
17058
17059File: gfortran.info,  Node: RANDOM_INIT,  Next: RANDOM_NUMBER,  Prev: RAND,  Up: Intrinsic Procedures
17060
170619.224 'RANDOM_INIT' -- Initialize a pseudo-random number generator
17062==================================================================
17063
17064_Description_:
17065     Initializes the state of the pseudorandom number generator used by
17066     'RANDOM_NUMBER'.
17067
17068_Standard_:
17069     Fortran 2018
17070
17071_Class_:
17072     Subroutine
17073
17074_Syntax_:
17075     'CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)'
17076
17077_Arguments_:
17078     REPEATABLE         Shall be a scalar with a 'LOGICAL' type, and it
17079                        is 'INTENT(IN)'.  If it is '.true.', the seed is
17080                        set to a processor-dependent value that is the
17081                        same each time 'RANDOM_INIT' is called from the
17082                        same image.  The term "same image" means a
17083                        single instance of program execution.  The
17084                        sequence of random numbers is different for
17085                        repeated execution of the program.  If it is
17086                        '.false.', the seed is set to a
17087                        processor-dependent value.
17088     IMAGE_DISTINCT     Shall be a scalar with a 'LOGICAL' type, and it
17089                        is 'INTENT(IN)'.  If it is '.true.', the seed is
17090                        set to a processor-dependent value that is
17091                        distinct from th seed set by a call to
17092                        'RANDOM_INIT' in another image.  If it is
17093                        '.false.', the seed is set value that does
17094                        depend which image called 'RANDOM_INIT'.
17095
17096_Example_:
17097          program test_random_seed
17098            implicit none
17099            real x(3), y(3)
17100            call random_init(.true., .true.)
17101            call random_number(x)
17102            call random_init(.true., .true.)
17103            call random_number(y)
17104            ! x and y are the same sequence
17105            if (any(x /= y)) call abort
17106          end program test_random_seed
17107
17108_See also_:
17109     *note RANDOM_NUMBER::, *note RANDOM_SEED::
17110
17111
17112File: gfortran.info,  Node: RANDOM_NUMBER,  Next: RANDOM_SEED,  Prev: RANDOM_INIT,  Up: Intrinsic Procedures
17113
171149.225 'RANDOM_NUMBER' -- Pseudo-random number
17115=============================================
17116
17117_Description_:
17118     Returns a single pseudorandom number or an array of pseudorandom
17119     numbers from the uniform distribution over the range 0 \leq x < 1.
17120
17121     The runtime-library implements the xoshiro256** pseudorandom number
17122     generator (PRNG). This generator has a period of 2^{256} - 1, and
17123     when using multiple threads up to 2^{128} threads can each generate
17124     2^{128} random numbers before any aliasing occurs.
17125
17126     Note that in a multi-threaded program (e.g.  using OpenMP
17127     directives), each thread will have its own random number state.
17128     For details of the seeding procedure, see the documentation for the
17129     'RANDOM_SEED' intrinsic.
17130
17131_Standard_:
17132     Fortran 90 and later
17133
17134_Class_:
17135     Subroutine
17136
17137_Syntax_:
17138     'RANDOM_NUMBER(HARVEST)'
17139
17140_Arguments_:
17141     HARVEST     Shall be a scalar or an array of type 'REAL'.
17142
17143_Example_:
17144          program test_random_number
17145            REAL :: r(5,5)
17146            CALL RANDOM_NUMBER(r)
17147          end program
17148
17149_See also_:
17150     *note RANDOM_SEED::, *note RANDOM_INIT::
17151
17152
17153File: gfortran.info,  Node: RANDOM_SEED,  Next: RANGE,  Prev: RANDOM_NUMBER,  Up: Intrinsic Procedures
17154
171559.226 'RANDOM_SEED' -- Initialize a pseudo-random number sequence
17156=================================================================
17157
17158_Description_:
17159     Restarts or queries the state of the pseudorandom number generator
17160     used by 'RANDOM_NUMBER'.
17161
17162     If 'RANDOM_SEED' is called without arguments, it is seeded with
17163     random data retrieved from the operating system.
17164
17165     As an extension to the Fortran standard, the GFortran
17166     'RANDOM_NUMBER' supports multiple threads.  Each thread in a
17167     multi-threaded program has its own seed.  When 'RANDOM_SEED' is
17168     called either without arguments or with the PUT argument, the given
17169     seed is copied into a master seed as well as the seed of the
17170     current thread.  When a new thread uses 'RANDOM_NUMBER' for the
17171     first time, the seed is copied from the master seed, and forwarded
17172     N * 2^{128} steps to guarantee that the random stream does not
17173     alias any other stream in the system, where N is the number of
17174     threads that have used 'RANDOM_NUMBER' so far during the program
17175     execution.
17176
17177_Standard_:
17178     Fortran 90 and later
17179
17180_Class_:
17181     Subroutine
17182
17183_Syntax_:
17184     'CALL RANDOM_SEED([SIZE, PUT, GET])'
17185
17186_Arguments_:
17187     SIZE        (Optional) Shall be a scalar and of type default
17188                 'INTEGER', with 'INTENT(OUT)'.  It specifies the
17189                 minimum size of the arrays used with the PUT and
17190                 GET arguments.
17191     PUT         (Optional) Shall be an array of type default
17192                 'INTEGER' and rank one.  It is 'INTENT(IN)' and
17193                 the size of the array must be larger than or
17194                 equal to the number returned by the SIZE
17195                 argument.
17196     GET         (Optional) Shall be an array of type default
17197                 'INTEGER' and rank one.  It is 'INTENT(OUT)' and
17198                 the size of the array must be larger than or
17199                 equal to the number returned by the SIZE
17200                 argument.
17201
17202_Example_:
17203          program test_random_seed
17204            implicit none
17205            integer, allocatable :: seed(:)
17206            integer :: n
17207
17208            call random_seed(size = n)
17209            allocate(seed(n))
17210            call random_seed(get=seed)
17211            write (*, *) seed
17212          end program test_random_seed
17213
17214_See also_:
17215     *note RANDOM_NUMBER::, *note RANDOM_INIT::
17216
17217
17218File: gfortran.info,  Node: RANGE,  Next: RANK,  Prev: RANDOM_SEED,  Up: Intrinsic Procedures
17219
172209.227 'RANGE' -- Decimal exponent range
17221=======================================
17222
17223_Description_:
17224     'RANGE(X)' returns the decimal exponent range in the model of the
17225     type of 'X'.
17226
17227_Standard_:
17228     Fortran 90 and later
17229
17230_Class_:
17231     Inquiry function
17232
17233_Syntax_:
17234     'RESULT = RANGE(X)'
17235
17236_Arguments_:
17237     X           Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'.
17238
17239_Return value_:
17240     The return value is of type 'INTEGER' and of the default integer
17241     kind.
17242
17243_Example_:
17244     See 'PRECISION' for an example.
17245_See also_:
17246     *note SELECTED_REAL_KIND::, *note PRECISION::
17247
17248
17249File: gfortran.info,  Node: RANK,  Next: REAL,  Prev: RANGE,  Up: Intrinsic Procedures
17250
172519.228 'RANK' -- Rank of a data object
17252=====================================
17253
17254_Description_:
17255     'RANK(A)' returns the rank of a scalar or array data object.
17256
17257_Standard_:
17258     Technical Specification (TS) 29113
17259
17260_Class_:
17261     Inquiry function
17262
17263_Syntax_:
17264     'RESULT = RANK(A)'
17265
17266_Arguments_:
17267     A           can be of any type
17268
17269_Return value_:
17270     The return value is of type 'INTEGER' and of the default integer
17271     kind.  For arrays, their rank is returned; for scalars zero is
17272     returned.
17273
17274_Example_:
17275          program test_rank
17276            integer :: a
17277            real, allocatable :: b(:,:)
17278
17279            print *, rank(a), rank(b) ! Prints:  0  2
17280          end program test_rank
17281
17282
17283File: gfortran.info,  Node: REAL,  Next: RENAME,  Prev: RANK,  Up: Intrinsic Procedures
17284
172859.229 'REAL' -- Convert to real type
17286====================================
17287
17288_Description_:
17289     'REAL(A [, KIND])' converts its argument A to a real type.  The
17290     'REALPART' function is provided for compatibility with 'g77', and
17291     its use is strongly discouraged.
17292
17293_Standard_:
17294     Fortran 77 and later, with KIND argument Fortran 90 and later, has
17295     GNU extensions
17296
17297_Class_:
17298     Elemental function
17299
17300_Syntax_:
17301     'RESULT = REAL(A [, KIND])'
17302     'RESULT = REALPART(Z)'
17303
17304_Arguments_:
17305     A           Shall be 'INTEGER', 'REAL', or 'COMPLEX'.
17306     KIND        (Optional) An 'INTEGER' initialization
17307                 expression indicating the kind parameter of the
17308                 result.
17309
17310_Return value_:
17311     These functions return a 'REAL' variable or array under the
17312     following rules:
17313
17314     (A)
17315          'REAL(A)' is converted to a default real type if A is an
17316          integer or real variable.
17317     (B)
17318          'REAL(A)' is converted to a real type with the kind type
17319          parameter of A if A is a complex variable.
17320     (C)
17321          'REAL(A, KIND)' is converted to a real type with kind type
17322          parameter KIND if A is a complex, integer, or real variable.
17323
17324_Example_:
17325          program test_real
17326            complex :: x = (1.0, 2.0)
17327            print *, real(x), real(x,8), realpart(x)
17328          end program test_real
17329
17330_Specific names_:
17331     Name           Argument       Return type    Standard
17332     'FLOAT(A)'     'INTEGER(4)'   'REAL(4)'      GNU extension
17333     'DFLOAT(A)'    'INTEGER(4)'   'REAL(8)'      GNU extension
17334     'FLOATI(A)'    'INTEGER(2)'   'REAL(4)'      GNU extension
17335     'FLOATJ(A)'    'INTEGER(4)'   'REAL(4)'      GNU extension
17336     'FLOATK(A)'    'INTEGER(8)'   'REAL(4)'      GNU extension
17337     'SNGL(A)'      'INTEGER(8)'   'REAL(4)'      GNU extension
17338
17339_See also_:
17340     *note DBLE::
17341
17342
17343File: gfortran.info,  Node: RENAME,  Next: REPEAT,  Prev: REAL,  Up: Intrinsic Procedures
17344
173459.230 'RENAME' -- Rename a file
17346===============================
17347
17348_Description_:
17349     Renames a file from file PATH1 to PATH2.  A null character
17350     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
17351     PATH2; otherwise, trailing blanks in the file names are ignored.
17352     If the STATUS argument is supplied, it contains 0 on success or a
17353     nonzero error code upon return; see 'rename(2)'.
17354
17355     This intrinsic is provided in both subroutine and function forms;
17356     however, only one form can be used in any given program unit.
17357
17358_Standard_:
17359     GNU extension
17360
17361_Class_:
17362     Subroutine, function
17363
17364_Syntax_:
17365     'CALL RENAME(PATH1, PATH2 [, STATUS])'
17366     'STATUS = RENAME(PATH1, PATH2)'
17367
17368_Arguments_:
17369     PATH1       Shall be of default 'CHARACTER' type.
17370     PATH2       Shall be of default 'CHARACTER' type.
17371     STATUS      (Optional) Shall be of default 'INTEGER' type.
17372
17373_See also_:
17374     *note LINK::
17375
17376
17377File: gfortran.info,  Node: REPEAT,  Next: RESHAPE,  Prev: RENAME,  Up: Intrinsic Procedures
17378
173799.231 'REPEAT' -- Repeated string concatenation
17380===============================================
17381
17382_Description_:
17383     Concatenates NCOPIES copies of a string.
17384
17385_Standard_:
17386     Fortran 90 and later
17387
17388_Class_:
17389     Transformational function
17390
17391_Syntax_:
17392     'RESULT = REPEAT(STRING, NCOPIES)'
17393
17394_Arguments_:
17395     STRING      Shall be scalar and of type 'CHARACTER'.
17396     NCOPIES     Shall be scalar and of type 'INTEGER'.
17397
17398_Return value_:
17399     A new scalar of type 'CHARACTER' built up from NCOPIES copies of
17400     STRING.
17401
17402_Example_:
17403          program test_repeat
17404            write(*,*) repeat("x", 5)   ! "xxxxx"
17405          end program
17406
17407
17408File: gfortran.info,  Node: RESHAPE,  Next: RRSPACING,  Prev: REPEAT,  Up: Intrinsic Procedures
17409
174109.232 'RESHAPE' -- Function to reshape an array
17411===============================================
17412
17413_Description_:
17414     Reshapes SOURCE to correspond to SHAPE.  If necessary, the new
17415     array may be padded with elements from PAD or permuted as defined
17416     by ORDER.
17417
17418_Standard_:
17419     Fortran 90 and later
17420
17421_Class_:
17422     Transformational function
17423
17424_Syntax_:
17425     'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
17426
17427_Arguments_:
17428     SOURCE      Shall be an array of any type.
17429     SHAPE       Shall be of type 'INTEGER' and an array of rank
17430                 one.  Its values must be positive or zero.
17431     PAD         (Optional) shall be an array of the same type as
17432                 SOURCE.
17433     ORDER       (Optional) shall be of type 'INTEGER' and an
17434                 array of the same shape as SHAPE.  Its values
17435                 shall be a permutation of the numbers from 1 to
17436                 n, where n is the size of SHAPE.  If ORDER is
17437                 absent, the natural ordering shall be assumed.
17438
17439_Return value_:
17440     The result is an array of shape SHAPE with the same type as SOURCE.
17441
17442_Example_:
17443          PROGRAM test_reshape
17444            INTEGER, DIMENSION(4) :: x
17445            WRITE(*,*) SHAPE(x)                       ! prints "4"
17446            WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/)))    ! prints "2 2"
17447          END PROGRAM
17448
17449_See also_:
17450     *note SHAPE::
17451
17452
17453File: gfortran.info,  Node: RRSPACING,  Next: RSHIFT,  Prev: RESHAPE,  Up: Intrinsic Procedures
17454
174559.233 'RRSPACING' -- Reciprocal of the relative spacing
17456=======================================================
17457
17458_Description_:
17459     'RRSPACING(X)' returns the reciprocal of the relative spacing of
17460     model numbers near X.
17461
17462_Standard_:
17463     Fortran 90 and later
17464
17465_Class_:
17466     Elemental function
17467
17468_Syntax_:
17469     'RESULT = RRSPACING(X)'
17470
17471_Arguments_:
17472     X           Shall be of type 'REAL'.
17473
17474_Return value_:
17475     The return value is of the same type and kind as X.  The value
17476     returned is equal to 'ABS(FRACTION(X)) *
17477     FLOAT(RADIX(X))**DIGITS(X)'.
17478
17479_See also_:
17480     *note SPACING::
17481
17482
17483File: gfortran.info,  Node: RSHIFT,  Next: SAME_TYPE_AS,  Prev: RRSPACING,  Up: Intrinsic Procedures
17484
174859.234 'RSHIFT' -- Right shift bits
17486==================================
17487
17488_Description_:
17489     'RSHIFT' returns a value corresponding to I with all of the bits
17490     shifted right by SHIFT places.  SHIFT shall be nonnegative and less
17491     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17492     undefined.  Bits shifted out from the right end are lost.  The fill
17493     is arithmetic: the bits shifted in from the left end are equal to
17494     the leftmost bit, which in two's complement representation is the
17495     sign bit.
17496
17497     This function has been superseded by the 'SHIFTA' intrinsic, which
17498     is standard in Fortran 2008 and later.
17499
17500_Standard_:
17501     GNU extension
17502
17503_Class_:
17504     Elemental function
17505
17506_Syntax_:
17507     'RESULT = RSHIFT(I, SHIFT)'
17508
17509_Arguments_:
17510     I           The type shall be 'INTEGER'.
17511     SHIFT       The type shall be 'INTEGER'.
17512
17513_Return value_:
17514     The return value is of type 'INTEGER' and of the same kind as I.
17515
17516_See also_:
17517     *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
17518     *note SHIFTR::, *note SHIFTL::
17519
17520
17521File: gfortran.info,  Node: SAME_TYPE_AS,  Next: SCALE,  Prev: RSHIFT,  Up: Intrinsic Procedures
17522
175239.235 'SAME_TYPE_AS' -- Query dynamic types for equality
17524========================================================
17525
17526_Description_:
17527     Query dynamic types for equality.
17528
17529_Standard_:
17530     Fortran 2003 and later
17531
17532_Class_:
17533     Inquiry function
17534
17535_Syntax_:
17536     'RESULT = SAME_TYPE_AS(A, B)'
17537
17538_Arguments_:
17539     A           Shall be an object of extensible declared type
17540                 or unlimited polymorphic.
17541     B           Shall be an object of extensible declared type
17542                 or unlimited polymorphic.
17543
17544_Return value_:
17545     The return value is a scalar of type default logical.  It is true
17546     if and only if the dynamic type of A is the same as the dynamic
17547     type of B.
17548
17549_See also_:
17550     *note EXTENDS_TYPE_OF::
17551
17552
17553File: gfortran.info,  Node: SCALE,  Next: SCAN,  Prev: SAME_TYPE_AS,  Up: Intrinsic Procedures
17554
175559.236 'SCALE' -- Scale a real value
17556===================================
17557
17558_Description_:
17559     'SCALE(X,I)' returns 'X * RADIX(X)**I'.
17560
17561_Standard_:
17562     Fortran 90 and later
17563
17564_Class_:
17565     Elemental function
17566
17567_Syntax_:
17568     'RESULT = SCALE(X, I)'
17569
17570_Arguments_:
17571     X           The type of the argument shall be a 'REAL'.
17572     I           The type of the argument shall be a 'INTEGER'.
17573
17574_Return value_:
17575     The return value is of the same type and kind as X.  Its value is
17576     'X * RADIX(X)**I'.
17577
17578_Example_:
17579          program test_scale
17580            real :: x = 178.1387e-4
17581            integer :: i = 5
17582            print *, scale(x,i), x*radix(x)**i
17583          end program test_scale
17584
17585
17586File: gfortran.info,  Node: SCAN,  Next: SECNDS,  Prev: SCALE,  Up: Intrinsic Procedures
17587
175889.237 'SCAN' -- Scan a string for the presence of a set of characters
17589=====================================================================
17590
17591_Description_:
17592     Scans a STRING for any of the characters in a SET of characters.
17593
17594     If BACK is either absent or equals 'FALSE', this function returns
17595     the position of the leftmost character of STRING that is in SET.
17596     If BACK equals 'TRUE', the rightmost position is returned.  If no
17597     character of SET is found in STRING, the result is zero.
17598
17599_Standard_:
17600     Fortran 90 and later, with KIND argument Fortran 2003 and later
17601
17602_Class_:
17603     Elemental function
17604
17605_Syntax_:
17606     'RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
17607
17608_Arguments_:
17609     STRING      Shall be of type 'CHARACTER'.
17610     SET         Shall be of type 'CHARACTER'.
17611     BACK        (Optional) shall be of type 'LOGICAL'.
17612     KIND        (Optional) An 'INTEGER' initialization
17613                 expression indicating the kind parameter of the
17614                 result.
17615
17616_Return value_:
17617     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
17618     absent, the return value is of default integer kind.
17619
17620_Example_:
17621          PROGRAM test_scan
17622            WRITE(*,*) SCAN("FORTRAN", "AO")          ! 2, found 'O'
17623            WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.)  ! 6, found 'A'
17624            WRITE(*,*) SCAN("FORTRAN", "C++")         ! 0, found none
17625          END PROGRAM
17626
17627_See also_:
17628     *note INDEX intrinsic::, *note VERIFY::
17629
17630
17631File: gfortran.info,  Node: SECNDS,  Next: SECOND,  Prev: SCAN,  Up: Intrinsic Procedures
17632
176339.238 'SECNDS' -- Time function
17634===============================
17635
17636_Description_:
17637     'SECNDS(X)' gets the time in seconds from the real-time system
17638     clock.  X is a reference time, also in seconds.  If this is zero,
17639     the time in seconds from midnight is returned.  This function is
17640     non-standard and its use is discouraged.
17641
17642_Standard_:
17643     GNU extension
17644
17645_Class_:
17646     Function
17647
17648_Syntax_:
17649     'RESULT = SECNDS (X)'
17650
17651_Arguments_:
17652     T           Shall be of type 'REAL(4)'.
17653     X           Shall be of type 'REAL(4)'.
17654
17655_Return value_:
17656     None
17657
17658_Example_:
17659          program test_secnds
17660              integer :: i
17661              real(4) :: t1, t2
17662              print *, secnds (0.0)   ! seconds since midnight
17663              t1 = secnds (0.0)       ! reference time
17664              do i = 1, 10000000      ! do something
17665              end do
17666              t2 = secnds (t1)        ! elapsed time
17667              print *, "Something took ", t2, " seconds."
17668          end program test_secnds
17669
17670
17671File: gfortran.info,  Node: SECOND,  Next: SELECTED_CHAR_KIND,  Prev: SECNDS,  Up: Intrinsic Procedures
17672
176739.239 'SECOND' -- CPU time function
17674===================================
17675
17676_Description_:
17677     Returns a 'REAL(4)' value representing the elapsed CPU time in
17678     seconds.  This provides the same functionality as the standard
17679     'CPU_TIME' intrinsic, and is only included for backwards
17680     compatibility.
17681
17682     This intrinsic is provided in both subroutine and function forms;
17683     however, only one form can be used in any given program unit.
17684
17685_Standard_:
17686     GNU extension
17687
17688_Class_:
17689     Subroutine, function
17690
17691_Syntax_:
17692     'CALL SECOND(TIME)'
17693     'TIME = SECOND()'
17694
17695_Arguments_:
17696     TIME        Shall be of type 'REAL(4)'.
17697
17698_Return value_:
17699     In either syntax, TIME is set to the process's current runtime in
17700     seconds.
17701
17702_See also_:
17703     *note CPU_TIME::
17704
17705
17706File: gfortran.info,  Node: SELECTED_CHAR_KIND,  Next: SELECTED_INT_KIND,  Prev: SECOND,  Up: Intrinsic Procedures
17707
177089.240 'SELECTED_CHAR_KIND' -- Choose character kind
17709===================================================
17710
17711_Description_:
17712
17713     'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
17714     set named NAME, if a character set with such a name is supported,
17715     or -1 otherwise.  Currently, supported character sets include
17716     "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
17717     (Universal Character Set, UCS-4) which is commonly known as
17718     Unicode.
17719
17720_Standard_:
17721     Fortran 2003 and later
17722
17723_Class_:
17724     Transformational function
17725
17726_Syntax_:
17727     'RESULT = SELECTED_CHAR_KIND(NAME)'
17728
17729_Arguments_:
17730     NAME        Shall be a scalar and of the default character
17731                 type.
17732
17733_Example_:
17734          program character_kind
17735            use iso_fortran_env
17736            implicit none
17737            integer, parameter :: ascii = selected_char_kind ("ascii")
17738            integer, parameter :: ucs4  = selected_char_kind ('ISO_10646')
17739
17740            character(kind=ascii, len=26) :: alphabet
17741            character(kind=ucs4,  len=30) :: hello_world
17742
17743            alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
17744            hello_world = ucs4_'Hello World and Ni Hao -- ' &
17745                          // char (int (z'4F60'), ucs4)     &
17746                          // char (int (z'597D'), ucs4)
17747
17748            write (*,*) alphabet
17749
17750            open (output_unit, encoding='UTF-8')
17751            write (*,*) trim (hello_world)
17752          end program character_kind
17753
17754
17755File: gfortran.info,  Node: SELECTED_INT_KIND,  Next: SELECTED_REAL_KIND,  Prev: SELECTED_CHAR_KIND,  Up: Intrinsic Procedures
17756
177579.241 'SELECTED_INT_KIND' -- Choose integer kind
17758================================================
17759
17760_Description_:
17761     'SELECTED_INT_KIND(R)' return the kind value of the smallest
17762     integer type that can represent all values ranging from -10^R
17763     (exclusive) to 10^R (exclusive).  If there is no integer kind that
17764     accommodates this range, 'SELECTED_INT_KIND' returns -1.
17765
17766_Standard_:
17767     Fortran 90 and later
17768
17769_Class_:
17770     Transformational function
17771
17772_Syntax_:
17773     'RESULT = SELECTED_INT_KIND(R)'
17774
17775_Arguments_:
17776     R           Shall be a scalar and of type 'INTEGER'.
17777
17778_Example_:
17779          program large_integers
17780            integer,parameter :: k5 = selected_int_kind(5)
17781            integer,parameter :: k15 = selected_int_kind(15)
17782            integer(kind=k5) :: i5
17783            integer(kind=k15) :: i15
17784
17785            print *, huge(i5), huge(i15)
17786
17787            ! The following inequalities are always true
17788            print *, huge(i5) >= 10_k5**5-1
17789            print *, huge(i15) >= 10_k15**15-1
17790          end program large_integers
17791
17792
17793File: gfortran.info,  Node: SELECTED_REAL_KIND,  Next: SET_EXPONENT,  Prev: SELECTED_INT_KIND,  Up: Intrinsic Procedures
17794
177959.242 'SELECTED_REAL_KIND' -- Choose real kind
17796==============================================
17797
17798_Description_:
17799     'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
17800     type with decimal precision of at least 'P' digits, exponent range
17801     of at least 'R', and with a radix of 'RADIX'.
17802
17803_Standard_:
17804     Fortran 90 and later, with 'RADIX' Fortran 2008 or later
17805
17806_Class_:
17807     Transformational function
17808
17809_Syntax_:
17810     'RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
17811
17812_Arguments_:
17813     P           (Optional) shall be a scalar and of type
17814                 'INTEGER'.
17815     R           (Optional) shall be a scalar and of type
17816                 'INTEGER'.
17817     RADIX       (Optional) shall be a scalar and of type
17818                 'INTEGER'.
17819     Before Fortran 2008, at least one of the arguments R or P shall be
17820     present; since Fortran 2008, they are assumed to be zero if absent.
17821
17822_Return value_:
17823
17824     'SELECTED_REAL_KIND' returns the value of the kind type parameter
17825     of a real data type with decimal precision of at least 'P' digits,
17826     a decimal exponent range of at least 'R', and with the requested
17827     'RADIX'.  If the 'RADIX' parameter is absent, real kinds with any
17828     radix can be returned.  If more than one real data type meet the
17829     criteria, the kind of the data type with the smallest decimal
17830     precision is returned.  If no real data type matches the criteria,
17831     the result is
17832     -1 if the processor does not support a real data type with a
17833          precision greater than or equal to 'P', but the 'R' and
17834          'RADIX' requirements can be fulfilled
17835     -2 if the processor does not support a real type with an exponent
17836          range greater than or equal to 'R', but 'P' and 'RADIX' are
17837          fulfillable
17838     -3 if 'RADIX' but not 'P' and 'R' requirements
17839          are fulfillable
17840     -4 if 'RADIX' and either 'P' or 'R' requirements
17841          are fulfillable
17842     -5 if there is no real type with the given 'RADIX'
17843
17844_Example_:
17845          program real_kinds
17846            integer,parameter :: p6 = selected_real_kind(6)
17847            integer,parameter :: p10r100 = selected_real_kind(10,100)
17848            integer,parameter :: r400 = selected_real_kind(r=400)
17849            real(kind=p6) :: x
17850            real(kind=p10r100) :: y
17851            real(kind=r400) :: z
17852
17853            print *, precision(x), range(x)
17854            print *, precision(y), range(y)
17855            print *, precision(z), range(z)
17856          end program real_kinds
17857_See also_:
17858     *note PRECISION::, *note RANGE::, *note RADIX::
17859
17860
17861File: gfortran.info,  Node: SET_EXPONENT,  Next: SHAPE,  Prev: SELECTED_REAL_KIND,  Up: Intrinsic Procedures
17862
178639.243 'SET_EXPONENT' -- Set the exponent of the model
17864=====================================================
17865
17866_Description_:
17867     'SET_EXPONENT(X, I)' returns the real number whose fractional part
17868     is that that of X and whose exponent part is I.
17869
17870_Standard_:
17871     Fortran 90 and later
17872
17873_Class_:
17874     Elemental function
17875
17876_Syntax_:
17877     'RESULT = SET_EXPONENT(X, I)'
17878
17879_Arguments_:
17880     X           Shall be of type 'REAL'.
17881     I           Shall be of type 'INTEGER'.
17882
17883_Return value_:
17884     The return value is of the same type and kind as X.  The real
17885     number whose fractional part is that that of X and whose exponent
17886     part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'.
17887
17888_Example_:
17889          PROGRAM test_setexp
17890            REAL :: x = 178.1387e-4
17891            INTEGER :: i = 17
17892            PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
17893          END PROGRAM
17894
17895
17896File: gfortran.info,  Node: SHAPE,  Next: SHIFTA,  Prev: SET_EXPONENT,  Up: Intrinsic Procedures
17897
178989.244 'SHAPE' -- Determine the shape of an array
17899================================================
17900
17901_Description_:
17902     Determines the shape of an array.
17903
17904_Standard_:
17905     Fortran 90 and later, with KIND argument Fortran 2003 and later
17906
17907_Class_:
17908     Inquiry function
17909
17910_Syntax_:
17911     'RESULT = SHAPE(SOURCE [, KIND])'
17912
17913_Arguments_:
17914     SOURCE      Shall be an array or scalar of any type.  If
17915                 SOURCE is a pointer it must be associated and
17916                 allocatable arrays must be allocated.
17917     KIND        (Optional) An 'INTEGER' initialization
17918                 expression indicating the kind parameter of the
17919                 result.
17920
17921_Return value_:
17922     An 'INTEGER' array of rank one with as many elements as SOURCE has
17923     dimensions.  The elements of the resulting array correspond to the
17924     extend of SOURCE along the respective dimensions.  If SOURCE is a
17925     scalar, the result is the rank one array of size zero.  If KIND is
17926     absent, the return value has the default integer kind otherwise the
17927     specified kind.
17928
17929_Example_:
17930          PROGRAM test_shape
17931            INTEGER, DIMENSION(-1:1, -1:2) :: A
17932            WRITE(*,*) SHAPE(A)             ! (/ 3, 4 /)
17933            WRITE(*,*) SIZE(SHAPE(42))      ! (/ /)
17934          END PROGRAM
17935
17936_See also_:
17937     *note RESHAPE::, *note SIZE::
17938
17939
17940File: gfortran.info,  Node: SHIFTA,  Next: SHIFTL,  Prev: SHAPE,  Up: Intrinsic Procedures
17941
179429.245 'SHIFTA' -- Right shift with fill
17943=======================================
17944
17945_Description_:
17946     'SHIFTA' returns a value corresponding to I with all of the bits
17947     shifted right by SHIFT places.  SHIFT that be nonnegative and less
17948     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17949     undefined.  Bits shifted out from the right end are lost.  The fill
17950     is arithmetic: the bits shifted in from the left end are equal to
17951     the leftmost bit, which in two's complement representation is the
17952     sign bit.
17953
17954_Standard_:
17955     Fortran 2008 and later
17956
17957_Class_:
17958     Elemental function
17959
17960_Syntax_:
17961     'RESULT = SHIFTA(I, SHIFT)'
17962
17963_Arguments_:
17964     I           The type shall be 'INTEGER'.
17965     SHIFT       The type shall be 'INTEGER'.
17966
17967_Return value_:
17968     The return value is of type 'INTEGER' and of the same kind as I.
17969
17970_See also_:
17971     *note SHIFTL::, *note SHIFTR::
17972
17973
17974File: gfortran.info,  Node: SHIFTL,  Next: SHIFTR,  Prev: SHIFTA,  Up: Intrinsic Procedures
17975
179769.246 'SHIFTL' -- Left shift
17977============================
17978
17979_Description_:
17980     'SHIFTL' returns a value corresponding to I with all of the bits
17981     shifted left by SHIFT places.  SHIFT shall be nonnegative and less
17982     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17983     undefined.  Bits shifted out from the left end are lost, and bits
17984     shifted in from the right end are set to 0.
17985
17986_Standard_:
17987     Fortran 2008 and later
17988
17989_Class_:
17990     Elemental function
17991
17992_Syntax_:
17993     'RESULT = SHIFTL(I, SHIFT)'
17994
17995_Arguments_:
17996     I           The type shall be 'INTEGER'.
17997     SHIFT       The type shall be 'INTEGER'.
17998
17999_Return value_:
18000     The return value is of type 'INTEGER' and of the same kind as I.
18001
18002_See also_:
18003     *note SHIFTA::, *note SHIFTR::
18004
18005
18006File: gfortran.info,  Node: SHIFTR,  Next: SIGN,  Prev: SHIFTL,  Up: Intrinsic Procedures
18007
180089.247 'SHIFTR' -- Right shift
18009=============================
18010
18011_Description_:
18012     'SHIFTR' returns a value corresponding to I with all of the bits
18013     shifted right by SHIFT places.  SHIFT shall be nonnegative and less
18014     than or equal to 'BIT_SIZE(I)', otherwise the result value is
18015     undefined.  Bits shifted out from the right end are lost, and bits
18016     shifted in from the left end are set to 0.
18017
18018_Standard_:
18019     Fortran 2008 and later
18020
18021_Class_:
18022     Elemental function
18023
18024_Syntax_:
18025     'RESULT = SHIFTR(I, SHIFT)'
18026
18027_Arguments_:
18028     I           The type shall be 'INTEGER'.
18029     SHIFT       The type shall be 'INTEGER'.
18030
18031_Return value_:
18032     The return value is of type 'INTEGER' and of the same kind as I.
18033
18034_See also_:
18035     *note SHIFTA::, *note SHIFTL::
18036
18037
18038File: gfortran.info,  Node: SIGN,  Next: SIGNAL,  Prev: SHIFTR,  Up: Intrinsic Procedures
18039
180409.248 'SIGN' -- Sign copying function
18041=====================================
18042
18043_Description_:
18044     'SIGN(A,B)' returns the value of A with the sign of B.
18045
18046_Standard_:
18047     Fortran 77 and later
18048
18049_Class_:
18050     Elemental function
18051
18052_Syntax_:
18053     'RESULT = SIGN(A, B)'
18054
18055_Arguments_:
18056     A           Shall be of type 'INTEGER' or 'REAL'
18057     B           Shall be of the same type and kind as A.
18058
18059_Return value_:
18060     The kind of the return value is that of A and B.  If B\ge 0 then
18061     the result is 'ABS(A)', else it is '-ABS(A)'.
18062
18063_Example_:
18064          program test_sign
18065            print *, sign(-12,1)
18066            print *, sign(-12,0)
18067            print *, sign(-12,-1)
18068
18069            print *, sign(-12.,1.)
18070            print *, sign(-12.,0.)
18071            print *, sign(-12.,-1.)
18072          end program test_sign
18073
18074_Specific names_:
18075     Name           Arguments      Return type    Standard
18076     'SIGN(A,B)'    'REAL(4) A,    'REAL(4)'      Fortran 77 and
18077                    B'                            later
18078     'ISIGN(A,B)'   'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
18079                    A, B'                         later
18080     'DSIGN(A,B)'   'REAL(8) A,    'REAL(8)'      Fortran 77 and
18081                    B'                            later
18082
18083
18084File: gfortran.info,  Node: SIGNAL,  Next: SIN,  Prev: SIGN,  Up: Intrinsic Procedures
18085
180869.249 'SIGNAL' -- Signal handling subroutine (or function)
18087==========================================================
18088
18089_Description_:
18090     'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
18091     HANDLER to be executed with a single integer argument when signal
18092     NUMBER occurs.  If HANDLER is an integer, it can be used to turn
18093     off handling of signal NUMBER or revert to its default action.  See
18094     'signal(2)'.
18095
18096     If 'SIGNAL' is called as a subroutine and the STATUS argument is
18097     supplied, it is set to the value returned by 'signal(2)'.
18098
18099_Standard_:
18100     GNU extension
18101
18102_Class_:
18103     Subroutine, function
18104
18105_Syntax_:
18106     'CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
18107     'STATUS = SIGNAL(NUMBER, HANDLER)'
18108
18109_Arguments_:
18110     NUMBER      Shall be a scalar integer, with 'INTENT(IN)'
18111     HANDLER     Signal handler ('INTEGER FUNCTION' or
18112                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
18113                 'INTEGER'.  It is 'INTENT(IN)'.
18114     STATUS      (Optional) STATUS shall be a scalar integer.  It
18115                 has 'INTENT(OUT)'.
18116
18117_Return value_:
18118     The 'SIGNAL' function returns the value returned by 'signal(2)'.
18119
18120_Example_:
18121          program test_signal
18122            intrinsic signal
18123            external handler_print
18124
18125            call signal (12, handler_print)
18126            call signal (10, 1)
18127
18128            call sleep (30)
18129          end program test_signal
18130
18131
18132File: gfortran.info,  Node: SIN,  Next: SIND,  Prev: SIGNAL,  Up: Intrinsic Procedures
18133
181349.250 'SIN' -- Sine function
18135============================
18136
18137_Description_:
18138     'SIN(X)' computes the sine of X.
18139
18140_Standard_:
18141     Fortran 77 and later
18142
18143_Class_:
18144     Elemental function
18145
18146_Syntax_:
18147     'RESULT = SIN(X)'
18148
18149_Arguments_:
18150     X           The type shall be 'REAL' or 'COMPLEX'.
18151
18152_Return value_:
18153     The return value has same type and kind as X.
18154
18155_Example_:
18156          program test_sin
18157            real :: x = 0.0
18158            x = sin(x)
18159          end program test_sin
18160
18161_Specific names_:
18162     Name           Argument       Return type    Standard
18163     'SIN(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
18164                                                  later
18165     'DSIN(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
18166                                                  later
18167     'CSIN(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
18168                    X'                            later
18169     'ZSIN(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18170                    X'
18171     'CDSIN(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18172                    X'
18173
18174_See also_:
18175     Inverse function: *note ASIN:: Degrees function: *note SIND::
18176
18177
18178File: gfortran.info,  Node: SIND,  Next: SINH,  Prev: SIN,  Up: Intrinsic Procedures
18179
181809.251 'SIND' -- Sine function, degrees
18181======================================
18182
18183_Description_:
18184     'SIND(X)' computes the sine of X in degrees.
18185
18186     This function is for compatibility only and should be avoided in
18187     favor of standard constructs wherever possible.
18188
18189_Standard_:
18190     GNU extension, enabled with '-fdec-math'.
18191
18192_Class_:
18193     Elemental function
18194
18195_Syntax_:
18196     'RESULT = SIND(X)'
18197
18198_Arguments_:
18199     X           The type shall be 'REAL' or 'COMPLEX'.
18200
18201_Return value_:
18202     The return value has same type and kind as X, and its value is in
18203     degrees.
18204
18205_Example_:
18206          program test_sind
18207            real :: x = 0.0
18208            x = sind(x)
18209          end program test_sind
18210
18211_Specific names_:
18212     Name           Argument       Return type    Standard
18213     'SIND(X)'      'REAL(4) X'    'REAL(4)'      GNU extension
18214     'DSIND(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
18215     'CSIND(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU extension
18216                    X'
18217     'ZSIND(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18218                    X'
18219     'CDSIND(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18220                    X'
18221
18222_See also_:
18223     Inverse function: *note ASIND:: Radians function: *note SIN::
18224
18225
18226File: gfortran.info,  Node: SINH,  Next: SIZE,  Prev: SIND,  Up: Intrinsic Procedures
18227
182289.252 'SINH' -- Hyperbolic sine function
18229========================================
18230
18231_Description_:
18232     'SINH(X)' computes the hyperbolic sine of X.
18233
18234_Standard_:
18235     Fortran 90 and later, for a complex argument Fortran 2008 or later,
18236     has a GNU extension
18237
18238_Class_:
18239     Elemental function
18240
18241_Syntax_:
18242     'RESULT = SINH(X)'
18243
18244_Arguments_:
18245     X           The type shall be 'REAL' or 'COMPLEX'.
18246
18247_Return value_:
18248     The return value has same type and kind as X.
18249
18250_Example_:
18251          program test_sinh
18252            real(8) :: x = - 1.0_8
18253            x = sinh(x)
18254          end program test_sinh
18255
18256_Specific names_:
18257     Name           Argument       Return type    Standard
18258     'DSINH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 90 and
18259                                                  later
18260
18261_See also_:
18262     *note ASINH::
18263
18264
18265File: gfortran.info,  Node: SIZE,  Next: SIZEOF,  Prev: SINH,  Up: Intrinsic Procedures
18266
182679.253 'SIZE' -- Determine the size of an array
18268==============================================
18269
18270_Description_:
18271     Determine the extent of ARRAY along a specified dimension DIM, or
18272     the total number of elements in ARRAY if DIM is absent.
18273
18274_Standard_:
18275     Fortran 90 and later, with KIND argument Fortran 2003 and later
18276
18277_Class_:
18278     Inquiry function
18279
18280_Syntax_:
18281     'RESULT = SIZE(ARRAY[, DIM [, KIND]])'
18282
18283_Arguments_:
18284     ARRAY       Shall be an array of any type.  If ARRAY is a
18285                 pointer it must be associated and allocatable
18286                 arrays must be allocated.
18287     DIM         (Optional) shall be a scalar of type 'INTEGER'
18288                 and its value shall be in the range from 1 to n,
18289                 where n equals the rank of ARRAY.
18290     KIND        (Optional) An 'INTEGER' initialization
18291                 expression indicating the kind parameter of the
18292                 result.
18293
18294_Return value_:
18295     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
18296     absent, the return value is of default integer kind.
18297
18298_Example_:
18299          PROGRAM test_size
18300            WRITE(*,*) SIZE((/ 1, 2 /))    ! 2
18301          END PROGRAM
18302
18303_See also_:
18304     *note SHAPE::, *note RESHAPE::
18305
18306
18307File: gfortran.info,  Node: SIZEOF,  Next: SLEEP,  Prev: SIZE,  Up: Intrinsic Procedures
18308
183099.254 'SIZEOF' -- Size in bytes of an expression
18310================================================
18311
18312_Description_:
18313     'SIZEOF(X)' calculates the number of bytes of storage the
18314     expression 'X' occupies.
18315
18316_Standard_:
18317     GNU extension
18318
18319_Class_:
18320     Inquiry function
18321
18322_Syntax_:
18323     'N = SIZEOF(X)'
18324
18325_Arguments_:
18326     X           The argument shall be of any type, rank or
18327                 shape.
18328
18329_Return value_:
18330     The return value is of type integer and of the system-dependent
18331     kind C_SIZE_T (from the ISO_C_BINDING module).  Its value is the
18332     number of bytes occupied by the argument.  If the argument has the
18333     'POINTER' attribute, the number of bytes of the storage area
18334     pointed to is returned.  If the argument is of a derived type with
18335     'POINTER' or 'ALLOCATABLE' components, the return value does not
18336     account for the sizes of the data pointed to by these components.
18337     If the argument is polymorphic, the size according to the dynamic
18338     type is returned.  The argument may not be a procedure or procedure
18339     pointer.  Note that the code assumes for arrays that those are
18340     contiguous; for contiguous arrays, it returns the storage or an
18341     array element multiplied by the size of the array.
18342
18343_Example_:
18344             integer :: i
18345             real :: r, s(5)
18346             print *, (sizeof(s)/sizeof(r) == 5)
18347             end
18348     The example will print '.TRUE.' unless you are using a platform
18349     where default 'REAL' variables are unusually padded.
18350
18351_See also_:
18352     *note C_SIZEOF::, *note STORAGE_SIZE::
18353
18354
18355File: gfortran.info,  Node: SLEEP,  Next: SPACING,  Prev: SIZEOF,  Up: Intrinsic Procedures
18356
183579.255 'SLEEP' -- Sleep for the specified number of seconds
18358==========================================================
18359
18360_Description_:
18361     Calling this subroutine causes the process to pause for SECONDS
18362     seconds.
18363
18364_Standard_:
18365     GNU extension
18366
18367_Class_:
18368     Subroutine
18369
18370_Syntax_:
18371     'CALL SLEEP(SECONDS)'
18372
18373_Arguments_:
18374     SECONDS     The type shall be of default 'INTEGER'.
18375
18376_Example_:
18377          program test_sleep
18378            call sleep(5)
18379          end
18380
18381
18382File: gfortran.info,  Node: SPACING,  Next: SPREAD,  Prev: SLEEP,  Up: Intrinsic Procedures
18383
183849.256 'SPACING' -- Smallest distance between two numbers of a given type
18385========================================================================
18386
18387_Description_:
18388     Determines the distance between the argument X and the nearest
18389     adjacent number of the same type.
18390
18391_Standard_:
18392     Fortran 90 and later
18393
18394_Class_:
18395     Elemental function
18396
18397_Syntax_:
18398     'RESULT = SPACING(X)'
18399
18400_Arguments_:
18401     X           Shall be of type 'REAL'.
18402
18403_Return value_:
18404     The result is of the same type as the input argument X.
18405
18406_Example_:
18407          PROGRAM test_spacing
18408            INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
18409            INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
18410
18411            WRITE(*,*) spacing(1.0_SGL)      ! "1.1920929E-07"          on i686
18412            WRITE(*,*) spacing(1.0_DBL)      ! "2.220446049250313E-016" on i686
18413          END PROGRAM
18414
18415_See also_:
18416     *note RRSPACING::
18417
18418
18419File: gfortran.info,  Node: SPREAD,  Next: SQRT,  Prev: SPACING,  Up: Intrinsic Procedures
18420
184219.257 'SPREAD' -- Add a dimension to an array
18422=============================================
18423
18424_Description_:
18425     Replicates a SOURCE array NCOPIES times along a specified dimension
18426     DIM.
18427
18428_Standard_:
18429     Fortran 90 and later
18430
18431_Class_:
18432     Transformational function
18433
18434_Syntax_:
18435     'RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
18436
18437_Arguments_:
18438     SOURCE      Shall be a scalar or an array of any type and a
18439                 rank less than seven.
18440     DIM         Shall be a scalar of type 'INTEGER' with a value
18441                 in the range from 1 to n+1, where n equals the
18442                 rank of SOURCE.
18443     NCOPIES     Shall be a scalar of type 'INTEGER'.
18444
18445_Return value_:
18446     The result is an array of the same type as SOURCE and has rank n+1
18447     where n equals the rank of SOURCE.
18448
18449_Example_:
18450          PROGRAM test_spread
18451            INTEGER :: a = 1, b(2) = (/ 1, 2 /)
18452            WRITE(*,*) SPREAD(A, 1, 2)            ! "1 1"
18453            WRITE(*,*) SPREAD(B, 1, 2)            ! "1 1 2 2"
18454          END PROGRAM
18455
18456_See also_:
18457     *note UNPACK::
18458
18459
18460File: gfortran.info,  Node: SQRT,  Next: SRAND,  Prev: SPREAD,  Up: Intrinsic Procedures
18461
184629.258 'SQRT' -- Square-root function
18463====================================
18464
18465_Description_:
18466     'SQRT(X)' computes the square root of X.
18467
18468_Standard_:
18469     Fortran 77 and later
18470
18471_Class_:
18472     Elemental function
18473
18474_Syntax_:
18475     'RESULT = SQRT(X)'
18476
18477_Arguments_:
18478     X           The type shall be 'REAL' or 'COMPLEX'.
18479
18480_Return value_:
18481     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
18482     parameter is the same as X.
18483
18484_Example_:
18485          program test_sqrt
18486            real(8) :: x = 2.0_8
18487            complex :: z = (1.0, 2.0)
18488            x = sqrt(x)
18489            z = sqrt(z)
18490          end program test_sqrt
18491
18492_Specific names_:
18493     Name           Argument       Return type    Standard
18494     'SQRT(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
18495                                                  later
18496     'DSQRT(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
18497                                                  later
18498     'CSQRT(X)'     'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
18499                    X'                            later
18500     'ZSQRT(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18501                    X'
18502     'CDSQRT(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18503                    X'
18504
18505
18506File: gfortran.info,  Node: SRAND,  Next: STAT,  Prev: SQRT,  Up: Intrinsic Procedures
18507
185089.259 'SRAND' -- Reinitialize the random number generator
18509=========================================================
18510
18511_Description_:
18512     'SRAND' reinitializes the pseudo-random number generator called by
18513     'RAND' and 'IRAND'.  The new seed used by the generator is
18514     specified by the required argument SEED.
18515
18516_Standard_:
18517     GNU extension
18518
18519_Class_:
18520     Subroutine
18521
18522_Syntax_:
18523     'CALL SRAND(SEED)'
18524
18525_Arguments_:
18526     SEED        Shall be a scalar 'INTEGER(kind=4)'.
18527
18528_Return value_:
18529     Does not return anything.
18530
18531_Example_:
18532     See 'RAND' and 'IRAND' for examples.
18533
18534_Notes_:
18535     The Fortran standard specifies the intrinsic subroutines
18536     'RANDOM_SEED' to initialize the pseudo-random number generator and
18537     'RANDOM_NUMBER' to generate pseudo-random numbers.  These
18538     subroutines should be used in new codes.
18539
18540     Please note that in GNU Fortran, these two sets of intrinsics
18541     ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and
18542     'RANDOM_SEED' on the other hand) access two independent
18543     pseudo-random number generators.
18544
18545_See also_:
18546     *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
18547
18548
18549File: gfortran.info,  Node: STAT,  Next: STORAGE_SIZE,  Prev: SRAND,  Up: Intrinsic Procedures
18550
185519.260 'STAT' -- Get file status
18552===============================
18553
18554_Description_:
18555     This function returns information about a file.  No permissions are
18556     required on the file itself, but execute (search) permission is
18557     required on all of the directories in path that lead to the file.
18558
18559     The elements that are obtained and stored in the array 'VALUES':
18560     'VALUES(1)' Device ID
18561     'VALUES(2)' Inode number
18562     'VALUES(3)' File mode
18563     'VALUES(4)' Number of links
18564     'VALUES(5)' Owner's uid
18565     'VALUES(6)' Owner's gid
18566     'VALUES(7)' ID of device containing directory entry for file
18567                 (0 if not available)
18568     'VALUES(8)' File size (bytes)
18569     'VALUES(9)' Last access time
18570     'VALUES(10)'Last modification time
18571     'VALUES(11)'Last file status change time
18572     'VALUES(12)'Preferred I/O block size (-1 if not available)
18573     'VALUES(13)'Number of blocks allocated (-1 if not available)
18574
18575     Not all these elements are relevant on all systems.  If an element
18576     is not relevant, it is returned as 0.
18577
18578     This intrinsic is provided in both subroutine and function forms;
18579     however, only one form can be used in any given program unit.
18580
18581_Standard_:
18582     GNU extension
18583
18584_Class_:
18585     Subroutine, function
18586
18587_Syntax_:
18588     'CALL STAT(NAME, VALUES [, STATUS])'
18589     'STATUS = STAT(NAME, VALUES)'
18590
18591_Arguments_:
18592     NAME        The type shall be 'CHARACTER', of the default
18593                 kind and a valid path within the file system.
18594     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
18595     STATUS      (Optional) status flag of type 'INTEGER(4)'.
18596                 Returns 0 on success and a system specific error
18597                 code otherwise.
18598
18599_Example_:
18600          PROGRAM test_stat
18601            INTEGER, DIMENSION(13) :: buff
18602            INTEGER :: status
18603
18604            CALL STAT("/etc/passwd", buff, status)
18605
18606            IF (status == 0) THEN
18607              WRITE (*, FMT="('Device ID:',               T30, I19)") buff(1)
18608              WRITE (*, FMT="('Inode number:',            T30, I19)") buff(2)
18609              WRITE (*, FMT="('File mode (octal):',       T30, O19)") buff(3)
18610              WRITE (*, FMT="('Number of links:',         T30, I19)") buff(4)
18611              WRITE (*, FMT="('Owner''s uid:',            T30, I19)") buff(5)
18612              WRITE (*, FMT="('Owner''s gid:',            T30, I19)") buff(6)
18613              WRITE (*, FMT="('Device where located:',    T30, I19)") buff(7)
18614              WRITE (*, FMT="('File size:',               T30, I19)") buff(8)
18615              WRITE (*, FMT="('Last access time:',        T30, A19)") CTIME(buff(9))
18616              WRITE (*, FMT="('Last modification time',   T30, A19)") CTIME(buff(10))
18617              WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
18618              WRITE (*, FMT="('Preferred block size:',    T30, I19)") buff(12)
18619              WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
18620            END IF
18621          END PROGRAM
18622
18623_See also_:
18624     To stat an open file: *note FSTAT:: To stat a link: *note LSTAT::
18625
18626
18627File: gfortran.info,  Node: STORAGE_SIZE,  Next: SUM,  Prev: STAT,  Up: Intrinsic Procedures
18628
186299.261 'STORAGE_SIZE' -- Storage size in bits
18630============================================
18631
18632_Description_:
18633     Returns the storage size of argument A in bits.
18634_Standard_:
18635     Fortran 2008 and later
18636_Class_:
18637     Inquiry function
18638_Syntax_:
18639     'RESULT = STORAGE_SIZE(A [, KIND])'
18640
18641_Arguments_:
18642     A           Shall be a scalar or array of any type.
18643     KIND        (Optional) shall be a scalar integer constant
18644                 expression.
18645
18646_Return Value_:
18647     The result is a scalar integer with the kind type parameter
18648     specified by KIND (or default integer type if KIND is missing).
18649     The result value is the size expressed in bits for an element of an
18650     array that has the dynamic type and type parameters of A.
18651
18652_See also_:
18653     *note C_SIZEOF::, *note SIZEOF::
18654
18655
18656File: gfortran.info,  Node: SUM,  Next: SYMLNK,  Prev: STORAGE_SIZE,  Up: Intrinsic Procedures
18657
186589.262 'SUM' -- Sum of array elements
18659====================================
18660
18661_Description_:
18662     Adds the elements of ARRAY along dimension DIM if the corresponding
18663     element in MASK is 'TRUE'.
18664
18665_Standard_:
18666     Fortran 90 and later
18667
18668_Class_:
18669     Transformational function
18670
18671_Syntax_:
18672     'RESULT = SUM(ARRAY[, MASK])'
18673     'RESULT = SUM(ARRAY, DIM[, MASK])'
18674
18675_Arguments_:
18676     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
18677                 'COMPLEX'.
18678     DIM         (Optional) shall be a scalar of type 'INTEGER'
18679                 with a value in the range from 1 to n, where n
18680                 equals the rank of ARRAY.
18681     MASK        (Optional) shall be of type 'LOGICAL' and either
18682                 be a scalar or an array of the same shape as
18683                 ARRAY.
18684
18685_Return value_:
18686     The result is of the same type as ARRAY.
18687
18688     If DIM is absent, a scalar with the sum of all elements in ARRAY is
18689     returned.  Otherwise, an array of rank n-1, where n equals the rank
18690     of ARRAY, and a shape similar to that of ARRAY with dimension DIM
18691     dropped is returned.
18692
18693_Example_:
18694          PROGRAM test_sum
18695            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
18696            print *, SUM(x)                        ! all elements, sum = 15
18697            print *, SUM(x, MASK=MOD(x, 2)==1)     ! odd elements, sum = 9
18698          END PROGRAM
18699
18700_See also_:
18701     *note PRODUCT::
18702
18703
18704File: gfortran.info,  Node: SYMLNK,  Next: SYSTEM,  Prev: SUM,  Up: Intrinsic Procedures
18705
187069.263 'SYMLNK' -- Create a symbolic link
18707========================================
18708
18709_Description_:
18710     Makes a symbolic link from file PATH1 to PATH2.  A null character
18711     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
18712     PATH2; otherwise, trailing blanks in the file names are ignored.
18713     If the STATUS argument is supplied, it contains 0 on success or a
18714     nonzero error code upon return; see 'symlink(2)'.  If the system
18715     does not supply 'symlink(2)', 'ENOSYS' is returned.
18716
18717     This intrinsic is provided in both subroutine and function forms;
18718     however, only one form can be used in any given program unit.
18719
18720_Standard_:
18721     GNU extension
18722
18723_Class_:
18724     Subroutine, function
18725
18726_Syntax_:
18727     'CALL SYMLNK(PATH1, PATH2 [, STATUS])'
18728     'STATUS = SYMLNK(PATH1, PATH2)'
18729
18730_Arguments_:
18731     PATH1       Shall be of default 'CHARACTER' type.
18732     PATH2       Shall be of default 'CHARACTER' type.
18733     STATUS      (Optional) Shall be of default 'INTEGER' type.
18734
18735_See also_:
18736     *note LINK::, *note UNLINK::
18737
18738
18739File: gfortran.info,  Node: SYSTEM,  Next: SYSTEM_CLOCK,  Prev: SYMLNK,  Up: Intrinsic Procedures
18740
187419.264 'SYSTEM' -- Execute a shell command
18742=========================================
18743
18744_Description_:
18745     Passes the command COMMAND to a shell (see 'system(3)').  If
18746     argument STATUS is present, it contains the value returned by
18747     'system(3)', which is presumably 0 if the shell command succeeded.
18748     Note that which shell is used to invoke the command is
18749     system-dependent and environment-dependent.
18750
18751     This intrinsic is provided in both subroutine and function forms;
18752     however, only one form can be used in any given program unit.
18753
18754     Note that the 'system' function need not be thread-safe.  It is the
18755     responsibility of the user to ensure that 'system' is not called
18756     concurrently.
18757
18758_Standard_:
18759     GNU extension
18760
18761_Class_:
18762     Subroutine, function
18763
18764_Syntax_:
18765     'CALL SYSTEM(COMMAND [, STATUS])'
18766     'STATUS = SYSTEM(COMMAND)'
18767
18768_Arguments_:
18769     COMMAND     Shall be of default 'CHARACTER' type.
18770     STATUS      (Optional) Shall be of default 'INTEGER' type.
18771
18772_See also_:
18773     *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
18774     standard and should considered in new code for future portability.
18775
18776
18777File: gfortran.info,  Node: SYSTEM_CLOCK,  Next: TAN,  Prev: SYSTEM,  Up: Intrinsic Procedures
18778
187799.265 'SYSTEM_CLOCK' -- Time function
18780=====================================
18781
18782_Description_:
18783     Determines the COUNT of a processor clock since an unspecified time
18784     in the past modulo COUNT_MAX, COUNT_RATE determines the number of
18785     clock ticks per second.  If the platform supports a monotonic
18786     clock, that clock is used and can, depending on the platform clock
18787     implementation, provide up to nanosecond resolution.  If a
18788     monotonic clock is not available, the implementation falls back to
18789     a realtime clock.
18790
18791     COUNT_RATE is system dependent and can vary depending on the kind
18792     of the arguments.  For KIND=4 arguments (and smaller integer
18793     kinds), COUNT represents milliseconds, while for KIND=8 arguments
18794     (and larger integer kinds), COUNT typically represents micro- or
18795     nanoseconds depending on resolution of the underlying platform
18796     clock.  COUNT_MAX usually equals 'HUGE(COUNT_MAX)'.  Note that the
18797     millisecond resolution of the KIND=4 version implies that the COUNT
18798     will wrap around in roughly 25 days.  In order to avoid issues with
18799     the wrap around and for more precise timing, please use the KIND=8
18800     version.
18801
18802     If there is no clock, or querying the clock fails, COUNT is set to
18803     '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
18804
18805     When running on a platform using the GNU C library (glibc) version
18806     2.16 or older, or a derivative thereof, the high resolution
18807     monotonic clock is available only when linking with the RT library.
18808     This can be done explicitly by adding the '-lrt' flag when linking
18809     the application, but is also done implicitly when using OpenMP.
18810
18811     On the Windows platform, the version with KIND=4 arguments uses the
18812     'GetTickCount' function, whereas the KIND=8 version uses
18813     'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'.
18814     For more information, and potential caveats, please see the
18815     platform documentation.
18816
18817_Standard_:
18818     Fortran 90 and later
18819
18820_Class_:
18821     Subroutine
18822
18823_Syntax_:
18824     'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
18825
18826_Arguments_:
18827     COUNT          (Optional) shall be a scalar of type
18828                    'INTEGER' with 'INTENT(OUT)'.
18829     COUNT_RATE     (Optional) shall be a scalar of type
18830                    'INTEGER' or 'REAL', with 'INTENT(OUT)'.
18831     COUNT_MAX      (Optional) shall be a scalar of type
18832                    'INTEGER' with 'INTENT(OUT)'.
18833
18834_Example_:
18835          PROGRAM test_system_clock
18836            INTEGER :: count, count_rate, count_max
18837            CALL SYSTEM_CLOCK(count, count_rate, count_max)
18838            WRITE(*,*) count, count_rate, count_max
18839          END PROGRAM
18840
18841_See also_:
18842     *note DATE_AND_TIME::, *note CPU_TIME::
18843
18844
18845File: gfortran.info,  Node: TAN,  Next: TAND,  Prev: SYSTEM_CLOCK,  Up: Intrinsic Procedures
18846
188479.266 'TAN' -- Tangent function
18848===============================
18849
18850_Description_:
18851     'TAN(X)' computes the tangent of X.
18852
18853_Standard_:
18854     Fortran 77 and later, for a complex argument Fortran 2008 or later
18855
18856_Class_:
18857     Elemental function
18858
18859_Syntax_:
18860     'RESULT = TAN(X)'
18861
18862_Arguments_:
18863     X           The type shall be 'REAL' or 'COMPLEX'.
18864
18865_Return value_:
18866     The return value has same type and kind as X, and its value is in
18867     radians.
18868
18869_Example_:
18870          program test_tan
18871            real(8) :: x = 0.165_8
18872            x = tan(x)
18873          end program test_tan
18874
18875_Specific names_:
18876     Name           Argument       Return type    Standard
18877     'TAN(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
18878                                                  later
18879     'DTAN(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
18880                                                  later
18881
18882_See also_:
18883     Inverse function: *note ATAN:: Degrees function: *note TAND::
18884
18885
18886File: gfortran.info,  Node: TAND,  Next: TANH,  Prev: TAN,  Up: Intrinsic Procedures
18887
188889.267 'TAND' -- Tangent function, degrees
18889=========================================
18890
18891_Description_:
18892     'TAND(X)' computes the tangent of X in degrees.
18893
18894     This function is for compatibility only and should be avoided in
18895     favor of standard constructs wherever possible.
18896
18897_Standard_:
18898     GNU extension, enabled with '-fdec-math'.
18899
18900_Class_:
18901     Elemental function
18902
18903_Syntax_:
18904     'RESULT = TAND(X)'
18905
18906_Arguments_:
18907     X           The type shall be 'REAL' or 'COMPLEX'.
18908
18909_Return value_:
18910     The return value has same type and kind as X, and its value is in
18911     degrees.
18912
18913_Example_:
18914          program test_tand
18915            real(8) :: x = 0.165_8
18916            x = tand(x)
18917          end program test_tand
18918
18919_Specific names_:
18920     Name           Argument       Return type    Standard
18921     'TAND(X)'      'REAL(4) X'    'REAL(4)'      GNU extension
18922     'DTAND(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
18923
18924_See also_:
18925     Inverse function: *note ATAND:: Radians function: *note TAN::
18926
18927
18928File: gfortran.info,  Node: TANH,  Next: THIS_IMAGE,  Prev: TAND,  Up: Intrinsic Procedures
18929
189309.268 'TANH' -- Hyperbolic tangent function
18931===========================================
18932
18933_Description_:
18934     'TANH(X)' computes the hyperbolic tangent of X.
18935
18936_Standard_:
18937     Fortran 77 and later, for a complex argument Fortran 2008 or later
18938
18939_Class_:
18940     Elemental function
18941
18942_Syntax_:
18943     'X = TANH(X)'
18944
18945_Arguments_:
18946     X           The type shall be 'REAL' or 'COMPLEX'.
18947
18948_Return value_:
18949     The return value has same type and kind as X.  If X is complex, the
18950     imaginary part of the result is in radians.  If X is 'REAL', the
18951     return value lies in the range - 1 \leq tanh(x) \leq 1 .
18952
18953_Example_:
18954          program test_tanh
18955            real(8) :: x = 2.1_8
18956            x = tanh(x)
18957          end program test_tanh
18958
18959_Specific names_:
18960     Name           Argument       Return type    Standard
18961     'TANH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
18962                                                  later
18963     'DTANH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
18964                                                  later
18965
18966_See also_:
18967     *note ATANH::
18968
18969
18970File: gfortran.info,  Node: THIS_IMAGE,  Next: TIME,  Prev: TANH,  Up: Intrinsic Procedures
18971
189729.269 'THIS_IMAGE' -- Function that returns the cosubscript index of this image
18973===============================================================================
18974
18975_Description_:
18976     Returns the cosubscript for this image.
18977
18978_Standard_:
18979     Fortran 2008 and later.  With DISTANCE argument, Technical
18980     Specification (TS) 18508 or later
18981
18982_Class_:
18983     Transformational function
18984
18985_Syntax_:
18986     'RESULT = THIS_IMAGE()'
18987     'RESULT = THIS_IMAGE(DISTANCE)'
18988     'RESULT = THIS_IMAGE(COARRAY [, DIM])'
18989
18990_Arguments_:
18991     DISTANCE    (optional, intent(in)) Nonnegative scalar
18992                 integer (not permitted together with COARRAY).
18993     COARRAY     Coarray of any type (optional; if DIM present,
18994                 required).
18995     DIM         default integer scalar (optional).  If present,
18996                 DIM shall be between one and the corank of
18997                 COARRAY.
18998
18999_Return value_:
19000     Default integer.  If COARRAY is not present, it is scalar; if
19001     DISTANCE is not present or has value 0, its value is the image
19002     index on the invoking image for the current team, for values
19003     smaller or equal distance to the initial team, it returns the image
19004     index on the ancestor team which has a distance of DISTANCE from
19005     the invoking team.  If DISTANCE is larger than the distance to the
19006     initial team, the image index of the initial team is returned.
19007     Otherwise when the COARRAY is present, if DIM is not present, a
19008     rank-1 array with corank elements is returned, containing the
19009     cosubscripts for COARRAY specifying the invoking image.  If DIM is
19010     present, a scalar is returned, with the value of the DIM element of
19011     'THIS_IMAGE(COARRAY)'.
19012
19013_Example_:
19014          INTEGER :: value[*]
19015          INTEGER :: i
19016          value = THIS_IMAGE()
19017          SYNC ALL
19018          IF (THIS_IMAGE() == 1) THEN
19019            DO i = 1, NUM_IMAGES()
19020              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
19021            END DO
19022          END IF
19023
19024          ! Check whether the current image is the initial image
19025          IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
19026            error stop "something is rotten here"
19027
19028_See also_:
19029     *note NUM_IMAGES::, *note IMAGE_INDEX::
19030
19031
19032File: gfortran.info,  Node: TIME,  Next: TIME8,  Prev: THIS_IMAGE,  Up: Intrinsic Procedures
19033
190349.270 'TIME' -- Time function
19035=============================
19036
19037_Description_:
19038     Returns the current time encoded as an integer (in the manner of
19039     the function 'time(3)' in the C standard library).  This value is
19040     suitable for passing to *note CTIME::, *note GMTIME::, and *note
19041     LTIME::.
19042
19043     This intrinsic is not fully portable, such as to systems with
19044     32-bit 'INTEGER' types but supporting times wider than 32 bits.
19045     Therefore, the values returned by this intrinsic might be, or
19046     become, negative, or numerically less than previous values, during
19047     a single run of the compiled program.
19048
19049     See *note TIME8::, for information on a similar intrinsic that
19050     might be portable to more GNU Fortran implementations, though to
19051     fewer Fortran compilers.
19052
19053_Standard_:
19054     GNU extension
19055
19056_Class_:
19057     Function
19058
19059_Syntax_:
19060     'RESULT = TIME()'
19061
19062_Return value_:
19063     The return value is a scalar of type 'INTEGER(4)'.
19064
19065_See also_:
19066     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
19067     LTIME::, *note MCLOCK::, *note TIME8::
19068
19069
19070File: gfortran.info,  Node: TIME8,  Next: TINY,  Prev: TIME,  Up: Intrinsic Procedures
19071
190729.271 'TIME8' -- Time function (64-bit)
19073=======================================
19074
19075_Description_:
19076     Returns the current time encoded as an integer (in the manner of
19077     the function 'time(3)' in the C standard library).  This value is
19078     suitable for passing to *note CTIME::, *note GMTIME::, and *note
19079     LTIME::.
19080
19081     _Warning:_ this intrinsic does not increase the range of the timing
19082     values over that returned by 'time(3)'.  On a system with a 32-bit
19083     'time(3)', 'TIME8' will return a 32-bit value, even though it is
19084     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
19085     the 32-bit value can still occur.  Therefore, the values returned
19086     by this intrinsic might be or become negative or numerically less
19087     than previous values during a single run of the compiled program.
19088
19089_Standard_:
19090     GNU extension
19091
19092_Class_:
19093     Function
19094
19095_Syntax_:
19096     'RESULT = TIME8()'
19097
19098_Return value_:
19099     The return value is a scalar of type 'INTEGER(8)'.
19100
19101_See also_:
19102     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
19103     LTIME::, *note MCLOCK8::, *note TIME::
19104
19105
19106File: gfortran.info,  Node: TINY,  Next: TRAILZ,  Prev: TIME8,  Up: Intrinsic Procedures
19107
191089.272 'TINY' -- Smallest positive number of a real kind
19109=======================================================
19110
19111_Description_:
19112     'TINY(X)' returns the smallest positive (non zero) number in the
19113     model of the type of 'X'.
19114
19115_Standard_:
19116     Fortran 90 and later
19117
19118_Class_:
19119     Inquiry function
19120
19121_Syntax_:
19122     'RESULT = TINY(X)'
19123
19124_Arguments_:
19125     X           Shall be of type 'REAL'.
19126
19127_Return value_:
19128     The return value is of the same type and kind as X
19129
19130_Example_:
19131     See 'HUGE' for an example.
19132
19133
19134File: gfortran.info,  Node: TRAILZ,  Next: TRANSFER,  Prev: TINY,  Up: Intrinsic Procedures
19135
191369.273 'TRAILZ' -- Number of trailing zero bits of an integer
19137============================================================
19138
19139_Description_:
19140     'TRAILZ' returns the number of trailing zero bits of an integer.
19141
19142_Standard_:
19143     Fortran 2008 and later
19144
19145_Class_:
19146     Elemental function
19147
19148_Syntax_:
19149     'RESULT = TRAILZ(I)'
19150
19151_Arguments_:
19152     I           Shall be of type 'INTEGER'.
19153
19154_Return value_:
19155     The type of the return value is the default 'INTEGER'.  If all the
19156     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
19157
19158_Example_:
19159          PROGRAM test_trailz
19160            WRITE (*,*) TRAILZ(8)  ! prints 3
19161          END PROGRAM
19162
19163_See also_:
19164     *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
19165
19166
19167File: gfortran.info,  Node: TRANSFER,  Next: TRANSPOSE,  Prev: TRAILZ,  Up: Intrinsic Procedures
19168
191699.274 'TRANSFER' -- Transfer bit patterns
19170=========================================
19171
19172_Description_:
19173     Interprets the bitwise representation of SOURCE in memory as if it
19174     is the representation of a variable or array of the same type and
19175     type parameters as MOLD.
19176
19177     This is approximately equivalent to the C concept of _casting_ one
19178     type to another.
19179
19180_Standard_:
19181     Fortran 90 and later
19182
19183_Class_:
19184     Transformational function
19185
19186_Syntax_:
19187     'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
19188
19189_Arguments_:
19190     SOURCE      Shall be a scalar or an array of any type.
19191     MOLD        Shall be a scalar or an array of any type.
19192     SIZE        (Optional) shall be a scalar of type 'INTEGER'.
19193
19194_Return value_:
19195     The result has the same type as MOLD, with the bit level
19196     representation of SOURCE.  If SIZE is present, the result is a
19197     one-dimensional array of length SIZE.  If SIZE is absent but MOLD
19198     is an array (of any size or shape), the result is a one-
19199     dimensional array of the minimum length needed to contain the
19200     entirety of the bitwise representation of SOURCE.  If SIZE is
19201     absent and MOLD is a scalar, the result is a scalar.
19202
19203     If the bitwise representation of the result is longer than that of
19204     SOURCE, then the leading bits of the result correspond to those of
19205     SOURCE and any trailing bits are filled arbitrarily.
19206
19207     When the resulting bit representation does not correspond to a
19208     valid representation of a variable of the same type as MOLD, the
19209     results are undefined, and subsequent operations on the result
19210     cannot be guaranteed to produce sensible behavior.  For example, it
19211     is possible to create 'LOGICAL' variables for which 'VAR' and
19212     '.NOT.VAR' both appear to be true.
19213
19214_Example_:
19215          PROGRAM test_transfer
19216            integer :: x = 2143289344
19217            print *, transfer(x, 1.0)    ! prints "NaN" on i686
19218          END PROGRAM
19219
19220
19221File: gfortran.info,  Node: TRANSPOSE,  Next: TRIM,  Prev: TRANSFER,  Up: Intrinsic Procedures
19222
192239.275 'TRANSPOSE' -- Transpose an array of rank two
19224===================================================
19225
19226_Description_:
19227     Transpose an array of rank two.  Element (i, j) of the result has
19228     the value 'MATRIX(j, i)', for all i, j.
19229
19230_Standard_:
19231     Fortran 90 and later
19232
19233_Class_:
19234     Transformational function
19235
19236_Syntax_:
19237     'RESULT = TRANSPOSE(MATRIX)'
19238
19239_Arguments_:
19240     MATRIX      Shall be an array of any type and have a rank of
19241                 two.
19242
19243_Return value_:
19244     The result has the same type as MATRIX, and has shape '(/ m, n /)'
19245     if MATRIX has shape '(/ n, m /)'.
19246
19247
19248File: gfortran.info,  Node: TRIM,  Next: TTYNAM,  Prev: TRANSPOSE,  Up: Intrinsic Procedures
19249
192509.276 'TRIM' -- Remove trailing blank characters of a string
19251============================================================
19252
19253_Description_:
19254     Removes trailing blank characters of a string.
19255
19256_Standard_:
19257     Fortran 90 and later
19258
19259_Class_:
19260     Transformational function
19261
19262_Syntax_:
19263     'RESULT = TRIM(STRING)'
19264
19265_Arguments_:
19266     STRING      Shall be a scalar of type 'CHARACTER'.
19267
19268_Return value_:
19269     A scalar of type 'CHARACTER' which length is that of STRING less
19270     the number of trailing blanks.
19271
19272_Example_:
19273          PROGRAM test_trim
19274            CHARACTER(len=10), PARAMETER :: s = "GFORTRAN  "
19275            WRITE(*,*) LEN(s), LEN(TRIM(s))  ! "10 8", with/without trailing blanks
19276          END PROGRAM
19277
19278_See also_:
19279     *note ADJUSTL::, *note ADJUSTR::
19280
19281
19282File: gfortran.info,  Node: TTYNAM,  Next: UBOUND,  Prev: TRIM,  Up: Intrinsic Procedures
19283
192849.277 'TTYNAM' -- Get the name of a terminal device.
19285====================================================
19286
19287_Description_:
19288     Get the name of a terminal device.  For more information, see
19289     'ttyname(3)'.
19290
19291     This intrinsic is provided in both subroutine and function forms;
19292     however, only one form can be used in any given program unit.
19293
19294_Standard_:
19295     GNU extension
19296
19297_Class_:
19298     Subroutine, function
19299
19300_Syntax_:
19301     'CALL TTYNAM(UNIT, NAME)'
19302     'NAME = TTYNAM(UNIT)'
19303
19304_Arguments_:
19305     UNIT        Shall be a scalar 'INTEGER'.
19306     NAME        Shall be of type 'CHARACTER'.
19307
19308_Example_:
19309          PROGRAM test_ttynam
19310            INTEGER :: unit
19311            DO unit = 1, 10
19312              IF (isatty(unit=unit)) write(*,*) ttynam(unit)
19313            END DO
19314          END PROGRAM
19315
19316_See also_:
19317     *note ISATTY::
19318
19319
19320File: gfortran.info,  Node: UBOUND,  Next: UCOBOUND,  Prev: TTYNAM,  Up: Intrinsic Procedures
19321
193229.278 'UBOUND' -- Upper dimension bounds of an array
19323====================================================
19324
19325_Description_:
19326     Returns the upper bounds of an array, or a single upper bound along
19327     the DIM dimension.
19328_Standard_:
19329     Fortran 90 and later, with KIND argument Fortran 2003 and later
19330
19331_Class_:
19332     Inquiry function
19333
19334_Syntax_:
19335     'RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
19336
19337_Arguments_:
19338     ARRAY       Shall be an array, of any type.
19339     DIM         (Optional) Shall be a scalar 'INTEGER'.
19340     KIND        (Optional) An 'INTEGER' initialization
19341                 expression indicating the kind parameter of the
19342                 result.
19343
19344_Return value_:
19345     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19346     absent, the return value is of default integer kind.  If DIM is
19347     absent, the result is an array of the upper bounds of ARRAY.  If
19348     DIM is present, the result is a scalar corresponding to the upper
19349     bound of the array along that dimension.  If ARRAY is an expression
19350     rather than a whole array or array structure component, or if it
19351     has a zero extent along the relevant dimension, the upper bound is
19352     taken to be the number of elements along the relevant dimension.
19353
19354_See also_:
19355     *note LBOUND::, *note LCOBOUND::
19356
19357
19358File: gfortran.info,  Node: UCOBOUND,  Next: UMASK,  Prev: UBOUND,  Up: Intrinsic Procedures
19359
193609.279 'UCOBOUND' -- Upper codimension bounds of an array
19361========================================================
19362
19363_Description_:
19364     Returns the upper cobounds of a coarray, or a single upper cobound
19365     along the DIM codimension.
19366_Standard_:
19367     Fortran 2008 and later
19368
19369_Class_:
19370     Inquiry function
19371
19372_Syntax_:
19373     'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
19374
19375_Arguments_:
19376     ARRAY       Shall be an coarray, of any type.
19377     DIM         (Optional) Shall be a scalar 'INTEGER'.
19378     KIND        (Optional) An 'INTEGER' initialization
19379                 expression indicating the kind parameter of the
19380                 result.
19381
19382_Return value_:
19383     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19384     absent, the return value is of default integer kind.  If DIM is
19385     absent, the result is an array of the lower cobounds of COARRAY.
19386     If DIM is present, the result is a scalar corresponding to the
19387     lower cobound of the array along that codimension.
19388
19389_See also_:
19390     *note LCOBOUND::, *note LBOUND::
19391
19392
19393File: gfortran.info,  Node: UMASK,  Next: UNLINK,  Prev: UCOBOUND,  Up: Intrinsic Procedures
19394
193959.280 'UMASK' -- Set the file creation mask
19396===========================================
19397
19398_Description_:
19399     Sets the file creation mask to MASK.  If called as a function, it
19400     returns the old value.  If called as a subroutine and argument OLD
19401     if it is supplied, it is set to the old value.  See 'umask(2)'.
19402
19403_Standard_:
19404     GNU extension
19405
19406_Class_:
19407     Subroutine, function
19408
19409_Syntax_:
19410     'CALL UMASK(MASK [, OLD])'
19411     'OLD = UMASK(MASK)'
19412
19413_Arguments_:
19414     MASK        Shall be a scalar of type 'INTEGER'.
19415     OLD         (Optional) Shall be a scalar of type 'INTEGER'.
19416
19417
19418File: gfortran.info,  Node: UNLINK,  Next: UNPACK,  Prev: UMASK,  Up: Intrinsic Procedures
19419
194209.281 'UNLINK' -- Remove a file from the file system
19421====================================================
19422
19423_Description_:
19424     Unlinks the file PATH.  A null character ('CHAR(0)') can be used to
19425     mark the end of the name in PATH; otherwise, trailing blanks in the
19426     file name are ignored.  If the STATUS argument is supplied, it
19427     contains 0 on success or a nonzero error code upon return; see
19428     'unlink(2)'.
19429
19430     This intrinsic is provided in both subroutine and function forms;
19431     however, only one form can be used in any given program unit.
19432
19433_Standard_:
19434     GNU extension
19435
19436_Class_:
19437     Subroutine, function
19438
19439_Syntax_:
19440     'CALL UNLINK(PATH [, STATUS])'
19441     'STATUS = UNLINK(PATH)'
19442
19443_Arguments_:
19444     PATH        Shall be of default 'CHARACTER' type.
19445     STATUS      (Optional) Shall be of default 'INTEGER' type.
19446
19447_See also_:
19448     *note LINK::, *note SYMLNK::
19449
19450
19451File: gfortran.info,  Node: UNPACK,  Next: VERIFY,  Prev: UNLINK,  Up: Intrinsic Procedures
19452
194539.282 'UNPACK' -- Unpack an array of rank one into an array
19454===========================================================
19455
19456_Description_:
19457     Store the elements of VECTOR in an array of higher rank.
19458
19459_Standard_:
19460     Fortran 90 and later
19461
19462_Class_:
19463     Transformational function
19464
19465_Syntax_:
19466     'RESULT = UNPACK(VECTOR, MASK, FIELD)'
19467
19468_Arguments_:
19469     VECTOR      Shall be an array of any type and rank one.  It
19470                 shall have at least as many elements as MASK has
19471                 'TRUE' values.
19472     MASK        Shall be an array of type 'LOGICAL'.
19473     FIELD       Shall be of the same type as VECTOR and have the
19474                 same shape as MASK.
19475
19476_Return value_:
19477     The resulting array corresponds to FIELD with 'TRUE' elements of
19478     MASK replaced by values from VECTOR in array element order.
19479
19480_Example_:
19481          PROGRAM test_unpack
19482            integer :: vector(2)  = (/1,1/)
19483            logical :: mask(4)  = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
19484            integer :: field(2,2) = 0, unity(2,2)
19485
19486            ! result: unity matrix
19487            unity = unpack(vector, reshape(mask, (/2,2/)), field)
19488          END PROGRAM
19489
19490_See also_:
19491     *note PACK::, *note SPREAD::
19492
19493
19494File: gfortran.info,  Node: VERIFY,  Next: XOR,  Prev: UNPACK,  Up: Intrinsic Procedures
19495
194969.283 'VERIFY' -- Scan a string for characters not a given set
19497==============================================================
19498
19499_Description_:
19500     Verifies that all the characters in STRING belong to the set of
19501     characters in SET.
19502
19503     If BACK is either absent or equals 'FALSE', this function returns
19504     the position of the leftmost character of STRING that is not in
19505     SET.  If BACK equals 'TRUE', the rightmost position is returned.
19506     If all characters of STRING are found in SET, the result is zero.
19507
19508_Standard_:
19509     Fortran 90 and later, with KIND argument Fortran 2003 and later
19510
19511_Class_:
19512     Elemental function
19513
19514_Syntax_:
19515     'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
19516
19517_Arguments_:
19518     STRING      Shall be of type 'CHARACTER'.
19519     SET         Shall be of type 'CHARACTER'.
19520     BACK        (Optional) shall be of type 'LOGICAL'.
19521     KIND        (Optional) An 'INTEGER' initialization
19522                 expression indicating the kind parameter of the
19523                 result.
19524
19525_Return value_:
19526     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19527     absent, the return value is of default integer kind.
19528
19529_Example_:
19530          PROGRAM test_verify
19531            WRITE(*,*) VERIFY("FORTRAN", "AO")           ! 1, found 'F'
19532            WRITE(*,*) VERIFY("FORTRAN", "FOO")          ! 3, found 'R'
19533            WRITE(*,*) VERIFY("FORTRAN", "C++")          ! 1, found 'F'
19534            WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.)  ! 7, found 'N'
19535            WRITE(*,*) VERIFY("FORTRAN", "FORTRAN")      ! 0' found none
19536          END PROGRAM
19537
19538_See also_:
19539     *note SCAN::, *note INDEX intrinsic::
19540
19541
19542File: gfortran.info,  Node: XOR,  Prev: VERIFY,  Up: Intrinsic Procedures
19543
195449.284 'XOR' -- Bitwise logical exclusive OR
19545===========================================
19546
19547_Description_:
19548     Bitwise logical exclusive or.
19549
19550     This intrinsic routine is provided for backwards compatibility with
19551     GNU Fortran 77.  For integer arguments, programmers should consider
19552     the use of the *note IEOR:: intrinsic and for logical arguments the
19553     '.NEQV.' operator, which are both defined by the Fortran standard.
19554
19555_Standard_:
19556     GNU extension
19557
19558_Class_:
19559     Function
19560
19561_Syntax_:
19562     'RESULT = XOR(I, J)'
19563
19564_Arguments_:
19565     I           The type shall be either a scalar 'INTEGER' type
19566                 or a scalar 'LOGICAL' type or a
19567                 boz-literal-constant.
19568     J           The type shall be the same as the type of I or a
19569                 boz-literal-constant.  I and J shall not both be
19570                 boz-literal-constants.  If either I and J is a
19571                 boz-literal-constant, then the other argument
19572                 must be a scalar 'INTEGER'.
19573
19574_Return value_:
19575     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
19576     If the kind type parameters differ, then the smaller kind type is
19577     implicitly converted to larger kind, and the return has the larger
19578     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
19579     kind type parameter of the other argument as-if a call to *note
19580     INT:: occurred.
19581
19582_Example_:
19583          PROGRAM test_xor
19584            LOGICAL :: T = .TRUE., F = .FALSE.
19585            INTEGER :: a, b
19586            DATA a / Z'F' /, b / Z'3' /
19587
19588            WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
19589            WRITE (*,*) XOR(a, b)
19590          END PROGRAM
19591
19592_See also_:
19593     Fortran 95 elemental function: *note IEOR::
19594
19595
19596File: gfortran.info,  Node: Intrinsic Modules,  Next: Contributing,  Prev: Intrinsic Procedures,  Up: Top
19597
1959810 Intrinsic Modules
19599********************
19600
19601* Menu:
19602
19603* ISO_FORTRAN_ENV::
19604* ISO_C_BINDING::
19605* IEEE modules::
19606* OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
19607* OpenACC Module OPENACC::
19608
19609
19610File: gfortran.info,  Node: ISO_FORTRAN_ENV,  Next: ISO_C_BINDING,  Up: Intrinsic Modules
19611
1961210.1 'ISO_FORTRAN_ENV'
19613======================
19614
19615_Standard_:
19616     Fortran 2003 and later, except when otherwise noted
19617
19618   The 'ISO_FORTRAN_ENV' module provides the following scalar
19619default-integer named constants:
19620
19621'ATOMIC_INT_KIND':
19622     Default-kind integer constant to be used as kind parameter when
19623     defining integer variables used in atomic operations.  (Fortran
19624     2008 or later.)
19625
19626'ATOMIC_LOGICAL_KIND':
19627     Default-kind integer constant to be used as kind parameter when
19628     defining logical variables used in atomic operations.  (Fortran
19629     2008 or later.)
19630
19631'CHARACTER_KINDS':
19632     Default-kind integer constant array of rank one containing the
19633     supported kind parameters of the 'CHARACTER' type.  (Fortran 2008
19634     or later.)
19635
19636'CHARACTER_STORAGE_SIZE':
19637     Size in bits of the character storage unit.
19638
19639'ERROR_UNIT':
19640     Identifies the preconnected unit used for error reporting.
19641
19642'FILE_STORAGE_SIZE':
19643     Size in bits of the file-storage unit.
19644
19645'INPUT_UNIT':
19646     Identifies the preconnected unit identified by the asterisk ('*')
19647     in 'READ' statement.
19648
19649'INT8', 'INT16', 'INT32', 'INT64':
19650     Kind type parameters to specify an INTEGER type with a storage size
19651     of 16, 32, and 64 bits.  It is negative if a target platform does
19652     not support the particular kind.  (Fortran 2008 or later.)
19653
19654'INTEGER_KINDS':
19655     Default-kind integer constant array of rank one containing the
19656     supported kind parameters of the 'INTEGER' type.  (Fortran 2008 or
19657     later.)
19658
19659'IOSTAT_END':
19660     The value assigned to the variable passed to the 'IOSTAT='
19661     specifier of an input/output statement if an end-of-file condition
19662     occurred.
19663
19664'IOSTAT_EOR':
19665     The value assigned to the variable passed to the 'IOSTAT='
19666     specifier of an input/output statement if an end-of-record
19667     condition occurred.
19668
19669'IOSTAT_INQUIRE_INTERNAL_UNIT':
19670     Scalar default-integer constant, used by 'INQUIRE' for the
19671     'IOSTAT=' specifier to denote an that a unit number identifies an
19672     internal unit.  (Fortran 2008 or later.)
19673
19674'NUMERIC_STORAGE_SIZE':
19675     The size in bits of the numeric storage unit.
19676
19677'LOGICAL_KINDS':
19678     Default-kind integer constant array of rank one containing the
19679     supported kind parameters of the 'LOGICAL' type.  (Fortran 2008 or
19680     later.)
19681
19682'OUTPUT_UNIT':
19683     Identifies the preconnected unit identified by the asterisk ('*')
19684     in 'WRITE' statement.
19685
19686'REAL32', 'REAL64', 'REAL128':
19687     Kind type parameters to specify a REAL type with a storage size of
19688     32, 64, and 128 bits.  It is negative if a target platform does not
19689     support the particular kind.  (Fortran 2008 or later.)
19690
19691'REAL_KINDS':
19692     Default-kind integer constant array of rank one containing the
19693     supported kind parameters of the 'REAL' type.  (Fortran 2008 or
19694     later.)
19695
19696'STAT_LOCKED':
19697     Scalar default-integer constant used as STAT= return value by
19698     'LOCK' to denote that the lock variable is locked by the executing
19699     image.  (Fortran 2008 or later.)
19700
19701'STAT_LOCKED_OTHER_IMAGE':
19702     Scalar default-integer constant used as STAT= return value by
19703     'UNLOCK' to denote that the lock variable is locked by another
19704     image.  (Fortran 2008 or later.)
19705
19706'STAT_STOPPED_IMAGE':
19707     Positive, scalar default-integer constant used as STAT= return
19708     value if the argument in the statement requires synchronisation
19709     with an image, which has initiated the termination of the
19710     execution.  (Fortran 2008 or later.)
19711
19712'STAT_FAILED_IMAGE':
19713     Positive, scalar default-integer constant used as STAT= return
19714     value if the argument in the statement requires communication with
19715     an image, which has is in the failed state.  (TS 18508 or later.)
19716
19717'STAT_UNLOCKED':
19718     Scalar default-integer constant used as STAT= return value by
19719     'UNLOCK' to denote that the lock variable is unlocked.  (Fortran
19720     2008 or later.)
19721
19722   The module provides the following derived type:
19723
19724'LOCK_TYPE':
19725     Derived type with private components to be use with the 'LOCK' and
19726     'UNLOCK' statement.  A variable of its type has to be always
19727     declared as coarray and may not appear in a variable-definition
19728     context.  (Fortran 2008 or later.)
19729
19730   The module also provides the following intrinsic procedures: *note
19731COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
19732
19733
19734File: gfortran.info,  Node: ISO_C_BINDING,  Next: IEEE modules,  Prev: ISO_FORTRAN_ENV,  Up: Intrinsic Modules
19735
1973610.2 'ISO_C_BINDING'
19737====================
19738
19739_Standard_:
19740     Fortran 2003 and later, GNU extensions
19741
19742   The following intrinsic procedures are provided by the module; their
19743definition can be found in the section Intrinsic Procedures of this
19744manual.
19745
19746'C_ASSOCIATED'
19747'C_F_POINTER'
19748'C_F_PROCPOINTER'
19749'C_FUNLOC'
19750'C_LOC'
19751'C_SIZEOF'
19752
19753   The 'ISO_C_BINDING' module provides the following named constants of
19754type default integer, which can be used as KIND type parameters.
19755
19756   In addition to the integer named constants required by the Fortran
197572003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
19758extension named constants for the 128-bit integer types supported by the
19759C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
19760Furthermore, if '__float128' is supported in C, the named constants
19761'C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
19762
19763Fortran     Named constant            C type                    Extension
19764Type
19765'INTEGER'   'C_INT'                   'int'
19766'INTEGER'   'C_SHORT'                 'short int'
19767'INTEGER'   'C_LONG'                  'long int'
19768'INTEGER'   'C_LONG_LONG'             'long long int'
19769'INTEGER'   'C_SIGNED_CHAR'           'signed char'/'unsigned
19770                                      char'
19771'INTEGER'   'C_SIZE_T'                'size_t'
19772'INTEGER'   'C_INT8_T'                'int8_t'
19773'INTEGER'   'C_INT16_T'               'int16_t'
19774'INTEGER'   'C_INT32_T'               'int32_t'
19775'INTEGER'   'C_INT64_T'               'int64_t'
19776'INTEGER'   'C_INT128_T'              'int128_t'                Ext.
19777'INTEGER'   'C_INT_LEAST8_T'          'int_least8_t'
19778'INTEGER'   'C_INT_LEAST16_T'         'int_least16_t'
19779'INTEGER'   'C_INT_LEAST32_T'         'int_least32_t'
19780'INTEGER'   'C_INT_LEAST64_T'         'int_least64_t'
19781'INTEGER'   'C_INT_LEAST128_T'        'int_least128_t'          Ext.
19782'INTEGER'   'C_INT_FAST8_T'           'int_fast8_t'
19783'INTEGER'   'C_INT_FAST16_T'          'int_fast16_t'
19784'INTEGER'   'C_INT_FAST32_T'          'int_fast32_t'
19785'INTEGER'   'C_INT_FAST64_T'          'int_fast64_t'
19786'INTEGER'   'C_INT_FAST128_T'         'int_fast128_t'           Ext.
19787'INTEGER'   'C_INTMAX_T'              'intmax_t'
19788'INTEGER'   'C_INTPTR_T'              'intptr_t'
19789'INTEGER'   'C_PTRDIFF_T'             'ptrdiff_t'               TS 29113
19790'REAL'      'C_FLOAT'                 'float'
19791'REAL'      'C_DOUBLE'                'double'
19792'REAL'      'C_LONG_DOUBLE'           'long double'
19793'REAL'      'C_FLOAT128'              '__float128'              Ext.
19794'COMPLEX'   'C_FLOAT_COMPLEX'         'float _Complex'
19795'COMPLEX'   'C_DOUBLE_COMPLEX'        'double _Complex'
19796'COMPLEX'   'C_LONG_DOUBLE_COMPLEX'   'long double _Complex'
19797'REAL'      'C_FLOAT128_COMPLEX'      '__float128 _Complex'     Ext.
19798'LOGICAL'   'C_BOOL'                  '_Bool'
19799'CHARACTER' 'C_CHAR'                  'char'
19800
19801   Additionally, the following parameters of type
19802'CHARACTER(KIND=C_CHAR)' are defined.
19803
19804Name           C definition                     Value
19805'C_NULL_CHAR'  null character                   ''\0''
19806'C_ALERT'      alert                            ''\a''
19807'C_BACKSPACE'  backspace                        ''\b''
19808'C_FORM_FEED'  form feed                        ''\f''
19809'C_NEW_LINE'   new line                         ''\n''
19810'C_CARRIAGE_RETURN'carriage return              ''\r''
19811'C_HORIZONTAL_TAB'horizontal tab                ''\t''
19812'C_VERTICAL_TAB'vertical tab                    ''\v''
19813
19814   Moreover, the following two named constants are defined:
19815
19816Name           Type
19817'C_NULL_PTR'   'C_PTR'
19818'C_NULL_FUNPTR''C_FUNPTR'
19819
19820   Both are equivalent to the value 'NULL' in C.
19821
19822
19823File: gfortran.info,  Node: IEEE modules,  Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Prev: ISO_C_BINDING,  Up: Intrinsic Modules
19824
1982510.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19826============================================================================
19827
19828_Standard_:
19829     Fortran 2003 and later
19830
19831   The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19832intrinsic modules provide support for exceptions and IEEE arithmetic, as
19833defined in Fortran 2003 and later standards, and the IEC 60559:1989
19834standard (_Binary floating-point arithmetic for microprocessor
19835systems_).  These modules are only provided on the following supported
19836platforms:
19837
19838   * i386 and x86_64 processors
19839   * platforms which use the GNU C Library (glibc)
19840   * platforms with support for SysV/386 routines for floating point
19841     interface (including Solaris and BSDs)
19842   * platforms with the AIX OS
19843
19844   For full compliance with the Fortran standards, code using the
19845'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with
19846the following options: '-fno-unsafe-math-optimizations -frounding-math
19847-fsignaling-nans'.
19848
19849
19850File: gfortran.info,  Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Next: OpenACC Module OPENACC,  Prev: IEEE modules,  Up: Intrinsic Modules
19851
1985210.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS'
19853=================================================
19854
19855_Standard_:
19856     OpenMP Application Program Interface v4.5
19857
19858   The OpenMP Fortran runtime library routines are provided both in a
19859form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and
19860in a form of a Fortran 'include' file named 'omp_lib.h'.  The procedures
19861provided by 'OMP_LIB' can be found in the *note Introduction:
19862(libgomp)Top. manual, the named constants defined in the modules are
19863listed below.
19864
19865   For details refer to the actual OpenMP Application Program Interface
19866v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf).  And for
19867the 'pause'-related constants to the OpenMP 5.0 specification.
19868
19869   'OMP_LIB_KINDS' provides the following scalar default-integer named
19870constants:
19871
19872'omp_lock_kind'
19873'omp_lock_hint_kind'
19874'omp_nest_lock_kind'
19875'omp_pause_resource_kind'
19876'omp_proc_bind_kind'
19877'omp_sched_kind'
19878
19879   'OMP_LIB' provides the scalar default-integer named constant
19880'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the
19881year and MM the month of the OpenMP version; for OpenMP v4.5 the value
19882is '201511'.
19883
19884   The following scalar integer named constants of the kind
19885'omp_sched_kind':
19886
19887'omp_sched_static'
19888'omp_sched_dynamic'
19889'omp_sched_guided'
19890'omp_sched_auto'
19891
19892   And the following scalar integer named constants of the kind
19893'omp_proc_bind_kind':
19894
19895'omp_proc_bind_false'
19896'omp_proc_bind_true'
19897'omp_proc_bind_master'
19898'omp_proc_bind_close'
19899'omp_proc_bind_spread'
19900
19901   The following scalar integer named constants are of the kind
19902'omp_lock_hint_kind':
19903
19904'omp_lock_hint_none'
19905'omp_lock_hint_uncontended'
19906'omp_lock_hint_contended'
19907'omp_lock_hint_nonspeculative'
19908'omp_lock_hint_speculative'
19909
19910   And the following two scalar integer named constants are of the kind
19911'omp_pause_resource_kind':
19912
19913'omp_pause_soft'
19914'omp_pause_hard'
19915
19916
19917File: gfortran.info,  Node: OpenACC Module OPENACC,  Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Up: Intrinsic Modules
19918
1991910.5 OpenACC Module 'OPENACC'
19920=============================
19921
19922_Standard_:
19923     OpenACC Application Programming Interface v2.6
19924
19925   The OpenACC Fortran runtime library routines are provided both in a
19926form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran
19927'include' file named 'openacc_lib.h'.  The procedures provided by
19928'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
19929the named constants defined in the modules are listed below.
19930
19931   For details refer to the actual OpenACC Application Programming
19932Interface v2.6 (http://www.openacc.org/).
19933
19934   'OPENACC' provides the scalar default-integer named constant
19935'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the
19936year and MM the month of the OpenACC version; for OpenACC v2.6 the value
19937is '201711'.
19938
19939
19940File: gfortran.info,  Node: Contributing,  Next: Copying,  Prev: Intrinsic Modules,  Up: Top
19941
19942Contributing
19943************
19944
19945Free software is only possible if people contribute to efforts to create
19946it.  We're always in need of more people helping out with ideas and
19947comments, writing documentation and contributing code.
19948
19949   If you want to contribute to GNU Fortran, have a look at the long
19950lists of projects you can take on.  Some of these projects are small,
19951some of them are large; some are completely orthogonal to the rest of
19952what is happening on GNU Fortran, but others are "mainstream" projects
19953in need of enthusiastic hackers.  All of these projects are important!
19954We will eventually get around to the things here, but they are also
19955things doable by someone who is willing and able.
19956
19957* Menu:
19958
19959* Contributors::
19960* Projects::
19961* Proposed Extensions::
19962
19963
19964File: gfortran.info,  Node: Contributors,  Next: Projects,  Up: Contributing
19965
19966Contributors to GNU Fortran
19967===========================
19968
19969Most of the parser was hand-crafted by _Andy Vaught_, who is also the
19970initiator of the whole project.  Thanks Andy!  Most of the interface
19971with GCC was written by _Paul Brook_.
19972
19973   The following individuals have contributed code and/or ideas and
19974significant help to the GNU Fortran project (in alphabetical order):
19975
19976   - Janne Blomqvist
19977   - Steven Bosscher
19978   - Paul Brook
19979   - Tobias Burnus
19980   - Franc,ois-Xavier Coudert
19981   - Bud Davis
19982   - Jerry DeLisle
19983   - Erik Edelmann
19984   - Bernhard Fischer
19985   - Daniel Franke
19986   - Richard Guenther
19987   - Richard Henderson
19988   - Katherine Holcomb
19989   - Jakub Jelinek
19990   - Niels Kristian Bech Jensen
19991   - Steven Johnson
19992   - Steven G. Kargl
19993   - Thomas Koenig
19994   - Asher Langton
19995   - H. J. Lu
19996   - Toon Moene
19997   - Brooks Moses
19998   - Andrew Pinski
19999   - Tim Prince
20000   - Christopher D. Rickett
20001   - Richard Sandiford
20002   - Tobias Schlu"ter
20003   - Roger Sayle
20004   - Paul Thomas
20005   - Andy Vaught
20006   - Feng Wang
20007   - Janus Weil
20008   - Daniel Kraft
20009
20010   The following people have contributed bug reports, smaller or larger
20011patches, and much needed feedback and encouragement for the GNU Fortran
20012project:
20013
20014   - Bill Clodius
20015   - Dominique d'Humie`res
20016   - Kate Hedstrom
20017   - Erik Schnetter
20018   - Joost VandeVondele
20019
20020   Many other individuals have helped debug, test and improve the GNU
20021Fortran compiler over the past few years, and we welcome you to do the
20022same!  If you already have done so, and you would like to see your name
20023listed in the list above, please contact us.
20024
20025
20026File: gfortran.info,  Node: Projects,  Next: Proposed Extensions,  Prev: Contributors,  Up: Contributing
20027
20028Projects
20029========
20030
20031_Help build the test suite_
20032     Solicit more code for donation to the test suite: the more
20033     extensive the testsuite, the smaller the risk of breaking things in
20034     the future!  We can keep code private on request.
20035
20036_Bug hunting/squishing_
20037     Find bugs and write more test cases!  Test cases are especially
20038     very welcome, because it allows us to concentrate on fixing bugs
20039     instead of isolating them.  Going through the bugzilla database at
20040     <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there
20041     and add more information (for example, for which version does the
20042     testcase work, for which versions does it fail?)  is also very
20043     helpful.
20044
20045
20046File: gfortran.info,  Node: Proposed Extensions,  Prev: Projects,  Up: Contributing
20047
20048Proposed Extensions
20049===================
20050
20051Here's a list of proposed extensions for the GNU Fortran compiler, in no
20052particular order.  Most of these are necessary to be fully compatible
20053with existing Fortran compilers, but they are not part of the official
20054J3 Fortran 95 standard.
20055
20056Compiler extensions:
20057--------------------
20058
20059   * User-specified alignment rules for structures.
20060
20061   * Automatically extend single precision constants to double.
20062
20063   * Compile code that conserves memory by dynamically allocating common
20064     and module storage either on stack or heap.
20065
20066   * Compile flag to generate code for array conformance checking
20067     (suggest -CC).
20068
20069   * User control of symbol names (underscores, etc).
20070
20071   * Compile setting for maximum size of stack frame size before
20072     spilling parts to static or heap.
20073
20074   * Flag to force local variables into static space.
20075
20076   * Flag to force local variables onto stack.
20077
20078Environment Options
20079-------------------
20080
20081   * Pluggable library modules for random numbers, linear algebra.  LA
20082     should use BLAS calling conventions.
20083
20084   * Environment variables controlling actions on arithmetic exceptions
20085     like overflow, underflow, precision loss--Generate NaN, abort,
20086     default.  action.
20087
20088   * Set precision for fp units that support it (i387).
20089
20090   * Variable for setting fp rounding mode.
20091
20092   * Variable to fill uninitialized variables with a user-defined bit
20093     pattern.
20094
20095   * Environment variable controlling filename that is opened for that
20096     unit number.
20097
20098   * Environment variable to clear/trash memory being freed.
20099
20100   * Environment variable to control tracing of allocations and frees.
20101
20102   * Environment variable to display allocated memory at normal program
20103     end.
20104
20105   * Environment variable for filename for * IO-unit.
20106
20107   * Environment variable for temporary file directory.
20108
20109   * Environment variable forcing standard output to be line buffered
20110     (Unix).
20111
20112
20113File: gfortran.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Contributing,  Up: Top
20114
20115GNU General Public License
20116**************************
20117
20118                        Version 3, 29 June 2007
20119
20120     Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
20121
20122     Everyone is permitted to copy and distribute verbatim copies of this
20123     license document, but changing it is not allowed.
20124
20125Preamble
20126========
20127
20128The GNU General Public License is a free, copyleft license for software
20129and other kinds of works.
20130
20131   The licenses for most software and other practical works are designed
20132to take away your freedom to share and change the works.  By contrast,
20133the GNU General Public License is intended to guarantee your freedom to
20134share and change all versions of a program-to make sure it remains free
20135software for all its users.  We, the Free Software Foundation, use the
20136GNU General Public License for most of our software; it applies also to
20137any other work released this way by its authors.  You can apply it to
20138your programs, too.
20139
20140   When we speak of free software, we are referring to freedom, not
20141price.  Our General Public Licenses are designed to make sure that you
20142have the freedom to distribute copies of free software (and charge for
20143them if you wish), that you receive source code or can get it if you
20144want it, that you can change the software or use pieces of it in new
20145free programs, and that you know you can do these things.
20146
20147   To protect your rights, we need to prevent others from denying you
20148these rights or asking you to surrender the rights.  Therefore, you have
20149certain responsibilities if you distribute copies of the software, or if
20150you modify it: responsibilities to respect the freedom of others.
20151
20152   For example, if you distribute copies of such a program, whether
20153gratis or for a fee, you must pass on to the recipients the same
20154freedoms that you received.  You must make sure that they, too, receive
20155or can get the source code.  And you must show them these terms so they
20156know their rights.
20157
20158   Developers that use the GNU GPL protect your rights with two steps:
20159(1) assert copyright on the software, and (2) offer you this License
20160giving you legal permission to copy, distribute and/or modify it.
20161
20162   For the developers' and authors' protection, the GPL clearly explains
20163that there is no warranty for this free software.  For both users' and
20164authors' sake, the GPL requires that modified versions be marked as
20165changed, so that their problems will not be attributed erroneously to
20166authors of previous versions.
20167
20168   Some devices are designed to deny users access to install or run
20169modified versions of the software inside them, although the manufacturer
20170can do so.  This is fundamentally incompatible with the aim of
20171protecting users' freedom to change the software.  The systematic
20172pattern of such abuse occurs in the area of products for individuals to
20173use, which is precisely where it is most unacceptable.  Therefore, we
20174have designed this version of the GPL to prohibit the practice for those
20175products.  If such problems arise substantially in other domains, we
20176stand ready to extend this provision to those domains in future versions
20177of the GPL, as needed to protect the freedom of users.
20178
20179   Finally, every program is threatened constantly by software patents.
20180States should not allow patents to restrict development and use of
20181software on general-purpose computers, but in those that do, we wish to
20182avoid the special danger that patents applied to a free program could
20183make it effectively proprietary.  To prevent this, the GPL assures that
20184patents cannot be used to render the program non-free.
20185
20186   The precise terms and conditions for copying, distribution and
20187modification follow.
20188
20189TERMS AND CONDITIONS
20190====================
20191
20192  0. Definitions.
20193
20194     "This License" refers to version 3 of the GNU General Public
20195     License.
20196
20197     "Copyright" also means copyright-like laws that apply to other
20198     kinds of works, such as semiconductor masks.
20199
20200     "The Program" refers to any copyrightable work licensed under this
20201     License.  Each licensee is addressed as "you".  "Licensees" and
20202     "recipients" may be individuals or organizations.
20203
20204     To "modify" a work means to copy from or adapt all or part of the
20205     work in a fashion requiring copyright permission, other than the
20206     making of an exact copy.  The resulting work is called a "modified
20207     version" of the earlier work or a work "based on" the earlier work.
20208
20209     A "covered work" means either the unmodified Program or a work
20210     based on the Program.
20211
20212     To "propagate" a work means to do anything with it that, without
20213     permission, would make you directly or secondarily liable for
20214     infringement under applicable copyright law, except executing it on
20215     a computer or modifying a private copy.  Propagation includes
20216     copying, distribution (with or without modification), making
20217     available to the public, and in some countries other activities as
20218     well.
20219
20220     To "convey" a work means any kind of propagation that enables other
20221     parties to make or receive copies.  Mere interaction with a user
20222     through a computer network, with no transfer of a copy, is not
20223     conveying.
20224
20225     An interactive user interface displays "Appropriate Legal Notices"
20226     to the extent that it includes a convenient and prominently visible
20227     feature that (1) displays an appropriate copyright notice, and (2)
20228     tells the user that there is no warranty for the work (except to
20229     the extent that warranties are provided), that licensees may convey
20230     the work under this License, and how to view a copy of this
20231     License.  If the interface presents a list of user commands or
20232     options, such as a menu, a prominent item in the list meets this
20233     criterion.
20234
20235  1. Source Code.
20236
20237     The "source code" for a work means the preferred form of the work
20238     for making modifications to it.  "Object code" means any non-source
20239     form of a work.
20240
20241     A "Standard Interface" means an interface that either is an
20242     official standard defined by a recognized standards body, or, in
20243     the case of interfaces specified for a particular programming
20244     language, one that is widely used among developers working in that
20245     language.
20246
20247     The "System Libraries" of an executable work include anything,
20248     other than the work as a whole, that (a) is included in the normal
20249     form of packaging a Major Component, but which is not part of that
20250     Major Component, and (b) serves only to enable use of the work with
20251     that Major Component, or to implement a Standard Interface for
20252     which an implementation is available to the public in source code
20253     form.  A "Major Component", in this context, means a major
20254     essential component (kernel, window system, and so on) of the
20255     specific operating system (if any) on which the executable work
20256     runs, or a compiler used to produce the work, or an object code
20257     interpreter used to run it.
20258
20259     The "Corresponding Source" for a work in object code form means all
20260     the source code needed to generate, install, and (for an executable
20261     work) run the object code and to modify the work, including scripts
20262     to control those activities.  However, it does not include the
20263     work's System Libraries, or general-purpose tools or generally
20264     available free programs which are used unmodified in performing
20265     those activities but which are not part of the work.  For example,
20266     Corresponding Source includes interface definition files associated
20267     with source files for the work, and the source code for shared
20268     libraries and dynamically linked subprograms that the work is
20269     specifically designed to require, such as by intimate data
20270     communication or control flow between those subprograms and other
20271     parts of the work.
20272
20273     The Corresponding Source need not include anything that users can
20274     regenerate automatically from other parts of the Corresponding
20275     Source.
20276
20277     The Corresponding Source for a work in source code form is that
20278     same work.
20279
20280  2. Basic Permissions.
20281
20282     All rights granted under this License are granted for the term of
20283     copyright on the Program, and are irrevocable provided the stated
20284     conditions are met.  This License explicitly affirms your unlimited
20285     permission to run the unmodified Program.  The output from running
20286     a covered work is covered by this License only if the output, given
20287     its content, constitutes a covered work.  This License acknowledges
20288     your rights of fair use or other equivalent, as provided by
20289     copyright law.
20290
20291     You may make, run and propagate covered works that you do not
20292     convey, without conditions so long as your license otherwise
20293     remains in force.  You may convey covered works to others for the
20294     sole purpose of having them make modifications exclusively for you,
20295     or provide you with facilities for running those works, provided
20296     that you comply with the terms of this License in conveying all
20297     material for which you do not control copyright.  Those thus making
20298     or running the covered works for you must do so exclusively on your
20299     behalf, under your direction and control, on terms that prohibit
20300     them from making any copies of your copyrighted material outside
20301     their relationship with you.
20302
20303     Conveying under any other circumstances is permitted solely under
20304     the conditions stated below.  Sublicensing is not allowed; section
20305     10 makes it unnecessary.
20306
20307  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
20308
20309     No covered work shall be deemed part of an effective technological
20310     measure under any applicable law fulfilling obligations under
20311     article 11 of the WIPO copyright treaty adopted on 20 December
20312     1996, or similar laws prohibiting or restricting circumvention of
20313     such measures.
20314
20315     When you convey a covered work, you waive any legal power to forbid
20316     circumvention of technological measures to the extent such
20317     circumvention is effected by exercising rights under this License
20318     with respect to the covered work, and you disclaim any intention to
20319     limit operation or modification of the work as a means of
20320     enforcing, against the work's users, your or third parties' legal
20321     rights to forbid circumvention of technological measures.
20322
20323  4. Conveying Verbatim Copies.
20324
20325     You may convey verbatim copies of the Program's source code as you
20326     receive it, in any medium, provided that you conspicuously and
20327     appropriately publish on each copy an appropriate copyright notice;
20328     keep intact all notices stating that this License and any
20329     non-permissive terms added in accord with section 7 apply to the
20330     code; keep intact all notices of the absence of any warranty; and
20331     give all recipients a copy of this License along with the Program.
20332
20333     You may charge any price or no price for each copy that you convey,
20334     and you may offer support or warranty protection for a fee.
20335
20336  5. Conveying Modified Source Versions.
20337
20338     You may convey a work based on the Program, or the modifications to
20339     produce it from the Program, in the form of source code under the
20340     terms of section 4, provided that you also meet all of these
20341     conditions:
20342
20343       a. The work must carry prominent notices stating that you
20344          modified it, and giving a relevant date.
20345
20346       b. The work must carry prominent notices stating that it is
20347          released under this License and any conditions added under
20348          section 7.  This requirement modifies the requirement in
20349          section 4 to "keep intact all notices".
20350
20351       c. You must license the entire work, as a whole, under this
20352          License to anyone who comes into possession of a copy.  This
20353          License will therefore apply, along with any applicable
20354          section 7 additional terms, to the whole of the work, and all
20355          its parts, regardless of how they are packaged.  This License
20356          gives no permission to license the work in any other way, but
20357          it does not invalidate such permission if you have separately
20358          received it.
20359
20360       d. If the work has interactive user interfaces, each must display
20361          Appropriate Legal Notices; however, if the Program has
20362          interactive interfaces that do not display Appropriate Legal
20363          Notices, your work need not make them do so.
20364
20365     A compilation of a covered work with other separate and independent
20366     works, which are not by their nature extensions of the covered
20367     work, and which are not combined with it such as to form a larger
20368     program, in or on a volume of a storage or distribution medium, is
20369     called an "aggregate" if the compilation and its resulting
20370     copyright are not used to limit the access or legal rights of the
20371     compilation's users beyond what the individual works permit.
20372     Inclusion of a covered work in an aggregate does not cause this
20373     License to apply to the other parts of the aggregate.
20374
20375  6. Conveying Non-Source Forms.
20376
20377     You may convey a covered work in object code form under the terms
20378     of sections 4 and 5, provided that you also convey the
20379     machine-readable Corresponding Source under the terms of this
20380     License, in one of these ways:
20381
20382       a. Convey the object code in, or embodied in, a physical product
20383          (including a physical distribution medium), accompanied by the
20384          Corresponding Source fixed on a durable physical medium
20385          customarily used for software interchange.
20386
20387       b. Convey the object code in, or embodied in, a physical product
20388          (including a physical distribution medium), accompanied by a
20389          written offer, valid for at least three years and valid for as
20390          long as you offer spare parts or customer support for that
20391          product model, to give anyone who possesses the object code
20392          either (1) a copy of the Corresponding Source for all the
20393          software in the product that is covered by this License, on a
20394          durable physical medium customarily used for software
20395          interchange, for a price no more than your reasonable cost of
20396          physically performing this conveying of source, or (2) access
20397          to copy the Corresponding Source from a network server at no
20398          charge.
20399
20400       c. Convey individual copies of the object code with a copy of the
20401          written offer to provide the Corresponding Source.  This
20402          alternative is allowed only occasionally and noncommercially,
20403          and only if you received the object code with such an offer,
20404          in accord with subsection 6b.
20405
20406       d. Convey the object code by offering access from a designated
20407          place (gratis or for a charge), and offer equivalent access to
20408          the Corresponding Source in the same way through the same
20409          place at no further charge.  You need not require recipients
20410          to copy the Corresponding Source along with the object code.
20411          If the place to copy the object code is a network server, the
20412          Corresponding Source may be on a different server (operated by
20413          you or a third party) that supports equivalent copying
20414          facilities, provided you maintain clear directions next to the
20415          object code saying where to find the Corresponding Source.
20416          Regardless of what server hosts the Corresponding Source, you
20417          remain obligated to ensure that it is available for as long as
20418          needed to satisfy these requirements.
20419
20420       e. Convey the object code using peer-to-peer transmission,
20421          provided you inform other peers where the object code and
20422          Corresponding Source of the work are being offered to the
20423          general public at no charge under subsection 6d.
20424
20425     A separable portion of the object code, whose source code is
20426     excluded from the Corresponding Source as a System Library, need
20427     not be included in conveying the object code work.
20428
20429     A "User Product" is either (1) a "consumer product", which means
20430     any tangible personal property which is normally used for personal,
20431     family, or household purposes, or (2) anything designed or sold for
20432     incorporation into a dwelling.  In determining whether a product is
20433     a consumer product, doubtful cases shall be resolved in favor of
20434     coverage.  For a particular product received by a particular user,
20435     "normally used" refers to a typical or common use of that class of
20436     product, regardless of the status of the particular user or of the
20437     way in which the particular user actually uses, or expects or is
20438     expected to use, the product.  A product is a consumer product
20439     regardless of whether the product has substantial commercial,
20440     industrial or non-consumer uses, unless such uses represent the
20441     only significant mode of use of the product.
20442
20443     "Installation Information" for a User Product means any methods,
20444     procedures, authorization keys, or other information required to
20445     install and execute modified versions of a covered work in that
20446     User Product from a modified version of its Corresponding Source.
20447     The information must suffice to ensure that the continued
20448     functioning of the modified object code is in no case prevented or
20449     interfered with solely because modification has been made.
20450
20451     If you convey an object code work under this section in, or with,
20452     or specifically for use in, a User Product, and the conveying
20453     occurs as part of a transaction in which the right of possession
20454     and use of the User Product is transferred to the recipient in
20455     perpetuity or for a fixed term (regardless of how the transaction
20456     is characterized), the Corresponding Source conveyed under this
20457     section must be accompanied by the Installation Information.  But
20458     this requirement does not apply if neither you nor any third party
20459     retains the ability to install modified object code on the User
20460     Product (for example, the work has been installed in ROM).
20461
20462     The requirement to provide Installation Information does not
20463     include a requirement to continue to provide support service,
20464     warranty, or updates for a work that has been modified or installed
20465     by the recipient, or for the User Product in which it has been
20466     modified or installed.  Access to a network may be denied when the
20467     modification itself materially and adversely affects the operation
20468     of the network or violates the rules and protocols for
20469     communication across the network.
20470
20471     Corresponding Source conveyed, and Installation Information
20472     provided, in accord with this section must be in a format that is
20473     publicly documented (and with an implementation available to the
20474     public in source code form), and must require no special password
20475     or key for unpacking, reading or copying.
20476
20477  7. Additional Terms.
20478
20479     "Additional permissions" are terms that supplement the terms of
20480     this License by making exceptions from one or more of its
20481     conditions.  Additional permissions that are applicable to the
20482     entire Program shall be treated as though they were included in
20483     this License, to the extent that they are valid under applicable
20484     law.  If additional permissions apply only to part of the Program,
20485     that part may be used separately under those permissions, but the
20486     entire Program remains governed by this License without regard to
20487     the additional permissions.
20488
20489     When you convey a copy of a covered work, you may at your option
20490     remove any additional permissions from that copy, or from any part
20491     of it.  (Additional permissions may be written to require their own
20492     removal in certain cases when you modify the work.)  You may place
20493     additional permissions on material, added by you to a covered work,
20494     for which you have or can give appropriate copyright permission.
20495
20496     Notwithstanding any other provision of this License, for material
20497     you add to a covered work, you may (if authorized by the copyright
20498     holders of that material) supplement the terms of this License with
20499     terms:
20500
20501       a. Disclaiming warranty or limiting liability differently from
20502          the terms of sections 15 and 16 of this License; or
20503
20504       b. Requiring preservation of specified reasonable legal notices
20505          or author attributions in that material or in the Appropriate
20506          Legal Notices displayed by works containing it; or
20507
20508       c. Prohibiting misrepresentation of the origin of that material,
20509          or requiring that modified versions of such material be marked
20510          in reasonable ways as different from the original version; or
20511
20512       d. Limiting the use for publicity purposes of names of licensors
20513          or authors of the material; or
20514
20515       e. Declining to grant rights under trademark law for use of some
20516          trade names, trademarks, or service marks; or
20517
20518       f. Requiring indemnification of licensors and authors of that
20519          material by anyone who conveys the material (or modified
20520          versions of it) with contractual assumptions of liability to
20521          the recipient, for any liability that these contractual
20522          assumptions directly impose on those licensors and authors.
20523
20524     All other non-permissive additional terms are considered "further
20525     restrictions" within the meaning of section 10.  If the Program as
20526     you received it, or any part of it, contains a notice stating that
20527     it is governed by this License along with a term that is a further
20528     restriction, you may remove that term.  If a license document
20529     contains a further restriction but permits relicensing or conveying
20530     under this License, you may add to a covered work material governed
20531     by the terms of that license document, provided that the further
20532     restriction does not survive such relicensing or conveying.
20533
20534     If you add terms to a covered work in accord with this section, you
20535     must place, in the relevant source files, a statement of the
20536     additional terms that apply to those files, or a notice indicating
20537     where to find the applicable terms.
20538
20539     Additional terms, permissive or non-permissive, may be stated in
20540     the form of a separately written license, or stated as exceptions;
20541     the above requirements apply either way.
20542
20543  8. Termination.
20544
20545     You may not propagate or modify a covered work except as expressly
20546     provided under this License.  Any attempt otherwise to propagate or
20547     modify it is void, and will automatically terminate your rights
20548     under this License (including any patent licenses granted under the
20549     third paragraph of section 11).
20550
20551     However, if you cease all violation of this License, then your
20552     license from a particular copyright holder is reinstated (a)
20553     provisionally, unless and until the copyright holder explicitly and
20554     finally terminates your license, and (b) permanently, if the
20555     copyright holder fails to notify you of the violation by some
20556     reasonable means prior to 60 days after the cessation.
20557
20558     Moreover, your license from a particular copyright holder is
20559     reinstated permanently if the copyright holder notifies you of the
20560     violation by some reasonable means, this is the first time you have
20561     received notice of violation of this License (for any work) from
20562     that copyright holder, and you cure the violation prior to 30 days
20563     after your receipt of the notice.
20564
20565     Termination of your rights under this section does not terminate
20566     the licenses of parties who have received copies or rights from you
20567     under this License.  If your rights have been terminated and not
20568     permanently reinstated, you do not qualify to receive new licenses
20569     for the same material under section 10.
20570
20571  9. Acceptance Not Required for Having Copies.
20572
20573     You are not required to accept this License in order to receive or
20574     run a copy of the Program.  Ancillary propagation of a covered work
20575     occurring solely as a consequence of using peer-to-peer
20576     transmission to receive a copy likewise does not require
20577     acceptance.  However, nothing other than this License grants you
20578     permission to propagate or modify any covered work.  These actions
20579     infringe copyright if you do not accept this License.  Therefore,
20580     by modifying or propagating a covered work, you indicate your
20581     acceptance of this License to do so.
20582
20583  10. Automatic Licensing of Downstream Recipients.
20584
20585     Each time you convey a covered work, the recipient automatically
20586     receives a license from the original licensors, to run, modify and
20587     propagate that work, subject to this License.  You are not
20588     responsible for enforcing compliance by third parties with this
20589     License.
20590
20591     An "entity transaction" is a transaction transferring control of an
20592     organization, or substantially all assets of one, or subdividing an
20593     organization, or merging organizations.  If propagation of a
20594     covered work results from an entity transaction, each party to that
20595     transaction who receives a copy of the work also receives whatever
20596     licenses to the work the party's predecessor in interest had or
20597     could give under the previous paragraph, plus a right to possession
20598     of the Corresponding Source of the work from the predecessor in
20599     interest, if the predecessor has it or can get it with reasonable
20600     efforts.
20601
20602     You may not impose any further restrictions on the exercise of the
20603     rights granted or affirmed under this License.  For example, you
20604     may not impose a license fee, royalty, or other charge for exercise
20605     of rights granted under this License, and you may not initiate
20606     litigation (including a cross-claim or counterclaim in a lawsuit)
20607     alleging that any patent claim is infringed by making, using,
20608     selling, offering for sale, or importing the Program or any portion
20609     of it.
20610
20611  11. Patents.
20612
20613     A "contributor" is a copyright holder who authorizes use under this
20614     License of the Program or a work on which the Program is based.
20615     The work thus licensed is called the contributor's "contributor
20616     version".
20617
20618     A contributor's "essential patent claims" are all patent claims
20619     owned or controlled by the contributor, whether already acquired or
20620     hereafter acquired, that would be infringed by some manner,
20621     permitted by this License, of making, using, or selling its
20622     contributor version, but do not include claims that would be
20623     infringed only as a consequence of further modification of the
20624     contributor version.  For purposes of this definition, "control"
20625     includes the right to grant patent sublicenses in a manner
20626     consistent with the requirements of this License.
20627
20628     Each contributor grants you a non-exclusive, worldwide,
20629     royalty-free patent license under the contributor's essential
20630     patent claims, to make, use, sell, offer for sale, import and
20631     otherwise run, modify and propagate the contents of its contributor
20632     version.
20633
20634     In the following three paragraphs, a "patent license" is any
20635     express agreement or commitment, however denominated, not to
20636     enforce a patent (such as an express permission to practice a
20637     patent or covenant not to sue for patent infringement).  To "grant"
20638     such a patent license to a party means to make such an agreement or
20639     commitment not to enforce a patent against the party.
20640
20641     If you convey a covered work, knowingly relying on a patent
20642     license, and the Corresponding Source of the work is not available
20643     for anyone to copy, free of charge and under the terms of this
20644     License, through a publicly available network server or other
20645     readily accessible means, then you must either (1) cause the
20646     Corresponding Source to be so available, or (2) arrange to deprive
20647     yourself of the benefit of the patent license for this particular
20648     work, or (3) arrange, in a manner consistent with the requirements
20649     of this License, to extend the patent license to downstream
20650     recipients.  "Knowingly relying" means you have actual knowledge
20651     that, but for the patent license, your conveying the covered work
20652     in a country, or your recipient's use of the covered work in a
20653     country, would infringe one or more identifiable patents in that
20654     country that you have reason to believe are valid.
20655
20656     If, pursuant to or in connection with a single transaction or
20657     arrangement, you convey, or propagate by procuring conveyance of, a
20658     covered work, and grant a patent license to some of the parties
20659     receiving the covered work authorizing them to use, propagate,
20660     modify or convey a specific copy of the covered work, then the
20661     patent license you grant is automatically extended to all
20662     recipients of the covered work and works based on it.
20663
20664     A patent license is "discriminatory" if it does not include within
20665     the scope of its coverage, prohibits the exercise of, or is
20666     conditioned on the non-exercise of one or more of the rights that
20667     are specifically granted under this License.  You may not convey a
20668     covered work if you are a party to an arrangement with a third
20669     party that is in the business of distributing software, under which
20670     you make payment to the third party based on the extent of your
20671     activity of conveying the work, and under which the third party
20672     grants, to any of the parties who would receive the covered work
20673     from you, a discriminatory patent license (a) in connection with
20674     copies of the covered work conveyed by you (or copies made from
20675     those copies), or (b) primarily for and in connection with specific
20676     products or compilations that contain the covered work, unless you
20677     entered into that arrangement, or that patent license was granted,
20678     prior to 28 March 2007.
20679
20680     Nothing in this License shall be construed as excluding or limiting
20681     any implied license or other defenses to infringement that may
20682     otherwise be available to you under applicable patent law.
20683
20684  12. No Surrender of Others' Freedom.
20685
20686     If conditions are imposed on you (whether by court order, agreement
20687     or otherwise) that contradict the conditions of this License, they
20688     do not excuse you from the conditions of this License.  If you
20689     cannot convey a covered work so as to satisfy simultaneously your
20690     obligations under this License and any other pertinent obligations,
20691     then as a consequence you may not convey it at all.  For example,
20692     if you agree to terms that obligate you to collect a royalty for
20693     further conveying from those to whom you convey the Program, the
20694     only way you could satisfy both those terms and this License would
20695     be to refrain entirely from conveying the Program.
20696
20697  13. Use with the GNU Affero General Public License.
20698
20699     Notwithstanding any other provision of this License, you have
20700     permission to link or combine any covered work with a work licensed
20701     under version 3 of the GNU Affero General Public License into a
20702     single combined work, and to convey the resulting work.  The terms
20703     of this License will continue to apply to the part which is the
20704     covered work, but the special requirements of the GNU Affero
20705     General Public License, section 13, concerning interaction through
20706     a network will apply to the combination as such.
20707
20708  14. Revised Versions of this License.
20709
20710     The Free Software Foundation may publish revised and/or new
20711     versions of the GNU General Public License from time to time.  Such
20712     new versions will be similar in spirit to the present version, but
20713     may differ in detail to address new problems or concerns.
20714
20715     Each version is given a distinguishing version number.  If the
20716     Program specifies that a certain numbered version of the GNU
20717     General Public License "or any later version" applies to it, you
20718     have the option of following the terms and conditions either of
20719     that numbered version or of any later version published by the Free
20720     Software Foundation.  If the Program does not specify a version
20721     number of the GNU General Public License, you may choose any
20722     version ever published by the Free Software Foundation.
20723
20724     If the Program specifies that a proxy can decide which future
20725     versions of the GNU General Public License can be used, that
20726     proxy's public statement of acceptance of a version permanently
20727     authorizes you to choose that version for the Program.
20728
20729     Later license versions may give you additional or different
20730     permissions.  However, no additional obligations are imposed on any
20731     author or copyright holder as a result of your choosing to follow a
20732     later version.
20733
20734  15. Disclaimer of Warranty.
20735
20736     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
20737     APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
20738     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
20739     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
20740     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20741     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
20742     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
20743     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
20744     NECESSARY SERVICING, REPAIR OR CORRECTION.
20745
20746  16. Limitation of Liability.
20747
20748     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
20749     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
20750     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
20751     DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
20752     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
20753     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
20754     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
20755     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
20756     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
20757     THE POSSIBILITY OF SUCH DAMAGES.
20758
20759  17. Interpretation of Sections 15 and 16.
20760
20761     If the disclaimer of warranty and limitation of liability provided
20762     above cannot be given local legal effect according to their terms,
20763     reviewing courts shall apply local law that most closely
20764     approximates an absolute waiver of all civil liability in
20765     connection with the Program, unless a warranty or assumption of
20766     liability accompanies a copy of the Program in return for a fee.
20767
20768END OF TERMS AND CONDITIONS
20769===========================
20770
20771How to Apply These Terms to Your New Programs
20772=============================================
20773
20774If you develop a new program, and you want it to be of the greatest
20775possible use to the public, the best way to achieve this is to make it
20776free software which everyone can redistribute and change under these
20777terms.
20778
20779   To do so, attach the following notices to the program.  It is safest
20780to attach them to the start of each source file to most effectively
20781state the exclusion of warranty; and each file should have at least the
20782"copyright" line and a pointer to where the full notice is found.
20783
20784     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
20785     Copyright (C) YEAR NAME OF AUTHOR
20786
20787     This program is free software: you can redistribute it and/or modify
20788     it under the terms of the GNU General Public License as published by
20789     the Free Software Foundation, either version 3 of the License, or (at
20790     your option) any later version.
20791
20792     This program is distributed in the hope that it will be useful, but
20793     WITHOUT ANY WARRANTY; without even the implied warranty of
20794     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20795     General Public License for more details.
20796
20797     You should have received a copy of the GNU General Public License
20798     along with this program.  If not, see <http://www.gnu.org/licenses/>.
20799
20800   Also add information on how to contact you by electronic and paper
20801mail.
20802
20803   If the program does terminal interaction, make it output a short
20804notice like this when it starts in an interactive mode:
20805
20806     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
20807     This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
20808     This is free software, and you are welcome to redistribute it
20809     under certain conditions; type 'show c' for details.
20810
20811   The hypothetical commands 'show w' and 'show c' should show the
20812appropriate parts of the General Public License.  Of course, your
20813program's commands might be different; for a GUI interface, you would
20814use an "about box".
20815
20816   You should also get your employer (if you work as a programmer) or
20817school, if any, to sign a "copyright disclaimer" for the program, if
20818necessary.  For more information on this, and how to apply and follow
20819the GNU GPL, see <http://www.gnu.org/licenses/>.
20820
20821   The GNU General Public License does not permit incorporating your
20822program into proprietary programs.  If your program is a subroutine
20823library, you may consider it more useful to permit linking proprietary
20824applications with the library.  If this is what you want to do, use the
20825GNU Lesser General Public License instead of this License.  But first,
20826please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
20827
20828
20829File: gfortran.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
20830
20831GNU Free Documentation License
20832******************************
20833
20834                     Version 1.3, 3 November 2008
20835
20836     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
20837     <http://fsf.org/>
20838
20839     Everyone is permitted to copy and distribute verbatim copies
20840     of this license document, but changing it is not allowed.
20841
20842  0. PREAMBLE
20843
20844     The purpose of this License is to make a manual, textbook, or other
20845     functional and useful document "free" in the sense of freedom: to
20846     assure everyone the effective freedom to copy and redistribute it,
20847     with or without modifying it, either commercially or
20848     noncommercially.  Secondarily, this License preserves for the
20849     author and publisher a way to get credit for their work, while not
20850     being considered responsible for modifications made by others.
20851
20852     This License is a kind of "copyleft", which means that derivative
20853     works of the document must themselves be free in the same sense.
20854     It complements the GNU General Public License, which is a copyleft
20855     license designed for free software.
20856
20857     We have designed this License in order to use it for manuals for
20858     free software, because free software needs free documentation: a
20859     free program should come with manuals providing the same freedoms
20860     that the software does.  But this License is not limited to
20861     software manuals; it can be used for any textual work, regardless
20862     of subject matter or whether it is published as a printed book.  We
20863     recommend this License principally for works whose purpose is
20864     instruction or reference.
20865
20866  1. APPLICABILITY AND DEFINITIONS
20867
20868     This License applies to any manual or other work, in any medium,
20869     that contains a notice placed by the copyright holder saying it can
20870     be distributed under the terms of this License.  Such a notice
20871     grants a world-wide, royalty-free license, unlimited in duration,
20872     to use that work under the conditions stated herein.  The
20873     "Document", below, refers to any such manual or work.  Any member
20874     of the public is a licensee, and is addressed as "you".  You accept
20875     the license if you copy, modify or distribute the work in a way
20876     requiring permission under copyright law.
20877
20878     A "Modified Version" of the Document means any work containing the
20879     Document or a portion of it, either copied verbatim, or with
20880     modifications and/or translated into another language.
20881
20882     A "Secondary Section" is a named appendix or a front-matter section
20883     of the Document that deals exclusively with the relationship of the
20884     publishers or authors of the Document to the Document's overall
20885     subject (or to related matters) and contains nothing that could
20886     fall directly within that overall subject.  (Thus, if the Document
20887     is in part a textbook of mathematics, a Secondary Section may not
20888     explain any mathematics.)  The relationship could be a matter of
20889     historical connection with the subject or with related matters, or
20890     of legal, commercial, philosophical, ethical or political position
20891     regarding them.
20892
20893     The "Invariant Sections" are certain Secondary Sections whose
20894     titles are designated, as being those of Invariant Sections, in the
20895     notice that says that the Document is released under this License.
20896     If a section does not fit the above definition of Secondary then it
20897     is not allowed to be designated as Invariant.  The Document may
20898     contain zero Invariant Sections.  If the Document does not identify
20899     any Invariant Sections then there are none.
20900
20901     The "Cover Texts" are certain short passages of text that are
20902     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
20903     that says that the Document is released under this License.  A
20904     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
20905     be at most 25 words.
20906
20907     A "Transparent" copy of the Document means a machine-readable copy,
20908     represented in a format whose specification is available to the
20909     general public, that is suitable for revising the document
20910     straightforwardly with generic text editors or (for images composed
20911     of pixels) generic paint programs or (for drawings) some widely
20912     available drawing editor, and that is suitable for input to text
20913     formatters or for automatic translation to a variety of formats
20914     suitable for input to text formatters.  A copy made in an otherwise
20915     Transparent file format whose markup, or absence of markup, has
20916     been arranged to thwart or discourage subsequent modification by
20917     readers is not Transparent.  An image format is not Transparent if
20918     used for any substantial amount of text.  A copy that is not
20919     "Transparent" is called "Opaque".
20920
20921     Examples of suitable formats for Transparent copies include plain
20922     ASCII without markup, Texinfo input format, LaTeX input format,
20923     SGML or XML using a publicly available DTD, and standard-conforming
20924     simple HTML, PostScript or PDF designed for human modification.
20925     Examples of transparent image formats include PNG, XCF and JPG.
20926     Opaque formats include proprietary formats that can be read and
20927     edited only by proprietary word processors, SGML or XML for which
20928     the DTD and/or processing tools are not generally available, and
20929     the machine-generated HTML, PostScript or PDF produced by some word
20930     processors for output purposes only.
20931
20932     The "Title Page" means, for a printed book, the title page itself,
20933     plus such following pages as are needed to hold, legibly, the
20934     material this License requires to appear in the title page.  For
20935     works in formats which do not have any title page as such, "Title
20936     Page" means the text near the most prominent appearance of the
20937     work's title, preceding the beginning of the body of the text.
20938
20939     The "publisher" means any person or entity that distributes copies
20940     of the Document to the public.
20941
20942     A section "Entitled XYZ" means a named subunit of the Document
20943     whose title either is precisely XYZ or contains XYZ in parentheses
20944     following text that translates XYZ in another language.  (Here XYZ
20945     stands for a specific section name mentioned below, such as
20946     "Acknowledgements", "Dedications", "Endorsements", or "History".)
20947     To "Preserve the Title" of such a section when you modify the
20948     Document means that it remains a section "Entitled XYZ" according
20949     to this definition.
20950
20951     The Document may include Warranty Disclaimers next to the notice
20952     which states that this License applies to the Document.  These
20953     Warranty Disclaimers are considered to be included by reference in
20954     this License, but only as regards disclaiming warranties: any other
20955     implication that these Warranty Disclaimers may have is void and
20956     has no effect on the meaning of this License.
20957
20958  2. VERBATIM COPYING
20959
20960     You may copy and distribute the Document in any medium, either
20961     commercially or noncommercially, provided that this License, the
20962     copyright notices, and the license notice saying this License
20963     applies to the Document are reproduced in all copies, and that you
20964     add no other conditions whatsoever to those of this License.  You
20965     may not use technical measures to obstruct or control the reading
20966     or further copying of the copies you make or distribute.  However,
20967     you may accept compensation in exchange for copies.  If you
20968     distribute a large enough number of copies you must also follow the
20969     conditions in section 3.
20970
20971     You may also lend copies, under the same conditions stated above,
20972     and you may publicly display copies.
20973
20974  3. COPYING IN QUANTITY
20975
20976     If you publish printed copies (or copies in media that commonly
20977     have printed covers) of the Document, numbering more than 100, and
20978     the Document's license notice requires Cover Texts, you must
20979     enclose the copies in covers that carry, clearly and legibly, all
20980     these Cover Texts: Front-Cover Texts on the front cover, and
20981     Back-Cover Texts on the back cover.  Both covers must also clearly
20982     and legibly identify you as the publisher of these copies.  The
20983     front cover must present the full title with all words of the title
20984     equally prominent and visible.  You may add other material on the
20985     covers in addition.  Copying with changes limited to the covers, as
20986     long as they preserve the title of the Document and satisfy these
20987     conditions, can be treated as verbatim copying in other respects.
20988
20989     If the required texts for either cover are too voluminous to fit
20990     legibly, you should put the first ones listed (as many as fit
20991     reasonably) on the actual cover, and continue the rest onto
20992     adjacent pages.
20993
20994     If you publish or distribute Opaque copies of the Document
20995     numbering more than 100, you must either include a machine-readable
20996     Transparent copy along with each Opaque copy, or state in or with
20997     each Opaque copy a computer-network location from which the general
20998     network-using public has access to download using public-standard
20999     network protocols a complete Transparent copy of the Document, free
21000     of added material.  If you use the latter option, you must take
21001     reasonably prudent steps, when you begin distribution of Opaque
21002     copies in quantity, to ensure that this Transparent copy will
21003     remain thus accessible at the stated location until at least one
21004     year after the last time you distribute an Opaque copy (directly or
21005     through your agents or retailers) of that edition to the public.
21006
21007     It is requested, but not required, that you contact the authors of
21008     the Document well before redistributing any large number of copies,
21009     to give them a chance to provide you with an updated version of the
21010     Document.
21011
21012  4. MODIFICATIONS
21013
21014     You may copy and distribute a Modified Version of the Document
21015     under the conditions of sections 2 and 3 above, provided that you
21016     release the Modified Version under precisely this License, with the
21017     Modified Version filling the role of the Document, thus licensing
21018     distribution and modification of the Modified Version to whoever
21019     possesses a copy of it.  In addition, you must do these things in
21020     the Modified Version:
21021
21022       A. Use in the Title Page (and on the covers, if any) a title
21023          distinct from that of the Document, and from those of previous
21024          versions (which should, if there were any, be listed in the
21025          History section of the Document).  You may use the same title
21026          as a previous version if the original publisher of that
21027          version gives permission.
21028
21029       B. List on the Title Page, as authors, one or more persons or
21030          entities responsible for authorship of the modifications in
21031          the Modified Version, together with at least five of the
21032          principal authors of the Document (all of its principal
21033          authors, if it has fewer than five), unless they release you
21034          from this requirement.
21035
21036       C. State on the Title page the name of the publisher of the
21037          Modified Version, as the publisher.
21038
21039       D. Preserve all the copyright notices of the Document.
21040
21041       E. Add an appropriate copyright notice for your modifications
21042          adjacent to the other copyright notices.
21043
21044       F. Include, immediately after the copyright notices, a license
21045          notice giving the public permission to use the Modified
21046          Version under the terms of this License, in the form shown in
21047          the Addendum below.
21048
21049       G. Preserve in that license notice the full lists of Invariant
21050          Sections and required Cover Texts given in the Document's
21051          license notice.
21052
21053       H. Include an unaltered copy of this License.
21054
21055       I. Preserve the section Entitled "History", Preserve its Title,
21056          and add to it an item stating at least the title, year, new
21057          authors, and publisher of the Modified Version as given on the
21058          Title Page.  If there is no section Entitled "History" in the
21059          Document, create one stating the title, year, authors, and
21060          publisher of the Document as given on its Title Page, then add
21061          an item describing the Modified Version as stated in the
21062          previous sentence.
21063
21064       J. Preserve the network location, if any, given in the Document
21065          for public access to a Transparent copy of the Document, and
21066          likewise the network locations given in the Document for
21067          previous versions it was based on.  These may be placed in the
21068          "History" section.  You may omit a network location for a work
21069          that was published at least four years before the Document
21070          itself, or if the original publisher of the version it refers
21071          to gives permission.
21072
21073       K. For any section Entitled "Acknowledgements" or "Dedications",
21074          Preserve the Title of the section, and preserve in the section
21075          all the substance and tone of each of the contributor
21076          acknowledgements and/or dedications given therein.
21077
21078       L. Preserve all the Invariant Sections of the Document, unaltered
21079          in their text and in their titles.  Section numbers or the
21080          equivalent are not considered part of the section titles.
21081
21082       M. Delete any section Entitled "Endorsements".  Such a section
21083          may not be included in the Modified Version.
21084
21085       N. Do not retitle any existing section to be Entitled
21086          "Endorsements" or to conflict in title with any Invariant
21087          Section.
21088
21089       O. Preserve any Warranty Disclaimers.
21090
21091     If the Modified Version includes new front-matter sections or
21092     appendices that qualify as Secondary Sections and contain no
21093     material copied from the Document, you may at your option designate
21094     some or all of these sections as invariant.  To do this, add their
21095     titles to the list of Invariant Sections in the Modified Version's
21096     license notice.  These titles must be distinct from any other
21097     section titles.
21098
21099     You may add a section Entitled "Endorsements", provided it contains
21100     nothing but endorsements of your Modified Version by various
21101     parties--for example, statements of peer review or that the text
21102     has been approved by an organization as the authoritative
21103     definition of a standard.
21104
21105     You may add a passage of up to five words as a Front-Cover Text,
21106     and a passage of up to 25 words as a Back-Cover Text, to the end of
21107     the list of Cover Texts in the Modified Version.  Only one passage
21108     of Front-Cover Text and one of Back-Cover Text may be added by (or
21109     through arrangements made by) any one entity.  If the Document
21110     already includes a cover text for the same cover, previously added
21111     by you or by arrangement made by the same entity you are acting on
21112     behalf of, you may not add another; but you may replace the old
21113     one, on explicit permission from the previous publisher that added
21114     the old one.
21115
21116     The author(s) and publisher(s) of the Document do not by this
21117     License give permission to use their names for publicity for or to
21118     assert or imply endorsement of any Modified Version.
21119
21120  5. COMBINING DOCUMENTS
21121
21122     You may combine the Document with other documents released under
21123     this License, under the terms defined in section 4 above for
21124     modified versions, provided that you include in the combination all
21125     of the Invariant Sections of all of the original documents,
21126     unmodified, and list them all as Invariant Sections of your
21127     combined work in its license notice, and that you preserve all
21128     their Warranty Disclaimers.
21129
21130     The combined work need only contain one copy of this License, and
21131     multiple identical Invariant Sections may be replaced with a single
21132     copy.  If there are multiple Invariant Sections with the same name
21133     but different contents, make the title of each such section unique
21134     by adding at the end of it, in parentheses, the name of the
21135     original author or publisher of that section if known, or else a
21136     unique number.  Make the same adjustment to the section titles in
21137     the list of Invariant Sections in the license notice of the
21138     combined work.
21139
21140     In the combination, you must combine any sections Entitled
21141     "History" in the various original documents, forming one section
21142     Entitled "History"; likewise combine any sections Entitled
21143     "Acknowledgements", and any sections Entitled "Dedications".  You
21144     must delete all sections Entitled "Endorsements."
21145
21146  6. COLLECTIONS OF DOCUMENTS
21147
21148     You may make a collection consisting of the Document and other
21149     documents released under this License, and replace the individual
21150     copies of this License in the various documents with a single copy
21151     that is included in the collection, provided that you follow the
21152     rules of this License for verbatim copying of each of the documents
21153     in all other respects.
21154
21155     You may extract a single document from such a collection, and
21156     distribute it individually under this License, provided you insert
21157     a copy of this License into the extracted document, and follow this
21158     License in all other respects regarding verbatim copying of that
21159     document.
21160
21161  7. AGGREGATION WITH INDEPENDENT WORKS
21162
21163     A compilation of the Document or its derivatives with other
21164     separate and independent documents or works, in or on a volume of a
21165     storage or distribution medium, is called an "aggregate" if the
21166     copyright resulting from the compilation is not used to limit the
21167     legal rights of the compilation's users beyond what the individual
21168     works permit.  When the Document is included in an aggregate, this
21169     License does not apply to the other works in the aggregate which
21170     are not themselves derivative works of the Document.
21171
21172     If the Cover Text requirement of section 3 is applicable to these
21173     copies of the Document, then if the Document is less than one half
21174     of the entire aggregate, the Document's Cover Texts may be placed
21175     on covers that bracket the Document within the aggregate, or the
21176     electronic equivalent of covers if the Document is in electronic
21177     form.  Otherwise they must appear on printed covers that bracket
21178     the whole aggregate.
21179
21180  8. TRANSLATION
21181
21182     Translation is considered a kind of modification, so you may
21183     distribute translations of the Document under the terms of section
21184     4.  Replacing Invariant Sections with translations requires special
21185     permission from their copyright holders, but you may include
21186     translations of some or all Invariant Sections in addition to the
21187     original versions of these Invariant Sections.  You may include a
21188     translation of this License, and all the license notices in the
21189     Document, and any Warranty Disclaimers, provided that you also
21190     include the original English version of this License and the
21191     original versions of those notices and disclaimers.  In case of a
21192     disagreement between the translation and the original version of
21193     this License or a notice or disclaimer, the original version will
21194     prevail.
21195
21196     If a section in the Document is Entitled "Acknowledgements",
21197     "Dedications", or "History", the requirement (section 4) to
21198     Preserve its Title (section 1) will typically require changing the
21199     actual title.
21200
21201  9. TERMINATION
21202
21203     You may not copy, modify, sublicense, or distribute the Document
21204     except as expressly provided under this License.  Any attempt
21205     otherwise to copy, modify, sublicense, or distribute it is void,
21206     and will automatically terminate your rights under this License.
21207
21208     However, if you cease all violation of this License, then your
21209     license from a particular copyright holder is reinstated (a)
21210     provisionally, unless and until the copyright holder explicitly and
21211     finally terminates your license, and (b) permanently, if the
21212     copyright holder fails to notify you of the violation by some
21213     reasonable means prior to 60 days after the cessation.
21214
21215     Moreover, your license from a particular copyright holder is
21216     reinstated permanently if the copyright holder notifies you of the
21217     violation by some reasonable means, this is the first time you have
21218     received notice of violation of this License (for any work) from
21219     that copyright holder, and you cure the violation prior to 30 days
21220     after your receipt of the notice.
21221
21222     Termination of your rights under this section does not terminate
21223     the licenses of parties who have received copies or rights from you
21224     under this License.  If your rights have been terminated and not
21225     permanently reinstated, receipt of a copy of some or all of the
21226     same material does not give you any rights to use it.
21227
21228  10. FUTURE REVISIONS OF THIS LICENSE
21229
21230     The Free Software Foundation may publish new, revised versions of
21231     the GNU Free Documentation License from time to time.  Such new
21232     versions will be similar in spirit to the present version, but may
21233     differ in detail to address new problems or concerns.  See
21234     <http://www.gnu.org/copyleft/>.
21235
21236     Each version of the License is given a distinguishing version
21237     number.  If the Document specifies that a particular numbered
21238     version of this License "or any later version" applies to it, you
21239     have the option of following the terms and conditions either of
21240     that specified version or of any later version that has been
21241     published (not as a draft) by the Free Software Foundation.  If the
21242     Document does not specify a version number of this License, you may
21243     choose any version ever published (not as a draft) by the Free
21244     Software Foundation.  If the Document specifies that a proxy can
21245     decide which future versions of this License can be used, that
21246     proxy's public statement of acceptance of a version permanently
21247     authorizes you to choose that version for the Document.
21248
21249  11. RELICENSING
21250
21251     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
21252     World Wide Web server that publishes copyrightable works and also
21253     provides prominent facilities for anybody to edit those works.  A
21254     public wiki that anybody can edit is an example of such a server.
21255     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
21256     site means any set of copyrightable works thus published on the MMC
21257     site.
21258
21259     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
21260     license published by Creative Commons Corporation, a not-for-profit
21261     corporation with a principal place of business in San Francisco,
21262     California, as well as future copyleft versions of that license
21263     published by that same organization.
21264
21265     "Incorporate" means to publish or republish a Document, in whole or
21266     in part, as part of another Document.
21267
21268     An MMC is "eligible for relicensing" if it is licensed under this
21269     License, and if all works that were first published under this
21270     License somewhere other than this MMC, and subsequently
21271     incorporated in whole or in part into the MMC, (1) had no cover
21272     texts or invariant sections, and (2) were thus incorporated prior
21273     to November 1, 2008.
21274
21275     The operator of an MMC Site may republish an MMC contained in the
21276     site under CC-BY-SA on the same site at any time before August 1,
21277     2009, provided the MMC is eligible for relicensing.
21278
21279ADDENDUM: How to use this License for your documents
21280====================================================
21281
21282To use this License in a document you have written, include a copy of
21283the License in the document and put the following copyright and license
21284notices just after the title page:
21285
21286       Copyright (C)  YEAR  YOUR NAME.
21287       Permission is granted to copy, distribute and/or modify this document
21288       under the terms of the GNU Free Documentation License, Version 1.3
21289       or any later version published by the Free Software Foundation;
21290       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
21291       Texts.  A copy of the license is included in the section entitled ``GNU
21292       Free Documentation License''.
21293
21294   If you have Invariant Sections, Front-Cover Texts and Back-Cover
21295Texts, replace the "with...Texts."  line with this:
21296
21297         with the Invariant Sections being LIST THEIR TITLES, with
21298         the Front-Cover Texts being LIST, and with the Back-Cover Texts
21299         being LIST.
21300
21301   If you have Invariant Sections without Cover Texts, or some other
21302combination of the three, merge those two alternatives to suit the
21303situation.
21304
21305   If your document contains nontrivial examples of program code, we
21306recommend releasing these examples in parallel under your choice of free
21307software license, such as the GNU General Public License, to permit
21308their use in free software.
21309
21310
21311File: gfortran.info,  Node: Funding,  Next: Option Index,  Prev: GNU Free Documentation License,  Up: Top
21312
21313Funding Free Software
21314*********************
21315
21316If you want to have more free software a few years from now, it makes
21317sense for you to help encourage people to contribute funds for its
21318development.  The most effective approach known is to encourage
21319commercial redistributors to donate.
21320
21321   Users of free software systems can boost the pace of development by
21322encouraging for-a-fee distributors to donate part of their selling price
21323to free software developers--the Free Software Foundation, and others.
21324
21325   The way to convince distributors to do this is to demand it and
21326expect it from them.  So when you compare distributors, judge them
21327partly by how much they give to free software development.  Show
21328distributors they must compete to be the one who gives the most.
21329
21330   To make this approach work, you must insist on numbers that you can
21331compare, such as, "We will donate ten dollars to the Frobnitz project
21332for each disk sold."  Don't be satisfied with a vague promise, such as
21333"A portion of the profits are donated," since it doesn't give a basis
21334for comparison.
21335
21336   Even a precise fraction "of the profits from this disk" is not very
21337meaningful, since creative accounting and unrelated business decisions
21338can greatly alter what fraction of the sales price counts as profit.  If
21339the price you pay is $50, ten percent of the profit is probably less
21340than a dollar; it might be a few cents, or nothing at all.
21341
21342   Some redistributors do development work themselves.  This is useful
21343too; but to keep everyone honest, you need to inquire how much they do,
21344and what kind.  Some kinds of development make much more long-term
21345difference than others.  For example, maintaining a separate version of
21346a program contributes very little; maintaining the standard version of a
21347program for the whole community contributes much.  Easy new ports
21348contribute little, since someone else would surely do them; difficult
21349ports such as adding a new CPU to the GNU Compiler Collection contribute
21350more; major new features or packages contribute the most.
21351
21352   By establishing the idea that supporting further development is "the
21353proper thing to do" when distributing free software for a fee, we can
21354assure a steady flow of resources into making more free software.
21355
21356     Copyright (C) 1994 Free Software Foundation, Inc.
21357     Verbatim copying and redistribution of this section is permitted
21358     without royalty; alteration is not permitted.
21359
21360
21361File: gfortran.info,  Node: Option Index,  Next: Keyword Index,  Prev: Funding,  Up: Top
21362
21363Option Index
21364************
21365
21366'gfortran''s command line options are indexed here without any initial
21367'-' or '--'.  Where an option has both positive and negative forms (such
21368as -foption and -fno-option), relevant entries in the manual are indexed
21369under the most appropriate form; it may sometimes be useful to look up
21370both forms.
21371
21372�[index�]
21373* Menu:
21374
21375* 'A-PREDICATE=ANSWER':                  Preprocessing Options.
21376                                                              (line 119)
21377* 'allow-invalid-boz':                   Fortran Dialect Options.
21378                                                              (line  40)
21379* 'APREDICATE=ANSWER':                   Preprocessing Options.
21380                                                              (line 113)
21381* 'backslash':                           Fortran Dialect Options.
21382                                                              (line 112)
21383* 'C':                                   Preprocessing Options.
21384                                                              (line 122)
21385* 'c-prototypes':                        Interoperability Options.
21386                                                              (line   7)
21387* 'c-prototypes-external':               Interoperability Options.
21388                                                              (line  25)
21389* 'CC':                                  Preprocessing Options.
21390                                                              (line 137)
21391* 'cpp':                                 Preprocessing Options.
21392                                                              (line  12)
21393* 'dD':                                  Preprocessing Options.
21394                                                              (line  35)
21395* 'dI':                                  Preprocessing Options.
21396                                                              (line  51)
21397* 'dM':                                  Preprocessing Options.
21398                                                              (line  26)
21399* 'dN':                                  Preprocessing Options.
21400                                                              (line  41)
21401* 'DNAME':                               Preprocessing Options.
21402                                                              (line 151)
21403* 'DNAME=DEFINITION':                    Preprocessing Options.
21404                                                              (line 154)
21405* 'dU':                                  Preprocessing Options.
21406                                                              (line  44)
21407* 'faggressive-function-elimination':    Code Gen Options.    (line 435)
21408* 'falign-commons':                      Code Gen Options.    (line 408)
21409* 'fall-intrinsics':                     Fortran Dialect Options.
21410                                                              (line  17)
21411* 'fallow-argument-mismatch':            Fortran Dialect Options.
21412                                                              (line  26)
21413* 'fblas-matmul-limit':                  Code Gen Options.    (line 337)
21414* 'fbounds-check':                       Code Gen Options.    (line 205)
21415* 'fcheck':                              Code Gen Options.    (line 144)
21416* 'fcheck-array-temporaries':            Code Gen Options.    (line 239)
21417* 'fcoarray':                            Code Gen Options.    (line 130)
21418* 'fconvert='CONVERSION:                 Runtime Options.     (line  10)
21419* 'fcray-pointer':                       Fortran Dialect Options.
21420                                                              (line 167)
21421* 'fd-lines-as-code':                    Fortran Dialect Options.
21422                                                              (line  47)
21423* 'fd-lines-as-comments':                Fortran Dialect Options.
21424                                                              (line  47)
21425* 'fdec':                                Fortran Dialect Options.
21426                                                              (line  54)
21427* 'fdec-blank-format-item':              Fortran Dialect Options.
21428                                                              (line 102)
21429* 'fdec-char-conversions':               Fortran Dialect Options.
21430                                                              (line  69)
21431* 'fdec-format-defaults':                Fortran Dialect Options.
21432                                                              (line  98)
21433* 'fdec-include':                        Fortran Dialect Options.
21434                                                              (line  93)
21435* 'fdec-intrinsic-ints':                 Fortran Dialect Options.
21436                                                              (line  79)
21437* 'fdec-math':                           Fortran Dialect Options.
21438                                                              (line  84)
21439* 'fdec-static':                         Fortran Dialect Options.
21440                                                              (line  89)
21441* 'fdec-structure':                      Fortran Dialect Options.
21442                                                              (line  73)
21443* 'fdefault-double-8':                   Fortran Dialect Options.
21444                                                              (line 234)
21445* 'fdefault-integer-8':                  Fortran Dialect Options.
21446                                                              (line 198)
21447* 'fdefault-real-10':                    Fortran Dialect Options.
21448                                                              (line 214)
21449* 'fdefault-real-16':                    Fortran Dialect Options.
21450                                                              (line 224)
21451* 'fdefault-real-8':                     Fortran Dialect Options.
21452                                                              (line 204)
21453* 'fdollar-ok':                          Fortran Dialect Options.
21454                                                              (line 106)
21455* 'fdump-fortran-global':                Debugging Options.   (line  33)
21456* 'fdump-fortran-optimized':             Debugging Options.   (line  18)
21457* 'fdump-fortran-original':              Debugging Options.   (line  10)
21458* 'fdump-parse-tree':                    Debugging Options.   (line  25)
21459* 'fexternal-blas':                      Code Gen Options.    (line 329)
21460* ff2c:                                  Code Gen Options.    (line  28)
21461* 'ffixed-form':                         Fortran Dialect Options.
21462                                                              (line  11)
21463* 'ffixed-line-length-'N:                Fortran Dialect Options.
21464                                                              (line 129)
21465* 'ffpe-summary='LIST:                   Debugging Options.   (line  73)
21466* 'ffpe-trap='LIST:                      Debugging Options.   (line  40)
21467* 'ffree-form':                          Fortran Dialect Options.
21468                                                              (line  11)
21469* 'ffree-line-length-'N:                 Fortran Dialect Options.
21470                                                              (line 151)
21471* 'fimplicit-none':                      Fortran Dialect Options.
21472                                                              (line 162)
21473* 'finit-character':                     Code Gen Options.    (line 372)
21474* 'finit-derived':                       Code Gen Options.    (line 372)
21475* 'finit-integer':                       Code Gen Options.    (line 372)
21476* 'finit-local-zero':                    Code Gen Options.    (line 372)
21477* 'finit-logical':                       Code Gen Options.    (line 372)
21478* 'finit-real':                          Code Gen Options.    (line 372)
21479* 'finline-arg-packing':                 Code Gen Options.    (line 304)
21480* 'finline-matmul-limit':                Code Gen Options.    (line 348)
21481* 'finteger-4-integer-8':                Fortran Dialect Options.
21482                                                              (line 242)
21483* 'fintrinsic-modules-path' DIR:         Directory Options.   (line  36)
21484* 'fmax-array-constructor':              Code Gen Options.    (line 242)
21485* 'fmax-errors='N:                       Error and Warning Options.
21486                                                              (line  27)
21487* 'fmax-identifier-length='N:            Fortran Dialect Options.
21488                                                              (line 158)
21489* 'fmax-stack-var-size':                 Code Gen Options.    (line 260)
21490* 'fmax-subrecord-length='LENGTH:        Runtime Options.     (line  29)
21491* 'fmodule-private':                     Fortran Dialect Options.
21492                                                              (line 124)
21493* 'fno-automatic':                       Code Gen Options.    (line  15)
21494* 'fno-backtrace':                       Debugging Options.   (line  86)
21495* 'fno-protect-parens':                  Code Gen Options.    (line 420)
21496* 'fno-underscoring':                    Code Gen Options.    (line  57)
21497* 'fopenacc':                            Fortran Dialect Options.
21498                                                              (line 171)
21499* 'fopenmp':                             Fortran Dialect Options.
21500                                                              (line 178)
21501* 'fpack-derived':                       Code Gen Options.    (line 282)
21502* 'fpad-source':                         Fortran Dialect Options.
21503                                                              (line 143)
21504* 'fpp':                                 Preprocessing Options.
21505                                                              (line  12)
21506* 'frange-check':                        Fortran Dialect Options.
21507                                                              (line 186)
21508* 'freal-4-real-10':                     Fortran Dialect Options.
21509                                                              (line 257)
21510* 'freal-4-real-16':                     Fortran Dialect Options.
21511                                                              (line 257)
21512* 'freal-4-real-8':                      Fortran Dialect Options.
21513                                                              (line 257)
21514* 'freal-8-real-10':                     Fortran Dialect Options.
21515                                                              (line 257)
21516* 'freal-8-real-16':                     Fortran Dialect Options.
21517                                                              (line 257)
21518* 'freal-8-real-4':                      Fortran Dialect Options.
21519                                                              (line 257)
21520* 'frealloc-lhs':                        Code Gen Options.    (line 429)
21521* 'frecord-marker='LENGTH:               Runtime Options.     (line  21)
21522* 'frecursive':                          Code Gen Options.    (line 362)
21523* 'frepack-arrays':                      Code Gen Options.    (line 288)
21524* 'frontend-loop-interchange':           Code Gen Options.    (line 456)
21525* 'frontend-optimize':                   Code Gen Options.    (line 443)
21526* 'fsecond-underscore':                  Code Gen Options.    (line 113)
21527* 'fshort-enums':                        Code Gen Options.    (line 298)
21528* 'fshort-enums' <1>:                    Fortran 2003 status. (line  92)
21529* 'fsign-zero':                          Runtime Options.     (line  34)
21530* 'fstack-arrays':                       Code Gen Options.    (line 274)
21531* 'fsyntax-only':                        Error and Warning Options.
21532                                                              (line  33)
21533* 'ftest-forall-temp':                   Fortran Dialect Options.
21534                                                              (line 287)
21535* 'fworking-directory':                  Preprocessing Options.
21536                                                              (line  55)
21537* 'H':                                   Preprocessing Options.
21538                                                              (line 174)
21539* 'I'DIR:                                Directory Options.   (line  14)
21540* 'idirafter DIR':                       Preprocessing Options.
21541                                                              (line  69)
21542* 'imultilib DIR':                       Preprocessing Options.
21543                                                              (line  76)
21544* 'iprefix PREFIX':                      Preprocessing Options.
21545                                                              (line  80)
21546* 'iquote DIR':                          Preprocessing Options.
21547                                                              (line  89)
21548* 'isysroot DIR':                        Preprocessing Options.
21549                                                              (line  85)
21550* 'isystem DIR':                         Preprocessing Options.
21551                                                              (line  96)
21552* 'J'DIR:                                Directory Options.   (line  29)
21553* 'M'DIR:                                Directory Options.   (line  29)
21554* 'nostdinc':                            Preprocessing Options.
21555                                                              (line 104)
21556* 'P':                                   Preprocessing Options.
21557                                                              (line 179)
21558* 'pedantic':                            Error and Warning Options.
21559                                                              (line  39)
21560* 'pedantic-errors':                     Error and Warning Options.
21561                                                              (line  58)
21562* 'static-libgfortran':                  Link Options.        (line  11)
21563* 'std='STD option:                      Fortran Dialect Options.
21564                                                              (line 268)
21565* 'tail-call-workaround':                Code Gen Options.    (line 209)
21566* 'UNAME':                               Preprocessing Options.
21567                                                              (line 185)
21568* 'undef':                               Preprocessing Options.
21569                                                              (line 109)
21570* 'Waliasing':                           Error and Warning Options.
21571                                                              (line  71)
21572* 'Walign-commons':                      Error and Warning Options.
21573                                                              (line 228)
21574* 'Wall':                                Error and Warning Options.
21575                                                              (line  62)
21576* 'Wampersand':                          Error and Warning Options.
21577                                                              (line  88)
21578* 'Warray-temporaries':                  Error and Warning Options.
21579                                                              (line  96)
21580* 'Wc-binding-type':                     Error and Warning Options.
21581                                                              (line 101)
21582* 'Wcharacter-truncation':               Error and Warning Options.
21583                                                              (line 108)
21584* 'Wcompare-reals':                      Error and Warning Options.
21585                                                              (line 256)
21586* 'Wconversion':                         Error and Warning Options.
21587                                                              (line 117)
21588* 'Wconversion-extra':                   Error and Warning Options.
21589                                                              (line 121)
21590* 'Wdo-subscript':                       Error and Warning Options.
21591                                                              (line 268)
21592* 'Werror':                              Error and Warning Options.
21593                                                              (line 280)
21594* 'Wextra':                              Error and Warning Options.
21595                                                              (line 125)
21596* 'Wfrontend-loop-interchange':          Error and Warning Options.
21597                                                              (line 130)
21598* 'Wfunction-elimination':               Error and Warning Options.
21599                                                              (line 234)
21600* 'Wimplicit-interface':                 Error and Warning Options.
21601                                                              (line 134)
21602* 'Wimplicit-procedure':                 Error and Warning Options.
21603                                                              (line 140)
21604* 'Winteger-division':                   Error and Warning Options.
21605                                                              (line 144)
21606* 'Wintrinsic-shadow':                   Error and Warning Options.
21607                                                              (line 206)
21608* 'Wintrinsics-std':                     Error and Warning Options.
21609                                                              (line 148)
21610* 'Wline-truncation':                    Error and Warning Options.
21611                                                              (line 111)
21612* 'Woverwrite-recursive':                Error and Warning Options.
21613                                                              (line 155)
21614* 'Wpedantic':                           Error and Warning Options.
21615                                                              (line  39)
21616* 'Wreal-q-constant':                    Error and Warning Options.
21617                                                              (line 162)
21618* 'Wrealloc-lhs':                        Error and Warning Options.
21619                                                              (line 239)
21620* 'Wrealloc-lhs-all':                    Error and Warning Options.
21621                                                              (line 251)
21622* 'Wsurprising':                         Error and Warning Options.
21623                                                              (line 166)
21624* 'Wtabs':                               Error and Warning Options.
21625                                                              (line 188)
21626* 'Wtargt-lifetime':                     Error and Warning Options.
21627                                                              (line 260)
21628* 'Wundefined-do-loop':                  Error and Warning Options.
21629                                                              (line 196)
21630* 'Wunderflow':                          Error and Warning Options.
21631                                                              (line 201)
21632* 'Wunused-dummy-argument':              Error and Warning Options.
21633                                                              (line 217)
21634* 'Wunused-parameter':                   Error and Warning Options.
21635                                                              (line 221)
21636* 'Wuse-without-only':                   Error and Warning Options.
21637                                                              (line 213)
21638* 'Wzerotrip':                           Error and Warning Options.
21639                                                              (line 264)
21640
21641
21642File: gfortran.info,  Node: Keyword Index,  Prev: Option Index,  Up: Top
21643
21644Keyword Index
21645*************
21646
21647�[index�]
21648* Menu:
21649
21650* '$':                                   Fortran Dialect Options.
21651                                                              (line 106)
21652* '%LOC':                                Argument list functions.
21653                                                              (line   6)
21654* '%REF':                                Argument list functions.
21655                                                              (line   6)
21656* '%VAL':                                Argument list functions.
21657                                                              (line   6)
21658* '&':                                   Error and Warning Options.
21659                                                              (line  88)
21660* '[...]':                               Fortran 2003 status. (line  78)
21661* _gfortran_set_args:                    _gfortran_set_args.  (line   6)
21662* _gfortran_set_convert:                 _gfortran_set_convert.
21663                                                              (line   6)
21664* _gfortran_set_fpe:                     _gfortran_set_fpe.   (line   6)
21665* _gfortran_set_max_subrecord_length:    _gfortran_set_max_subrecord_length.
21666                                                              (line   6)
21667* _gfortran_set_options:                 _gfortran_set_options.
21668                                                              (line   6)
21669* _gfortran_set_record_marker:           _gfortran_set_record_marker.
21670                                                              (line   6)
21671* ABORT:                                 ABORT.               (line   6)
21672* ABS:                                   ABS.                 (line   6)
21673* absolute value:                        ABS.                 (line   6)
21674* ACCESS:                                ACCESS.              (line   6)
21675* 'ACCESS='STREAM'' I/O:                 Fortran 2003 status. (line 102)
21676* ACHAR:                                 ACHAR.               (line   6)
21677* ACOS:                                  ACOS.                (line   6)
21678* ACOSD:                                 ACOSD.               (line   6)
21679* ACOSH:                                 ACOSH.               (line   6)
21680* adjust string:                         ADJUSTL.             (line   6)
21681* adjust string <1>:                     ADJUSTR.             (line   6)
21682* ADJUSTL:                               ADJUSTL.             (line   6)
21683* ADJUSTR:                               ADJUSTR.             (line   6)
21684* AIMAG:                                 AIMAG.               (line   6)
21685* AINT:                                  AINT.                (line   6)
21686* ALARM:                                 ALARM.               (line   6)
21687* ALGAMA:                                LOG_GAMMA.           (line   6)
21688* aliasing:                              Error and Warning Options.
21689                                                              (line  71)
21690* alignment of 'COMMON' blocks:          Error and Warning Options.
21691                                                              (line 228)
21692* alignment of 'COMMON' blocks <1>:      Code Gen Options.    (line 408)
21693* ALL:                                   ALL.                 (line   6)
21694* all warnings:                          Error and Warning Options.
21695                                                              (line  62)
21696* 'ALLOCATABLE' components of derived types: Fortran 2003 status.
21697                                                              (line 100)
21698* 'ALLOCATABLE' dummy arguments:         Fortran 2003 status. (line  98)
21699* 'ALLOCATABLE' function results:        Fortran 2003 status. (line  99)
21700* ALLOCATED:                             ALLOCATED.           (line   6)
21701* allocation, moving:                    MOVE_ALLOC.          (line   6)
21702* allocation, status:                    ALLOCATED.           (line   6)
21703* ALOG:                                  LOG.                 (line   6)
21704* ALOG10:                                LOG10.               (line   6)
21705* AMAX0:                                 MAX.                 (line   6)
21706* AMAX1:                                 MAX.                 (line   6)
21707* AMIN0:                                 MIN.                 (line   6)
21708* AMIN1:                                 MIN.                 (line   6)
21709* AMOD:                                  MOD.                 (line   6)
21710* AND:                                   AND.                 (line   6)
21711* ANINT:                                 ANINT.               (line   6)
21712* ANY:                                   ANY.                 (line   6)
21713* area hyperbolic cosine:                ACOSH.               (line   6)
21714* area hyperbolic sine:                  ASINH.               (line   6)
21715* area hyperbolic tangent:               ATANH.               (line   6)
21716* argument list functions:               Argument list functions.
21717                                                              (line   6)
21718* arguments, to program:                 COMMAND_ARGUMENT_COUNT.
21719                                                              (line   6)
21720* arguments, to program <1>:             GETARG.              (line   6)
21721* arguments, to program <2>:             GET_COMMAND.         (line   6)
21722* arguments, to program <3>:             GET_COMMAND_ARGUMENT.
21723                                                              (line   6)
21724* arguments, to program <4>:             IARGC.               (line   6)
21725* array, add elements:                   SUM.                 (line   6)
21726* array, AND:                            IALL.                (line   6)
21727* array, apply condition:                ALL.                 (line   6)
21728* array, apply condition <1>:            ANY.                 (line   6)
21729* array, bounds checking:                Code Gen Options.    (line 144)
21730* array, change dimensions:              RESHAPE.             (line   6)
21731* array, combine arrays:                 MERGE.               (line   6)
21732* array, condition testing:              ALL.                 (line   6)
21733* array, condition testing <1>:          ANY.                 (line   6)
21734* array, conditionally add elements:     SUM.                 (line   6)
21735* array, conditionally count elements:   COUNT.               (line   6)
21736* array, conditionally multiply elements: PRODUCT.            (line   6)
21737* array, constructors:                   Fortran 2003 status. (line  78)
21738* array, contiguity:                     IS_CONTIGUOUS.       (line   6)
21739* array, count elements:                 SIZE.                (line   6)
21740* array, duplicate dimensions:           SPREAD.              (line   6)
21741* array, duplicate elements:             SPREAD.              (line   6)
21742* array, element counting:               COUNT.               (line   6)
21743* array, gather elements:                PACK.                (line   6)
21744* array, increase dimension:             SPREAD.              (line   6)
21745* array, increase dimension <1>:         UNPACK.              (line   6)
21746* array, indices of type real:           Real array indices.  (line   6)
21747* array, location of maximum element:    MAXLOC.              (line   6)
21748* array, location of minimum element:    MINLOC.              (line   6)
21749* array, lower bound:                    LBOUND.              (line   6)
21750* array, maximum value:                  MAXVAL.              (line   6)
21751* array, merge arrays:                   MERGE.               (line   6)
21752* array, minimum value:                  MINVAL.              (line   6)
21753* array, multiply elements:              PRODUCT.             (line   6)
21754* array, number of elements:             COUNT.               (line   6)
21755* array, number of elements <1>:         SIZE.                (line   6)
21756* array, OR:                             IANY.                (line   6)
21757* array, packing:                        PACK.                (line   6)
21758* array, parity:                         IPARITY.             (line   6)
21759* array, permutation:                    CSHIFT.              (line   6)
21760* array, product:                        PRODUCT.             (line   6)
21761* array, reduce dimension:               PACK.                (line   6)
21762* array, rotate:                         CSHIFT.              (line   6)
21763* array, scatter elements:               UNPACK.              (line   6)
21764* array, shape:                          SHAPE.               (line   6)
21765* array, shift:                          EOSHIFT.             (line   6)
21766* array, shift circularly:               CSHIFT.              (line   6)
21767* array, size:                           SIZE.                (line   6)
21768* array, sum:                            SUM.                 (line   6)
21769* array, transmogrify:                   RESHAPE.             (line   6)
21770* array, transpose:                      TRANSPOSE.           (line   6)
21771* array, unpacking:                      UNPACK.              (line   6)
21772* array, upper bound:                    UBOUND.              (line   6)
21773* array, XOR:                            IPARITY.             (line   6)
21774* ASCII collating sequence:              ACHAR.               (line   6)
21775* ASCII collating sequence <1>:          IACHAR.              (line   6)
21776* ASIN:                                  ASIN.                (line   6)
21777* ASIND:                                 ASIND.               (line   6)
21778* ASINH:                                 ASINH.               (line   6)
21779* ASSOCIATED:                            ASSOCIATED.          (line   6)
21780* association status:                    ASSOCIATED.          (line   6)
21781* association status, C pointer:         C_ASSOCIATED.        (line   6)
21782* asynchronous I/O:                      Asynchronous I/O.    (line   6)
21783* ATAN:                                  ATAN.                (line   6)
21784* ATAN2:                                 ATAN2.               (line   6)
21785* ATAN2D:                                ATAN2D.              (line   6)
21786* ATAND:                                 ATAND.               (line   6)
21787* ATANH:                                 ATANH.               (line   6)
21788* Atomic subroutine, add:                ATOMIC_ADD.          (line   6)
21789* Atomic subroutine, ADD with fetch:     ATOMIC_FETCH_ADD.    (line   6)
21790* Atomic subroutine, AND:                ATOMIC_AND.          (line   6)
21791* Atomic subroutine, AND with fetch:     ATOMIC_FETCH_AND.    (line   6)
21792* Atomic subroutine, compare and swap:   ATOMIC_CAS.          (line   6)
21793* Atomic subroutine, define:             ATOMIC_DEFINE.       (line   6)
21794* Atomic subroutine, OR:                 ATOMIC_OR.           (line   6)
21795* Atomic subroutine, OR with fetch:      ATOMIC_FETCH_OR.     (line   6)
21796* Atomic subroutine, reference:          ATOMIC_REF.          (line   6)
21797* Atomic subroutine, XOR:                ATOMIC_XOR.          (line   6)
21798* Atomic subroutine, XOR with fetch:     ATOMIC_FETCH_XOR.    (line   6)
21799* ATOMIC_ADD:                            ATOMIC_ADD.          (line   6)
21800* ATOMIC_AND:                            ATOMIC_AND.          (line   6)
21801* ATOMIC_DEFINE:                         ATOMIC_CAS.          (line   6)
21802* ATOMIC_DEFINE <1>:                     ATOMIC_DEFINE.       (line   6)
21803* ATOMIC_FETCH_ADD:                      ATOMIC_FETCH_ADD.    (line   6)
21804* ATOMIC_FETCH_AND:                      ATOMIC_FETCH_AND.    (line   6)
21805* ATOMIC_FETCH_OR:                       ATOMIC_FETCH_OR.     (line   6)
21806* ATOMIC_FETCH_XOR:                      ATOMIC_FETCH_XOR.    (line   6)
21807* ATOMIC_OR:                             ATOMIC_OR.           (line   6)
21808* ATOMIC_REF:                            ATOMIC_REF.          (line   6)
21809* ATOMIC_XOR:                            ATOMIC_XOR.          (line   6)
21810* Authors:                               Contributors.        (line   6)
21811* 'AUTOMATIC':                           AUTOMATIC and STATIC attributes.
21812                                                              (line   6)
21813* BABS:                                  ABS.                 (line   6)
21814* backslash:                             Fortran Dialect Options.
21815                                                              (line 112)
21816* 'BACKSPACE':                           Read/Write after EOF marker.
21817                                                              (line   6)
21818* BACKTRACE:                             BACKTRACE.           (line   6)
21819* backtrace:                             Debugging Options.   (line  86)
21820* backtrace <1>:                         BACKTRACE.           (line   6)
21821* base 10 logarithm function:            LOG10.               (line   6)
21822* BBCLR:                                 IBCLR.               (line   6)
21823* BBITS:                                 IBITS.               (line   6)
21824* BBSET:                                 IBSET.               (line   6)
21825* BBTEST:                                BTEST.               (line   6)
21826* BESJ0:                                 BESSEL_J0.           (line   6)
21827* BESJ1:                                 BESSEL_J1.           (line   6)
21828* BESJN:                                 BESSEL_JN.           (line   6)
21829* Bessel function, first kind:           BESSEL_J0.           (line   6)
21830* Bessel function, first kind <1>:       BESSEL_J1.           (line   6)
21831* Bessel function, first kind <2>:       BESSEL_JN.           (line   6)
21832* Bessel function, second kind:          BESSEL_Y0.           (line   6)
21833* Bessel function, second kind <1>:      BESSEL_Y1.           (line   6)
21834* Bessel function, second kind <2>:      BESSEL_YN.           (line   6)
21835* BESSEL_J0:                             BESSEL_J0.           (line   6)
21836* BESSEL_J1:                             BESSEL_J1.           (line   6)
21837* BESSEL_JN:                             BESSEL_JN.           (line   6)
21838* BESSEL_Y0:                             BESSEL_Y0.           (line   6)
21839* BESSEL_Y1:                             BESSEL_Y1.           (line   6)
21840* BESSEL_YN:                             BESSEL_YN.           (line   6)
21841* BESY0:                                 BESSEL_Y0.           (line   6)
21842* BESY1:                                 BESSEL_Y1.           (line   6)
21843* BESYN:                                 BESSEL_YN.           (line   6)
21844* BGE:                                   BGE.                 (line   6)
21845* BGT:                                   BGT.                 (line   6)
21846* BIAND:                                 IAND.                (line   6)
21847* BIEOR:                                 IEOR.                (line   6)
21848* binary representation:                 POPCNT.              (line   6)
21849* binary representation <1>:             POPPAR.              (line   6)
21850* BIOR:                                  IOR.                 (line   6)
21851* bit intrinsics checking:               Code Gen Options.    (line 144)
21852* BITEST:                                BTEST.               (line   6)
21853* bits set:                              POPCNT.              (line   6)
21854* bits, AND of array elements:           IALL.                (line   6)
21855* bits, clear:                           IBCLR.               (line   6)
21856* bits, extract:                         IBITS.               (line   6)
21857* bits, get:                             IBITS.               (line   6)
21858* bits, merge:                           MERGE_BITS.          (line   6)
21859* bits, move:                            MVBITS.              (line   6)
21860* bits, move <1>:                        TRANSFER.            (line   6)
21861* bits, negate:                          NOT.                 (line   6)
21862* bits, number of:                       BIT_SIZE.            (line   6)
21863* bits, OR of array elements:            IANY.                (line   6)
21864* bits, set:                             IBSET.               (line   6)
21865* bits, shift:                           ISHFT.               (line   6)
21866* bits, shift circular:                  ISHFTC.              (line   6)
21867* bits, shift left:                      LSHIFT.              (line   6)
21868* bits, shift left <1>:                  SHIFTL.              (line   6)
21869* bits, shift right:                     RSHIFT.              (line   6)
21870* bits, shift right <1>:                 SHIFTA.              (line   6)
21871* bits, shift right <2>:                 SHIFTR.              (line   6)
21872* bits, testing:                         BTEST.               (line   6)
21873* bits, unset:                           IBCLR.               (line   6)
21874* bits, XOR of array elements:           IPARITY.             (line   6)
21875* bitwise comparison:                    BGE.                 (line   6)
21876* bitwise comparison <1>:                BGT.                 (line   6)
21877* bitwise comparison <2>:                BLE.                 (line   6)
21878* bitwise comparison <3>:                BLT.                 (line   6)
21879* bitwise logical and:                   AND.                 (line   6)
21880* bitwise logical and <1>:               IAND.                (line   6)
21881* bitwise logical exclusive or:          IEOR.                (line   6)
21882* bitwise logical exclusive or <1>:      XOR.                 (line   6)
21883* bitwise logical not:                   NOT.                 (line   6)
21884* bitwise logical or:                    IOR.                 (line   6)
21885* bitwise logical or <1>:                OR.                  (line   6)
21886* BIT_SIZE:                              BIT_SIZE.            (line   6)
21887* BJTEST:                                BTEST.               (line   6)
21888* BKTEST:                                BTEST.               (line   6)
21889* BLE:                                   BLE.                 (line   6)
21890* BLT:                                   BLT.                 (line   6)
21891* BMOD:                                  MOD.                 (line   6)
21892* BMVBITS:                               MVBITS.              (line   6)
21893* BNOT:                                  NOT.                 (line   6)
21894* bounds checking:                       Code Gen Options.    (line 144)
21895* BOZ literal constants:                 BOZ literal constants.
21896                                                              (line   6)
21897* BSHFT:                                 ISHFT.               (line   6)
21898* BSHFTC:                                ISHFTC.              (line   6)
21899* BTEST:                                 BTEST.               (line   6)
21900* CABS:                                  ABS.                 (line   6)
21901* calling convention:                    Code Gen Options.    (line  28)
21902* 'CARRIAGECONTROL':                     Extended I/O specifiers.
21903                                                              (line   6)
21904* CCOS:                                  COS.                 (line   6)
21905* CCOSD:                                 COSD.                (line   6)
21906* CDABS:                                 ABS.                 (line   6)
21907* CDCOS:                                 COS.                 (line   6)
21908* CDCOSD:                                COSD.                (line   6)
21909* CDEXP:                                 EXP.                 (line   6)
21910* CDLOG:                                 LOG.                 (line   6)
21911* CDSIN:                                 SIN.                 (line   6)
21912* CDSIND:                                SIND.                (line   6)
21913* CDSQRT:                                SQRT.                (line   6)
21914* CEILING:                               CEILING.             (line   6)
21915* ceiling:                               ANINT.               (line   6)
21916* ceiling <1>:                           CEILING.             (line   6)
21917* CEXP:                                  EXP.                 (line   6)
21918* CHAR:                                  CHAR.                (line   6)
21919* character kind:                        SELECTED_CHAR_KIND.  (line   6)
21920* character set:                         Fortran Dialect Options.
21921                                                              (line 106)
21922* CHDIR:                                 CHDIR.               (line   6)
21923* checking array temporaries:            Code Gen Options.    (line 144)
21924* checking subscripts:                   Code Gen Options.    (line 144)
21925* CHMOD:                                 CHMOD.               (line   6)
21926* clock ticks:                           MCLOCK.              (line   6)
21927* clock ticks <1>:                       MCLOCK8.             (line   6)
21928* clock ticks <2>:                       SYSTEM_CLOCK.        (line   6)
21929* CLOG:                                  LOG.                 (line   6)
21930* CMPLX:                                 CMPLX.               (line   6)
21931* coarray, 'IMAGE_INDEX':                IMAGE_INDEX.         (line   6)
21932* coarray, lower bound:                  LCOBOUND.            (line   6)
21933* coarray, 'NUM_IMAGES':                 NUM_IMAGES.          (line   6)
21934* coarray, 'THIS_IMAGE':                 THIS_IMAGE.          (line   6)
21935* coarray, upper bound:                  UCOBOUND.            (line   6)
21936* Coarray, _gfortran_caf_atomic_cas:     _gfortran_caf_atomic_cas.
21937                                                              (line   6)
21938* Coarray, _gfortran_caf_atomic_define:  _gfortran_caf_atomic_define.
21939                                                              (line   6)
21940* Coarray, _gfortran_caf_atomic_op:      _gfortran_caf_atomic_op.
21941                                                              (line   6)
21942* Coarray, _gfortran_caf_atomic_ref:     _gfortran_caf_atomic_ref.
21943                                                              (line   6)
21944* Coarray, _gfortran_caf_co_broadcast:   _gfortran_caf_co_broadcast.
21945                                                              (line   6)
21946* Coarray, _gfortran_caf_co_max:         _gfortran_caf_co_max.
21947                                                              (line   6)
21948* Coarray, _gfortran_caf_co_min:         _gfortran_caf_co_min.
21949                                                              (line   6)
21950* Coarray, _gfortran_caf_co_reduce:      _gfortran_caf_co_reduce.
21951                                                              (line   6)
21952* Coarray, _gfortran_caf_co_sum:         _gfortran_caf_co_sum.
21953                                                              (line   6)
21954* Coarray, _gfortran_caf_deregister:     _gfortran_caf_deregister.
21955                                                              (line   6)
21956* Coarray, _gfortran_caf_error_stop:     _gfortran_caf_error_stop.
21957                                                              (line   6)
21958* Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
21959                                                              (line   6)
21960* Coarray, _gfortran_caf_event_post:     _gfortran_caf_event_post.
21961                                                              (line   6)
21962* Coarray, _gfortran_caf_event_query:    _gfortran_caf_event_query.
21963                                                              (line   6)
21964* Coarray, _gfortran_caf_event_wait:     _gfortran_caf_event_wait.
21965                                                              (line   6)
21966* Coarray, _gfortran_caf_failed_images:  _gfortran_caf_failed_images.
21967                                                              (line   6)
21968* Coarray, _gfortran_caf_fail_image:     _gfortran_caf_fail_image.
21969                                                              (line   6)
21970* Coarray, _gfortran_caf_finish:         _gfortran_caf_finish.
21971                                                              (line   6)
21972* Coarray, _gfortran_caf_get:            _gfortran_caf_get.   (line   6)
21973* Coarray, _gfortran_caf_get_by_ref:     _gfortran_caf_get_by_ref.
21974                                                              (line   6)
21975* Coarray, _gfortran_caf_image_status:   _gfortran_caf_image_status.
21976                                                              (line   6)
21977* Coarray, _gfortran_caf_init:           _gfortran_caf_init.  (line   6)
21978* Coarray, _gfortran_caf_is_present:     _gfortran_caf_is_present.
21979                                                              (line   6)
21980* Coarray, _gfortran_caf_lock:           _gfortran_caf_lock.  (line   6)
21981* Coarray, _gfortran_caf_num_images:     _gfortran_caf_num_images.
21982                                                              (line   6)
21983* Coarray, _gfortran_caf_register:       _gfortran_caf_register.
21984                                                              (line   6)
21985* Coarray, _gfortran_caf_send:           _gfortran_caf_send.  (line   6)
21986* Coarray, _gfortran_caf_sendget:        _gfortran_caf_sendget.
21987                                                              (line   6)
21988* Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref.
21989                                                              (line   6)
21990* Coarray, _gfortran_caf_send_by_ref:    _gfortran_caf_send_by_ref.
21991                                                              (line   6)
21992* Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images.
21993                                                              (line   6)
21994* Coarray, _gfortran_caf_sync_all:       _gfortran_caf_sync_all.
21995                                                              (line   6)
21996* Coarray, _gfortran_caf_sync_images:    _gfortran_caf_sync_images.
21997                                                              (line   6)
21998* Coarray, _gfortran_caf_sync_memory:    _gfortran_caf_sync_memory.
21999                                                              (line   6)
22000* Coarray, _gfortran_caf_this_image:     _gfortran_caf_this_image.
22001                                                              (line   6)
22002* Coarray, _gfortran_caf_unlock:         _gfortran_caf_unlock.
22003                                                              (line   6)
22004* coarrays:                              Code Gen Options.    (line 130)
22005* Coarrays:                              Coarray Programming. (line   6)
22006* code generation, conventions:          Code Gen Options.    (line   6)
22007* collating sequence, ASCII:             ACHAR.               (line   6)
22008* collating sequence, ASCII <1>:         IACHAR.              (line   6)
22009* Collectives, generic reduction:        CO_REDUCE.           (line   6)
22010* Collectives, maximal value:            CO_MAX.              (line   6)
22011* Collectives, minimal value:            CO_MIN.              (line   6)
22012* Collectives, sum of values:            CO_SUM.              (line   6)
22013* Collectives, value broadcasting:       CO_BROADCAST.        (line   6)
22014* command line:                          EXECUTE_COMMAND_LINE.
22015                                                              (line   6)
22016* command options:                       Invoking GNU Fortran.
22017                                                              (line   6)
22018* command-line arguments:                COMMAND_ARGUMENT_COUNT.
22019                                                              (line   6)
22020* command-line arguments <1>:            GETARG.              (line   6)
22021* command-line arguments <2>:            GET_COMMAND.         (line   6)
22022* command-line arguments <3>:            GET_COMMAND_ARGUMENT.
22023                                                              (line   6)
22024* command-line arguments <4>:            IARGC.               (line   6)
22025* command-line arguments, number of:     COMMAND_ARGUMENT_COUNT.
22026                                                              (line   6)
22027* command-line arguments, number of <1>: IARGC.               (line   6)
22028* COMMAND_ARGUMENT_COUNT:                COMMAND_ARGUMENT_COUNT.
22029                                                              (line   6)
22030* 'COMMON':                              Volatile COMMON blocks.
22031                                                              (line   6)
22032* compiler flags inquiry function:       COMPILER_OPTIONS.    (line   6)
22033* compiler, name and version:            COMPILER_VERSION.    (line   6)
22034* COMPILER_OPTIONS:                      COMPILER_OPTIONS.    (line   6)
22035* COMPILER_VERSION:                      COMPILER_VERSION.    (line   6)
22036* COMPLEX:                               COMPLEX.             (line   6)
22037* complex conjugate:                     CONJG.               (line   6)
22038* Complex function:                      Alternate complex function syntax.
22039                                                              (line   6)
22040* complex numbers, conversion to:        CMPLX.               (line   6)
22041* complex numbers, conversion to <1>:    COMPLEX.             (line   6)
22042* complex numbers, conversion to <2>:    DCMPLX.              (line   6)
22043* complex numbers, imaginary part:       AIMAG.               (line   6)
22044* complex numbers, real part:            DREAL.               (line   6)
22045* complex numbers, real part <1>:        REAL.                (line   6)
22046* Conditional compilation:               Preprocessing and conditional compilation.
22047                                                              (line   6)
22048* CONJG:                                 CONJG.               (line   6)
22049* consistency, durability:               Data consistency and durability.
22050                                                              (line   6)
22051* Contributing:                          Contributing.        (line   6)
22052* Contributors:                          Contributors.        (line   6)
22053* conversion:                            Error and Warning Options.
22054                                                              (line 117)
22055* conversion <1>:                        Error and Warning Options.
22056                                                              (line 121)
22057* conversion, to character:              Character conversion.
22058                                                              (line   6)
22059* conversion, to character <1>:          CHAR.                (line   6)
22060* conversion, to complex:                CMPLX.               (line   6)
22061* conversion, to complex <1>:            COMPLEX.             (line   6)
22062* conversion, to complex <2>:            DCMPLX.              (line   6)
22063* conversion, to integer:                Implicitly convert LOGICAL and INTEGER values.
22064                                                              (line   6)
22065* conversion, to integer <1>:            IACHAR.              (line   6)
22066* conversion, to integer <2>:            ICHAR.               (line   6)
22067* conversion, to integer <3>:            INT.                 (line   6)
22068* conversion, to integer <4>:            INT2.                (line   6)
22069* conversion, to integer <5>:            INT8.                (line   6)
22070* conversion, to integer <6>:            LONG.                (line   6)
22071* conversion, to logical:                Implicitly convert LOGICAL and INTEGER values.
22072                                                              (line   6)
22073* conversion, to logical <1>:            LOGICAL.             (line   6)
22074* conversion, to real:                   DBLE.                (line   6)
22075* conversion, to real <1>:               REAL.                (line   6)
22076* conversion, to string:                 CTIME.               (line   6)
22077* 'CONVERT' specifier:                   CONVERT specifier.   (line   6)
22078* core, dump:                            ABORT.               (line   6)
22079* COS:                                   COS.                 (line   6)
22080* COSD:                                  COSD.                (line   6)
22081* COSH:                                  COSH.                (line   6)
22082* cosine:                                COS.                 (line   6)
22083* cosine, degrees:                       COSD.                (line   6)
22084* cosine, hyperbolic:                    COSH.                (line   6)
22085* cosine, hyperbolic, inverse:           ACOSH.               (line   6)
22086* cosine, inverse:                       ACOS.                (line   6)
22087* cosine, inverse, degrees:              ACOSD.               (line   6)
22088* COTAN:                                 COTAN.               (line   6)
22089* COTAND:                                COTAND.              (line   6)
22090* cotangent:                             COTAN.               (line   6)
22091* cotangent, degrees:                    COTAND.              (line   6)
22092* COUNT:                                 COUNT.               (line   6)
22093* CO_BROADCAST:                          CO_BROADCAST.        (line   6)
22094* CO_MAX:                                CO_MAX.              (line   6)
22095* CO_MIN:                                CO_MIN.              (line   6)
22096* CO_REDUCE:                             CO_REDUCE.           (line   6)
22097* CO_SUM:                                CO_SUM.              (line   6)
22098* CPP:                                   Preprocessing and conditional compilation.
22099                                                              (line   6)
22100* CPP <1>:                               Preprocessing Options.
22101                                                              (line   6)
22102* CPU_TIME:                              CPU_TIME.            (line   6)
22103* Credits:                               Contributors.        (line   6)
22104* CSHIFT:                                CSHIFT.              (line   6)
22105* CSIN:                                  SIN.                 (line   6)
22106* CSIND:                                 SIND.                (line   6)
22107* CSQRT:                                 SQRT.                (line   6)
22108* CTIME:                                 CTIME.               (line   6)
22109* current date:                          DATE_AND_TIME.       (line   6)
22110* current date <1>:                      FDATE.               (line   6)
22111* current date <2>:                      IDATE.               (line   6)
22112* current time:                          DATE_AND_TIME.       (line   6)
22113* current time <1>:                      FDATE.               (line   6)
22114* current time <2>:                      ITIME.               (line   6)
22115* current time <3>:                      TIME.                (line   6)
22116* current time <4>:                      TIME8.               (line   6)
22117* C_ASSOCIATED:                          C_ASSOCIATED.        (line   6)
22118* C_FUNLOC:                              C_FUNLOC.            (line   6)
22119* C_F_POINTER:                           C_F_POINTER.         (line   6)
22120* C_F_PROCPOINTER:                       C_F_PROCPOINTER.     (line   6)
22121* C_LOC:                                 C_LOC.               (line   6)
22122* C_SIZEOF:                              C_SIZEOF.            (line   6)
22123* DABS:                                  ABS.                 (line   6)
22124* DACOS:                                 ACOS.                (line   6)
22125* DACOSD:                                ACOSD.               (line   6)
22126* DACOSH:                                ACOSH.               (line   6)
22127* DASIN:                                 ASIN.                (line   6)
22128* DASIND:                                ASIND.               (line   6)
22129* DASINH:                                ASINH.               (line   6)
22130* DATAN:                                 ATAN.                (line   6)
22131* DATAN2:                                ATAN2.               (line   6)
22132* DATAN2D:                               ATAN2D.              (line   6)
22133* DATAND:                                ATAND.               (line   6)
22134* DATANH:                                ATANH.               (line   6)
22135* date, current:                         DATE_AND_TIME.       (line   6)
22136* date, current <1>:                     FDATE.               (line   6)
22137* date, current <2>:                     IDATE.               (line   6)
22138* DATE_AND_TIME:                         DATE_AND_TIME.       (line   6)
22139* DBESJ0:                                BESSEL_J0.           (line   6)
22140* DBESJ1:                                BESSEL_J1.           (line   6)
22141* DBESJN:                                BESSEL_JN.           (line   6)
22142* DBESY0:                                BESSEL_Y0.           (line   6)
22143* DBESY1:                                BESSEL_Y1.           (line   6)
22144* DBESYN:                                BESSEL_YN.           (line   6)
22145* DBLE:                                  DBLE.                (line   6)
22146* DCMPLX:                                DCMPLX.              (line   6)
22147* DCONJG:                                CONJG.               (line   6)
22148* DCOS:                                  COS.                 (line   6)
22149* DCOSD:                                 COSD.                (line   6)
22150* DCOSH:                                 COSH.                (line   6)
22151* DCOTAN:                                COTAN.               (line   6)
22152* DCOTAND:                               COTAND.              (line   6)
22153* DDIM:                                  DIM.                 (line   6)
22154* debugging information options:         Debugging Options.   (line   6)
22155* debugging, preprocessor:               Preprocessing Options.
22156                                                              (line  26)
22157* debugging, preprocessor <1>:           Preprocessing Options.
22158                                                              (line  35)
22159* debugging, preprocessor <2>:           Preprocessing Options.
22160                                                              (line  41)
22161* debugging, preprocessor <3>:           Preprocessing Options.
22162                                                              (line  44)
22163* debugging, preprocessor <4>:           Preprocessing Options.
22164                                                              (line  51)
22165* 'DECODE':                              ENCODE and DECODE statements.
22166                                                              (line   6)
22167* delayed execution:                     ALARM.               (line   6)
22168* delayed execution <1>:                 SLEEP.               (line   6)
22169* DEXP:                                  EXP.                 (line   6)
22170* DFLOAT:                                REAL.                (line   6)
22171* DGAMMA:                                GAMMA.               (line   6)
22172* dialect options:                       Fortran Dialect Options.
22173                                                              (line   6)
22174* DIGITS:                                DIGITS.              (line   6)
22175* DIM:                                   DIM.                 (line   6)
22176* DIMAG:                                 AIMAG.               (line   6)
22177* DINT:                                  AINT.                (line   6)
22178* directive, 'INCLUDE':                  Directory Options.   (line   6)
22179* directory, options:                    Directory Options.   (line   6)
22180* directory, search paths for inclusion: Directory Options.   (line  14)
22181* division, modulo:                      MODULO.              (line   6)
22182* division, remainder:                   MOD.                 (line   6)
22183* DLGAMA:                                LOG_GAMMA.           (line   6)
22184* DLOG:                                  LOG.                 (line   6)
22185* DLOG10:                                LOG10.               (line   6)
22186* DMAX1:                                 MAX.                 (line   6)
22187* DMIN1:                                 MIN.                 (line   6)
22188* DMOD:                                  MOD.                 (line   6)
22189* DNINT:                                 ANINT.               (line   6)
22190* dot product:                           DOT_PRODUCT.         (line   6)
22191* DOT_PRODUCT:                           DOT_PRODUCT.         (line   6)
22192* DPROD:                                 DPROD.               (line   6)
22193* DREAL:                                 DREAL.               (line   6)
22194* DSHIFTL:                               DSHIFTL.             (line   6)
22195* DSHIFTR:                               DSHIFTR.             (line   6)
22196* DSIGN:                                 SIGN.                (line   6)
22197* DSIN:                                  SIN.                 (line   6)
22198* DSIND:                                 SIND.                (line   6)
22199* DSINH:                                 SINH.                (line   6)
22200* DSQRT:                                 SQRT.                (line   6)
22201* DTAN:                                  TAN.                 (line   6)
22202* DTAND:                                 TAND.                (line   6)
22203* DTANH:                                 TANH.                (line   6)
22204* DTIME:                                 DTIME.               (line   6)
22205* dummy argument, unused:                Error and Warning Options.
22206                                                              (line 217)
22207* elapsed time:                          DTIME.               (line   6)
22208* elapsed time <1>:                      SECNDS.              (line   6)
22209* elapsed time <2>:                      SECOND.              (line   6)
22210* Elimination of functions with identical argument lists: Code Gen Options.
22211                                                              (line 435)
22212* 'ENCODE':                              ENCODE and DECODE statements.
22213                                                              (line   6)
22214* 'ENUM' statement:                      Fortran 2003 status. (line  92)
22215* 'ENUMERATOR' statement:                Fortran 2003 status. (line  92)
22216* environment variable:                  Environment Variables.
22217                                                              (line   6)
22218* environment variable <1>:              Runtime.             (line   6)
22219* environment variable <2>:              GETENV.              (line   6)
22220* environment variable <3>:              GET_ENVIRONMENT_VARIABLE.
22221                                                              (line   6)
22222* 'EOF':                                 Read/Write after EOF marker.
22223                                                              (line   6)
22224* EOSHIFT:                               EOSHIFT.             (line   6)
22225* EPSILON:                               EPSILON.             (line   6)
22226* ERF:                                   ERF.                 (line   6)
22227* ERFC:                                  ERFC.                (line   6)
22228* ERFC_SCALED:                           ERFC_SCALED.         (line   6)
22229* error function:                        ERF.                 (line   6)
22230* error function, complementary:         ERFC.                (line   6)
22231* error function, complementary, exponentially-scaled: ERFC_SCALED.
22232                                                              (line   6)
22233* errors, limiting:                      Error and Warning Options.
22234                                                              (line  27)
22235* escape characters:                     Fortran Dialect Options.
22236                                                              (line 112)
22237* ETIME:                                 ETIME.               (line   6)
22238* Euclidean distance:                    HYPOT.               (line   6)
22239* Euclidean vector norm:                 NORM2.               (line   6)
22240* Events, EVENT_QUERY:                   EVENT_QUERY.         (line   6)
22241* EVENT_QUERY:                           EVENT_QUERY.         (line   6)
22242* EXECUTE_COMMAND_LINE:                  EXECUTE_COMMAND_LINE.
22243                                                              (line   6)
22244* EXIT:                                  EXIT.                (line   6)
22245* EXP:                                   EXP.                 (line   6)
22246* EXPONENT:                              EXPONENT.            (line   6)
22247* exponent:                              Default exponents.   (line   6)
22248* exponential function:                  EXP.                 (line   6)
22249* exponential function, inverse:         LOG.                 (line   6)
22250* exponential function, inverse <1>:     LOG10.               (line   6)
22251* expression size:                       C_SIZEOF.            (line   6)
22252* expression size <1>:                   SIZEOF.              (line   6)
22253* EXTENDS_TYPE_OF:                       EXTENDS_TYPE_OF.     (line   6)
22254* extensions:                            Extensions.          (line   6)
22255* extensions, implemented:               Extensions implemented in GNU Fortran.
22256                                                              (line   6)
22257* extensions, not implemented:           Extensions not implemented in GNU Fortran.
22258                                                              (line   6)
22259* extra warnings:                        Error and Warning Options.
22260                                                              (line 125)
22261* 'f2c' calling convention:              Code Gen Options.    (line  28)
22262* 'f2c' calling convention <1>:          Code Gen Options.    (line 113)
22263* Factorial function:                    GAMMA.               (line   6)
22264* FDATE:                                 FDATE.               (line   6)
22265* FDL, GNU Free Documentation License:   GNU Free Documentation License.
22266                                                              (line   6)
22267* FGET:                                  FGET.                (line   6)
22268* FGETC:                                 FGETC.               (line   6)
22269* file format, fixed:                    Fortran Dialect Options.
22270                                                              (line  11)
22271* file format, fixed <1>:                Fortran Dialect Options.
22272                                                              (line 129)
22273* file format, free:                     Fortran Dialect Options.
22274                                                              (line  11)
22275* file format, free <1>:                 Fortran Dialect Options.
22276                                                              (line 151)
22277* file operation, file number:           FNUM.                (line   6)
22278* file operation, flush:                 FLUSH.               (line   6)
22279* file operation, position:              FSEEK.               (line   6)
22280* file operation, position <1>:          FTELL.               (line   6)
22281* file operation, read character:        FGET.                (line   6)
22282* file operation, read character <1>:    FGETC.               (line   6)
22283* file operation, seek:                  FSEEK.               (line   6)
22284* file operation, write character:       FPUT.                (line   6)
22285* file operation, write character <1>:   FPUTC.               (line   6)
22286* file system, access mode:              ACCESS.              (line   6)
22287* file system, change access mode:       CHMOD.               (line   6)
22288* file system, create link:              LINK.                (line   6)
22289* file system, create link <1>:          SYMLNK.              (line   6)
22290* file system, file creation mask:       UMASK.               (line   6)
22291* file system, file status:              FSTAT.               (line   6)
22292* file system, file status <1>:          LSTAT.               (line   6)
22293* file system, file status <2>:          STAT.                (line   6)
22294* file system, hard link:                LINK.                (line   6)
22295* file system, remove file:              UNLINK.              (line   6)
22296* file system, rename file:              RENAME.              (line   6)
22297* file system, soft link:                SYMLNK.              (line   6)
22298* file, symbolic link:                   File operations on symbolic links.
22299                                                              (line   6)
22300* file, unformatted sequential:          File format of unformatted sequential files.
22301                                                              (line   6)
22302* FINDLOC:                               FINDLOC.             (line   6)
22303* findloc:                               FINDLOC.             (line   6)
22304* flags inquiry function:                COMPILER_OPTIONS.    (line   6)
22305* FLOAT:                                 REAL.                (line   6)
22306* FLOATI:                                REAL.                (line   6)
22307* floating point, exponent:              EXPONENT.            (line   6)
22308* floating point, fraction:              FRACTION.            (line   6)
22309* floating point, nearest different:     NEAREST.             (line   6)
22310* floating point, relative spacing:      RRSPACING.           (line   6)
22311* floating point, relative spacing <1>:  SPACING.             (line   6)
22312* floating point, scale:                 SCALE.               (line   6)
22313* floating point, set exponent:          SET_EXPONENT.        (line   6)
22314* FLOATJ:                                REAL.                (line   6)
22315* FLOATK:                                REAL.                (line   6)
22316* FLOOR:                                 FLOOR.               (line   6)
22317* floor:                                 AINT.                (line   6)
22318* floor <1>:                             FLOOR.               (line   6)
22319* FLUSH:                                 FLUSH.               (line   6)
22320* 'FLUSH' statement:                     Fortran 2003 status. (line  88)
22321* FNUM:                                  FNUM.                (line   6)
22322* form feed whitespace:                  Form feed as whitespace.
22323                                                              (line   6)
22324* 'FORMAT':                              Variable FORMAT expressions.
22325                                                              (line   6)
22326* Fortran 77:                            GNU Fortran and G77. (line   6)
22327* FPP:                                   Preprocessing and conditional compilation.
22328                                                              (line   6)
22329* FPUT:                                  FPUT.                (line   6)
22330* FPUTC:                                 FPUTC.               (line   6)
22331* FRACTION:                              FRACTION.            (line   6)
22332* FREE:                                  FREE.                (line   6)
22333* Front-end optimization:                Code Gen Options.    (line 443)
22334* FSEEK:                                 FSEEK.               (line   6)
22335* FSTAT:                                 FSTAT.               (line   6)
22336* FTELL:                                 FTELL.               (line   6)
22337* function elimination:                  Error and Warning Options.
22338                                                              (line 234)
22339* 'g77':                                 GNU Fortran and G77. (line   6)
22340* 'g77' calling convention:              Code Gen Options.    (line  28)
22341* 'g77' calling convention <1>:          Code Gen Options.    (line 113)
22342* GAMMA:                                 GAMMA.               (line   6)
22343* Gamma function:                        GAMMA.               (line   6)
22344* Gamma function, logarithm of:          LOG_GAMMA.           (line   6)
22345* GCC:                                   GNU Fortran and GCC. (line   6)
22346* Generating C prototypes from external procedures: Interoperability Options.
22347                                                              (line  25)
22348* Generating C prototypes from Fortran BIND(C) enteties: Interoperability Options.
22349                                                              (line   7)
22350* GERROR:                                GERROR.              (line   6)
22351* GETARG:                                GETARG.              (line   6)
22352* GETCWD:                                GETCWD.              (line   6)
22353* GETENV:                                GETENV.              (line   6)
22354* GETGID:                                GETGID.              (line   6)
22355* GETLOG:                                GETLOG.              (line   6)
22356* GETPID:                                GETPID.              (line   6)
22357* GETUID:                                GETUID.              (line   6)
22358* GET_COMMAND:                           GET_COMMAND.         (line   6)
22359* GET_COMMAND_ARGUMENT:                  GET_COMMAND_ARGUMENT.
22360                                                              (line   6)
22361* GET_ENVIRONMENT_VARIABLE:              GET_ENVIRONMENT_VARIABLE.
22362                                                              (line   6)
22363* GMTIME:                                GMTIME.              (line   6)
22364* GNU Compiler Collection:               GNU Fortran and GCC. (line   6)
22365* GNU Fortran command options:           Invoking GNU Fortran.
22366                                                              (line   6)
22367* Hollerith constants:                   Hollerith constants support.
22368                                                              (line   6)
22369* HOSTNM:                                HOSTNM.              (line   6)
22370* HUGE:                                  HUGE.                (line   6)
22371* hyperbolic cosine:                     COSH.                (line   6)
22372* hyperbolic function, cosine:           COSH.                (line   6)
22373* hyperbolic function, cosine, inverse:  ACOSH.               (line   6)
22374* hyperbolic function, sine:             SINH.                (line   6)
22375* hyperbolic function, sine, inverse:    ASINH.               (line   6)
22376* hyperbolic function, tangent:          TANH.                (line   6)
22377* hyperbolic function, tangent, inverse: ATANH.               (line   6)
22378* hyperbolic sine:                       SINH.                (line   6)
22379* hyperbolic tangent:                    TANH.                (line   6)
22380* HYPOT:                                 HYPOT.               (line   6)
22381* I/O item lists:                        I/O item lists.      (line   6)
22382* I/O specifiers:                        Extended I/O specifiers.
22383                                                              (line   6)
22384* IABS:                                  ABS.                 (line   6)
22385* IACHAR:                                IACHAR.              (line   6)
22386* IALL:                                  IALL.                (line   6)
22387* IAND:                                  IAND.                (line   6)
22388* IANY:                                  IANY.                (line   6)
22389* IARGC:                                 IARGC.               (line   6)
22390* IBCLR:                                 IBCLR.               (line   6)
22391* IBITS:                                 IBITS.               (line   6)
22392* IBSET:                                 IBSET.               (line   6)
22393* ICHAR:                                 ICHAR.               (line   6)
22394* IDATE:                                 IDATE.               (line   6)
22395* IDIM:                                  DIM.                 (line   6)
22396* IDINT:                                 INT.                 (line   6)
22397* IDNINT:                                NINT.                (line   6)
22398* IEEE, ISNAN:                           ISNAN.               (line   6)
22399* IEOR:                                  IEOR.                (line   6)
22400* IERRNO:                                IERRNO.              (line   6)
22401* IFIX:                                  INT.                 (line   6)
22402* IIABS:                                 ABS.                 (line   6)
22403* IIAND:                                 IAND.                (line   6)
22404* IIBCLR:                                IBCLR.               (line   6)
22405* IIBITS:                                IBITS.               (line   6)
22406* IIBSET:                                IBSET.               (line   6)
22407* IIEOR:                                 IEOR.                (line   6)
22408* IIOR:                                  IOR.                 (line   6)
22409* IISHFT:                                ISHFT.               (line   6)
22410* IISHFTC:                               ISHFTC.              (line   6)
22411* IMAG:                                  AIMAG.               (line   6)
22412* images, cosubscript to image index conversion: IMAGE_INDEX. (line   6)
22413* images, index of this image:           THIS_IMAGE.          (line   6)
22414* images, number of:                     NUM_IMAGES.          (line   6)
22415* IMAGE_INDEX:                           IMAGE_INDEX.         (line   6)
22416* IMAGPART:                              AIMAG.               (line   6)
22417* IMOD:                                  MOD.                 (line   6)
22418* 'IMPORT' statement:                    Fortran 2003 status. (line 119)
22419* IMVBITS:                               MVBITS.              (line   6)
22420* 'INCLUDE' directive:                   Directory Options.   (line   6)
22421* inclusion, directory search paths for: Directory Options.   (line  14)
22422* INDEX:                                 INDEX intrinsic.     (line   6)
22423* INOT:                                  NOT.                 (line   6)
22424* input/output, asynchronous:            Asynchronous I/O.    (line   6)
22425* INT:                                   INT.                 (line   6)
22426* INT2:                                  INT2.                (line   6)
22427* INT8:                                  INT8.                (line   6)
22428* integer kind:                          SELECTED_INT_KIND.   (line   6)
22429* Interoperability:                      Mixed-Language Programming.
22430                                                              (line   6)
22431* intrinsic:                             Error and Warning Options.
22432                                                              (line 206)
22433* intrinsic <1>:                         Error and Warning Options.
22434                                                              (line 213)
22435* intrinsic Modules:                     Intrinsic Modules.   (line   6)
22436* intrinsic procedures:                  Intrinsic Procedures.
22437                                                              (line   6)
22438* intrinsics, integer:                   Type variants for integer intrinsics.
22439                                                              (line   6)
22440* intrinsics, math:                      Extended math intrinsics.
22441                                                              (line   6)
22442* intrinsics, trigonometric functions:   Extended math intrinsics.
22443                                                              (line   6)
22444* Introduction:                          Top.                 (line   6)
22445* inverse hyperbolic cosine:             ACOSH.               (line   6)
22446* inverse hyperbolic sine:               ASINH.               (line   6)
22447* inverse hyperbolic tangent:            ATANH.               (line   6)
22448* 'IOMSG=' specifier:                    Fortran 2003 status. (line  90)
22449* IOR:                                   IOR.                 (line   6)
22450* 'IOSTAT', end of file:                 IS_IOSTAT_END.       (line   6)
22451* 'IOSTAT', end of record:               IS_IOSTAT_EOR.       (line   6)
22452* IPARITY:                               IPARITY.             (line   6)
22453* IRAND:                                 IRAND.               (line   6)
22454* ISATTY:                                ISATTY.              (line   6)
22455* ISHFT:                                 ISHFT.               (line   6)
22456* ISHFTC:                                ISHFTC.              (line   6)
22457* ISIGN:                                 SIGN.                (line   6)
22458* ISNAN:                                 ISNAN.               (line   6)
22459* 'ISO_FORTRAN_ENV' statement:           Fortran 2003 status. (line 127)
22460* IS_IOSTAT_END:                         IS_IOSTAT_END.       (line   6)
22461* IS_IOSTAT_EOR:                         IS_CONTIGUOUS.       (line   6)
22462* IS_IOSTAT_EOR <1>:                     IS_IOSTAT_EOR.       (line   6)
22463* ITIME:                                 ITIME.               (line   6)
22464* JIABS:                                 ABS.                 (line   6)
22465* JIAND:                                 IAND.                (line   6)
22466* JIBCLR:                                IBCLR.               (line   6)
22467* JIBITS:                                IBITS.               (line   6)
22468* JIBSET:                                IBSET.               (line   6)
22469* JIEOR:                                 IEOR.                (line   6)
22470* JIOR:                                  IOR.                 (line   6)
22471* JISHFT:                                ISHFT.               (line   6)
22472* JISHFTC:                               ISHFTC.              (line   6)
22473* JMOD:                                  MOD.                 (line   6)
22474* JMVBITS:                               MVBITS.              (line   6)
22475* JNOT:                                  NOT.                 (line   6)
22476* KIABS:                                 ABS.                 (line   6)
22477* KIAND:                                 IAND.                (line   6)
22478* KIBCLR:                                IBCLR.               (line   6)
22479* KIBITS:                                IBITS.               (line   6)
22480* KIBSET:                                IBSET.               (line   6)
22481* KIEOR:                                 IEOR.                (line   6)
22482* KILL:                                  KILL.                (line   6)
22483* kind:                                  KIND Type Parameters.
22484                                                              (line   6)
22485* KIND:                                  KIND.                (line   6)
22486* kind <1>:                              KIND.                (line   6)
22487* kind, character:                       SELECTED_CHAR_KIND.  (line   6)
22488* kind, integer:                         SELECTED_INT_KIND.   (line   6)
22489* kind, old-style:                       Old-style kind specifications.
22490                                                              (line   6)
22491* kind, real:                            SELECTED_REAL_KIND.  (line   6)
22492* KIOR:                                  IOR.                 (line   6)
22493* KISHFT:                                ISHFT.               (line   6)
22494* KISHFTC:                               ISHFTC.              (line   6)
22495* KMOD:                                  MOD.                 (line   6)
22496* KMVBITS:                               MVBITS.              (line   6)
22497* KNOT:                                  NOT.                 (line   6)
22498* L2 vector norm:                        NORM2.               (line   6)
22499* language, dialect options:             Fortran Dialect Options.
22500                                                              (line   6)
22501* LBOUND:                                LBOUND.              (line   6)
22502* LCOBOUND:                              LCOBOUND.            (line   6)
22503* LEADZ:                                 LEADZ.               (line   6)
22504* left shift, combined:                  DSHIFTL.             (line   6)
22505* LEN:                                   LEN.                 (line   6)
22506* LEN_TRIM:                              LEN_TRIM.            (line   6)
22507* lexical comparison of strings:         LGE.                 (line   6)
22508* lexical comparison of strings <1>:     LGT.                 (line   6)
22509* lexical comparison of strings <2>:     LLE.                 (line   6)
22510* lexical comparison of strings <3>:     LLT.                 (line   6)
22511* LGAMMA:                                LOG_GAMMA.           (line   6)
22512* LGE:                                   LGE.                 (line   6)
22513* LGT:                                   LGT.                 (line   6)
22514* libf2c calling convention:             Code Gen Options.    (line  28)
22515* libf2c calling convention <1>:         Code Gen Options.    (line 113)
22516* libgfortran initialization, set_args:  _gfortran_set_args.  (line   6)
22517* libgfortran initialization, set_convert: _gfortran_set_convert.
22518                                                              (line   6)
22519* libgfortran initialization, set_fpe:   _gfortran_set_fpe.   (line   6)
22520* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
22521                                                              (line   6)
22522* libgfortran initialization, set_options: _gfortran_set_options.
22523                                                              (line   6)
22524* libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
22525                                                              (line   6)
22526* limits, largest number:                HUGE.                (line   6)
22527* limits, smallest number:               TINY.                (line   6)
22528* LINK:                                  LINK.                (line   6)
22529* linking, static:                       Link Options.        (line   6)
22530* LLE:                                   LLE.                 (line   6)
22531* LLT:                                   LLT.                 (line   6)
22532* LNBLNK:                                LNBLNK.              (line   6)
22533* LOC:                                   %LOC as an rvalue.   (line   6)
22534* LOC <1>:                               LOC.                 (line   6)
22535* location of a variable in memory:      LOC.                 (line   6)
22536* LOG:                                   LOG.                 (line   6)
22537* LOG10:                                 LOG10.               (line   6)
22538* logarithm function:                    LOG.                 (line   6)
22539* logarithm function with base 10:       LOG10.               (line   6)
22540* logarithm function, inverse:           EXP.                 (line   6)
22541* LOGICAL:                               LOGICAL.             (line   6)
22542* logical and, bitwise:                  AND.                 (line   6)
22543* logical and, bitwise <1>:              IAND.                (line   6)
22544* logical exclusive or, bitwise:         IEOR.                (line   6)
22545* logical exclusive or, bitwise <1>:     XOR.                 (line   6)
22546* logical not, bitwise:                  NOT.                 (line   6)
22547* logical or, bitwise:                   IOR.                 (line   6)
22548* logical or, bitwise <1>:               OR.                  (line   6)
22549* logical, bitwise:                      Bitwise logical operators.
22550                                                              (line   6)
22551* logical, variable representation:      Internal representation of LOGICAL variables.
22552                                                              (line   6)
22553* login name:                            GETLOG.              (line   6)
22554* LOG_GAMMA:                             LOG_GAMMA.           (line   6)
22555* LONG:                                  LONG.                (line   6)
22556* loop interchange, Fortran:             Code Gen Options.    (line 456)
22557* loop interchange, warning:             Error and Warning Options.
22558                                                              (line 130)
22559* LSHIFT:                                LSHIFT.              (line   6)
22560* LSTAT:                                 LSTAT.               (line   6)
22561* LTIME:                                 LTIME.               (line   6)
22562* MALLOC:                                MALLOC.              (line   6)
22563* 'MAP':                                 UNION and MAP.       (line   6)
22564* mask, left justified:                  MASKL.               (line   6)
22565* mask, right justified:                 MASKR.               (line   6)
22566* MASKL:                                 MASKL.               (line   6)
22567* MASKR:                                 MASKR.               (line   6)
22568* MATMUL:                                MATMUL.              (line   6)
22569* matrix multiplication:                 MATMUL.              (line   6)
22570* matrix, transpose:                     TRANSPOSE.           (line   6)
22571* MAX:                                   MAX.                 (line   6)
22572* MAX, MIN, NaN:                         MAX and MIN intrinsics with REAL NaN arguments.
22573                                                              (line   6)
22574* MAX0:                                  MAX.                 (line   6)
22575* MAX1:                                  MAX.                 (line   6)
22576* MAXEXPONENT:                           MAXEXPONENT.         (line   6)
22577* maximum value:                         MAX.                 (line   6)
22578* maximum value <1>:                     MAXVAL.              (line   6)
22579* MAXLOC:                                MAXLOC.              (line   6)
22580* MAXVAL:                                MAXVAL.              (line   6)
22581* MCLOCK:                                MCLOCK.              (line   6)
22582* MCLOCK8:                               MCLOCK8.             (line   6)
22583* memory checking:                       Code Gen Options.    (line 144)
22584* MERGE:                                 MERGE.               (line   6)
22585* MERGE_BITS:                            MERGE_BITS.          (line   6)
22586* messages, error:                       Error and Warning Options.
22587                                                              (line   6)
22588* messages, warning:                     Error and Warning Options.
22589                                                              (line   6)
22590* MIN:                                   MIN.                 (line   6)
22591* MIN0:                                  MIN.                 (line   6)
22592* MIN1:                                  MIN.                 (line   6)
22593* MINEXPONENT:                           MINEXPONENT.         (line   6)
22594* minimum value:                         MIN.                 (line   6)
22595* minimum value <1>:                     MINVAL.              (line   6)
22596* MINLOC:                                MINLOC.              (line   6)
22597* MINVAL:                                MINVAL.              (line   6)
22598* Mixed-language programming:            Mixed-Language Programming.
22599                                                              (line   6)
22600* MOD:                                   MOD.                 (line   6)
22601* model representation, base:            RADIX.               (line   6)
22602* model representation, epsilon:         EPSILON.             (line   6)
22603* model representation, largest number:  HUGE.                (line   6)
22604* model representation, maximum exponent: MAXEXPONENT.        (line   6)
22605* model representation, minimum exponent: MINEXPONENT.        (line   6)
22606* model representation, precision:       PRECISION.           (line   6)
22607* model representation, radix:           RADIX.               (line   6)
22608* model representation, range:           RANGE.               (line   6)
22609* model representation, significant digits: DIGITS.           (line   6)
22610* model representation, smallest number: TINY.                (line   6)
22611* module entities:                       Fortran Dialect Options.
22612                                                              (line 124)
22613* module search path:                    Directory Options.   (line  14)
22614* module search path <1>:                Directory Options.   (line  29)
22615* module search path <2>:                Directory Options.   (line  36)
22616* MODULO:                                MODULO.              (line   6)
22617* modulo:                                MODULO.              (line   6)
22618* MOVE_ALLOC:                            MOVE_ALLOC.          (line   6)
22619* moving allocation:                     MOVE_ALLOC.          (line   6)
22620* multiply array elements:               PRODUCT.             (line   6)
22621* MVBITS:                                MVBITS.              (line   6)
22622* 'NAME':                                OPEN( ... NAME=).    (line   6)
22623* Namelist:                              Extensions to namelist.
22624                                                              (line   6)
22625* natural logarithm function:            LOG.                 (line   6)
22626* NEAREST:                               NEAREST.             (line   6)
22627* newline:                               NEW_LINE.            (line   6)
22628* NEW_LINE:                              NEW_LINE.            (line   6)
22629* NINT:                                  NINT.                (line   6)
22630* norm, Euclidean:                       NORM2.               (line   6)
22631* NORM2:                                 NORM2.               (line   6)
22632* 'NOSHARED':                            Extended I/O specifiers.
22633                                                              (line   6)
22634* NOT:                                   NOT.                 (line   6)
22635* NULL:                                  NULL.                (line   6)
22636* NUM_IMAGES:                            NUM_IMAGES.          (line   6)
22637* open, action:                          Files opened without an explicit ACTION= specifier.
22638                                                              (line   6)
22639* OpenACC:                               Fortran Dialect Options.
22640                                                              (line 171)
22641* OpenACC <1>:                           OpenACC.             (line   6)
22642* OpenMP:                                Fortran Dialect Options.
22643                                                              (line 178)
22644* OpenMP <1>:                            OpenMP.              (line   6)
22645* operators, unary:                      Unary operators.     (line   6)
22646* operators, xor:                        .XOR. operator.      (line   6)
22647* options inquiry function:              COMPILER_OPTIONS.    (line   6)
22648* options, code generation:              Code Gen Options.    (line   6)
22649* options, debugging:                    Debugging Options.   (line   6)
22650* options, dialect:                      Fortran Dialect Options.
22651                                                              (line   6)
22652* options, directory search:             Directory Options.   (line   6)
22653* options, errors:                       Error and Warning Options.
22654                                                              (line   6)
22655* options, Fortran dialect:              Fortran Dialect Options.
22656                                                              (line  11)
22657* options, 'gfortran' command:           Invoking GNU Fortran.
22658                                                              (line   6)
22659* options, linking:                      Link Options.        (line   6)
22660* options, negative forms:               Invoking GNU Fortran.
22661                                                              (line  13)
22662* options, preprocessor:                 Preprocessing Options.
22663                                                              (line   6)
22664* options, real kind type promotion:     Fortran Dialect Options.
22665                                                              (line 257)
22666* options, run-time:                     Code Gen Options.    (line   6)
22667* options, runtime:                      Runtime Options.     (line   6)
22668* options, warnings:                     Error and Warning Options.
22669                                                              (line   6)
22670* OR:                                    OR.                  (line   6)
22671* output, newline:                       NEW_LINE.            (line   6)
22672* PACK:                                  PACK.                (line   6)
22673* PARAMETER:                             Legacy PARAMETER statements.
22674                                                              (line   6)
22675* PARITY:                                PARITY.              (line   6)
22676* Parity:                                PARITY.              (line   6)
22677* parity:                                POPPAR.              (line   6)
22678* paths, search:                         Directory Options.   (line  14)
22679* paths, search <1>:                     Directory Options.   (line  29)
22680* paths, search <2>:                     Directory Options.   (line  36)
22681* PERROR:                                PERROR.              (line   6)
22682* pointer checking:                      Code Gen Options.    (line 144)
22683* pointer, C address of pointers:        C_F_PROCPOINTER.     (line   6)
22684* pointer, C address of procedures:      C_FUNLOC.            (line   6)
22685* pointer, C association status:         C_ASSOCIATED.        (line   6)
22686* pointer, convert C to Fortran:         C_F_POINTER.         (line   6)
22687* pointer, Cray:                         Cray pointers.       (line   6)
22688* pointer, cray:                         FREE.                (line   6)
22689* pointer, cray <1>:                     MALLOC.              (line   6)
22690* pointer, disassociated:                NULL.                (line   6)
22691* pointer, status:                       ASSOCIATED.          (line   6)
22692* pointer, status <1>:                   NULL.                (line   6)
22693* POPCNT:                                POPCNT.              (line   6)
22694* POPPAR:                                POPPAR.              (line   6)
22695* positive difference:                   DIM.                 (line   6)
22696* PRECISION:                             PRECISION.           (line   6)
22697* Preprocessing:                         Preprocessing and conditional compilation.
22698                                                              (line   6)
22699* preprocessing, assertion:              Preprocessing Options.
22700                                                              (line 113)
22701* preprocessing, assertion <1>:          Preprocessing Options.
22702                                                              (line 119)
22703* preprocessing, define macros:          Preprocessing Options.
22704                                                              (line 151)
22705* preprocessing, define macros <1>:      Preprocessing Options.
22706                                                              (line 154)
22707* preprocessing, include path:           Preprocessing Options.
22708                                                              (line  69)
22709* preprocessing, include path <1>:       Preprocessing Options.
22710                                                              (line  76)
22711* preprocessing, include path <2>:       Preprocessing Options.
22712                                                              (line  80)
22713* preprocessing, include path <3>:       Preprocessing Options.
22714                                                              (line  85)
22715* preprocessing, include path <4>:       Preprocessing Options.
22716                                                              (line  89)
22717* preprocessing, include path <5>:       Preprocessing Options.
22718                                                              (line  96)
22719* preprocessing, keep comments:          Preprocessing Options.
22720                                                              (line 122)
22721* preprocessing, keep comments <1>:      Preprocessing Options.
22722                                                              (line 137)
22723* preprocessing, no linemarkers:         Preprocessing Options.
22724                                                              (line 179)
22725* preprocessing, undefine macros:        Preprocessing Options.
22726                                                              (line 185)
22727* preprocessor:                          Preprocessing Options.
22728                                                              (line   6)
22729* preprocessor, debugging:               Preprocessing Options.
22730                                                              (line  26)
22731* preprocessor, debugging <1>:           Preprocessing Options.
22732                                                              (line  35)
22733* preprocessor, debugging <2>:           Preprocessing Options.
22734                                                              (line  41)
22735* preprocessor, debugging <3>:           Preprocessing Options.
22736                                                              (line  44)
22737* preprocessor, debugging <4>:           Preprocessing Options.
22738                                                              (line  51)
22739* preprocessor, disable:                 Preprocessing Options.
22740                                                              (line  12)
22741* preprocessor, enable:                  Preprocessing Options.
22742                                                              (line  12)
22743* preprocessor, include file handling:   Preprocessing and conditional compilation.
22744                                                              (line   6)
22745* preprocessor, working directory:       Preprocessing Options.
22746                                                              (line  55)
22747* PRESENT:                               PRESENT.             (line   6)
22748* private:                               Fortran Dialect Options.
22749                                                              (line 124)
22750* procedure pointer, convert C to Fortran: C_LOC.             (line   6)
22751* process ID:                            GETPID.              (line   6)
22752* PRODUCT:                               PRODUCT.             (line   6)
22753* product, double-precision:             DPROD.               (line   6)
22754* product, matrix:                       MATMUL.              (line   6)
22755* product, vector:                       DOT_PRODUCT.         (line   6)
22756* program termination:                   EXIT.                (line   6)
22757* program termination, with core dump:   ABORT.               (line   6)
22758* 'PROTECTED' statement:                 Fortran 2003 status. (line 113)
22759* 'Q' edit descriptor:                   Q edit descriptor.   (line   6)
22760* 'Q' exponent-letter:                   'Q' exponent-letter. (line   6)
22761* RADIX:                                 RADIX.               (line   6)
22762* radix, real:                           SELECTED_REAL_KIND.  (line   6)
22763* RAN:                                   RAN.                 (line   6)
22764* RAND:                                  RAND.                (line   6)
22765* random number generation:              IRAND.               (line   6)
22766* random number generation <1>:          RAN.                 (line   6)
22767* random number generation <2>:          RAND.                (line   6)
22768* random number generation <3>:          RANDOM_NUMBER.       (line   6)
22769* random number generation, initialization: RANDOM_INIT.      (line   6)
22770* random number generation, seeding:     RANDOM_SEED.         (line   6)
22771* random number generation, seeding <1>: SRAND.               (line   6)
22772* RANDOM_INIT:                           RANDOM_INIT.         (line   6)
22773* RANDOM_NUMBER:                         RANDOM_NUMBER.       (line   6)
22774* RANDOM_SEED:                           RANDOM_SEED.         (line   6)
22775* RANGE:                                 RANGE.               (line   6)
22776* range checking:                        Code Gen Options.    (line 144)
22777* RANK:                                  RANK.                (line   6)
22778* rank:                                  RANK.                (line   6)
22779* re-association of parenthesized expressions: Code Gen Options.
22780                                                              (line 420)
22781* read character, stream mode:           FGET.                (line   6)
22782* read character, stream mode <1>:       FGETC.               (line   6)
22783* 'READONLY':                            Extended I/O specifiers.
22784                                                              (line   6)
22785* REAL:                                  REAL.                (line   6)
22786* real kind:                             SELECTED_REAL_KIND.  (line   6)
22787* real number, exponent:                 EXPONENT.            (line   6)
22788* real number, fraction:                 FRACTION.            (line   6)
22789* real number, nearest different:        NEAREST.             (line   6)
22790* real number, relative spacing:         RRSPACING.           (line   6)
22791* real number, relative spacing <1>:     SPACING.             (line   6)
22792* real number, scale:                    SCALE.               (line   6)
22793* real number, set exponent:             SET_EXPONENT.        (line   6)
22794* Reallocate the LHS in assignments:     Code Gen Options.    (line 429)
22795* Reallocate the LHS in assignments, notification: Error and Warning Options.
22796                                                              (line 239)
22797* REALPART:                              REAL.                (line   6)
22798* 'RECORD':                              STRUCTURE and RECORD.
22799                                                              (line   6)
22800* record marker:                         File format of unformatted sequential files.
22801                                                              (line   6)
22802* Reduction, XOR:                        PARITY.              (line   6)
22803* remainder:                             MOD.                 (line   6)
22804* RENAME:                                RENAME.              (line   6)
22805* repacking arrays:                      Code Gen Options.    (line 288)
22806* REPEAT:                                REPEAT.              (line   6)
22807* RESHAPE:                               RESHAPE.             (line   6)
22808* 'REWIND':                              Read/Write after EOF marker.
22809                                                              (line   6)
22810* right shift, combined:                 DSHIFTR.             (line   6)
22811* root:                                  SQRT.                (line   6)
22812* rounding, ceiling:                     ANINT.               (line   6)
22813* rounding, ceiling <1>:                 CEILING.             (line   6)
22814* rounding, floor:                       AINT.                (line   6)
22815* rounding, floor <1>:                   FLOOR.               (line   6)
22816* rounding, nearest whole number:        NINT.                (line   6)
22817* RRSPACING:                             RRSPACING.           (line   6)
22818* RSHIFT:                                RSHIFT.              (line   6)
22819* run-time checking:                     Code Gen Options.    (line 144)
22820* SAME_TYPE_AS:                          SAME_TYPE_AS.        (line   6)
22821* 'SAVE' statement:                      Code Gen Options.    (line  15)
22822* SCALE:                                 SCALE.               (line   6)
22823* SCAN:                                  SCAN.                (line   6)
22824* search path:                           Directory Options.   (line   6)
22825* search paths, for included files:      Directory Options.   (line  14)
22826* SECNDS:                                SECNDS.              (line   6)
22827* SECOND:                                SECOND.              (line   6)
22828* seeding a random number generator:     RANDOM_SEED.         (line   6)
22829* seeding a random number generator <1>: SRAND.               (line   6)
22830* SELECTED_CHAR_KIND:                    SELECTED_CHAR_KIND.  (line   6)
22831* SELECTED_INT_KIND:                     SELECTED_INT_KIND.   (line   6)
22832* SELECTED_REAL_KIND:                    SELECTED_REAL_KIND.  (line   6)
22833* sequential, unformatted:               File format of unformatted sequential files.
22834                                                              (line   6)
22835* SET_EXPONENT:                          SET_EXPONENT.        (line   6)
22836* SHAPE:                                 SHAPE.               (line   6)
22837* 'SHARE':                               Extended I/O specifiers.
22838                                                              (line   6)
22839* 'SHARED':                              Extended I/O specifiers.
22840                                                              (line   6)
22841* shift, left:                           DSHIFTL.             (line   6)
22842* shift, left <1>:                       SHIFTL.              (line   6)
22843* shift, right:                          DSHIFTR.             (line   6)
22844* shift, right <1>:                      SHIFTR.              (line   6)
22845* shift, right with fill:                SHIFTA.              (line   6)
22846* SHIFTA:                                SHIFTA.              (line   6)
22847* SHIFTL:                                SHIFTL.              (line   6)
22848* SHIFTR:                                SHIFTR.              (line   6)
22849* SHORT:                                 INT2.                (line   6)
22850* SIGN:                                  SIGN.                (line   6)
22851* sign copying:                          SIGN.                (line   6)
22852* SIGNAL:                                SIGNAL.              (line   6)
22853* SIN:                                   SIN.                 (line   6)
22854* SIND:                                  SIND.                (line   6)
22855* sine:                                  SIN.                 (line   6)
22856* sine, degrees:                         SIND.                (line   6)
22857* sine, hyperbolic:                      SINH.                (line   6)
22858* sine, hyperbolic, inverse:             ASINH.               (line   6)
22859* sine, inverse:                         ASIN.                (line   6)
22860* sine, inverse, degrees:                ASIND.               (line   6)
22861* SINH:                                  SINH.                (line   6)
22862* SIZE:                                  SIZE.                (line   6)
22863* size of a variable, in bits:           BIT_SIZE.            (line   6)
22864* size of an expression:                 C_SIZEOF.            (line   6)
22865* size of an expression <1>:             SIZEOF.              (line   6)
22866* SIZEOF:                                SIZEOF.              (line   6)
22867* SLEEP:                                 SLEEP.               (line   6)
22868* SNGL:                                  REAL.                (line   6)
22869* SPACING:                               SPACING.             (line   6)
22870* SPREAD:                                SPREAD.              (line   6)
22871* SQRT:                                  SQRT.                (line   6)
22872* square-root:                           SQRT.                (line   6)
22873* SRAND:                                 SRAND.               (line   6)
22874* Standards:                             Standards.           (line   6)
22875* STAT:                                  STAT.                (line   6)
22876* statement, 'ENUM':                     Fortran 2003 status. (line  92)
22877* statement, 'ENUMERATOR':               Fortran 2003 status. (line  92)
22878* statement, 'FLUSH':                    Fortran 2003 status. (line  88)
22879* statement, 'IMPORT':                   Fortran 2003 status. (line 119)
22880* statement, 'ISO_FORTRAN_ENV':          Fortran 2003 status. (line 127)
22881* statement, 'PROTECTED':                Fortran 2003 status. (line 113)
22882* statement, 'SAVE':                     Code Gen Options.    (line  15)
22883* statement, 'USE, INTRINSIC':           Fortran 2003 status. (line 127)
22884* statement, 'VALUE':                    Fortran 2003 status. (line 115)
22885* statement, 'VOLATILE':                 Fortran 2003 status. (line 117)
22886* 'STATIC':                              AUTOMATIC and STATIC attributes.
22887                                                              (line   6)
22888* storage size:                          STORAGE_SIZE.        (line   6)
22889* STORAGE_SIZE:                          STORAGE_SIZE.        (line   6)
22890* 'STREAM' I/O:                          Fortran 2003 status. (line 102)
22891* stream mode, read character:           FGET.                (line   6)
22892* stream mode, read character <1>:       FGETC.               (line   6)
22893* stream mode, write character:          FPUT.                (line   6)
22894* stream mode, write character <1>:      FPUTC.               (line   6)
22895* string, adjust left:                   ADJUSTL.             (line   6)
22896* string, adjust right:                  ADJUSTR.             (line   6)
22897* string, comparison:                    LGE.                 (line   6)
22898* string, comparison <1>:                LGT.                 (line   6)
22899* string, comparison <2>:                LLE.                 (line   6)
22900* string, comparison <3>:                LLT.                 (line   6)
22901* string, concatenate:                   REPEAT.              (line   6)
22902* string, find missing set:              VERIFY.              (line   6)
22903* string, find non-blank character:      LNBLNK.              (line   6)
22904* string, find subset:                   SCAN.                (line   6)
22905* string, find substring:                INDEX intrinsic.     (line   6)
22906* string, length:                        LEN.                 (line   6)
22907* string, length, without trailing whitespace: LEN_TRIM.      (line   6)
22908* string, remove trailing whitespace:    TRIM.                (line   6)
22909* string, repeat:                        REPEAT.              (line   6)
22910* strings, varying length:               Varying Length Character Strings.
22911                                                              (line   6)
22912* 'STRUCTURE':                           STRUCTURE and RECORD.
22913                                                              (line   6)
22914* structure packing:                     Code Gen Options.    (line 282)
22915* subrecord:                             File format of unformatted sequential files.
22916                                                              (line   6)
22917* subscript checking:                    Code Gen Options.    (line 144)
22918* substring position:                    INDEX intrinsic.     (line   6)
22919* SUM:                                   SUM.                 (line   6)
22920* sum array elements:                    SUM.                 (line   6)
22921* suppressing warnings:                  Error and Warning Options.
22922                                                              (line   6)
22923* symbol names:                          Fortran Dialect Options.
22924                                                              (line 106)
22925* symbol names, transforming:            Code Gen Options.    (line  57)
22926* symbol names, transforming <1>:        Code Gen Options.    (line 113)
22927* symbol names, underscores:             Code Gen Options.    (line  57)
22928* symbol names, underscores <1>:         Code Gen Options.    (line 113)
22929* SYMLNK:                                SYMLNK.              (line   6)
22930* syntax checking:                       Error and Warning Options.
22931                                                              (line  33)
22932* SYSTEM:                                SYSTEM.              (line   6)
22933* system, error handling:                GERROR.              (line   6)
22934* system, error handling <1>:            IERRNO.              (line   6)
22935* system, error handling <2>:            PERROR.              (line   6)
22936* system, group ID:                      GETGID.              (line   6)
22937* system, host name:                     HOSTNM.              (line   6)
22938* system, login name:                    GETLOG.              (line   6)
22939* system, process ID:                    GETPID.              (line   6)
22940* system, signal handling:               SIGNAL.              (line   6)
22941* system, system call:                   EXECUTE_COMMAND_LINE.
22942                                                              (line   6)
22943* system, system call <1>:               SYSTEM.              (line   6)
22944* system, terminal:                      ISATTY.              (line   6)
22945* system, terminal <1>:                  TTYNAM.              (line   6)
22946* system, user ID:                       GETUID.              (line   6)
22947* system, working directory:             CHDIR.               (line   6)
22948* system, working directory <1>:         GETCWD.              (line   6)
22949* SYSTEM_CLOCK:                          SYSTEM_CLOCK.        (line   6)
22950* tabulators:                            Error and Warning Options.
22951                                                              (line 188)
22952* TAN:                                   TAN.                 (line   6)
22953* TAND:                                  TAND.                (line   6)
22954* tangent:                               TAN.                 (line   6)
22955* tangent, degrees:                      TAND.                (line   6)
22956* tangent, hyperbolic:                   TANH.                (line   6)
22957* tangent, hyperbolic, inverse:          ATANH.               (line   6)
22958* tangent, inverse:                      ATAN.                (line   6)
22959* tangent, inverse <1>:                  ATAN2.               (line   6)
22960* tangent, inverse, degrees:             ATAND.               (line   6)
22961* tangent, inverse, degrees <1>:         ATAN2D.              (line   6)
22962* TANH:                                  TANH.                (line   6)
22963* terminate program:                     EXIT.                (line   6)
22964* terminate program, with core dump:     ABORT.               (line   6)
22965* THIS_IMAGE:                            THIS_IMAGE.          (line   6)
22966* thread-safety, threads:                Thread-safety of the runtime library.
22967                                                              (line   6)
22968* TIME:                                  TIME.                (line   6)
22969* time, clock ticks:                     MCLOCK.              (line   6)
22970* time, clock ticks <1>:                 MCLOCK8.             (line   6)
22971* time, clock ticks <2>:                 SYSTEM_CLOCK.        (line   6)
22972* time, conversion to GMT info:          GMTIME.              (line   6)
22973* time, conversion to local time info:   LTIME.               (line   6)
22974* time, conversion to string:            CTIME.               (line   6)
22975* time, current:                         DATE_AND_TIME.       (line   6)
22976* time, current <1>:                     FDATE.               (line   6)
22977* time, current <2>:                     ITIME.               (line   6)
22978* time, current <3>:                     TIME.                (line   6)
22979* time, current <4>:                     TIME8.               (line   6)
22980* time, elapsed:                         CPU_TIME.            (line   6)
22981* time, elapsed <1>:                     DTIME.               (line   6)
22982* time, elapsed <2>:                     ETIME.               (line   6)
22983* time, elapsed <3>:                     SECNDS.              (line   6)
22984* time, elapsed <4>:                     SECOND.              (line   6)
22985* TIME8:                                 TIME8.               (line   6)
22986* TINY:                                  TINY.                (line   6)
22987* TR 15581:                              Fortran 2003 status. (line  97)
22988* trace:                                 Debugging Options.   (line  86)
22989* TRAILZ:                                TRAILZ.              (line   6)
22990* TRANSFER:                              TRANSFER.            (line   6)
22991* transforming symbol names:             Code Gen Options.    (line  57)
22992* transforming symbol names <1>:         Code Gen Options.    (line 113)
22993* TRANSPOSE:                             TRANSPOSE.           (line   6)
22994* transpose:                             TRANSPOSE.           (line   6)
22995* trigonometric function, cosine:        COS.                 (line   6)
22996* trigonometric function, cosine, degrees: COSD.              (line   6)
22997* trigonometric function, cosine, inverse: ACOS.              (line   6)
22998* trigonometric function, cosine, inverse, degrees: ACOSD.    (line   6)
22999* trigonometric function, cotangent:     COTAN.               (line   6)
23000* trigonometric function, cotangent, degrees: COTAND.         (line   6)
23001* trigonometric function, sine:          SIN.                 (line   6)
23002* trigonometric function, sine, degrees: SIND.                (line   6)
23003* trigonometric function, sine, inverse: ASIN.                (line   6)
23004* trigonometric function, sine, inverse, degrees: ASIND.      (line   6)
23005* trigonometric function, tangent:       TAN.                 (line   6)
23006* trigonometric function, tangent, degrees: TAND.             (line   6)
23007* trigonometric function, tangent, inverse: ATAN.             (line   6)
23008* trigonometric function, tangent, inverse <1>: ATAN2.        (line   6)
23009* trigonometric function, tangent, inverse, degrees: ATAND.   (line   6)
23010* trigonometric function, tangent, inverse, degrees <1>: ATAN2D.
23011                                                              (line   6)
23012* TRIM:                                  TRIM.                (line   6)
23013* TTYNAM:                                TTYNAM.              (line   6)
23014* type alias print:                      TYPE as an alias for PRINT.
23015                                                              (line   6)
23016* type cast:                             TRANSFER.            (line   6)
23017* UBOUND:                                UBOUND.              (line   6)
23018* UCOBOUND:                              UCOBOUND.            (line   6)
23019* UMASK:                                 UMASK.               (line   6)
23020* underflow:                             Error and Warning Options.
23021                                                              (line 201)
23022* underscore:                            Code Gen Options.    (line  57)
23023* underscore <1>:                        Code Gen Options.    (line 113)
23024* unformatted sequential:                File format of unformatted sequential files.
23025                                                              (line   6)
23026* 'UNION':                               UNION and MAP.       (line   6)
23027* UNLINK:                                UNLINK.              (line   6)
23028* UNPACK:                                UNPACK.              (line   6)
23029* unused dummy argument:                 Error and Warning Options.
23030                                                              (line 217)
23031* unused parameter:                      Error and Warning Options.
23032                                                              (line 221)
23033* 'USE, INTRINSIC' statement:            Fortran 2003 status. (line 127)
23034* user id:                               GETUID.              (line   6)
23035* 'VALUE' statement:                     Fortran 2003 status. (line 115)
23036* variable attributes:                   AUTOMATIC and STATIC attributes.
23037                                                              (line   6)
23038* Varying length character strings:      Varying Length Character Strings.
23039                                                              (line   6)
23040* Varying length strings:                Varying Length Character Strings.
23041                                                              (line   6)
23042* vector product:                        DOT_PRODUCT.         (line   6)
23043* VERIFY:                                VERIFY.              (line   6)
23044* version of the compiler:               COMPILER_VERSION.    (line   6)
23045* 'VOLATILE':                            Volatile COMMON blocks.
23046                                                              (line   6)
23047* 'VOLATILE' statement:                  Fortran 2003 status. (line 117)
23048* warning, C binding type:               Error and Warning Options.
23049                                                              (line 101)
23050* warnings, aliasing:                    Error and Warning Options.
23051                                                              (line  71)
23052* warnings, alignment of 'COMMON' blocks: Error and Warning Options.
23053                                                              (line 228)
23054* warnings, all:                         Error and Warning Options.
23055                                                              (line  62)
23056* warnings, ampersand:                   Error and Warning Options.
23057                                                              (line  88)
23058* warnings, array temporaries:           Error and Warning Options.
23059                                                              (line  96)
23060* warnings, character truncation:        Error and Warning Options.
23061                                                              (line 108)
23062* warnings, conversion:                  Error and Warning Options.
23063                                                              (line 117)
23064* warnings, conversion <1>:              Error and Warning Options.
23065                                                              (line 121)
23066* warnings, division of integers:        Error and Warning Options.
23067                                                              (line 144)
23068* warnings, extra:                       Error and Warning Options.
23069                                                              (line 125)
23070* warnings, function elimination:        Error and Warning Options.
23071                                                              (line 234)
23072* warnings, implicit interface:          Error and Warning Options.
23073                                                              (line 134)
23074* warnings, implicit procedure:          Error and Warning Options.
23075                                                              (line 140)
23076* warnings, integer division:            Error and Warning Options.
23077                                                              (line 144)
23078* warnings, intrinsic:                   Error and Warning Options.
23079                                                              (line 206)
23080* warnings, intrinsics of other standards: Error and Warning Options.
23081                                                              (line 148)
23082* warnings, line truncation:             Error and Warning Options.
23083                                                              (line 111)
23084* warnings, loop interchange:            Error and Warning Options.
23085                                                              (line 130)
23086* warnings, non-standard intrinsics:     Error and Warning Options.
23087                                                              (line 148)
23088* warnings, overwrite recursive:         Error and Warning Options.
23089                                                              (line 155)
23090* warnings, 'q' exponent-letter:         Error and Warning Options.
23091                                                              (line 162)
23092* warnings, suppressing:                 Error and Warning Options.
23093                                                              (line   6)
23094* warnings, suspicious code:             Error and Warning Options.
23095                                                              (line 166)
23096* warnings, tabs:                        Error and Warning Options.
23097                                                              (line 188)
23098* warnings, to errors:                   Error and Warning Options.
23099                                                              (line 280)
23100* warnings, undefined do loop:           Error and Warning Options.
23101                                                              (line 196)
23102* warnings, underflow:                   Error and Warning Options.
23103                                                              (line 201)
23104* warnings, unused dummy argument:       Error and Warning Options.
23105                                                              (line 217)
23106* warnings, unused parameter:            Error and Warning Options.
23107                                                              (line 221)
23108* warnings, use statements:              Error and Warning Options.
23109                                                              (line 213)
23110* write character, stream mode:          FPUT.                (line   6)
23111* write character, stream mode <1>:      FPUTC.               (line   6)
23112* XOR:                                   XOR.                 (line   6)
23113* XOR reduction:                         PARITY.              (line   6)
23114* ZABS:                                  ABS.                 (line   6)
23115* ZCOS:                                  COS.                 (line   6)
23116* ZCOSD:                                 COSD.                (line   6)
23117* zero bits:                             LEADZ.               (line   6)
23118* zero bits <1>:                         TRAILZ.              (line   6)
23119* ZEXP:                                  EXP.                 (line   6)
23120* ZLOG:                                  LOG.                 (line   6)
23121* ZSIN:                                  SIN.                 (line   6)
23122* ZSIND:                                 SIND.                (line   6)
23123* ZSQRT:                                 SQRT.                (line   6)
23124
23125
23126
23127Tag Table:
23128Node: Top1950
23129Node: Introduction3367
23130Node: About GNU Fortran4116
23131Node: GNU Fortran and GCC8117
23132Node: Preprocessing and conditional compilation10231
23133Node: GNU Fortran and G7712320
23134Node: Project Status12893
23135Node: Standards15470
23136Node: Varying Length Character Strings16695
23137Node: Invoking GNU Fortran17447
23138Node: Option Summary19281
23139Node: Fortran Dialect Options23452
23140Node: Preprocessing Options37417
23141Node: Error and Warning Options45658
23142Node: Debugging Options57588
23143Node: Directory Options62360
23144Node: Link Options63795
23145Node: Runtime Options64421
23146Node: Code Gen Options66328
23147Node: Interoperability Options87457
23148Node: Environment Variables89535
23149Node: Runtime90148
23150Node: TMPDIR91319
23151Node: GFORTRAN_STDIN_UNIT91989
23152Node: GFORTRAN_STDOUT_UNIT92371
23153Node: GFORTRAN_STDERR_UNIT92772
23154Node: GFORTRAN_UNBUFFERED_ALL93174
23155Node: GFORTRAN_UNBUFFERED_PRECONNECTED93705
23156Node: GFORTRAN_SHOW_LOCUS94349
23157Node: GFORTRAN_OPTIONAL_PLUS94845
23158Node: GFORTRAN_LIST_SEPARATOR95323
23159Node: GFORTRAN_CONVERT_UNIT95931
23160Node: GFORTRAN_ERROR_BACKTRACE98786
23161Node: GFORTRAN_FORMATTED_BUFFER_SIZE99382
23162Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE99830
23163Node: Fortran standards status100259
23164Node: Fortran 2003 status100511
23165Node: Fortran 2008 status105666
23166Node: Fortran 2018 status111044
23167Node: Compiler Characteristics113402
23168Node: KIND Type Parameters114185
23169Node: Internal representation of LOGICAL variables115613
23170Node: Evaluation of logical expressions116470
23171Node: MAX and MIN intrinsics with REAL NaN arguments117321
23172Node: Thread-safety of the runtime library118142
23173Node: Data consistency and durability120547
23174Node: Files opened without an explicit ACTION= specifier123660
23175Node: File operations on symbolic links124351
23176Node: File format of unformatted sequential files125471
23177Node: Asynchronous I/O127843
23178Node: Extensions128543
23179Node: Extensions implemented in GNU Fortran129148
23180Node: Old-style kind specifications131124
23181Node: Old-style variable initialization132226
23182Node: Extensions to namelist133538
23183Node: X format descriptor without count field135841
23184Node: Commas in FORMAT specifications136368
23185Node: Missing period in FORMAT specifications137119
23186Node: Default widths for F, G and I format descriptors137715
23187Node: I/O item lists138420
23188Node: 'Q' exponent-letter138816
23189Node: BOZ literal constants139416
23190Node: Real array indices140995
23191Node: Unary operators141294
23192Node: Implicitly convert LOGICAL and INTEGER values141708
23193Node: Hollerith constants support142667
23194Node: Character conversion144891
23195Node: Cray pointers145785
23196Node: CONVERT specifier151286
23197Node: OpenMP153281
23198Node: OpenACC155539
23199Node: Argument list functions156679
23200Node: Read/Write after EOF marker158322
23201Node: STRUCTURE and RECORD158925
23202Node: UNION and MAP164012
23203Node: Type variants for integer intrinsics166980
23204Node: AUTOMATIC and STATIC attributes168982
23205Node: Extended math intrinsics170516
23206Node: Form feed as whitespace172312
23207Node: TYPE as an alias for PRINT172858
23208Node: %LOC as an rvalue173323
23209Node: .XOR. operator173970
23210Node: Bitwise logical operators174370
23211Node: Extended I/O specifiers175922
23212Node: Legacy PARAMETER statements179642
23213Node: Default exponents180247
23214Node: Extensions not implemented in GNU Fortran180599
23215Node: ENCODE and DECODE statements181566
23216Node: Variable FORMAT expressions182897
23217Node: Alternate complex function syntax184002
23218Node: Volatile COMMON blocks184552
23219Node: OPEN( ... NAME=)185054
23220Node: Q edit descriptor185482
23221Node: Mixed-Language Programming186434
23222Node: Interoperability with C187014
23223Node: Intrinsic Types188348
23224Node: Derived Types and struct189344
23225Node: Interoperable Global Variables190702
23226Node: Interoperable Subroutines and Functions191977
23227Node: Working with Pointers195771
23228Node: Further Interoperability of Fortran with C200247
23229Node: GNU Fortran Compiler Directives203819
23230Node: ATTRIBUTES directive204195
23231Node: UNROLL directive207383
23232Node: BUILTIN directive207916
23233Node: IVDEP directive208758
23234Node: VECTOR directive209577
23235Node: NOVECTOR directive209975
23236Node: Non-Fortran Main Program210360
23237Node: _gfortran_set_args212548
23238Node: _gfortran_set_options213486
23239Node: _gfortran_set_convert217132
23240Node: _gfortran_set_record_marker218000
23241Node: _gfortran_set_fpe218810
23242Node: _gfortran_set_max_subrecord_length220008
23243Node: Naming and argument-passing conventions220931
23244Node: Naming conventions221650
23245Node: Argument passing conventions223122
23246Node: Coarray Programming228427
23247Node: Type and enum ABI Documentation228674
23248Node: caf_token_t228972
23249Node: caf_register_t229208
23250Node: caf_deregister_t230419
23251Node: caf_reference_t230921
23252Node: caf_team_t235245
23253Node: Function ABI Documentation235544
23254Node: _gfortran_caf_init237994
23255Node: _gfortran_caf_finish239420
23256Node: _gfortran_caf_this_image240359
23257Node: _gfortran_caf_num_images241114
23258Node: _gfortran_caf_image_status242225
23259Node: _gfortran_caf_failed_images243345
23260Node: _gfortran_caf_stopped_images244515
23261Node: _gfortran_caf_register245688
23262Node: _gfortran_caf_deregister249870
23263Node: _gfortran_caf_is_present251476
23264Node: _gfortran_caf_send252555
23265Node: _gfortran_caf_get255745
23266Node: _gfortran_caf_sendget258826
23267Node: _gfortran_caf_send_by_ref262737
23268Node: _gfortran_caf_get_by_ref266346
23269Node: _gfortran_caf_sendget_by_ref269865
23270Node: _gfortran_caf_lock274161
23271Node: _gfortran_caf_unlock275947
23272Node: _gfortran_caf_event_post277428
23273Node: _gfortran_caf_event_wait278877
23274Node: _gfortran_caf_event_query280984
23275Node: _gfortran_caf_sync_all282315
23276Node: _gfortran_caf_sync_images283243
23277Node: _gfortran_caf_sync_memory284778
23278Node: _gfortran_caf_error_stop285770
23279Node: _gfortran_caf_error_stop_str286374
23280Node: _gfortran_caf_fail_image287079
23281Node: _gfortran_caf_atomic_define287615
23282Node: _gfortran_caf_atomic_ref288930
23283Node: _gfortran_caf_atomic_cas290234
23284Node: _gfortran_caf_atomic_op291995
23285Node: _gfortran_caf_co_broadcast294097
23286Node: _gfortran_caf_co_max295202
23287Node: _gfortran_caf_co_min296828
23288Node: _gfortran_caf_co_sum298448
23289Node: _gfortran_caf_co_reduce299988
23290Node: Intrinsic Procedures302632
23291Node: Introduction to Intrinsics319891
23292Node: ABORT322241
23293Node: ABS322986
23294Node: ACCESS324936
23295Node: ACHAR326836
23296Node: ACOS328040
23297Node: ACOSD329326
23298Node: ACOSH330638
23299Node: ADJUSTL331634
23300Node: ADJUSTR332576
23301Node: AIMAG333526
23302Node: AINT334955
23303Node: ALARM336561
23304Node: ALL338193
23305Node: ALLOCATED340117
23306Node: AND341256
23307Node: ANINT342991
23308Node: ANY344488
23309Node: ASIN346414
23310Node: ASIND347689
23311Node: ASINH348987
23312Node: ASSOCIATED349993
23313Node: ATAN353004
23314Node: ATAND354477
23315Node: ATAN2355970
23316Node: ATAN2D357835
23317Node: ATANH359810
23318Node: ATOMIC_ADD360816
23319Node: ATOMIC_AND362348
23320Node: ATOMIC_CAS363936
23321Node: ATOMIC_DEFINE365795
23322Node: ATOMIC_FETCH_ADD367514
23323Node: ATOMIC_FETCH_AND369314
23324Node: ATOMIC_FETCH_OR371104
23325Node: ATOMIC_FETCH_XOR372881
23326Node: ATOMIC_OR374664
23327Node: ATOMIC_REF376249
23328Node: ATOMIC_XOR378145
23329Node: BACKTRACE379730
23330Node: BESSEL_J0380310
23331Node: BESSEL_J1381326
23332Node: BESSEL_JN382343
23333Node: BESSEL_Y0384168
23334Node: BESSEL_Y1385123
23335Node: BESSEL_YN386078
23336Node: BGE387909
23337Node: BGT388601
23338Node: BIT_SIZE389251
23339Node: BLE390073
23340Node: BLT390755
23341Node: BTEST391393
23342Node: C_ASSOCIATED392880
23343Node: C_F_POINTER394091
23344Node: C_F_PROCPOINTER395526
23345Node: C_FUNLOC397033
23346Node: C_LOC398404
23347Node: C_SIZEOF399683
23348Node: CEILING401091
23349Node: CHAR402099
23350Node: CHDIR403368
23351Node: CHMOD404542
23352Node: CMPLX406457
23353Node: CO_BROADCAST407900
23354Node: CO_MAX409721
23355Node: CO_MIN411628
23356Node: CO_REDUCE413521
23357Node: CO_SUM417092
23358Node: COMMAND_ARGUMENT_COUNT419072
23359Node: COMPILER_OPTIONS419989
23360Node: COMPILER_VERSION421014
23361Node: COMPLEX421977
23362Node: CONJG423116
23363Node: COS424110
23364Node: COSD425565
23365Node: COSH427014
23366Node: COTAN428197
23367Node: COTAND429336
23368Node: COUNT430515
23369Node: CPU_TIME432540
23370Node: CSHIFT433897
23371Node: CTIME435557
23372Node: DATE_AND_TIME437065
23373Node: DBLE439545
23374Node: DCMPLX440340
23375Node: DIGITS441522
23376Node: DIM442489
23377Node: DOT_PRODUCT443948
23378Node: DPROD445591
23379Node: DREAL446518
23380Node: DSHIFTL447184
23381Node: DSHIFTR448517
23382Node: DTIME449851
23383Node: EOSHIFT452666
23384Node: EPSILON454739
23385Node: ERF455466
23386Node: ERFC456247
23387Node: ERFC_SCALED457057
23388Node: ETIME457750
23389Node: EVENT_QUERY459989
23390Node: EXECUTE_COMMAND_LINE461578
23391Node: EXIT464358
23392Node: EXP465236
23393Node: EXPONENT466489
23394Node: EXTENDS_TYPE_OF467253
23395Node: FDATE468111
23396Node: FGET469597
23397Node: FGETC471424
23398Node: FINDLOC473234
23399Node: FLOOR475727
23400Node: FLUSH476718
23401Node: FNUM478597
23402Node: FPUT479322
23403Node: FPUTC480956
23404Node: FRACTION482737
23405Node: FREE483641
23406Node: FSEEK484484
23407Node: FSTAT486790
23408Node: FTELL487876
23409Node: GAMMA488858
23410Node: GERROR489848
23411Node: GETARG490570
23412Node: GET_COMMAND492341
23413Node: GET_COMMAND_ARGUMENT493715
23414Node: GETCWD495762
23415Node: GETENV496742
23416Node: GET_ENVIRONMENT_VARIABLE498174
23417Node: GETGID500337
23418Node: GETLOG500874
23419Node: GETPID501736
23420Node: GETUID502466
23421Node: GMTIME502982
23422Node: HOSTNM504742
23423Node: HUGE505663
23424Node: HYPOT506385
23425Node: IACHAR507211
23426Node: IALL508379
23427Node: IAND509864
23428Node: IANY511646
23429Node: IARGC513140
23430Node: IBCLR514159
23431Node: IBITS515407
23432Node: IBSET516911
23433Node: ICHAR518154
23434Node: IDATE520324
23435Node: IEOR521624
23436Node: IERRNO523299
23437Node: IMAGE_INDEX523847
23438Node: INDEX intrinsic524869
23439Node: INT526395
23440Node: INT2528239
23441Node: INT8529007
23442Node: IOR529722
23443Node: IPARITY531373
23444Node: IRAND532921
23445Node: IS_CONTIGUOUS534280
23446Node: IS_IOSTAT_END535446
23447Node: IS_IOSTAT_EOR536553
23448Node: ISATTY537682
23449Node: ISHFT538465
23450Node: ISHFTC540034
23451Node: ISNAN541841
23452Node: ITIME542608
23453Node: KILL543906
23454Node: KIND545042
23455Node: LBOUND545940
23456Node: LCOBOUND547278
23457Node: LEADZ548413
23458Node: LEN549274
23459Node: LEN_TRIM550570
23460Node: LGE551558
23461Node: LGT553071
23462Node: LINK554549
23463Node: LLE555588
23464Node: LLT557088
23465Node: LNBLNK558559
23466Node: LOC559337
23467Node: LOG560069
23468Node: LOG10561604
23469Node: LOG_GAMMA562594
23470Node: LOGICAL563696
23471Node: LONG564508
23472Node: LSHIFT565266
23473Node: LSTAT566375
23474Node: LTIME567574
23475Node: MALLOC569256
23476Node: MASKL570718
23477Node: MASKR571485
23478Node: MATMUL572255
23479Node: MAX573415
23480Node: MAXEXPONENT574950
23481Node: MAXLOC575767
23482Node: MAXVAL578384
23483Node: MCLOCK580034
23484Node: MCLOCK8581057
23485Node: MERGE582287
23486Node: MERGE_BITS583039
23487Node: MIN584078
23488Node: MINEXPONENT585616
23489Node: MINLOC586247
23490Node: MINVAL588895
23491Node: MOD590548
23492Node: MODULO592873
23493Node: MOVE_ALLOC594338
23494Node: MVBITS595371
23495Node: NEAREST597023
23496Node: NEW_LINE598123
23497Node: NINT598896
23498Node: NORM2600317
23499Node: NOT601459
23500Node: NULL602629
23501Node: NUM_IMAGES603537
23502Node: OR605238
23503Node: PACK606961
23504Node: PARITY609005
23505Node: PERROR610226
23506Node: POPCNT610851
23507Node: POPPAR611722
23508Node: PRECISION612775
23509Node: PRESENT613707
23510Node: PRODUCT614819
23511Node: RADIX616353
23512Node: RAN617164
23513Node: RAND617620
23514Node: RANDOM_INIT618953
23515Node: RANDOM_NUMBER621019
23516Node: RANDOM_SEED622266
23517Node: RANGE624736
23518Node: RANK625416
23519Node: REAL626197
23520Node: RENAME628138
23521Node: REPEAT629160
23522Node: RESHAPE629888
23523Node: RRSPACING631355
23524Node: RSHIFT632048
23525Node: SAME_TYPE_AS633216
23526Node: SCALE634048
23527Node: SCAN634829
23528Node: SECNDS636387
23529Node: SECOND637479
23530Node: SELECTED_CHAR_KIND638355
23531Node: SELECTED_INT_KIND639950
23532Node: SELECTED_REAL_KIND641127
23533Node: SET_EXPONENT643803
23534Node: SHAPE644800
23535Node: SHIFTA646224
23536Node: SHIFTL647215
23537Node: SHIFTR648075
23538Node: SIGN648936
23539Node: SIGNAL650277
23540Node: SIN651783
23541Node: SIND653047
23542Node: SINH654376
23543Node: SIZE655294
23544Node: SIZEOF656613
23545Node: SLEEP658268
23546Node: SPACING658829
23547Node: SPREAD659843
23548Node: SQRT660994
23549Node: SRAND662326
23550Node: STAT663560
23551Node: STORAGE_SIZE666727
23552Node: SUM667606
23553Node: SYMLNK669098
23554Node: SYSTEM670233
23555Node: SYSTEM_CLOCK671488
23556Node: TAN674336
23557Node: TAND675407
23558Node: TANH676491
23559Node: THIS_IMAGE677666
23560Node: TIME679966
23561Node: TIME8681137
23562Node: TINY682336
23563Node: TRAILZ682937
23564Node: TRANSFER683755
23565Node: TRANSPOSE685791
23566Node: TRIM686481
23567Node: TTYNAM687339
23568Node: UBOUND688257
23569Node: UCOBOUND689647
23570Node: UMASK690784
23571Node: UNLINK691466
23572Node: UNPACK692446
23573Node: VERIFY693741
23574Node: XOR695470
23575Node: Intrinsic Modules697280
23576Node: ISO_FORTRAN_ENV697569
23577Node: ISO_C_BINDING701972
23578Node: IEEE modules705678
23579Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS706821
23580Node: OpenACC Module OPENACC708837
23581Node: Contributing709764
23582Node: Contributors710618
23583Node: Projects712249
23584Node: Proposed Extensions713056
23585Node: Copying715066
23586Node: GNU Free Documentation License752610
23587Node: Funding777733
23588Node: Option Index780259
23589Node: Keyword Index799320
23590
23591End Tag Table
23592